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

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

Alien Thief - collect puzzle game.swf

This is the info page for
Flash #135457

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


Text
add this to your site

add this to your site

BR

Use                    to move the camera

Press         again to resume the game

Enter

1UP

1UP

Total Score:

?

ActionScript [AS3]

Section 1
//flag_icon_234 (AlienThief_fla.flag_icon_234) package AlienThief_fla { import flash.display.*; public dynamic class flag_icon_234 extends MovieClip { public function flag_icon_234(){ addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package AlienThief_fla
Section 2
//Timeline_107 (AlienThief_fla.Timeline_107) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_107 extends SimpleButton { public var __id16_:LocalizedTextField; public function Timeline_107(){ __setProp___id16__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id16__(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id16___1(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id16__(_arg1:Object){ var __id16_ = _arg1; try { __id16_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id16_.text = "{quitBtn}"; __id16_.textColor = 4137230; __id16_.textSize = 14; __id16_.bold = true; __id16_.disableWordwrap = false; __id16_.embedFonts = true; __id16_.font = ""; __id16_.hAlign = "center"; __id16_.multiline = false; __id16_.vAlign = "top"; __id16_.antiAliasType = "advanced"; __id16_.glowBlur = 3; __id16_.glowColor = 0; __id16_.useGlowFilter = true; __id16_.glowQuality = 0; __id16_.glowStrength = 0; __id16_.gridFitType = "pixel"; __id16_.italic = false; __id16_.selectable = false; __id16_.underline = false; try { __id16_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id16___1(_arg1:Object){ var __id16_ = _arg1; try { __id16_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id16_.text = "{quitBtn}"; __id16_.textColor = 0xFFFFFF; __id16_.textSize = 14; __id16_.bold = true; __id16_.disableWordwrap = false; __id16_.embedFonts = true; __id16_.font = ""; __id16_.hAlign = "center"; __id16_.multiline = false; __id16_.vAlign = "top"; __id16_.antiAliasType = "advanced"; __id16_.glowBlur = 3; __id16_.glowColor = 0; __id16_.useGlowFilter = true; __id16_.glowQuality = 0; __id16_.glowStrength = 0; __id16_.gridFitType = "pixel"; __id16_.italic = false; __id16_.selectable = false; __id16_.underline = false; try { __id16_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 3
//Timeline_113 (AlienThief_fla.Timeline_113) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_113 extends SimpleButton { public var __id18_:LocalizedTextField; public function Timeline_113(){ __setProp___id18__(DisplayObjectContainer(upState).getChildAt(9)); __setProp___id18___1(DisplayObjectContainer(overState).getChildAt(9)); __setProp___id18___2(DisplayObjectContainer(downState).getChildAt(9)); } function __setProp___id18__(_arg1:Object){ var __id18_ = _arg1; try { __id18_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id18_.text = "{keyboard}"; __id18_.textColor = 4137230; __id18_.textSize = 20; __id18_.bold = true; __id18_.disableWordwrap = false; __id18_.embedFonts = true; __id18_.font = ""; __id18_.hAlign = "center"; __id18_.multiline = false; __id18_.vAlign = "top"; __id18_.antiAliasType = "advanced"; __id18_.glowBlur = 3; __id18_.glowColor = 0; __id18_.useGlowFilter = true; __id18_.glowQuality = 0; __id18_.glowStrength = 0; __id18_.gridFitType = "pixel"; __id18_.italic = false; __id18_.selectable = false; __id18_.underline = false; try { __id18_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id18___1(_arg1:Object){ var __id18_ = _arg1; try { __id18_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id18_.text = "{keyboard}"; __id18_.textColor = 0xFFFFFF; __id18_.textSize = 20; __id18_.bold = true; __id18_.disableWordwrap = false; __id18_.embedFonts = true; __id18_.font = ""; __id18_.hAlign = "center"; __id18_.multiline = false; __id18_.vAlign = "top"; __id18_.antiAliasType = "advanced"; __id18_.glowBlur = 3; __id18_.glowColor = 0; __id18_.useGlowFilter = true; __id18_.glowQuality = 0; __id18_.glowStrength = 0; __id18_.gridFitType = "pixel"; __id18_.italic = false; __id18_.selectable = false; __id18_.underline = false; try { __id18_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id18___2(_arg1:Object){ var __id18_ = _arg1; try { __id18_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id18_.text = "{keyboard}"; __id18_.textColor = 4137230; __id18_.textSize = 20; __id18_.bold = true; __id18_.disableWordwrap = false; __id18_.embedFonts = true; __id18_.font = ""; __id18_.hAlign = "center"; __id18_.multiline = false; __id18_.vAlign = "top"; __id18_.antiAliasType = "advanced"; __id18_.glowBlur = 3; __id18_.glowColor = 0; __id18_.useGlowFilter = true; __id18_.glowQuality = 0; __id18_.glowStrength = 0; __id18_.gridFitType = "pixel"; __id18_.italic = false; __id18_.selectable = false; __id18_.underline = false; try { __id18_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 4
//Timeline_114 (AlienThief_fla.Timeline_114) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_114 extends SimpleButton { public var __id19_:LocalizedTextField; public function Timeline_114(){ __setProp___id19__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id19___1(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id19___2(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id19__(_arg1:Object){ var __id19_ = _arg1; try { __id19_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id19_.text = "{mouse}"; __id19_.textColor = 4137230; __id19_.textSize = 20; __id19_.bold = true; __id19_.disableWordwrap = false; __id19_.embedFonts = true; __id19_.font = ""; __id19_.hAlign = "center"; __id19_.multiline = false; __id19_.vAlign = "top"; __id19_.antiAliasType = "advanced"; __id19_.glowBlur = 3; __id19_.glowColor = 0; __id19_.useGlowFilter = true; __id19_.glowQuality = 0; __id19_.glowStrength = 0; __id19_.gridFitType = "pixel"; __id19_.italic = false; __id19_.selectable = false; __id19_.underline = false; try { __id19_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id19___1(_arg1:Object){ var __id19_ = _arg1; try { __id19_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id19_.text = "{mouse}"; __id19_.textColor = 0xFFFFFF; __id19_.textSize = 20; __id19_.bold = true; __id19_.disableWordwrap = false; __id19_.embedFonts = true; __id19_.font = ""; __id19_.hAlign = "center"; __id19_.multiline = false; __id19_.vAlign = "top"; __id19_.antiAliasType = "advanced"; __id19_.glowBlur = 3; __id19_.glowColor = 0; __id19_.useGlowFilter = true; __id19_.glowQuality = 0; __id19_.glowStrength = 0; __id19_.gridFitType = "pixel"; __id19_.italic = false; __id19_.selectable = false; __id19_.underline = false; try { __id19_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id19___2(_arg1:Object){ var __id19_ = _arg1; try { __id19_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id19_.text = "{mouse}"; __id19_.textColor = 4137230; __id19_.textSize = 20; __id19_.bold = true; __id19_.disableWordwrap = false; __id19_.embedFonts = true; __id19_.font = ""; __id19_.hAlign = "center"; __id19_.multiline = false; __id19_.vAlign = "top"; __id19_.antiAliasType = "advanced"; __id19_.glowBlur = 3; __id19_.glowColor = 0; __id19_.useGlowFilter = true; __id19_.glowQuality = 0; __id19_.glowStrength = 0; __id19_.gridFitType = "pixel"; __id19_.italic = false; __id19_.selectable = false; __id19_.underline = false; try { __id19_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 5
//Timeline_116 (AlienThief_fla.Timeline_116) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_116 extends SimpleButton { public var __id21_:LocalizedTextField; public function Timeline_116(){ __setProp___id21__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id21__(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id21___1(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id21__(_arg1:Object){ var __id21_ = _arg1; try { __id21_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id21_.text = "{submitBtn}"; __id21_.textColor = 4137230; __id21_.textSize = 14; __id21_.bold = true; __id21_.disableWordwrap = false; __id21_.embedFonts = true; __id21_.font = ""; __id21_.hAlign = "center"; __id21_.multiline = false; __id21_.vAlign = "top"; __id21_.antiAliasType = "advanced"; __id21_.glowBlur = 3; __id21_.glowColor = 0; __id21_.useGlowFilter = true; __id21_.glowQuality = 0; __id21_.glowStrength = 0; __id21_.gridFitType = "pixel"; __id21_.italic = false; __id21_.selectable = false; __id21_.underline = false; try { __id21_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id21___1(_arg1:Object){ var __id21_ = _arg1; try { __id21_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id21_.text = "{submitBtn}"; __id21_.textColor = 0xFFFFFF; __id21_.textSize = 14; __id21_.bold = true; __id21_.disableWordwrap = false; __id21_.embedFonts = true; __id21_.font = ""; __id21_.hAlign = "center"; __id21_.multiline = false; __id21_.vAlign = "top"; __id21_.antiAliasType = "advanced"; __id21_.glowBlur = 3; __id21_.glowColor = 0; __id21_.useGlowFilter = true; __id21_.glowQuality = 0; __id21_.glowStrength = 0; __id21_.gridFitType = "pixel"; __id21_.italic = false; __id21_.selectable = false; __id21_.underline = false; try { __id21_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 6
//Timeline_120 (AlienThief_fla.Timeline_120) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_120 extends SimpleButton { public var __id25_:LocalizedTextField; public function Timeline_120(){ __setProp___id25__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id25__(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id25___1(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id25__(_arg1:Object){ var __id25_ = _arg1; try { __id25_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id25_.text = "{tryAgainBtn}"; __id25_.textColor = 4137230; __id25_.textSize = 14; __id25_.bold = true; __id25_.disableWordwrap = false; __id25_.embedFonts = true; __id25_.font = ""; __id25_.hAlign = "center"; __id25_.multiline = false; __id25_.vAlign = "top"; __id25_.antiAliasType = "advanced"; __id25_.glowBlur = 3; __id25_.glowColor = 0; __id25_.useGlowFilter = true; __id25_.glowQuality = 0; __id25_.glowStrength = 0; __id25_.gridFitType = "pixel"; __id25_.italic = false; __id25_.selectable = false; __id25_.underline = false; try { __id25_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id25___1(_arg1:Object){ var __id25_ = _arg1; try { __id25_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id25_.text = "{tryAgainBtn}"; __id25_.textColor = 0xFFFFFF; __id25_.textSize = 14; __id25_.bold = true; __id25_.disableWordwrap = false; __id25_.embedFonts = true; __id25_.font = ""; __id25_.hAlign = "center"; __id25_.multiline = false; __id25_.vAlign = "top"; __id25_.antiAliasType = "advanced"; __id25_.glowBlur = 3; __id25_.glowColor = 0; __id25_.useGlowFilter = true; __id25_.glowQuality = 0; __id25_.glowStrength = 0; __id25_.gridFitType = "pixel"; __id25_.italic = false; __id25_.selectable = false; __id25_.underline = false; try { __id25_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 7
//Timeline_122 (AlienThief_fla.Timeline_122) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_122 extends SimpleButton { public var __id28_:LocalizedTextField; public function Timeline_122(){ __setProp___id28__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id28__(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id28___1(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id28__(_arg1:Object){ var __id28_ = _arg1; try { __id28_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id28_.text = "{resumeBtn}"; __id28_.textColor = 4137230; __id28_.textSize = 14; __id28_.bold = true; __id28_.disableWordwrap = false; __id28_.embedFonts = true; __id28_.font = ""; __id28_.hAlign = "center"; __id28_.multiline = false; __id28_.vAlign = "top"; __id28_.antiAliasType = "advanced"; __id28_.glowBlur = 3; __id28_.glowColor = 0; __id28_.useGlowFilter = true; __id28_.glowQuality = 0; __id28_.glowStrength = 0; __id28_.gridFitType = "pixel"; __id28_.italic = false; __id28_.selectable = false; __id28_.underline = false; try { __id28_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id28___1(_arg1:Object){ var __id28_ = _arg1; try { __id28_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id28_.text = "{resumeBtn}"; __id28_.textColor = 0xFFFFFF; __id28_.textSize = 14; __id28_.bold = true; __id28_.disableWordwrap = false; __id28_.embedFonts = true; __id28_.font = ""; __id28_.hAlign = "center"; __id28_.multiline = false; __id28_.vAlign = "top"; __id28_.antiAliasType = "advanced"; __id28_.glowBlur = 3; __id28_.glowColor = 0; __id28_.useGlowFilter = true; __id28_.glowQuality = 0; __id28_.glowStrength = 0; __id28_.gridFitType = "pixel"; __id28_.italic = false; __id28_.selectable = false; __id28_.underline = false; try { __id28_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 8
//Timeline_123 (AlienThief_fla.Timeline_123) package AlienThief_fla { import adobe.utils.*; import flash.accessibility.*; import flash.display.*; import flash.errors.*; import flash.events.*; import flash.external.*; import flash.filters.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.printing.*; import flash.profiler.*; import flash.sampler.*; import flash.system.*; import flash.text.*; import flash.ui.*; import flash.utils.*; import flash.xml.*; import spill.localisation.*; public dynamic class Timeline_123 extends SimpleButton { public var __id29_:LocalizedTextField; public function Timeline_123(){ __setProp___id29__(DisplayObjectContainer(upState).getChildAt(1)); __setProp___id29__(DisplayObjectContainer(overState).getChildAt(1)); __setProp___id29___1(DisplayObjectContainer(downState).getChildAt(1)); } function __setProp___id29__(_arg1:Object){ var __id29_ = _arg1; try { __id29_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id29_.text = "{restartBtn}"; __id29_.textColor = 4137230; __id29_.textSize = 14; __id29_.bold = true; __id29_.disableWordwrap = false; __id29_.embedFonts = true; __id29_.font = ""; __id29_.hAlign = "center"; __id29_.multiline = false; __id29_.vAlign = "top"; __id29_.antiAliasType = "advanced"; __id29_.glowBlur = 3; __id29_.glowColor = 0; __id29_.useGlowFilter = true; __id29_.glowQuality = 0; __id29_.glowStrength = 0; __id29_.gridFitType = "pixel"; __id29_.italic = false; __id29_.selectable = false; __id29_.underline = false; try { __id29_["componentInspectorSetting"] = false; } catch(e:Error) { }; } function __setProp___id29___1(_arg1:Object){ var __id29_ = _arg1; try { __id29_["componentInspectorSetting"] = true; } catch(e:Error) { }; __id29_.text = "{restartBtn}"; __id29_.textColor = 0xFFFFFF; __id29_.textSize = 14; __id29_.bold = true; __id29_.disableWordwrap = false; __id29_.embedFonts = true; __id29_.font = ""; __id29_.hAlign = "center"; __id29_.multiline = false; __id29_.vAlign = "top"; __id29_.antiAliasType = "advanced"; __id29_.glowBlur = 3; __id29_.glowColor = 0; __id29_.useGlowFilter = true; __id29_.glowQuality = 0; __id29_.glowStrength = 0; __id29_.gridFitType = "pixel"; __id29_.italic = false; __id29_.selectable = false; __id29_.underline = false; try { __id29_["componentInspectorSetting"] = false; } catch(e:Error) { }; } } }//package AlienThief_fla
Section 9
//b2CircleDef (Box2D.Collision.Shapes.b2CircleDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2CircleDef extends b2ShapeDef { public var localPosition:b2Vec2; public var radius:Number; public function b2CircleDef(){ localPosition = new b2Vec2(0, 0); super(); type = b2Shape.e_circleShape; radius = 1; } } }//package Box2D.Collision.Shapes
Section 10
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Common.*; 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){ m_localPosition = new b2Vec2(); super(_arg1); var _local2:b2CircleDef = (_arg1 as b2CircleDef); m_type = e_circleShape; m_localPosition.SetV(_local2.localPosition); m_radius = _local2.radius; } override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ var _local3:b2Mat22 = _arg1.R; var _local4:Number = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y))); var _local5:Number = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y))); _local4 = (_arg2.x - _local4); _local5 = (_arg2.y - _local5); return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius))); } override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ var _local10:Number; var _local6:b2Mat22 = _arg1.R; var _local7:Number = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y))); var _local8:Number = (_arg1.position.y + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y))); var _local9:Number = (_arg4.p1.x - _local7); _local10 = (_arg4.p1.y - _local8); var _local11:Number = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius)); if (_local11 < 0){ return (false); }; var _local12:Number = (_arg4.p2.x - _arg4.p1.x); var _local13:Number = (_arg4.p2.y - _arg4.p1.y); var _local14:Number = ((_local9 * _local12) + (_local10 * _local13)); var _local15:Number = ((_local12 * _local12) + (_local13 * _local13)); var _local16:Number = ((_local14 * _local14) - (_local15 * _local11)); if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){ return (false); }; var _local17:Number = -((_local14 + Math.sqrt(_local16))); if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){ _local17 = (_local17 / _local15); _arg2[0] = _local17; _arg3.x = (_local9 + (_local17 * _local12)); _arg3.y = (_local10 + (_local17 * _local13)); _arg3.Normalize(); return (true); }; return (false); } override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ var _local3:b2Mat22 = _arg2.R; var _local4:Number = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y))); var _local5:Number = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y))); _arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius)); _arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius)); } override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ var _local4:b2Mat22; _local4 = _arg2.R; var _local5:Number = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y))); var _local6:Number = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y))); _local4 = _arg3.R; var _local7:Number = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y))); var _local8:Number = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y))); _arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius)); _arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius)); } override public function ComputeMass(_arg1:b2MassData):void{ _arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius); _arg1.center.SetV(m_localPosition); _arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y)))); } public function GetLocalPosition():b2Vec2{ return (m_localPosition); } public function GetRadius():Number{ return (m_radius); } override public function UpdateSweepRadius(_arg1:b2Vec2):void{ var _local2:Number = (m_localPosition.x - _arg1.x); var _local3:Number = (m_localPosition.y - _arg1.y); _local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3))); m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop); } } }//package Box2D.Collision.Shapes
Section 11
//b2FilterData (Box2D.Collision.Shapes.b2FilterData) package Box2D.Collision.Shapes { public class b2FilterData { public var categoryBits:uint;// = 1 public var maskBits:uint;// = 0xFFFF public var groupIndex:int;// = 0 public function Copy():b2FilterData{ var _local1:b2FilterData = new b2FilterData(); _local1.categoryBits = categoryBits; _local1.maskBits = maskBits; _local1.groupIndex = groupIndex; return (_local1); } } }//package Box2D.Collision.Shapes
Section 12
//b2MassData (Box2D.Collision.Shapes.b2MassData) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; public class b2MassData { public var mass:Number;// = 0 public var center:b2Vec2; public var I:Number;// = 0 public function b2MassData(){ center = new b2Vec2(0, 0); super(); } } }//package Box2D.Collision.Shapes
Section 13
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2PolygonDef extends b2ShapeDef { public var vertices:Array; public var vertexCount:int; private static var s_mat:b2Mat22 = new b2Mat22(); public function b2PolygonDef(){ vertices = new Array(b2Settings.b2_maxPolygonVertices); super(); type = b2Shape.e_polygonShape; vertexCount = 0; var _local1:int; while (_local1 < b2Settings.b2_maxPolygonVertices) { vertices[_local1] = new b2Vec2(); _local1++; }; } public function SetAsBox(_arg1:Number, _arg2:Number):void{ vertexCount = 4; vertices[0].Set(-(_arg1), -(_arg2)); vertices[1].Set(_arg1, -(_arg2)); vertices[2].Set(_arg1, _arg2); vertices[3].Set(-(_arg1), _arg2); } public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{ var _local5:b2Vec2; var _local6:b2Mat22; var _local7:int; vertexCount = 4; vertices[0].Set(-(_arg1), -(_arg2)); vertices[1].Set(_arg1, -(_arg2)); vertices[2].Set(_arg1, _arg2); vertices[3].Set(-(_arg1), _arg2); if (_arg3){ _local5 = _arg3; _local6 = s_mat; _local6.Set(_arg4); _local7 = 0; while (_local7 < vertexCount) { _arg3 = vertices[_local7]; _arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y))); _arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y))); _arg3.x = _arg1; _local7++; }; }; } } }//package Box2D.Collision.Shapes
Section 14
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape) package Box2D.Collision.Shapes { import Box2D.Common.Math.*; import Box2D.Collision.*; import Box2D.Common.*; import Box2D.Dynamics.*; public class b2PolygonShape extends b2Shape { private var s_supportVec:b2Vec2; public var m_centroid:b2Vec2; public var m_obb:b2OBB; public var m_vertices:Array; public var m_normals:Array; public var m_coreVertices:Array; public var m_vertexCount:int; private static var s_computeMat:b2Mat22 = new b2Mat22(); private static var s_sweptAABB1:b2AABB = new b2AABB(); private static var s_sweptAABB2:b2AABB = new b2AABB(); public function b2PolygonShape(_arg1:b2ShapeDef){ var _local3:int; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; s_supportVec = new b2Vec2(); m_obb = new b2OBB(); m_vertices = new Array(b2Settings.b2_maxPolygonVertices); m_normals = new Array(b2Settings.b2_maxPolygonVertices); m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices); super(_arg1); m_type = e_polygonShape; var _local2:b2PolygonDef = (_arg1 as b2PolygonDef); m_vertexCount = _local2.vertexCount; var _local4:int = _local3; var _local5:int = _local3; _local3 = 0; while (_local3 < m_vertexCount) { m_vertices[_local3] = _local2.vertices[_local3].Copy(); _local3++; }; _local3 = 0; while (_local3 < m_vertexCount) { _local4 = _local3; _local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0; _local6 = (m_vertices[_local5].x - m_vertices[_local4].x); _local7 = (m_vertices[_local5].y - m_vertices[_local4].y); _local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7))); m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8)); _local3++; }; m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount); ComputeOBB(m_obb, m_vertices, m_vertexCount); _local3 = 0; while (_local3 < m_vertexCount) { _local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1); _local5 = _local3; _local9 = m_normals[_local4].x; _local10 = m_normals[_local4].y; _local11 = m_normals[_local5].x; _local12 = m_normals[_local5].y; _local13 = (m_vertices[_local3].x - m_centroid.x); _local14 = (m_vertices[_local3].y - m_centroid.y); _local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop); _local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop); _local17 = (1 / ((_local9 * _local12) - (_local10 * _local11))); m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y)); _local3++; }; } override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ var _local3:b2Vec2; var _local10:Number; var _local4:b2Mat22 = _arg1.R; var _local5:Number = (_arg2.x - _arg1.position.x); var _local6:Number = (_arg2.y - _arg1.position.y); var _local7:Number = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y)); var _local8:Number = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y)); var _local9:int; while (_local9 < m_vertexCount) { _local3 = m_vertices[_local9]; _local5 = (_local7 - _local3.x); _local6 = (_local8 - _local3.y); _local3 = m_normals[_local9]; _local10 = ((_local3.x * _local5) + (_local3.y * _local6)); if (_local10 > 0){ return (false); }; _local9++; }; return (true); } override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:b2Vec2; var _local20:Number; var _local21:Number; var _local6:Number = 0; var _local7:Number = _arg5; _local8 = (_arg4.p1.x - _arg1.position.x); _local9 = (_arg4.p1.y - _arg1.position.y); _local10 = _arg1.R; var _local12:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y)); var _local13:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y)); _local8 = (_arg4.p2.x - _arg1.position.x); _local9 = (_arg4.p2.y - _arg1.position.y); _local10 = _arg1.R; var _local14:Number = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y)); var _local15:Number = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y)); var _local16:Number = (_local14 - _local12); var _local17:Number = (_local15 - _local13); var _local18:int = -1; var _local19:int; while (_local19 < m_vertexCount) { _local11 = m_vertices[_local19]; _local8 = (_local11.x - _local12); _local9 = (_local11.y - _local13); _local11 = m_normals[_local19]; _local20 = ((_local11.x * _local8) + (_local11.y * _local9)); _local21 = ((_local11.x * _local16) + (_local11.y * _local17)); if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){ _local6 = (_local20 / _local21); _local18 = _local19; } else { if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){ _local7 = (_local20 / _local21); }; }; if (_local7 < _local6){ return (false); }; _local19++; }; if (_local18 >= 0){ _arg2[0] = _local6; _local10 = _arg1.R; _local11 = m_normals[_local18]; _arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); return (true); }; return (false); } override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ var _local3:b2Mat22; var _local4:b2Vec2; var _local5:b2Mat22 = s_computeMat; _local3 = _arg2.R; _local4 = m_obb.R.col1; _local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local4 = m_obb.R.col2; _local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); _local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); _local5.Abs(); var _local6:b2Mat22 = _local5; _local4 = m_obb.extents; var _local7:Number = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y)); var _local8:Number = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y)); _local3 = _arg2.R; _local4 = m_obb.center; var _local9:Number = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y))); var _local10:Number = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y))); _arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8)); _arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8)); } override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ var _local4:b2AABB = s_sweptAABB1; var _local5:b2AABB = s_sweptAABB2; ComputeAABB(_local4, _arg2); ComputeAABB(_local5, _arg3); _arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y); _arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y); } override public function ComputeMass(_arg1:b2MassData):void{ var _local10:b2Vec2; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local2:Number = 0; var _local3:Number = 0; var _local4:Number = 0; var _local5:Number = 0; var _local6:Number = 0; var _local7:Number = 0; var _local8:Number = (1 / 3); var _local9:int; while (_local9 < m_vertexCount) { _local10 = m_vertices[_local9]; _local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0]; _local12 = (_local10.x - _local6); _local13 = (_local10.y - _local7); _local14 = (_local11.x - _local6); _local15 = (_local11.y - _local7); _local16 = ((_local12 * _local15) - (_local13 * _local14)); _local17 = (0.5 * _local16); _local4 = (_local4 + _local17); _local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x))); _local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y))); _local18 = _local6; _local19 = _local7; _local20 = _local12; _local21 = _local13; _local22 = _local14; _local23 = _local15; _local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18)); _local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19)); _local5 = (_local5 + (_local16 * (_local24 + _local25))); _local9++; }; _arg1.mass = (m_density * _local4); _local2 = (_local2 * (1 / _local4)); _local3 = (_local3 * (1 / _local4)); _arg1.center.Set(_local2, _local3); _arg1.I = (m_density * _local5); } public function GetOBB():b2OBB{ return (m_obb); } public function GetCentroid():b2Vec2{ return (m_centroid); } public function GetVertexCount():int{ return (m_vertexCount); } public function GetVertices():Array{ return (m_vertices); } public function GetCoreVertices():Array{ return (m_coreVertices); } public function GetNormals():Array{ return (m_normals); } public function GetFirstVertex(_arg1:b2XForm):b2Vec2{ return (b2Math.b2MulX(_arg1, m_coreVertices[0])); } public function Centroid(_arg1:b2XForm):b2Vec2{ return (b2Math.b2MulX(_arg1, m_centroid)); } public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{ var _local4:b2Vec2; var _local5:b2Mat22; var _local11:Number; _local5 = _arg1.R; var _local6:Number = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y)); var _local7:Number = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y)); var _local8:int; _local4 = m_coreVertices[0]; var _local9:Number = ((_local4.x * _local6) + (_local4.y * _local7)); var _local10:int = 1; while (_local10 < m_vertexCount) { _local4 = m_coreVertices[_local10]; _local11 = ((_local4.x * _local6) + (_local4.y * _local7)); if (_local11 > _local9){ _local8 = _local10; _local9 = _local11; }; _local10++; }; _local5 = _arg1.R; _local4 = m_coreVertices[_local8]; s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y))); s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y))); return (s_supportVec); } override public function UpdateSweepRadius(_arg1:b2Vec2):void{ var _local2:b2Vec2; var _local4:Number; var _local5:Number; m_sweepRadius = 0; var _local3:int; while (_local3 < m_vertexCount) { _local2 = m_coreVertices[_local3]; _local4 = (_local2.x - _arg1.x); _local5 = (_local2.y - _arg1.y); _local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5))); if (_local4 > m_sweepRadius){ m_sweepRadius = _local4; }; _local3++; }; } public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{ var _local3:b2Vec2; var _local7:Number; var _local9:b2Vec2; var _local10:b2Vec2; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; _local3 = new b2Vec2(); var _local4:Number = 0; var _local5:Number = 0; var _local6:Number = 0; _local7 = (1 / 3); var _local8:int; while (_local8 < _arg2) { _local9 = _arg1[_local8]; _local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0]; _local11 = (_local9.x - _local5); _local12 = (_local9.y - _local6); _local13 = (_local10.x - _local5); _local14 = (_local10.y - _local6); _local15 = ((_local11 * _local14) - (_local12 * _local13)); _local16 = (0.5 * _local15); _local4 = (_local4 + _local16); _local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x))); _local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y))); _local8++; }; _local3.x = (_local3.x * (1 / _local4)); _local3.y = (_local3.y * (1 / _local4)); return (_local3); } public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{ var _local4:int; var _local7:b2Vec2; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:int; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:b2Mat22; var _local5:Array = new Array((b2Settings.b2_maxPolygonVertices + 1)); _local4 = 0; while (_local4 < _arg3) { _local5[_local4] = _arg2[_local4]; _local4++; }; _local5[_arg3] = _local5[0]; var _local6:Number = Number.MAX_VALUE; _local4 = 1; while (_local4 <= _arg3) { _local7 = _local5[int((_local4 - 1))]; _local8 = (_local5[_local4].x - _local7.x); _local9 = (_local5[_local4].y - _local7.y); _local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9))); _local8 = (_local8 / _local10); _local9 = (_local9 / _local10); _local11 = -(_local9); _local12 = _local8; _local13 = Number.MAX_VALUE; _local14 = Number.MAX_VALUE; _local15 = -(Number.MAX_VALUE); _local16 = -(Number.MAX_VALUE); _local17 = 0; while (_local17 < _arg3) { _local19 = (_local5[_local17].x - _local7.x); _local20 = (_local5[_local17].y - _local7.y); _local21 = ((_local8 * _local19) + (_local9 * _local20)); _local22 = ((_local11 * _local19) + (_local12 * _local20)); if (_local21 < _local13){ _local13 = _local21; }; if (_local22 < _local14){ _local14 = _local22; }; if (_local21 > _local15){ _local15 = _local21; }; if (_local22 > _local16){ _local16 = _local22; }; _local17++; }; _local18 = ((_local15 - _local13) * (_local16 - _local14)); if (_local18 < (0.95 * _local6)){ _local6 = _local18; _arg1.R.col1.x = _local8; _arg1.R.col1.y = _local9; _arg1.R.col2.x = _local11; _arg1.R.col2.y = _local12; _local23 = (0.5 * (_local13 + _local15)); _local24 = (0.5 * (_local14 + _local16)); _local25 = _arg1.R; _arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24))); _arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24))); _arg1.extents.x = (0.5 * (_local15 - _local13)); _arg1.extents.y = (0.5 * (_local16 - _local14)); }; _local4++; }; } } }//package Box2D.Collision.Shapes
Section 15
//b2Shape (Box2D.Collision.Shapes.b2Shape) package Box2D.Collision.Shapes { import Box2D.Collision.*; import Box2D.Dynamics.*; import Box2D.Common.Math.*; public class b2Shape { public var m_type:int; public var m_next:b2Shape; public var m_body:b2Body; public var m_sweepRadius:Number; public var m_density:Number; public var m_friction:Number; public var m_restitution:Number; public var m_proxyId:uint; public var m_filter:b2FilterData; public var m_isSensor:Boolean; public var m_userData; public static const e_unknownShape:int = -1; public static const e_circleShape:int = 0; public static const e_polygonShape:int = 1; public static const e_shapeTypeCount:int = 2; private static var s_proxyAABB:b2AABB = new b2AABB(); private static var s_syncAABB:b2AABB = new b2AABB(); private static var s_resetAABB:b2AABB = new b2AABB(); public function b2Shape(_arg1:b2ShapeDef){ m_userData = _arg1.userData; m_friction = _arg1.friction; m_restitution = _arg1.restitution; m_density = _arg1.density; m_body = null; m_sweepRadius = 0; m_next = null; m_proxyId = b2Pair.b2_nullProxy; m_filter = _arg1.filter.Copy(); m_isSensor = _arg1.isSensor; } public function GetType():int{ return (m_type); } public function IsSensor():Boolean{ return (m_isSensor); } public function SetFilterData(_arg1:b2FilterData):void{ m_filter = _arg1.Copy(); } public function GetFilterData():b2FilterData{ return (m_filter.Copy()); } public function GetBody():b2Body{ return (m_body); } public function GetNext():b2Shape{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{ return (false); } public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{ return (false); } public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{ } public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{ } public function ComputeMass(_arg1:b2MassData):void{ } public function GetSweepRadius():Number{ return (m_sweepRadius); } public function GetFriction():Number{ return (m_friction); } public function GetRestitution():Number{ return (m_restitution); } public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{ var _local3:b2AABB = s_proxyAABB; ComputeAABB(_local3, _arg2); var _local4:Boolean = _arg1.InRange(_local3); if (_local4){ m_proxyId = _arg1.CreateProxy(_local3, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; } public function DestroyProxy(_arg1:b2BroadPhase):void{ if (m_proxyId != b2Pair.b2_nullProxy){ _arg1.DestroyProxy(m_proxyId); m_proxyId = b2Pair.b2_nullProxy; }; } public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{ if (m_proxyId == b2Pair.b2_nullProxy){ return (false); }; var _local4:b2AABB = s_syncAABB; ComputeSweptAABB(_local4, _arg2, _arg3); if (_arg1.InRange(_local4)){ _arg1.MoveProxy(m_proxyId, _local4); return (true); }; return (false); } public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{ if (m_proxyId == b2Pair.b2_nullProxy){ return; }; _arg1.DestroyProxy(m_proxyId); var _local3:b2AABB = s_resetAABB; ComputeAABB(_local3, _arg2); var _local4:Boolean = _arg1.InRange(_local3); if (_local4){ m_proxyId = _arg1.CreateProxy(_local3, this); } else { m_proxyId = b2Pair.b2_nullProxy; }; } public function UpdateSweepRadius(_arg1:b2Vec2):void{ } public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{ switch (_arg1.type){ case e_circleShape: return (new b2CircleShape(_arg1)); case e_polygonShape: return (new b2PolygonShape(_arg1)); default: return (null); }; } public static function Destroy(_arg1:b2Shape, _arg2):void{ } } }//package Box2D.Collision.Shapes
Section 16
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef) package Box2D.Collision.Shapes { public class b2ShapeDef { public var type:int;// = -1 public var userData;// = null public var friction:Number;// = 0.2 public var restitution:Number;// = 0 public var density:Number;// = 0 public var isSensor:Boolean;// = false public var filter:b2FilterData; public function b2ShapeDef(){ filter = new b2FilterData(); super(); } } }//package Box2D.Collision.Shapes
Section 17
//b2AABB (Box2D.Collision.b2AABB) package Box2D.Collision { import Box2D.Common.Math.*; public class b2AABB { public var lowerBound:b2Vec2; public var upperBound:b2Vec2; public function b2AABB(){ lowerBound = new b2Vec2(); upperBound = new b2Vec2(); super(); } public function IsValid():Boolean{ var _local1:Number = (upperBound.x - lowerBound.x); var _local2:Number = (upperBound.y - lowerBound.y); var _local3:Boolean = (((_local1 >= 0)) && ((_local2 >= 0))); _local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid())); return (_local3); } } }//package Box2D.Collision
Section 18
//b2Bound (Box2D.Collision.b2Bound) package Box2D.Collision { public class b2Bound { public var value:uint; public var proxyId:uint; public var stabbingCount:uint; public function IsLower():Boolean{ return (((value & 1) == 0)); } public function IsUpper():Boolean{ return (((value & 1) == 1)); } public function Swap(_arg1:b2Bound):void{ var _local2:uint = value; var _local3:uint = proxyId; var _local4:uint = stabbingCount; value = _arg1.value; proxyId = _arg1.proxyId; stabbingCount = _arg1.stabbingCount; _arg1.value = _local2; _arg1.proxyId = _local3; _arg1.stabbingCount = _local4; } } }//package Box2D.Collision
Section 19
//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 20
//b2BroadPhase (Box2D.Collision.b2BroadPhase) package Box2D.Collision { import Box2D.Common.*; import Box2D.Common.Math.*; public class b2BroadPhase { public var m_pairManager:b2PairManager; public var m_proxyPool:Array; public var m_freeProxy:uint; public var m_bounds:Array; public var m_queryResults:Array; public var m_queryResultCount:int; public var m_worldAABB:b2AABB; public var m_quantizationFactor:b2Vec2; public var m_proxyCount:int; public var m_timeStamp:uint; public static const b2_invalid:uint = b2Settings.USHRT_MAX; public static const b2_nullEdge:uint = b2Settings.USHRT_MAX; public static var s_validate:Boolean = false; public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){ var _local3:int; var _local5:Number; var _local6:b2Proxy; var _local7:int; m_pairManager = new b2PairManager(); m_proxyPool = new Array(b2Settings.b2_maxPairs); m_bounds = new Array((2 * b2Settings.b2_maxProxies)); m_queryResults = new Array(b2Settings.b2_maxProxies); m_quantizationFactor = new b2Vec2(); super(); m_pairManager.Initialize(this, _arg2); m_worldAABB = _arg1; m_proxyCount = 0; _local3 = 0; while (_local3 < b2Settings.b2_maxProxies) { m_queryResults[_local3] = 0; _local3++; }; m_bounds = new Array(2); _local3 = 0; while (_local3 < 2) { m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies)); _local7 = 0; while (_local7 < (2 * b2Settings.b2_maxProxies)) { m_bounds[_local3][_local7] = new b2Bound(); _local7++; }; _local3++; }; var _local4:Number = (_arg1.upperBound.x - _arg1.lowerBound.x); _local5 = (_arg1.upperBound.y - _arg1.lowerBound.y); m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4); m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5); _local3 = 0; while (_local3 < (b2Settings.b2_maxProxies - 1)) { _local6 = new b2Proxy(); m_proxyPool[_local3] = _local6; _local6.SetNext((_local3 + 1)); _local6.timeStamp = 0; _local6.overlapCount = b2_invalid; _local6.userData = null; _local3++; }; _local6 = new b2Proxy(); m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6; _local6.SetNext(b2Pair.b2_nullProxy); _local6.timeStamp = 0; _local6.overlapCount = b2_invalid; _local6.userData = null; m_freeProxy = 0; m_timeStamp = 1; m_queryResultCount = 0; } public function InRange(_arg1:b2AABB):Boolean{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; _local2 = _arg1.lowerBound.x; _local3 = _arg1.lowerBound.y; _local2 = (_local2 - m_worldAABB.upperBound.x); _local3 = (_local3 - m_worldAABB.upperBound.y); _local4 = m_worldAABB.lowerBound.x; _local5 = m_worldAABB.lowerBound.y; _local4 = (_local4 - _arg1.upperBound.x); _local5 = (_local5 - _arg1.upperBound.y); _local2 = b2Math.b2Max(_local2, _local4); _local3 = b2Math.b2Max(_local3, _local5); return ((b2Math.b2Max(_local2, _local3) < 0)); } public function GetProxy(_arg1:int):b2Proxy{ var _local2:b2Proxy = m_proxyPool[_arg1]; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){ return (null); }; return (_local2); } public function CreateProxy(_arg1:b2AABB, _arg2):uint{ var _local3:uint; var _local4:b2Proxy; var _local11:Array; var _local12:uint; var _local13:uint; var _local14:Array; var _local15:Array; var _local16:Array; var _local17:int; var _local18:int; var _local19:b2Bound; var _local20:b2Bound; var _local21:b2Bound; var _local22:int; var _local23:b2Proxy; var _local5:uint = m_freeProxy; _local4 = m_proxyPool[_local5]; m_freeProxy = _local4.GetNext(); _local4.overlapCount = 0; _local4.userData = _arg2; var _local6:uint = (2 * m_proxyCount); var _local7:Array = new Array(); var _local8:Array = new Array(); ComputeBounds(_local7, _local8, _arg1); var _local9:int; while (_local9 < 2) { _local11 = m_bounds[_local9]; _local14 = [_local12]; _local15 = [_local13]; Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9); _local12 = _local14[0]; _local13 = _local15[0]; _local16 = new Array(); _local18 = (_local6 - _local13); _local17 = 0; while (_local17 < _local18) { _local16[_local17] = new b2Bound(); _local19 = _local16[_local17]; _local20 = _local11[int((_local13 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local22 = (_local13 + 2); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[int((_local22 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local16 = new Array(); _local18 = (_local13 - _local12); _local17 = 0; while (_local17 < _local18) { _local16[_local17] = new b2Bound(); _local19 = _local16[_local17]; _local20 = _local11[int((_local12 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local18 = _local16.length; _local22 = (_local12 + 1); _local17 = 0; while (_local17 < _local18) { _local20 = _local16[_local17]; _local19 = _local11[int((_local22 + _local17))]; _local19.value = _local20.value; _local19.proxyId = _local20.proxyId; _local19.stabbingCount = _local20.stabbingCount; _local17++; }; _local13++; _local19 = _local11[_local12]; _local20 = _local11[_local13]; _local19.value = _local7[_local9]; _local19.proxyId = _local5; _local20.value = _local8[_local9]; _local20.proxyId = _local5; _local21 = _local11[int((_local12 - 1))]; _local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount; _local21 = _local11[int((_local13 - 1))]; _local20.stabbingCount = _local21.stabbingCount; _local3 = _local12; while (_local3 < _local13) { _local21 = _local11[_local3]; _local21.stabbingCount++; _local3++; }; _local3 = _local12; while (_local3 < (_local6 + 2)) { _local19 = _local11[_local3]; _local23 = m_proxyPool[_local19.proxyId]; if (_local19.IsLower()){ _local23.lowerBounds[_local9] = _local3; } else { _local23.upperBounds[_local9] = _local3; }; _local3++; }; _local9++; }; m_proxyCount++; var _local10:int; while (_local10 < m_queryResultCount) { m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]); _local10++; }; m_pairManager.Commit(); m_queryResultCount = 0; IncrementTimeStamp(); return (_local5); } public function DestroyProxy(_arg1:uint):void{ var _local2:b2Bound; var _local3:b2Bound; var _local8:Array; var _local9:uint; var _local10:uint; var _local11:uint; var _local12:uint; var _local13:Array; var _local14:int; var _local15:int; var _local16:int; var _local17:uint; var _local18:int; var _local19:b2Proxy; var _local4:b2Proxy = m_proxyPool[_arg1]; var _local5:int = (2 * m_proxyCount); var _local6:int; while (_local6 < 2) { _local8 = m_bounds[_local6]; _local9 = _local4.lowerBounds[_local6]; _local10 = _local4.upperBounds[_local6]; _local2 = _local8[_local9]; _local11 = _local2.value; _local3 = _local8[_local10]; _local12 = _local3.value; _local13 = new Array(); _local15 = ((_local10 - _local9) - 1); _local14 = 0; while (_local14 < _local15) { _local13[_local14] = new b2Bound(); _local2 = _local13[_local14]; _local3 = _local8[int(((_local9 + 1) + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = _local13.length; _local16 = _local9; _local14 = 0; while (_local14 < _local15) { _local3 = _local13[_local14]; _local2 = _local8[int((_local16 + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local13 = new Array(); _local15 = ((_local5 - _local10) - 1); _local14 = 0; while (_local14 < _local15) { _local13[_local14] = new b2Bound(); _local2 = _local13[_local14]; _local3 = _local8[int(((_local10 + 1) + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = _local13.length; _local16 = (_local10 - 1); _local14 = 0; while (_local14 < _local15) { _local3 = _local13[_local14]; _local2 = _local8[int((_local16 + _local14))]; _local2.value = _local3.value; _local2.proxyId = _local3.proxyId; _local2.stabbingCount = _local3.stabbingCount; _local14++; }; _local15 = (_local5 - 2); _local17 = _local9; while (_local17 < _local15) { _local2 = _local8[_local17]; _local19 = m_proxyPool[_local2.proxyId]; if (_local2.IsLower()){ _local19.lowerBounds[_local6] = _local17; } else { _local19.upperBounds[_local6] = _local17; }; _local17++; }; _local15 = (_local10 - 1); _local18 = _local9; while (_local18 < _local15) { _local2 = _local8[_local18]; _local2.stabbingCount--; _local18++; }; Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6); _local6++; }; var _local7:int; while (_local7 < m_queryResultCount) { m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]); _local7++; }; m_pairManager.Commit(); m_queryResultCount = 0; IncrementTimeStamp(); _local4.userData = null; _local4.overlapCount = b2_invalid; _local4.lowerBounds[0] = b2_invalid; _local4.lowerBounds[1] = b2_invalid; _local4.upperBounds[0] = b2_invalid; _local4.upperBounds[1] = b2_invalid; _local4.SetNext(m_freeProxy); m_freeProxy = _arg1; m_proxyCount--; } public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{ var _local3:Array; var _local4:int; var _local5:uint; var _local6:uint; var _local7:b2Bound; var _local8:b2Bound; var _local9:b2Bound; var _local10:uint; var _local11:b2Proxy; var _local16:Array; var _local17:uint; var _local18:uint; var _local19:uint; var _local20:uint; var _local21:int; var _local22:int; var _local23:uint; var _local24:b2Proxy; if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){ return; }; if (_arg2.IsValid() == false){ return; }; var _local12:uint = (2 * m_proxyCount); var _local13:b2Proxy = m_proxyPool[_arg1]; var _local14:b2BoundValues = new b2BoundValues(); ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2); var _local15:b2BoundValues = new b2BoundValues(); _local5 = 0; while (_local5 < 2) { _local7 = m_bounds[_local5][_local13.lowerBounds[_local5]]; _local15.lowerValues[_local5] = _local7.value; _local7 = m_bounds[_local5][_local13.upperBounds[_local5]]; _local15.upperValues[_local5] = _local7.value; _local5++; }; _local5 = 0; while (_local5 < 2) { _local16 = m_bounds[_local5]; _local17 = _local13.lowerBounds[_local5]; _local18 = _local13.upperBounds[_local5]; _local19 = _local14.lowerValues[_local5]; _local20 = _local14.upperValues[_local5]; _local7 = _local16[_local17]; _local21 = (_local19 - _local7.value); _local7.value = _local19; _local7 = _local16[_local18]; _local22 = (_local20 - _local7.value); _local7.value = _local20; if (_local21 < 0){ _local6 = _local17; while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) { _local7 = _local16[_local6]; _local8 = _local16[int((_local6 - 1))]; _local23 = _local8.proxyId; _local24 = m_proxyPool[_local8.proxyId]; _local8.stabbingCount++; if (_local8.IsUpper() == true){ if (TestOverlap(_local14, _local24)){ m_pairManager.AddBufferedPair(_arg1, _local23); }; _local3 = _local24.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount++; } else { _local3 = _local24.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount--; }; _local3 = _local13.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.Swap(_local8); _local6--; }; }; if (_local22 > 0){ _local6 = _local18; while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) { _local7 = _local16[_local6]; _local9 = _local16[int((_local6 + 1))]; _local10 = _local9.proxyId; _local11 = m_proxyPool[_local10]; _local9.stabbingCount++; if (_local9.IsLower() == true){ if (TestOverlap(_local14, _local11)){ m_pairManager.AddBufferedPair(_arg1, _local10); }; _local3 = _local11.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount++; } else { _local3 = _local11.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount--; }; _local3 = _local13.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.Swap(_local9); _local6++; }; }; if (_local21 > 0){ _local6 = _local17; while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) { _local7 = _local16[_local6]; _local9 = _local16[int((_local6 + 1))]; _local10 = _local9.proxyId; _local11 = m_proxyPool[_local10]; _local9.stabbingCount--; if (_local9.IsUpper()){ if (TestOverlap(_local15, _local11)){ m_pairManager.RemoveBufferedPair(_arg1, _local10); }; _local3 = _local11.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount--; } else { _local3 = _local11.lowerBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.stabbingCount++; }; _local3 = _local13.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.Swap(_local9); _local6++; }; }; if (_local22 < 0){ _local6 = _local18; while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) { _local7 = _local16[_local6]; _local8 = _local16[int((_local6 - 1))]; _local23 = _local8.proxyId; _local24 = m_proxyPool[_local23]; _local8.stabbingCount--; if (_local8.IsLower() == true){ if (TestOverlap(_local15, _local24)){ m_pairManager.RemoveBufferedPair(_arg1, _local23); }; _local3 = _local24.lowerBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount--; } else { _local3 = _local24.upperBounds; _local4 = _local3[_local5]; _local4++; _local3[_local5] = _local4; _local7.stabbingCount++; }; _local3 = _local13.upperBounds; _local4 = _local3[_local5]; _local4--; _local3[_local5] = _local4; _local7.Swap(_local8); _local6--; }; }; _local5++; }; } public function Commit():void{ m_pairManager.Commit(); } public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{ var _local6:uint; var _local7:uint; var _local12:b2Proxy; var _local4:Array = new Array(); var _local5:Array = new Array(); ComputeBounds(_local4, _local5, _arg1); var _local8:Array = [_local6]; var _local9:Array = [_local7]; Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0); Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1); var _local10:int; var _local11:int; while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) { _local12 = m_proxyPool[m_queryResults[_local11]]; _arg2[_local11] = _local12.userData; _local11++; _local10++; }; m_queryResultCount = 0; IncrementTimeStamp(); return (_local10); } public function Validate():void{ var _local1:b2Pair; var _local2:b2Proxy; var _local3:b2Proxy; var _local4:Boolean; var _local6:b2Bound; var _local7:uint; var _local8:uint; var _local9:uint; var _local10:b2Bound; var _local5:int; while (_local5 < 2) { _local6 = m_bounds[_local5]; _local7 = (2 * m_proxyCount); _local8 = 0; _local9 = 0; while (_local9 < _local7) { _local10 = _local6[_local9]; if (_local10.IsLower() == true){ _local8++; } else { _local8--; }; _local9++; }; _local5++; }; } private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{ var _local4:Number = _arg3.lowerBound.x; var _local5:Number = _arg3.lowerBound.y; _local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x); _local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y); _local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x); _local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y); var _local6:Number = _arg3.upperBound.x; var _local7:Number = _arg3.upperBound.y; _local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x); _local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y); _local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x); _local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y); _arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1)); _arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1); _arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1)); _arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1); } private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{ var _local4:Array; var _local5:b2Bound; var _local6:b2Bound; var _local3:int; while (_local3 < 2) { _local4 = m_bounds[_local3]; _local5 = _local4[_arg1.lowerBounds[_local3]]; _local6 = _local4[_arg2.upperBounds[_local3]]; if (_local5.value > _local6.value){ return (false); }; _local5 = _local4[_arg1.upperBounds[_local3]]; _local6 = _local4[_arg2.lowerBounds[_local3]]; if (_local5.value < _local6.value){ return (false); }; _local3++; }; return (true); } public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{ var _local4:Array; var _local5:b2Bound; var _local3:int; while (_local3 < 2) { _local4 = m_bounds[_local3]; _local5 = _local4[_arg2.upperBounds[_local3]]; if (_arg1.lowerValues[_local3] > _local5.value){ return (false); }; _local5 = _local4[_arg2.lowerBounds[_local3]]; if (_arg1.upperValues[_local3] < _local5.value){ return (false); }; _local3++; }; return (true); } private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{ var _local10:b2Bound; var _local12:int; var _local13:int; var _local14:b2Proxy; var _local8:uint = BinarySearch(_arg5, _arg6, _arg3); var _local9:uint = BinarySearch(_arg5, _arg6, _arg4); var _local11:uint = _local8; while (_local11 < _local9) { _local10 = _arg5[_local11]; if (_local10.IsLower()){ IncrementOverlapCount(_local10.proxyId); }; _local11++; }; if (_local8 > 0){ _local12 = (_local8 - 1); _local10 = _arg5[_local12]; _local13 = _local10.stabbingCount; while (_local13) { _local10 = _arg5[_local12]; if (_local10.IsLower()){ _local14 = m_proxyPool[_local10.proxyId]; if (_local8 <= _local14.upperBounds[_arg7]){ IncrementOverlapCount(_local10.proxyId); _local13--; }; }; _local12--; }; }; _arg1[0] = _local8; _arg2[0] = _local9; } private function IncrementOverlapCount(_arg1:uint):void{ var _local2:b2Proxy = m_proxyPool[_arg1]; if (_local2.timeStamp < m_timeStamp){ _local2.timeStamp = m_timeStamp; _local2.overlapCount = 1; } else { _local2.overlapCount = 2; m_queryResults[m_queryResultCount] = _arg1; m_queryResultCount++; }; } private function IncrementTimeStamp():void{ var _local1:uint; if (m_timeStamp == b2Settings.USHRT_MAX){ _local1 = 0; while (_local1 < b2Settings.b2_maxProxies) { (m_proxyPool[_local1] as b2Proxy).timeStamp = 0; _local1++; }; m_timeStamp = 1; } else { m_timeStamp++; }; } public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{ var _local6:int; var _local7:b2Bound; var _local4:int; var _local5:int = (_arg2 - 1); while (_local4 <= _local5) { _local6 = ((_local4 + _local5) / 2); _local7 = _arg1[_local6]; if (_local7.value > _arg3){ _local5 = (_local6 - 1); } else { if (_local7.value < _arg3){ _local4 = (_local6 + 1); } else { return (uint(_local6)); }; }; }; return (uint(_local4)); } } }//package Box2D.Collision
Section 21
//b2BufferedPair (Box2D.Collision.b2BufferedPair) package Box2D.Collision { public class b2BufferedPair { public var proxyId1:uint; public var proxyId2:uint; } }//package Box2D.Collision
Section 22
//b2Collision (Box2D.Collision.b2Collision) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; import Box2D.Collision.Shapes.*; public class b2Collision { public static const b2_nullFeature:uint = 0xFF; private static var b2CollidePolyTempVec:b2Vec2 = new b2Vec2(); public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{ var _local5:ClipVertex; var _local6:int; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:Number; var _local11:Number; var _local12:b2Vec2; var _local13:ClipVertex; _local6 = 0; _local5 = _arg2[0]; _local7 = _local5.v; _local5 = _arg2[1]; _local8 = _local5.v; _local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4); var _local10:Number = (b2Math.b2Dot(_arg3, _local8) - _arg4); if (_local9 <= 0){ var _temp1 = _local6; _local6 = (_local6 + 1); var _local14 = _temp1; _arg1[_local14] = _arg2[0]; }; if (_local10 <= 0){ var _temp2 = _local6; _local6 = (_local6 + 1); _local14 = _temp2; _arg1[_local14] = _arg2[1]; }; if ((_local9 * _local10) < 0){ _local11 = (_local9 / (_local9 - _local10)); _local5 = _arg1[_local6]; _local12 = _local5.v; _local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x))); _local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y))); _local5 = _arg1[_local6]; if (_local9 > 0){ _local13 = _arg2[0]; _local5.id = _local13.id; } else { _local13 = _arg2[1]; _local5.id = _local13.id; }; _local6++; }; return (_local6); } public static function EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{ var _local11:b2Mat22; var _local12:b2Vec2; var _local25:Number; var _local6:int = _arg1.m_vertexCount; var _local7:Array = _arg1.m_vertices; var _local8:Array = _arg1.m_normals; var _local9:int = _arg4.m_vertexCount; var _local10:Array = _arg4.m_vertices; _local11 = _arg2.R; _local12 = _local8[_arg3]; var _local13:Number = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)); var _local14:Number = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)); _local11 = _arg5.R; var _local15:Number = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14)); var _local16:Number = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14)); var _local17:int; var _local18:Number = Number.MAX_VALUE; var _local19:int; while (_local19 < _local9) { _local12 = _local10[_local19]; _local25 = ((_local12.x * _local15) + (_local12.y * _local16)); if (_local25 < _local18){ _local18 = _local25; _local17 = _local19; }; _local19++; }; _local12 = _local7[_arg3]; _local11 = _arg2.R; var _local20:Number = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y))); var _local21:Number = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y))); _local12 = _local10[_local17]; _local11 = _arg5.R; var _local22:Number = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y))); var _local23:Number = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y))); _local22 = (_local22 - _local20); _local23 = (_local23 - _local21); var _local24:Number = ((_local22 * _local13) + (_local23 * _local14)); return (_local24); } public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{ var _local8:b2Vec2; var _local9:b2Mat22; var _local22:int; var _local23:Number; var _local24:int; var _local25:Number; var _local6:int = _arg2.m_vertexCount; var _local7:Array = _arg2.m_normals; _local9 = _arg5.R; _local8 = _arg4.m_centroid; var _local10:Number = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))); var _local11:Number = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))); _local9 = _arg3.R; _local8 = _arg2.m_centroid; _local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)))); _local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)))); var _local12:Number = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y)); var _local13:Number = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y)); var _local14:int; var _local15:Number = -(Number.MAX_VALUE); var _local16:int; while (_local16 < _local6) { _local8 = _local7[_local16]; _local25 = ((_local8.x * _local12) + (_local8.y * _local13)); if (_local25 > _local15){ _local15 = _local25; _local14 = _local16; }; _local16++; }; var _local17:Number = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5); if (_local17 > 0){ return (_local17); }; var _local18:int = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1); var _local19:Number = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5); if (_local19 > 0){ return (_local19); }; var _local20:int = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0; var _local21:Number = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5); if (_local21 > 0){ return (_local21); }; if ((((_local19 > _local17)) && ((_local19 > _local21)))){ _local24 = -1; _local22 = _local18; _local23 = _local19; } else { if (_local21 > _local17){ _local24 = 1; _local22 = _local20; _local23 = _local21; } else { _arg1[0] = _local14; return (_local17); }; }; while (true) { if (_local24 == -1){ _local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1); } else { _local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0; }; _local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5); if (_local17 > 0){ return (_local17); }; if (_local17 > _local23){ _local22 = _local14; _local23 = _local17; } else { break; }; }; _arg1[0] = _local22; return (_local23); } public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{ var _local12:b2Mat22; var _local13:b2Vec2; var _local20:ClipVertex; var _local23:Number; var _local7:int = _arg2.m_vertexCount; var _local8:Array = _arg2.m_normals; var _local9:int = _arg5.m_vertexCount; var _local10:Array = _arg5.m_vertices; var _local11:Array = _arg5.m_normals; _local12 = _arg3.R; _local13 = _local8[_arg4]; var _local14:Number = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)); var _local15:Number = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)); _local12 = _arg6.R; var _local16:Number = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15)); _local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15)); _local14 = _local16; var _local17:int; var _local18:Number = Number.MAX_VALUE; var _local19:int; while (_local19 < _local9) { _local13 = _local11[_local19]; _local23 = ((_local14 * _local13.x) + (_local15 * _local13.y)); if (_local23 < _local18){ _local18 = _local23; _local17 = _local19; }; _local19++; }; var _local21:int = _local17; var _local22:int = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0; _local20 = _arg1[0]; _local13 = _local10[_local21]; _local12 = _arg6.R; _local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y))); _local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y))); _local20.id.features.referenceEdge = _arg4; _local20.id.features.incidentEdge = _local21; _local20.id.features.incidentVertex = 0; _local20 = _arg1[1]; _local13 = _local10[_local22]; _local12 = _arg6.R; _local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y))); _local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y))); _local20.id.features.referenceEdge = _arg4; _local20.id.features.incidentEdge = _local22; _local20.id.features.incidentVertex = 1; } public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{ var _local6:ClipVertex; var _local13:b2PolygonShape; var _local14:b2PolygonShape; var _local17:int; var _local18:uint; var _local34:int; var _local37:b2Vec2; var _local38:Number; var _local39:b2ManifoldPoint; _arg1.pointCount = 0; var _local7:int; var _local8:Array = [_local7]; var _local9:Number = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5); _local7 = _local8[0]; if (_local9 > 0){ return; }; var _local10:int; var _local11:Array = [_local10]; var _local12:Number = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3); _local10 = _local11[0]; if (_local12 > 0){ return; }; var _local15:b2XForm = new b2XForm(); var _local16:b2XForm = new b2XForm(); var _local19:Number = 0.98; var _local20:Number = 0.001; if (_local12 > ((_local19 * _local9) + _local20)){ _local13 = _arg4; _local14 = _arg2; _local15.Set(_arg5); _local16.Set(_arg3); _local17 = _local10; _local18 = 1; } else { _local13 = _arg2; _local14 = _arg4; _local15.Set(_arg3); _local16.Set(_arg5); _local17 = _local7; _local18 = 0; }; var _local21:Array = [new ClipVertex(), new ClipVertex()]; FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16); var _local22:int = _local13.m_vertexCount; var _local23:Array = _local13.m_vertices; var _local24:b2Vec2 = _local23[_local17]; var _local25:b2Vec2 = _local24.Copy(); if ((_local17 + 1) < _local22){ _local24 = _local23[int((_local17 + 1))]; _local37 = _local24.Copy(); } else { _local24 = _local23[0]; _local37 = _local24.Copy(); }; var _local26:b2Vec2 = b2Math.SubtractVV(_local37, _local25); var _local27:b2Vec2 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25)); _local27.Normalize(); var _local28:b2Vec2 = b2Math.b2CrossVF(_local27, 1); _local25 = b2Math.b2MulX(_local15, _local25); _local37 = b2Math.b2MulX(_local15, _local37); var _local29:Number = b2Math.b2Dot(_local28, _local25); var _local30:Number = -(b2Math.b2Dot(_local27, _local25)); var _local31:Number = b2Math.b2Dot(_local27, _local37); var _local32:Array = [new ClipVertex(), new ClipVertex()]; var _local33:Array = [new ClipVertex(), new ClipVertex()]; _local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30); if (_local34 < 2){ return; }; _local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31); if (_local34 < 2){ return; }; _arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy(); var _local35:int; var _local36:int; while (_local36 < b2Settings.b2_maxManifoldPoints) { _local6 = _local33[_local36]; _local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29); if (_local38 <= 0){ _local39 = _arg1.points[_local35]; _local39.separation = _local38; _local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v); _local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v); _local39.id.key = _local6.id._key; _local39.id.features.flip = _local18; _local35++; }; _local36++; }; _arg1.pointCount = _local35; } public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{ var _local6:b2Mat22; var _local7:b2Vec2; var _local18:Number; var _local24:Number; var _local25:Number; _arg1.pointCount = 0; _local6 = _arg3.R; _local7 = _arg2.m_localPosition; var _local8:Number = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y))); var _local9:Number = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y))); _local6 = _arg5.R; _local7 = _arg4.m_localPosition; var _local10:Number = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y))); var _local11:Number = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y))); var _local12:Number = (_local10 - _local8); var _local13:Number = (_local11 - _local9); var _local14:Number = ((_local12 * _local12) + (_local13 * _local13)); var _local15:Number = _arg2.m_radius; var _local16:Number = _arg4.m_radius; var _local17:Number = (_local15 + _local16); if (_local14 > (_local17 * _local17)){ return; }; if (_local14 < Number.MIN_VALUE){ _local18 = -(_local17); _arg1.normal.Set(0, 1); } else { _local24 = Math.sqrt(_local14); _local18 = (_local24 - _local17); _local25 = (1 / _local24); _arg1.normal.x = (_local25 * _local12); _arg1.normal.y = (_local25 * _local13); }; _arg1.pointCount = 1; var _local19:b2ManifoldPoint = _arg1.points[0]; _local19.id.key = 0; _local19.separation = _local18; _local8 = (_local8 + (_local15 * _arg1.normal.x)); _local9 = (_local9 + (_local15 * _arg1.normal.y)); _local10 = (_local10 - (_local16 * _arg1.normal.x)); _local11 = (_local11 - (_local16 * _arg1.normal.y)); var _local20:Number = (0.5 * (_local8 + _local10)); var _local21:Number = (0.5 * (_local9 + _local11)); var _local22:Number = (_local20 - _arg3.position.x); var _local23:Number = (_local21 - _arg3.position.y); _local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y)); _local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y)); _local22 = (_local20 - _arg5.position.x); _local23 = (_local21 - _arg5.position.y); _local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y)); _local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y)); } public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{ var _local6:b2ManifoldPoint; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:b2Vec2; var _local12:b2Mat22; var _local17:Number; var _local32:Number; var _local33:Number; var _local34:Number; _arg1.pointCount = 0; _local12 = _arg5.R; _local11 = _arg4.m_localPosition; var _local13:Number = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y))); var _local14:Number = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y))); _local7 = (_local13 - _arg3.position.x); _local8 = (_local14 - _arg3.position.y); _local12 = _arg3.R; var _local15:Number = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); var _local16:Number = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); var _local18:int; var _local19:Number = -(Number.MAX_VALUE); var _local20:Number = _arg4.m_radius; var _local21:int = _arg2.m_vertexCount; var _local22:Array = _arg2.m_vertices; var _local23:Array = _arg2.m_normals; var _local24:int; while (_local24 < _local21) { _local11 = _local22[_local24]; _local7 = (_local15 - _local11.x); _local8 = (_local16 - _local11.y); _local11 = _local23[_local24]; _local34 = ((_local11.x * _local7) + (_local11.y * _local8)); if (_local34 > _local20){ return; }; if (_local34 > _local19){ _local19 = _local34; _local18 = _local24; }; _local24++; }; if (_local19 < Number.MIN_VALUE){ _arg1.pointCount = 1; _local11 = _local23[_local18]; _local12 = _arg3.R; _arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)); _arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)); _local6 = _arg1.points[0]; _local6.id.features.incidentEdge = _local18; _local6.id.features.incidentVertex = b2_nullFeature; _local6.id.features.referenceEdge = 0; _local6.id.features.flip = 0; _local9 = (_local13 - (_local20 * _arg1.normal.x)); _local10 = (_local14 - (_local20 * _arg1.normal.y)); _local7 = (_local9 - _arg3.position.x); _local8 = (_local10 - _arg3.position.y); _local12 = _arg3.R; _local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local7 = (_local9 - _arg5.position.x); _local8 = (_local10 - _arg5.position.y); _local12 = _arg5.R; _local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local6.separation = (_local19 - _local20); return; }; var _local25:int = _local18; var _local26:int = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0; _local11 = _local22[_local25]; var _local27:b2Vec2 = _local22[_local26]; var _local28:Number = (_local27.x - _local11.x); var _local29:Number = (_local27.y - _local11.y); var _local30:Number = Math.sqrt(((_local28 * _local28) + (_local29 * _local29))); _local28 = (_local28 / _local30); _local29 = (_local29 / _local30); _local7 = (_local15 - _local11.x); _local8 = (_local16 - _local11.y); var _local31:Number = ((_local7 * _local28) + (_local8 * _local29)); _local6 = _arg1.points[0]; if (_local31 <= 0){ _local32 = _local11.x; _local33 = _local11.y; _local6.id.features.incidentEdge = b2_nullFeature; _local6.id.features.incidentVertex = _local25; } else { if (_local31 >= _local30){ _local32 = _local27.x; _local33 = _local27.y; _local6.id.features.incidentEdge = b2_nullFeature; _local6.id.features.incidentVertex = _local26; } else { _local32 = ((_local28 * _local31) + _local11.x); _local33 = ((_local29 * _local31) + _local11.y); _local6.id.features.incidentEdge = _local18; _local6.id.features.incidentVertex = b2_nullFeature; }; }; _local7 = (_local15 - _local32); _local8 = (_local16 - _local33); _local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8))); _local7 = (_local7 / _local17); _local8 = (_local8 / _local17); if (_local17 > _local20){ return; }; _arg1.pointCount = 1; _local12 = _arg3.R; _arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8)); _arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8)); _local9 = (_local13 - (_local20 * _arg1.normal.x)); _local10 = (_local14 - (_local20 * _arg1.normal.y)); _local7 = (_local9 - _arg3.position.x); _local8 = (_local10 - _arg3.position.y); _local12 = _arg3.R; _local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local7 = (_local9 - _arg5.position.x); _local8 = (_local10 - _arg5.position.y); _local12 = _arg5.R; _local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y)); _local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y)); _local6.separation = (_local17 - _local20); _local6.id.features.referenceEdge = 0; _local6.id.features.flip = 0; } public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{ var _local3:b2Vec2 = _arg2.lowerBound; var _local4:b2Vec2 = _arg1.upperBound; var _local5:Number = (_local3.x - _local4.x); var _local6:Number = (_local3.y - _local4.y); _local3 = _arg1.lowerBound; _local4 = _arg2.upperBound; var _local7:Number = (_local3.x - _local4.x); var _local8:Number = (_local3.y - _local4.y); if ((((_local5 > 0)) || ((_local6 > 0)))){ return (false); }; if ((((_local7 > 0)) || ((_local8 > 0)))){ return (false); }; return (true); } } }//package Box2D.Collision
Section 23
//b2ContactID (Box2D.Collision.b2ContactID) package Box2D.Collision { public class b2ContactID { public var features:Features; public var _key:uint; public function b2ContactID(){ features = new Features(); super(); features._m_id = this; } public function Set(_arg1:b2ContactID):void{ key = _arg1._key; } public function Copy():b2ContactID{ var _local1:b2ContactID = new b2ContactID(); _local1.key = key; return (_local1); } public function get key():uint{ return (_key); } public function set key(_arg1:uint):void{ _key = _arg1; features._referenceEdge = (_key & 0xFF); features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF); features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF); features._flip = (((_key & 4278190080) >> 24) & 0xFF); } } }//package Box2D.Collision
Section 24
//b2ContactPoint (Box2D.Collision.b2ContactPoint) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; public class b2ContactPoint { public var shape1:b2Shape; public var shape2:b2Shape; public var position:b2Vec2; public var velocity:b2Vec2; public var normal:b2Vec2; public var separation:Number; public var friction:Number; public var restitution:Number; public var id:b2ContactID; public function b2ContactPoint(){ position = new b2Vec2(); velocity = new b2Vec2(); normal = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Collision
Section 25
//b2Distance (Box2D.Collision.b2Distance) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; import Box2D.Collision.Shapes.*; public class b2Distance { private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var s_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()]; private static var gPoint:b2Point = new b2Point(); public static var g_GJK_Iterations:int = 0; public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{ var _local9:b2Vec2; var _local10:b2Vec2; var _local11:b2Vec2; var _local17:Number; var _local6:b2Vec2 = _arg5[0]; var _local7:b2Vec2 = _arg5[1]; var _local8:b2Vec2 = _arg3[0]; _local9 = _arg3[1]; _local10 = _arg4[0]; _local11 = _arg4[1]; var _local12:Number = -(_local7.x); var _local13:Number = -(_local7.y); var _local14:Number = (_local6.x - _local7.x); var _local15:Number = (_local6.y - _local7.y); var _local16:Number = Math.sqrt(((_local14 * _local14) + (_local15 * _local15))); _local14 = (_local14 / _local16); _local15 = (_local15 / _local16); _local17 = ((_local12 * _local14) + (_local13 * _local15)); if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){ _arg1.SetV(_local9); _arg2.SetV(_local11); _local8.SetV(_local9); _local10.SetV(_local11); _local6.SetV(_local7); return (1); }; _local17 = (_local17 / _local16); _arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x))); _arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y))); _arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x))); _arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y))); return (2); } public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{ var _local6:b2Vec2; var _local7:b2Vec2; var _local8:b2Vec2; var _local9:b2Vec2; var _local10:b2Vec2; var _local11:b2Vec2; var _local12:b2Vec2; var _local13:b2Vec2; var _local35:Number; _local6 = _arg5[0]; _local7 = _arg5[1]; _local8 = _arg5[2]; _local9 = _arg3[0]; _local10 = _arg3[1]; _local11 = _arg3[2]; _local12 = _arg4[0]; _local13 = _arg4[1]; var _local14:b2Vec2 = _arg4[2]; var _local15:Number = _local6.x; var _local16:Number = _local6.y; var _local17:Number = _local7.x; var _local18:Number = _local7.y; var _local19:Number = _local8.x; var _local20:Number = _local8.y; var _local21:Number = (_local17 - _local15); var _local22:Number = (_local18 - _local16); var _local23:Number = (_local19 - _local15); var _local24:Number = (_local20 - _local16); var _local25:Number = (_local19 - _local17); var _local26:Number = (_local20 - _local18); var _local27:Number = -(((_local15 * _local21) + (_local16 * _local22))); var _local28:Number = ((_local17 * _local21) + (_local18 * _local22)); var _local29:Number = -(((_local15 * _local23) + (_local16 * _local24))); var _local30:Number = ((_local19 * _local23) + (_local20 * _local24)); var _local31:Number = -(((_local17 * _local25) + (_local18 * _local26))); var _local32:Number = ((_local19 * _local25) + (_local20 * _local26)); if ((((_local30 <= 0)) && ((_local32 <= 0)))){ _arg1.SetV(_local11); _arg2.SetV(_local14); _local9.SetV(_local11); _local12.SetV(_local14); _local6.SetV(_local8); return (1); }; var _local33:Number = ((_local21 * _local24) - (_local22 * _local23)); var _local34:Number = (_local33 * ((_local15 * _local18) - (_local16 * _local17))); var _local36:Number = (_local33 * ((_local17 * _local20) - (_local18 * _local19))); if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){ _local35 = (_local31 / (_local31 + _local32)); _arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x))); _arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y))); _arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x))); _arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y))); _local9.SetV(_local11); _local12.SetV(_local14); _local6.SetV(_local8); return (2); }; var _local37:Number = (_local33 * ((_local19 * _local16) - (_local20 * _local15))); if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){ _local35 = (_local29 / (_local29 + _local30)); _arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x))); _arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y))); _arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x))); _arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y))); _local10.SetV(_local11); _local13.SetV(_local14); _local7.SetV(_local8); return (2); }; var _local38:Number = ((_local36 + _local37) + _local34); _local38 = (1 / _local38); var _local39:Number = (_local36 * _local38); var _local40:Number = (_local37 * _local38); var _local41:Number = ((1 - _local39) - _local40); _arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x)); _arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y)); _arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x)); _arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y)); return (3); } public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{ var _local6:b2Vec2; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local4:Number = (100 * Number.MIN_VALUE); var _local5:int; while (_local5 < _arg3) { _local6 = _arg2[_local5]; _local7 = Math.abs((_arg1.x - _local6.x)); _local8 = Math.abs((_arg1.y - _local6.y)); _local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x)); _local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y)); if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){ return (true); }; _local5++; }; return (false); } public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{ var _local7:b2Vec2; var _local15:Number; var _local16:Number; var _local17:b2Vec2; var _local18:b2Vec2; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:int; var _local8:Array = s_p1s; var _local9:Array = s_p2s; var _local10:Array = s_points; var _local11:int; _arg1.SetV(_arg3.GetFirstVertex(_arg4)); _arg2.SetV(_arg5.GetFirstVertex(_arg6)); var _local12:Number = 0; var _local13:int = 20; var _local14:int; while (_local14 < _local13) { _local15 = (_arg2.x - _arg1.x); _local16 = (_arg2.y - _arg1.y); _local17 = _arg3.Support(_arg4, _local15, _local16); _local18 = _arg5.Support(_arg6, -(_local15), -(_local16)); _local12 = ((_local15 * _local15) + (_local16 * _local16)); _local19 = (_local18.x - _local17.x); _local20 = (_local18.y - _local17.y); _local21 = ((_local15 * _local19) + (_local16 * _local20)); if ((_local12 - _local21) <= (0.01 * _local12)){ if (_local11 == 0){ _arg1.SetV(_local17); _arg2.SetV(_local18); }; g_GJK_Iterations = _local14; return (Math.sqrt(_local12)); }; switch (_local11){ case 0: _local7 = _local8[0]; _local7.SetV(_local17); _local7 = _local9[0]; _local7.SetV(_local18); _local7 = _local10[0]; _local7.x = _local19; _local7.y = _local20; _arg1.SetV(_local8[0]); _arg2.SetV(_local9[0]); _local11++; break; case 1: _local7 = _local8[1]; _local7.SetV(_local17); _local7 = _local9[1]; _local7.SetV(_local18); _local7 = _local10[1]; _local7.x = _local19; _local7.y = _local20; _local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10); break; case 2: _local7 = _local8[2]; _local7.SetV(_local17); _local7 = _local9[2]; _local7.SetV(_local18); _local7 = _local10[2]; _local7.x = _local19; _local7.y = _local20; _local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10); break; }; if (_local11 == 3){ g_GJK_Iterations = _local14; return (0); }; _local22 = -(Number.MAX_VALUE); _local23 = 0; while (_local23 < _local11) { _local7 = _local10[_local23]; _local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y))); _local23++; }; if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){ g_GJK_Iterations = _local14; _local15 = (_arg2.x - _arg1.x); _local16 = (_arg2.y - _arg1.y); _local12 = ((_local15 * _local15) + (_local16 * _local16)); return (Math.sqrt(_local12)); }; _local14++; }; g_GJK_Iterations = _local13; return (Math.sqrt(_local12)); } public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{ var _local7:b2Mat22; var _local8:b2Vec2; var _local19:Number; var _local20:Number; _local7 = _arg4.R; _local8 = _arg3.m_localPosition; var _local9:Number = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); var _local10:Number = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); _local7 = _arg6.R; _local8 = _arg5.m_localPosition; var _local11:Number = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); var _local12:Number = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); var _local13:Number = (_local11 - _local9); var _local14:Number = (_local12 - _local10); var _local15:Number = ((_local13 * _local13) + (_local14 * _local14)); var _local16:Number = (_arg3.m_radius - b2Settings.b2_toiSlop); var _local17:Number = (_arg5.m_radius - b2Settings.b2_toiSlop); var _local18:Number = (_local16 + _local17); if (_local15 > (_local18 * _local18)){ _local19 = Math.sqrt(_local15); _local13 = (_local13 / _local19); _local14 = (_local14 / _local19); _local20 = (_local19 - _local18); _arg1.x = (_local9 + (_local16 * _local13)); _arg1.y = (_local10 + (_local16 * _local14)); _arg2.x = (_local11 - (_local17 * _local13)); _arg2.y = (_local12 - (_local17 * _local14)); return (_local20); }; if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){ _local19 = Math.sqrt(_local15); _local13 = (_local13 / _local19); _local14 = (_local14 / _local19); _arg1.x = (_local9 + (_local16 * _local13)); _arg1.y = (_local10 + (_local16 * _local14)); _arg2.x = _arg1.x; _arg2.y = _arg1.y; return (0); }; _arg1.x = _local9; _arg1.y = _local10; _arg2.x = _arg1.x; _arg2.y = _arg1.y; return (0); } public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{ var _local7:b2Mat22; var _local8:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local9:b2Point = gPoint; _local8 = _arg5.m_localPosition; _local7 = _arg6.R; _local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y))); _local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y))); var _local10:Number = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity); var _local11:Number = (_arg5.m_radius - b2Settings.b2_toiSlop); if (_local10 > _local11){ _local10 = (_local10 - _local11); _local12 = (_arg2.x - _arg1.x); _local13 = (_arg2.y - _arg1.y); _local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13))); _local12 = (_local12 / _local14); _local13 = (_local13 / _local14); _arg2.x = (_arg2.x - (_local11 * _local12)); _arg2.y = (_arg2.y - (_local11 * _local13)); } else { _local10 = 0; _arg2.x = _arg1.x; _arg2.y = _arg1.y; }; return (_local10); } public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{ var _local7:int = _arg3.m_type; var _local8:int = _arg5.m_type; if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){ return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6)); }; if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){ return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6)); }; if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){ return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4)); }; if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){ return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6)); }; return (0); } } }//package Box2D.Collision
Section 26
//b2Manifold (Box2D.Collision.b2Manifold) package Box2D.Collision { import Box2D.Common.*; import Box2D.Common.Math.*; public class b2Manifold { public var points:Array; public var normal:b2Vec2; public var pointCount:int;// = 0 public function b2Manifold(){ points = new Array(b2Settings.b2_maxManifoldPoints); var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ManifoldPoint(); _local1++; }; normal = new b2Vec2(); } public function Reset():void{ var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { (points[_local1] as b2ManifoldPoint).Reset(); _local1++; }; normal.SetZero(); pointCount = 0; } public function Set(_arg1:b2Manifold):void{ pointCount = _arg1.pointCount; var _local2:int; while (_local2 < b2Settings.b2_maxManifoldPoints) { (points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]); _local2++; }; normal.SetV(_arg1.normal); } } }//package Box2D.Collision
Section 27
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint) package Box2D.Collision { import Box2D.Common.Math.*; public class b2ManifoldPoint { public var localPoint1:b2Vec2; public var localPoint2:b2Vec2; public var separation:Number; public var normalImpulse:Number; public var tangentImpulse:Number; public var id:b2ContactID; public function b2ManifoldPoint(){ localPoint1 = new b2Vec2(); localPoint2 = new b2Vec2(); id = new b2ContactID(); super(); } public function Reset():void{ localPoint1.SetZero(); localPoint2.SetZero(); separation = 0; normalImpulse = 0; tangentImpulse = 0; id.key = 0; } public function Set(_arg1:b2ManifoldPoint):void{ localPoint1.SetV(_arg1.localPoint1); localPoint2.SetV(_arg1.localPoint2); separation = _arg1.separation; normalImpulse = _arg1.normalImpulse; tangentImpulse = _arg1.tangentImpulse; id.key = _arg1.id.key; } } }//package Box2D.Collision
Section 28
//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 29
//b2Pair (Box2D.Collision.b2Pair) package Box2D.Collision { import Box2D.Common.*; public class b2Pair { public var userData;// = null public var proxyId1:uint; public var proxyId2:uint; public var next:uint; public var status:uint; public static var b2_nullPair:uint = b2Settings.USHRT_MAX; public static var b2_nullProxy:uint = b2Settings.USHRT_MAX; public static var b2_tableCapacity:int = b2Settings.b2_maxPairs; public static var b2_tableMask:int = (b2_tableCapacity - 1); public static var e_pairBuffered:uint = 1; public static var e_pairRemoved:uint = 2; public static var e_pairFinal:uint = 4; public function SetBuffered():void{ status = (status | e_pairBuffered); } public function ClearBuffered():void{ status = (status & ~(e_pairBuffered)); } public function IsBuffered():Boolean{ return (((status & e_pairBuffered) == e_pairBuffered)); } public function SetRemoved():void{ status = (status | e_pairRemoved); } public function ClearRemoved():void{ status = (status & ~(e_pairRemoved)); } public function IsRemoved():Boolean{ return (((status & e_pairRemoved) == e_pairRemoved)); } public function SetFinal():void{ status = (status | e_pairFinal); } public function IsFinal():Boolean{ return (((status & e_pairFinal) == e_pairFinal)); } } }//package Box2D.Collision
Section 30
//b2PairCallback (Box2D.Collision.b2PairCallback) package Box2D.Collision { public class b2PairCallback { public function PairAdded(_arg1, _arg2){ return (null); } public function PairRemoved(_arg1, _arg2, _arg3):void{ } } }//package Box2D.Collision
Section 31
//b2PairManager (Box2D.Collision.b2PairManager) package Box2D.Collision { import Box2D.Common.*; import Box2D.Common.Math.*; public class b2PairManager { public var m_broadPhase:b2BroadPhase; public var m_callback:b2PairCallback; public var m_pairs:Array; public var m_freePair:uint; public var m_pairCount:int; public var m_pairBuffer:Array; public var m_pairBufferCount:int; public var m_hashTable:Array; public function b2PairManager(){ var _local1:uint; super(); m_hashTable = new Array(b2Pair.b2_tableCapacity); _local1 = 0; while (_local1 < b2Pair.b2_tableCapacity) { m_hashTable[_local1] = b2Pair.b2_nullPair; _local1++; }; m_pairs = new Array(b2Settings.b2_maxPairs); _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairs[_local1] = new b2Pair(); _local1++; }; m_pairBuffer = new Array(b2Settings.b2_maxPairs); _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairBuffer[_local1] = new b2BufferedPair(); _local1++; }; _local1 = 0; while (_local1 < b2Settings.b2_maxPairs) { m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy; m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy; m_pairs[_local1].userData = null; m_pairs[_local1].status = 0; m_pairs[_local1].next = (_local1 + 1); _local1++; }; m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair; m_pairCount = 0; m_pairBufferCount = 0; } public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{ m_broadPhase = _arg1; m_callback = _arg2; } public function AddBufferedPair(_arg1:int, _arg2:int):void{ var _local3:b2BufferedPair; var _local4:b2Pair = AddPair(_arg1, _arg2); if (_local4.IsBuffered() == false){ _local4.SetBuffered(); _local3 = m_pairBuffer[m_pairBufferCount]; _local3.proxyId1 = _local4.proxyId1; _local3.proxyId2 = _local4.proxyId2; m_pairBufferCount++; }; _local4.ClearRemoved(); if (b2BroadPhase.s_validate){ ValidateBuffer(); }; } public function RemoveBufferedPair(_arg1:int, _arg2:int):void{ var _local3:b2BufferedPair; var _local4:b2Pair = Find(_arg1, _arg2); if (_local4 == null){ return; }; if (_local4.IsBuffered() == false){ _local4.SetBuffered(); _local3 = m_pairBuffer[m_pairBufferCount]; _local3.proxyId1 = _local4.proxyId1; _local3.proxyId2 = _local4.proxyId2; m_pairBufferCount++; }; _local4.SetRemoved(); if (b2BroadPhase.s_validate){ ValidateBuffer(); }; } public function Commit():void{ var _local1:b2BufferedPair; var _local2:int; var _local5:b2Pair; var _local6:b2Proxy; var _local7:b2Proxy; var _local3:int; var _local4:Array = m_broadPhase.m_proxyPool; _local2 = 0; while (_local2 < m_pairBufferCount) { _local1 = m_pairBuffer[_local2]; _local5 = Find(_local1.proxyId1, _local1.proxyId2); _local5.ClearBuffered(); _local6 = _local4[_local5.proxyId1]; _local7 = _local4[_local5.proxyId2]; if (_local5.IsRemoved()){ if (_local5.IsFinal() == true){ m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData); }; _local1 = m_pairBuffer[_local3]; _local1.proxyId1 = _local5.proxyId1; _local1.proxyId2 = _local5.proxyId2; _local3++; } else { if (_local5.IsFinal() == false){ _local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData); _local5.SetFinal(); }; }; _local2++; }; _local2 = 0; while (_local2 < _local3) { _local1 = m_pairBuffer[_local2]; RemovePair(_local1.proxyId1, _local1.proxyId2); _local2++; }; m_pairBufferCount = 0; if (b2BroadPhase.s_validate){ ValidateTable(); }; } private function AddPair(_arg1:uint, _arg2:uint):b2Pair{ var _local6:uint; if (_arg1 > _arg2){ _local6 = _arg1; _arg1 = _arg2; _arg2 = _local6; }; var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); var _local4 = FindHash(_arg1, _arg2, _local3); if (_local4 != null){ return (_local4); }; var _local5:uint = m_freePair; _local4 = m_pairs[_local5]; m_freePair = _local4.next; _local4.proxyId1 = _arg1; _local4.proxyId2 = _arg2; _local4.status = 0; _local4.userData = null; _local4.next = m_hashTable[_local3]; m_hashTable[_local3] = _local5; m_pairCount++; return (_local4); } private function RemovePair(_arg1:uint, _arg2:uint){ var _local3:b2Pair; var _local7:uint; var _local8:uint; var _local9:*; if (_arg1 > _arg2){ _local7 = _arg1; _arg1 = _arg2; _arg2 = _local7; }; var _local4:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); var _local5:uint = m_hashTable[_local4]; var _local6:b2Pair; while (_local5 != b2Pair.b2_nullPair) { if (Equals(m_pairs[_local5], _arg1, _arg2)){ _local8 = _local5; _local3 = m_pairs[_local5]; if (_local6){ _local6.next = _local3.next; } else { m_hashTable[_local4] = _local3.next; }; _local3 = m_pairs[_local8]; _local9 = _local3.userData; _local3.next = m_freePair; _local3.proxyId1 = b2Pair.b2_nullProxy; _local3.proxyId2 = b2Pair.b2_nullProxy; _local3.userData = null; _local3.status = 0; m_freePair = _local8; m_pairCount--; return (_local9); } else { _local6 = m_pairs[_local5]; _local5 = _local6.next; }; }; return (null); } private function Find(_arg1:uint, _arg2:uint):b2Pair{ var _local4:uint; if (_arg1 > _arg2){ _local4 = _arg1; _arg1 = _arg2; _arg2 = _local4; }; var _local3:uint = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask); return (FindHash(_arg1, _arg2, _local3)); } private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{ var _local4:b2Pair; var _local5:uint = m_hashTable[_arg3]; _local4 = m_pairs[_local5]; while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) { _local5 = _local4.next; _local4 = m_pairs[_local5]; }; if (_local5 == b2Pair.b2_nullPair){ return (null); }; return (_local4); } private function ValidateBuffer():void{ } private function ValidateTable():void{ } public static function Hash(_arg1:uint, _arg2:uint):uint{ var _local3:uint = (((_arg2 << 16) & 4294901760) | _arg1); _local3 = (~(_local3) + ((_local3 << 15) & 4294934528)); _local3 = (_local3 ^ ((_local3 >> 12) & 1048575)); _local3 = (_local3 + ((_local3 << 2) & 4294967292)); _local3 = (_local3 ^ ((_local3 >> 4) & 268435455)); _local3 = (_local3 * 2057); _local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF)); return (_local3); } public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{ return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3)))); } public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{ return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2)))); } } }//package Box2D.Collision
Section 32
//b2Point (Box2D.Collision.b2Point) package Box2D.Collision { import Box2D.Common.Math.*; public class b2Point { public var p:b2Vec2; public function b2Point(){ p = new b2Vec2(); super(); } public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{ return (p); } public function GetFirstVertex(_arg1:b2XForm):b2Vec2{ return (p); } } }//package Box2D.Collision
Section 33
//b2Proxy (Box2D.Collision.b2Proxy) package Box2D.Collision { public class b2Proxy { public var lowerBounds:Array; public var upperBounds:Array; public var overlapCount:uint; public var timeStamp:uint; public var userData;// = null public function b2Proxy(){ lowerBounds = [uint(0), uint(0)]; upperBounds = [uint(0), uint(0)]; super(); } public function GetNext():uint{ return (lowerBounds[0]); } public function SetNext(_arg1:uint):void{ lowerBounds[0] = (_arg1 & 0xFFFF); } public function IsValid():Boolean{ return (!((overlapCount == b2BroadPhase.b2_invalid))); } } }//package Box2D.Collision
Section 34
//b2Segment (Box2D.Collision.b2Segment) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Segment { public var p1:b2Vec2; public var p2:b2Vec2; public function b2Segment(){ p1 = new b2Vec2(); p2 = new b2Vec2(); super(); } public function TestSegment(_arg1:Array, _arg2:b2Vec2, _arg3:b2Segment, _arg4:Number):Boolean{ var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local5:b2Vec2 = _arg3.p1; var _local6:Number = (_arg3.p2.x - _local5.x); var _local7:Number = (_arg3.p2.y - _local5.y); var _local8:Number = (p2.x - p1.x); var _local9:Number = (p2.y - p1.y); var _local10:Number = _local9; var _local11:Number = -(_local8); var _local12:Number = (100 * Number.MIN_VALUE); var _local13:Number = -(((_local6 * _local10) + (_local7 * _local11))); if (_local13 > _local12){ _local14 = (_local5.x - p1.x); _local15 = (_local5.y - p1.y); _local16 = ((_local14 * _local10) + (_local15 * _local11)); if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){ _local17 = ((-(_local6) * _local15) + (_local7 * _local14)); if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){ _local16 = (_local16 / _local13); _local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11))); _local10 = (_local10 / _local18); _local11 = (_local11 / _local18); _arg1[0] = _local16; _arg2.Set(_local10, _local11); return (true); }; }; }; return (false); } } }//package Box2D.Collision
Section 35
//b2TimeOfImpact (Box2D.Collision.b2TimeOfImpact) package Box2D.Collision { import Box2D.Common.Math.*; import Box2D.Common.*; import Box2D.Collision.Shapes.*; public class b2TimeOfImpact { public static var s_p1:b2Vec2 = new b2Vec2(); public static var s_p2:b2Vec2 = new b2Vec2(); public static var s_xf1:b2XForm = new b2XForm(); public static var s_xf2:b2XForm = new b2XForm(); public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{ var _local5:Number; var _local6:Number; var _local25:Number; var _local26:b2XForm; var _local27:b2XForm; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local7:Number = _arg1.m_sweepRadius; var _local8:Number = _arg3.m_sweepRadius; var _local9:Number = _arg2.t0; var _local10:Number = (_arg2.c.x - _arg2.c0.x); var _local11:Number = (_arg2.c.y - _arg2.c0.y); var _local12:Number = (_arg4.c.x - _arg4.c0.x); var _local13:Number = (_arg4.c.y - _arg4.c0.y); var _local14:Number = (_arg2.a - _arg2.a0); var _local15:Number = (_arg4.a - _arg4.a0); var _local16:Number = 0; var _local17:b2Vec2 = s_p1; var _local18:b2Vec2 = s_p2; var _local19:int = 20; var _local20:int; var _local21:Number = 0; var _local22:Number = 0; var _local23:Number = 0; var _local24:Number = 0; while (true) { _local25 = (((1 - _local16) * _local9) + _local16); _local26 = s_xf1; _local27 = s_xf2; _arg2.GetXForm(_local26, _local25); _arg4.GetXForm(_local27, _local25); _local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27); if (_local20 == 0){ if (_local23 > (2 * b2Settings.b2_toiSlop)){ _local24 = (1.5 * b2Settings.b2_toiSlop); } else { _local5 = (0.05 * b2Settings.b2_toiSlop); _local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop)); _local24 = ((_local5 > _local6)) ? _local5 : _local6; }; }; if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){ break; }; _local21 = (_local18.x - _local17.x); _local22 = (_local18.y - _local17.y); _local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22))); _local21 = (_local21 / _local28); _local22 = (_local22 / _local28); _local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8)); if (_local29 == 0){ _local16 = 1; break; }; _local30 = ((_local23 - _local24) / _local29); _local31 = (_local16 + _local30); if ((((_local31 < 0)) || ((1 < _local31)))){ _local16 = 1; break; }; if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){ break; }; _local16 = _local31; _local20++; }; return (_local16); } } }//package Box2D.Collision
Section 36
//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 37
//Features (Box2D.Collision.Features) package Box2D.Collision { public class Features { public var _referenceEdge:int; public var _incidentEdge:int; public var _incidentVertex:int; public var _flip:int; public var _m_id:b2ContactID; public function set referenceEdge(_arg1:int):void{ _referenceEdge = _arg1; _m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF)); } public function get referenceEdge():int{ return (_referenceEdge); } public function set incidentEdge(_arg1:int):void{ _incidentEdge = _arg1; _m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00)); } public function get incidentEdge():int{ return (_incidentEdge); } public function set incidentVertex(_arg1:int):void{ _incidentVertex = _arg1; _m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000)); } public function get incidentVertex():int{ return (_incidentVertex); } public function set flip(_arg1:int):void{ _flip = _arg1; _m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080)); } public function get flip():int{ return (_flip); } } }//package Box2D.Collision
Section 38
//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 Set(_arg1:Number):void{ var _local2:Number; _local2 = Math.cos(_arg1); var _local3:Number = Math.sin(_arg1); col1.x = _local2; col2.x = -(_local3); col1.y = _local3; col2.y = _local2; } public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{ col1.SetV(_arg1); col2.SetV(_arg2); } public function Copy():b2Mat22{ return (new b2Mat22(0, col1, col2)); } 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 SetIdentity():void{ col1.x = 1; col2.x = 0; col1.y = 0; col2.y = 1; } public function SetZero():void{ col1.x = 0; col2.x = 0; col1.y = 0; col2.y = 0; } public function GetAngle():Number{ return (Math.atan2(col1.y, col1.x)); } public function Invert(_arg1:b2Mat22):b2Mat22{ var _local2:Number; var _local4:Number; var _local6:Number; _local2 = col1.x; var _local3:Number = col2.x; _local4 = col1.y; var _local5:Number = col2.y; _local6 = ((_local2 * _local5) - (_local3 * _local4)); _local6 = (1 / _local6); _arg1.col1.x = (_local6 * _local5); _arg1.col2.x = (-(_local6) * _local3); _arg1.col1.y = (-(_local6) * _local4); _arg1.col2.y = (_local6 * _local2); return (_arg1); } public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{ var _local4:Number = col1.x; var _local5:Number = col2.x; var _local6:Number = col1.y; var _local7:Number = col2.y; var _local8:Number = ((_local4 * _local7) - (_local5 * _local6)); _local8 = (1 / _local8); _arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3))); _arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2))); return (_arg1); } public function Abs():void{ col1.Abs(); col2.Abs(); } } }//package Box2D.Common.Math
Section 39
//b2Math (Box2D.Common.Math.b2Math) package Box2D.Common.Math { public class b2Math { public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0); public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1)); public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity); public static function b2IsValid(_arg1:Number):Boolean{ return (isFinite(_arg1)); } public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y))); } public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{ return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x))); } public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x)); return (_local3); } public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x)); return (_local3); } public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y))); return (_local3); } public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2)); return (_local3); } public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2; _local3 = b2MulMV(_arg1.R, _arg2); _local3.x = (_local3.x + _arg1.position.x); _local3.y = (_local3.y + _arg1.position.y); return (_local3); } public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2; var _local4:Number; _local3 = SubtractVV(_arg2, _arg1.position); _local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y)); _local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y)); _local3.x = _local4; return (_local3); } public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y)); return (_local3); } public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y)); return (_local3); } public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{ var _local3:Number = (_arg1.x - _arg2.x); var _local4:Number = (_arg1.y - _arg2.y); return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4)))); } public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{ var _local3:Number = (_arg1.x - _arg2.x); var _local4:Number = (_arg1.y - _arg2.y); return (((_local3 * _local3) + (_local4 * _local4))); } public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y)); return (_local3); } public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Mat22 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2)); return (_local3); } public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Mat22 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2)); return (_local3); } public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{ var _local3:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1)); var _local4:b2Vec2 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2)); var _local5:b2Mat22 = new b2Mat22(0, _local3, _local4); return (_local5); } public static function b2Abs(_arg1:Number):Number{ return (((_arg1 > 0)) ? _arg1 : -(_arg1)); } public static function b2AbsV(_arg1:b2Vec2):b2Vec2{ var _local2:b2Vec2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y)); return (_local2); } public static function b2AbsM(_arg1:b2Mat22):b2Mat22{ var _local2:b2Mat22 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2)); return (_local2); } public static function b2Min(_arg1:Number, _arg2:Number):Number{ return (((_arg1 < _arg2)) ? _arg1 : _arg2); } public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y)); return (_local3); } public static function b2Max(_arg1:Number, _arg2:Number):Number{ return (((_arg1 > _arg2)) ? _arg1 : _arg2); } public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{ var _local3:b2Vec2 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y)); return (_local3); } public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{ return (b2Max(_arg2, b2Min(_arg1, _arg3))); } public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{ return (b2MaxV(_arg2, b2MinV(_arg1, _arg3))); } public static function b2Swap(_arg1:Array, _arg2:Array):void{ var _local3:* = _arg1[0]; _arg1[0] = _arg2[0]; _arg2[0] = _local3; } public static function b2Random():Number{ return (((Math.random() * 2) - 1)); } public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{ var _local3:Number = Math.random(); _local3 = (((_arg2 - _arg1) * _local3) + _arg1); 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 b2IsPowerOfTwo(_arg1:uint):Boolean{ var _local2:Boolean = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0))); return (_local2); } } }//package Box2D.Common.Math
Section 40
//b2Sweep (Box2D.Common.Math.b2Sweep) package Box2D.Common.Math { public class b2Sweep { public var localCenter:b2Vec2; public var c0:b2Vec2; public var c:b2Vec2; public var a0:Number; public var a:Number; public var t0:Number; public function b2Sweep(){ localCenter = new b2Vec2(); c0 = new b2Vec2(); c = new b2Vec2(); super(); } public function GetXForm(_arg1:b2XForm, _arg2:Number):void{ var _local4:Number; var _local5:Number; if ((1 - t0) > Number.MIN_VALUE){ _local4 = ((_arg2 - t0) / (1 - t0)); _arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x)); _arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y)); _local5 = (((1 - _local4) * a0) + (_local4 * a)); _arg1.R.Set(_local5); } else { _arg1.position.SetV(c); _arg1.R.Set(a); }; var _local3:b2Mat22 = _arg1.R; _arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y))); _arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y))); } public function Advance(_arg1:Number):void{ var _local2:Number; if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){ _local2 = ((_arg1 - t0) / (1 - t0)); c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x)); c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y)); a0 = (((1 - _local2) * a0) + (_local2 * a)); t0 = _arg1; }; } } }//package Box2D.Common.Math
Section 41
//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 SetZero():void{ x = 0; y = 0; } public function Set(_arg1:Number=0, _arg2:Number=0):void{ x = _arg1; y = _arg2; } public function SetV(_arg1:b2Vec2):void{ x = _arg1.x; y = _arg1.y; } public function Negative():b2Vec2{ return (new b2Vec2(-(x), -(y))); } public function Copy():b2Vec2{ return (new b2Vec2(x, y)); } public function Add(_arg1:b2Vec2):void{ x = (x + _arg1.x); y = (y + _arg1.y); } public function Subtract(_arg1:b2Vec2):void{ x = (x - _arg1.x); y = (y - _arg1.y); } public function Multiply(_arg1:Number):void{ x = (x * _arg1); y = (y * _arg1); } public function MulM(_arg1:b2Mat22):void{ var _local2:Number = x; x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y)); y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y)); } public function MulTM(_arg1:b2Mat22):void{ var _local2:Number = b2Math.b2Dot(this, _arg1.col1); y = b2Math.b2Dot(this, _arg1.col2); x = _local2; } public function CrossVF(_arg1:Number):void{ var _local2:Number = x; x = (_arg1 * y); y = (-(_arg1) * _local2); } public function CrossFV(_arg1:Number):void{ var _local2:Number = x; x = (-(_arg1) * y); y = (_arg1 * _local2); } public function MinV(_arg1:b2Vec2):void{ x = ((x < _arg1.x)) ? x : _arg1.x; y = ((y < _arg1.y)) ? y : _arg1.y; } public function MaxV(_arg1:b2Vec2):void{ x = ((x > _arg1.x)) ? x : _arg1.x; y = ((y > _arg1.y)) ? y : _arg1.y; } public function Abs():void{ if (x < 0){ x = -(x); }; if (y < 0){ y = -(y); }; } public function Length():Number{ return (Math.sqrt(((x * x) + (y * y)))); } public function LengthSquared():Number{ return (((x * x) + (y * y))); } public function Normalize():Number{ var _local1:Number = Math.sqrt(((x * x) + (y * y))); if (_local1 < Number.MIN_VALUE){ return (0); }; var _local2:Number = (1 / _local1); x = (x * _local2); y = (y * _local2); return (_local1); } public function IsValid():Boolean{ return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y)))); } public static function Make(_arg1:Number, _arg2:Number):b2Vec2{ return (new b2Vec2(_arg1, _arg2)); } } }//package Box2D.Common.Math
Section 42
//b2XForm (Box2D.Common.Math.b2XForm) package Box2D.Common.Math { public class b2XForm { public var position:b2Vec2; public var R:b2Mat22; public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{ position = new b2Vec2(); R = new b2Mat22(); super(); if (_arg1){ position.SetV(_arg1); R.SetM(_arg2); }; } public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{ position.SetV(_arg1); R.SetM(_arg2); } public function SetIdentity():void{ position.SetZero(); R.SetIdentity(); } public function Set(_arg1:b2XForm):void{ position.SetV(_arg1.position); R.SetM(_arg1.R); } } }//package Box2D.Common.Math
Section 43
//b2Color (Box2D.Common.b2Color) package Box2D.Common { import Box2D.Common.Math.*; public class b2Color { private var _r:uint;// = 0 private var _g:uint;// = 0 private var _b:uint;// = 0 public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); _g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1))); _b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1))); } public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); _g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1))); _b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1))); } public function set r(_arg1:Number):void{ _r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } public function set g(_arg1:Number):void{ _g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } public function set b(_arg1:Number):void{ _b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1))); } public function get color():uint{ return (((_r | (_g << 8)) | (_b << 16))); } } }//package Box2D.Common
Section 44
//b2Settings (Box2D.Common.b2Settings) package Box2D.Common { import Box2D.Common.Math.*; public class b2Settings { public static const USHRT_MAX:int = 0xFFFF; public static const b2_pi:Number = 3.14159265358979; public static const b2_maxManifoldPoints:int = 2; public static const b2_maxPolygonVertices:int = 8; public static const b2_maxProxies:int = 0x0200; public static const b2_maxPairs:int = 4096; public static const b2_linearSlop:Number = 0.005; public static const b2_angularSlop:Number = 0.0349065850398866; public static const b2_toiSlop:Number = 0.04; public static const b2_maxTOIContactsPerIsland:int = 32; public static const b2_velocityThreshold:Number = 1; public static const b2_maxLinearCorrection:Number = 0.2; public static const b2_maxAngularCorrection:Number = 0.139626340159546; public static const b2_maxLinearVelocity:Number = 200; public static const b2_maxLinearVelocitySquared:Number = 40000; public static const b2_maxAngularVelocity:Number = 250; public static const b2_maxAngularVelocitySquared:Number = 62500; public static const b2_contactBaumgarte:Number = 0.2; public static const b2_timeToSleep:Number = 0.5; public static const b2_linearSleepTolerance:Number = 0.01; public static const b2_angularSleepTolerance:Number = 0.0111111111111111; public static function b2Assert(_arg1:Boolean):void{ var _local2:b2Vec2; if (!(_arg1)){ _local2.x++; }; } } }//package Box2D.Common
Section 45
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Common.*; import Box2D.Common.Math.*; public class b2CircleContact extends b2Contact { private var m_manifolds:Array; public var m_manifold:b2Manifold; private var m0:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifolds = [new b2Manifold()]; m0 = new b2Manifold(); super(_arg1, _arg2); m_manifold = m_manifolds[0]; m_manifold.pointCount = 0; var _local3:b2ManifoldPoint = m_manifold.points[0]; _local3.normalImpulse = 0; _local3.tangentImpulse = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2ManifoldPoint; var _local8:b2ManifoldPoint; var _local5:b2Body = m_shape1.m_body; var _local6:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf); var _local7:b2ContactPoint = s_evalCP; _local7.shape1 = m_shape1; _local7.shape2 = m_shape2; _local7.friction = m_friction; _local7.restitution = m_restitution; if (m_manifold.pointCount > 0){ m_manifoldCount = 1; _local8 = m_manifold.points[0]; if (m0.pointCount == 0){ _local8.normalImpulse = 0; _local8.tangentImpulse = 0; if (_arg1){ _local7.position = _local5.GetWorldPoint(_local8.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local8.separation; _local7.id.key = _local8.id._key; _arg1.Add(_local7); }; } else { _local4 = m0.points[0]; _local8.normalImpulse = _local4.normalImpulse; _local8.tangentImpulse = _local4.tangentImpulse; if (_arg1){ _local7.position = _local5.GetWorldPoint(_local8.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local8.separation; _local7.id.key = _local8.id._key; _arg1.Persist(_local7); }; }; } else { m_manifoldCount = 0; if ((((m0.pointCount > 0)) && (_arg1))){ _local4 = m0.points[0]; _local7.position = _local5.GetWorldPoint(_local4.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m0.normal); _local7.separation = _local4.separation; _local7.id.key = _local4.id._key; _arg1.Remove(_local7); }; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2CircleContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//package Box2D.Dynamics.Contacts
Section 46
//b2Contact (Box2D.Dynamics.Contacts.b2Contact) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; import Box2D.Collision.Shapes.*; import Box2D.Collision.*; import Box2D.Common.Math.*; import Box2D.Common.*; public class b2Contact { public var m_flags:uint; public var m_prev:b2Contact; public var m_next:b2Contact; public var m_node1:b2ContactEdge; public var m_node2:b2ContactEdge; public var m_shape1:b2Shape; public var m_shape2:b2Shape; public var m_manifoldCount:int; public var m_friction:Number; public var m_restitution:Number; public var m_toi:Number; public static var e_nonSolidFlag:uint = 1; public static var e_slowFlag:uint = 2; public static var e_islandFlag:uint = 4; public static var e_toiFlag:uint = 8; public static var s_registers:Array; public static var s_initialized:Boolean = false; public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){ m_node1 = new b2ContactEdge(); m_node2 = new b2ContactEdge(); super(); m_flags = 0; if (((!(_arg1)) || (!(_arg2)))){ m_shape1 = null; m_shape2 = null; return; }; if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){ m_flags = (m_flags | e_nonSolidFlag); }; m_shape1 = _arg1; m_shape2 = _arg2; m_manifoldCount = 0; m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction)); m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution); m_prev = null; m_next = null; m_node1.contact = null; m_node1.prev = null; m_node1.next = null; m_node1.other = null; m_node2.contact = null; m_node2.prev = null; m_node2.next = null; m_node2.other = null; } public function GetManifolds():Array{ return (null); } public function GetManifoldCount():int{ return (m_manifoldCount); } public function IsSolid():Boolean{ return (((m_flags & e_nonSolidFlag) == 0)); } public function GetNext():b2Contact{ return (m_next); } public function GetShape1():b2Shape{ return (m_shape1); } public function GetShape2():b2Shape{ return (m_shape2); } public function Update(_arg1:b2ContactListener):void{ var _local2:int = m_manifoldCount; Evaluate(_arg1); var _local3:int = m_manifoldCount; var _local4:b2Body = m_shape1.m_body; var _local5:b2Body = m_shape2.m_body; if ((((_local3 == 0)) && ((_local2 > 0)))){ _local4.WakeUp(); _local5.WakeUp(); }; if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){ m_flags = (m_flags & ~(e_slowFlag)); } else { m_flags = (m_flags | e_slowFlag); }; } public function Evaluate(_arg1:b2ContactListener):void{ } public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{ s_registers[_arg3][_arg4].createFcn = _arg1; s_registers[_arg3][_arg4].destroyFcn = _arg2; s_registers[_arg3][_arg4].primary = true; if (_arg3 != _arg4){ s_registers[_arg4][_arg3].createFcn = _arg1; s_registers[_arg4][_arg3].destroyFcn = _arg2; s_registers[_arg4][_arg3].primary = false; }; } public static function InitializeRegisters():void{ var _local2:int; s_registers = new Array(b2Shape.e_shapeTypeCount); var _local1:int; while (_local1 < b2Shape.e_shapeTypeCount) { s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount); _local2 = 0; while (_local2 < b2Shape.e_shapeTypeCount) { s_registers[_local1][_local2] = new b2ContactRegister(); _local2++; }; _local1++; }; AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape); AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape); AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape); } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ var _local8:b2Contact; var _local9:int; var _local10:b2Manifold; if (s_initialized == false){ InitializeRegisters(); s_initialized = true; }; var _local4:int = _arg1.m_type; var _local5:int = _arg2.m_type; var _local6:b2ContactRegister = s_registers[_local4][_local5]; var _local7:Function = _local6.createFcn; if (_local7 != null){ if (_local6.primary){ return (_local7(_arg1, _arg2, _arg3)); }; _local8 = _local7(_arg2, _arg1, _arg3); _local9 = 0; while (_local9 < _local8.m_manifoldCount) { _local10 = _local8.GetManifolds()[_local9]; _local10.normal = _local10.normal.Negative(); _local9++; }; return (_local8); //unresolved jump }; return (null); } public static function Destroy(_arg1:b2Contact, _arg2):void{ if (_arg1.m_manifoldCount > 0){ _arg1.m_shape1.m_body.WakeUp(); _arg1.m_shape2.m_body.WakeUp(); }; var _local3:int = _arg1.m_shape1.m_type; var _local4:int = _arg1.m_shape2.m_type; var _local5:b2ContactRegister = s_registers[_local3][_local4]; var _local6:Function = _local5.destroyFcn; _local6(_arg1, _arg2); } } }//package Box2D.Dynamics.Contacts
Section 47
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Common.*; import Box2D.Collision.*; import Box2D.Dynamics.*; public class b2ContactConstraint { public var points:Array; public var normal:b2Vec2; public var manifold:b2Manifold; public var body1:b2Body; public var body2:b2Body; public var friction:Number; public var restitution:Number; public var pointCount:int; public function b2ContactConstraint(){ normal = new b2Vec2(); super(); points = new Array(b2Settings.b2_maxManifoldPoints); var _local1:int; while (_local1 < b2Settings.b2_maxManifoldPoints) { points[_local1] = new b2ContactConstraintPoint(); _local1++; }; } } }//package Box2D.Dynamics.Contacts
Section 48
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; public class b2ContactConstraintPoint { public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var r1:b2Vec2; public var r2:b2Vec2; public var normalImpulse:Number; public var tangentImpulse:Number; public var positionImpulse:Number; public var normalMass:Number; public var tangentMass:Number; public var equalizedMass:Number; public var separation:Number; public var velocityBias:Number; public function b2ContactConstraintPoint(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); r1 = new b2Vec2(); r2 = new b2Vec2(); super(); } } }//package Box2D.Dynamics.Contacts
Section 49
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; public class b2ContactEdge { public var other:b2Body; public var contact:b2Contact; public var prev:b2ContactEdge; public var next:b2ContactEdge; } }//package Box2D.Dynamics.Contacts
Section 50
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister) package Box2D.Dynamics.Contacts { public class b2ContactRegister { public var createFcn:Function; public var destroyFcn:Function; public var primary:Boolean; } }//package Box2D.Dynamics.Contacts
Section 51
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult) package Box2D.Dynamics.Contacts { import Box2D.Common.Math.*; import Box2D.Collision.*; import Box2D.Collision.Shapes.*; public class b2ContactResult { public var shape1:b2Shape; public var shape2:b2Shape; public var position:b2Vec2; public var normal:b2Vec2; public var normalImpulse:Number; public var tangentImpulse:Number; public var id:b2ContactID; public function b2ContactResult(){ position = new b2Vec2(); normal = new b2Vec2(); id = new b2ContactID(); super(); } } }//package Box2D.Dynamics.Contacts
Section 52
//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_step:b2TimeStep; public var m_allocator; public var m_constraints:Array; public var m_constraintCount:int; public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){ var _local5:b2Contact; var _local6:int; var _local7:b2Vec2; var _local8:b2Mat22; var _local10:b2Body; var _local11:b2Body; var _local12:int; var _local13:Array; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:int; var _local23:b2Manifold; var _local24:Number; var _local25:Number; var _local26:b2ContactConstraint; var _local27:uint; var _local28:b2ManifoldPoint; var _local29:b2ContactConstraintPoint; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local39:Number; var _local40:Number; var _local41:Number; var _local42:Number; var _local43:Number; var _local44:Number; var _local45:Number; var _local46:Number; var _local47:Number; m_step = new b2TimeStep(); m_constraints = new Array(); super(); m_step.dt = _arg1.dt; m_step.inv_dt = _arg1.inv_dt; m_step.maxIterations = _arg1.maxIterations; m_allocator = _arg4; m_constraintCount = 0; _local6 = 0; while (_local6 < _arg3) { _local5 = _arg2[_local6]; m_constraintCount = (m_constraintCount + _local5.m_manifoldCount); _local6++; }; _local6 = 0; while (_local6 < m_constraintCount) { m_constraints[_local6] = new b2ContactConstraint(); _local6++; }; var _local9:int; _local6 = 0; while (_local6 < _arg3) { _local5 = _arg2[_local6]; _local10 = _local5.m_shape1.m_body; _local11 = _local5.m_shape2.m_body; _local12 = _local5.m_manifoldCount; _local13 = _local5.GetManifolds(); _local14 = _local5.m_friction; _local15 = _local5.m_restitution; _local16 = _local10.m_linearVelocity.x; _local17 = _local10.m_linearVelocity.y; _local18 = _local11.m_linearVelocity.x; _local19 = _local11.m_linearVelocity.y; _local20 = _local10.m_angularVelocity; _local21 = _local11.m_angularVelocity; _local22 = 0; while (_local22 < _local12) { _local23 = _local13[_local22]; _local24 = _local23.normal.x; _local25 = _local23.normal.y; _local26 = m_constraints[_local9]; _local26.body1 = _local10; _local26.body2 = _local11; _local26.manifold = _local23; _local26.normal.x = _local24; _local26.normal.y = _local25; _local26.pointCount = _local23.pointCount; _local26.friction = _local14; _local26.restitution = _local15; _local27 = 0; while (_local27 < _local26.pointCount) { _local28 = _local23.points[_local27]; _local29 = _local26.points[_local27]; _local29.normalImpulse = _local28.normalImpulse; _local29.tangentImpulse = _local28.tangentImpulse; _local29.separation = _local28.separation; _local29.positionImpulse = 0; _local29.localAnchor1.SetV(_local28.localPoint1); _local29.localAnchor2.SetV(_local28.localPoint2); _local8 = _local10.m_xf.R; _local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x); _local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y); _local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33)); _local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33)); _local32 = _local30; _local29.r1.Set(_local32, _local33); _local8 = _local11.m_xf.R; _local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x); _local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y); _local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35)); _local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35)); _local34 = _local30; _local29.r2.Set(_local34, _local35); _local36 = ((_local32 * _local32) + (_local33 * _local33)); _local37 = ((_local34 * _local34) + (_local35 * _local35)); _local38 = ((_local32 * _local24) + (_local33 * _local25)); _local39 = ((_local34 * _local24) + (_local35 * _local25)); _local40 = (_local10.m_invMass + _local11.m_invMass); _local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39))))); _local29.normalMass = (1 / _local40); _local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass)); _local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39))))); _local29.equalizedMass = (1 / _local41); _local42 = _local25; _local43 = -(_local24); _local44 = ((_local32 * _local42) + (_local33 * _local43)); _local45 = ((_local34 * _local42) + (_local35 * _local43)); _local46 = (_local10.m_invMass + _local11.m_invMass); _local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45))))); _local29.tangentMass = (1 / _local46); _local29.velocityBias = 0; if (_local29.separation > 0){ _local29.velocityBias = (-60 * _local29.separation); }; _local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33)); _local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32)); _local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31)); if (_local47 < -(b2Settings.b2_velocityThreshold)){ _local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47)); }; _local27++; }; _local9++; _local22++; }; _local6++; }; } public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2Mat22; var _local6:b2ContactConstraint; var _local7:b2Body; var _local8:b2Body; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:int; var _local19:int; var _local20:b2ContactConstraintPoint; var _local21:Number; var _local22:Number; var _local23:b2ContactConstraintPoint; var _local5:int; while (_local5 < m_constraintCount) { _local6 = m_constraints[_local5]; _local7 = _local6.body1; _local8 = _local6.body2; _local9 = _local7.m_invMass; _local10 = _local7.m_invI; _local11 = _local8.m_invMass; _local12 = _local8.m_invI; _local13 = _local6.normal.x; _local14 = _local6.normal.y; _local15 = _local14; _local16 = -(_local13); if (_arg1.warmStarting){ _local19 = _local6.pointCount; _local18 = 0; while (_local18 < _local19) { _local20 = _local6.points[_local18]; _local20.normalImpulse = (_local20.normalImpulse * _arg1.dtRatio); _local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio); _local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15)); _local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16)); _local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21)))); _local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21)); _local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22)); _local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21)))); _local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21)); _local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22)); _local18++; }; } else { _local19 = _local6.pointCount; _local18 = 0; while (_local18 < _local19) { _local23 = _local6.points[_local18]; _local23.normalImpulse = 0; _local23.tangentImpulse = 0; _local18++; }; }; _local5++; }; } public function SolveVelocityConstraints():void{ var _local1:int; var _local2:b2ContactConstraintPoint; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:b2Mat22; var _local18:b2Vec2; var _local20:b2ContactConstraint; var _local21:b2Body; var _local22:b2Body; var _local23:Number; var _local24:Number; var _local25:b2Vec2; var _local26:b2Vec2; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:int; var _local38:Number; var _local19:int; while (_local19 < m_constraintCount) { _local20 = m_constraints[_local19]; _local21 = _local20.body1; _local22 = _local20.body2; _local23 = _local21.m_angularVelocity; _local24 = _local22.m_angularVelocity; _local25 = _local21.m_linearVelocity; _local26 = _local22.m_linearVelocity; _local27 = _local21.m_invMass; _local28 = _local21.m_invI; _local29 = _local22.m_invMass; _local30 = _local22.m_invI; _local31 = _local20.normal.x; _local32 = _local20.normal.y; _local33 = _local32; _local34 = -(_local31); _local35 = _local20.friction; _local37 = _local20.pointCount; _local1 = 0; while (_local1 < _local37) { _local2 = _local20.points[_local1]; _local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y)); _local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x)); _local9 = ((_local7 * _local31) + (_local8 * _local32)); _local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias)); _local10 = ((_local7 * _local33) + (_local8 * _local34)); _local12 = (_local2.tangentMass * -(_local10)); _local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0); _local11 = (_local13 - _local2.normalImpulse); _local38 = (_local35 * _local2.normalImpulse); _local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38); _local12 = (_local14 - _local2.tangentImpulse); _local15 = ((_local11 * _local31) + (_local12 * _local33)); _local16 = ((_local11 * _local32) + (_local12 * _local34)); _local25.x = (_local25.x - (_local27 * _local15)); _local25.y = (_local25.y - (_local27 * _local16)); _local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15)))); _local26.x = (_local26.x + (_local29 * _local15)); _local26.y = (_local26.y + (_local29 * _local16)); _local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15)))); _local2.normalImpulse = _local13; _local2.tangentImpulse = _local14; _local1++; }; _local21.m_angularVelocity = _local23; _local22.m_angularVelocity = _local24; _local19++; }; } public function FinalizeVelocityConstraints():void{ var _local2:b2ContactConstraint; var _local3:b2Manifold; var _local4:int; var _local5:b2ManifoldPoint; var _local6:b2ContactConstraintPoint; var _local1:int; while (_local1 < m_constraintCount) { _local2 = m_constraints[_local1]; _local3 = _local2.manifold; _local4 = 0; while (_local4 < _local2.pointCount) { _local5 = _local3.points[_local4]; _local6 = _local2.points[_local4]; _local5.normalImpulse = _local6.normalImpulse; _local5.tangentImpulse = _local6.tangentImpulse; _local4++; }; _local1++; }; } public function SolvePositionConstraints(_arg1:Number):Boolean{ var _local3:b2Mat22; var _local4:b2Vec2; var _local6:b2ContactConstraint; var _local7:b2Body; var _local8:b2Body; var _local9:b2Vec2; var _local10:Number; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:int; var _local20:int; var _local21:b2ContactConstraintPoint; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local33:Number; var _local34:Number; var _local35:Number; var _local36:Number; var _local37:Number; var _local38:Number; var _local2:Number = 0; var _local5:int; while (_local5 < m_constraintCount) { _local6 = m_constraints[_local5]; _local7 = _local6.body1; _local8 = _local6.body2; _local9 = _local7.m_sweep.c; _local10 = _local7.m_sweep.a; _local11 = _local8.m_sweep.c; _local12 = _local8.m_sweep.a; _local13 = (_local7.m_mass * _local7.m_invMass); _local14 = (_local7.m_mass * _local7.m_invI); _local15 = (_local8.m_mass * _local8.m_invMass); _local16 = (_local8.m_mass * _local8.m_invI); _local17 = _local6.normal.x; _local18 = _local6.normal.y; _local19 = _local6.pointCount; _local20 = 0; while (_local20 < _local19) { _local21 = _local6.points[_local20]; _local3 = _local7.m_xf.R; _local4 = _local7.m_sweep.localCenter; _local22 = (_local21.localAnchor1.x - _local4.x); _local23 = (_local21.localAnchor1.y - _local4.y); _local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23)); _local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23)); _local22 = _local26; _local3 = _local8.m_xf.R; _local4 = _local8.m_sweep.localCenter; _local24 = (_local21.localAnchor2.x - _local4.x); _local25 = (_local21.localAnchor2.y - _local4.y); _local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25)); _local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25)); _local24 = _local26; _local27 = (_local9.x + _local22); _local28 = (_local9.y + _local23); _local29 = (_local11.x + _local24); _local30 = (_local11.y + _local25); _local31 = (_local29 - _local27); _local32 = (_local30 - _local28); _local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation); _local2 = b2Math.b2Min(_local2, _local33); _local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0)); _local35 = (-(_local21.equalizedMass) * _local34); _local36 = _local21.positionImpulse; _local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0); _local35 = (_local21.positionImpulse - _local36); _local37 = (_local35 * _local17); _local38 = (_local35 * _local18); _local9.x = (_local9.x - (_local13 * _local37)); _local9.y = (_local9.y - (_local13 * _local38)); _local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37)))); _local7.m_sweep.a = _local10; _local7.SynchronizeTransform(); _local11.x = (_local11.x + (_local15 * _local37)); _local11.y = (_local11.y + (_local15 * _local38)); _local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37)))); _local8.m_sweep.a = _local12; _local8.SynchronizeTransform(); _local20++; }; _local5++; }; return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop))); } } }//package Box2D.Dynamics.Contacts
Section 53
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact) package Box2D.Dynamics.Contacts { import Box2D.Dynamics.*; public class b2NullContact extends b2Contact { override public function Evaluate(_arg1:b2ContactListener):void{ } override public function GetManifolds():Array{ return (null); } } }//package Box2D.Dynamics.Contacts
Section 54
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Common.*; import Box2D.Common.Math.*; public class b2PolyAndCircleContact extends b2Contact { private var m_manifolds:Array; public var m_manifold:b2Manifold; private var m0:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){ m_manifolds = [new b2Manifold()]; m0 = new b2Manifold(); super(_arg1, _arg2); m_manifold = m_manifolds[0]; b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape)); b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape)); m_manifold.pointCount = 0; var _local3:b2ManifoldPoint = m_manifold.points[0]; _local3.normalImpulse = 0; _local3.tangentImpulse = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:int; var _local3:b2Vec2; var _local4:b2Vec2; var _local5:b2ManifoldPoint; var _local10:b2ManifoldPoint; var _local11:Boolean; var _local12:uint; var _local13:int; var _local6:b2Body = m_shape1.m_body; var _local7:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf); var _local8:Array = [false, false]; var _local9:b2ContactPoint = s_evalCP; _local9.shape1 = m_shape1; _local9.shape2 = m_shape2; _local9.friction = m_friction; _local9.restitution = m_restitution; if (m_manifold.pointCount > 0){ _local2 = 0; while (_local2 < m_manifold.pointCount) { _local10 = m_manifold.points[_local2]; _local10.normalImpulse = 0; _local10.tangentImpulse = 0; _local11 = false; _local12 = _local10.id._key; _local13 = 0; while (_local13 < m0.pointCount) { if (_local8[_local13] == true){ } else { _local5 = m0.points[_local13]; if (_local5.id._key == _local12){ _local8[_local13] = true; _local10.normalImpulse = _local5.normalImpulse; _local10.tangentImpulse = _local5.tangentImpulse; _local11 = true; if (_arg1 != null){ _local9.position = _local6.GetWorldPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m_manifold.normal); _local9.separation = _local10.separation; _local9.id.key = _local12; _arg1.Persist(_local9); }; break; }; }; _local13++; }; if ((((_local11 == false)) && (!((_arg1 == null))))){ _local9.position = _local6.GetWorldPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m_manifold.normal); _local9.separation = _local10.separation; _local9.id.key = _local12; _arg1.Add(_local9); }; _local2++; }; m_manifoldCount = 1; } else { m_manifoldCount = 0; }; if (_arg1 == null){ return; }; _local2 = 0; while (_local2 < m0.pointCount) { if (_local8[_local2]){ } else { _local5 = m0.points[_local2]; _local9.position = _local6.GetWorldPoint(_local5.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1); _local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2); _local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y)); _local9.normal.SetV(m0.normal); _local9.separation = _local5.separation; _local9.id.key = _local5.id._key; _arg1.Remove(_local9); }; _local2++; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolyAndCircleContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//package Box2D.Dynamics.Contacts
Section 55
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact) package Box2D.Dynamics.Contacts { import Box2D.Collision.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Common.*; import Box2D.Common.Math.*; public class b2PolygonContact extends b2Contact { private var m0:b2Manifold; private var m_manifolds:Array; public var m_manifold:b2Manifold; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{ m0 = new b2Manifold(); m_manifolds = [new b2Manifold()]; super(_arg1, _arg2); m_manifold = m_manifolds[0]; m_manifold.pointCount = 0; } override public function Evaluate(_arg1:b2ContactListener):void{ var _local2:b2Vec2; var _local3:b2Vec2; var _local4:b2ManifoldPoint; var _local7:b2ContactPoint; var _local8:int; var _local10:b2ManifoldPoint; var _local11:Boolean; var _local12:uint; var _local13:int; var _local5:b2Body = m_shape1.m_body; var _local6:b2Body = m_shape2.m_body; m0.Set(m_manifold); b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf); var _local9:Array = [false, false]; _local7 = s_evalCP; _local7.shape1 = m_shape1; _local7.shape2 = m_shape2; _local7.friction = m_friction; _local7.restitution = m_restitution; if (m_manifold.pointCount > 0){ _local8 = 0; while (_local8 < m_manifold.pointCount) { _local10 = m_manifold.points[_local8]; _local10.normalImpulse = 0; _local10.tangentImpulse = 0; _local11 = false; _local12 = _local10.id._key; _local13 = 0; while (_local13 < m0.pointCount) { if (_local9[_local13] == true){ } else { _local4 = m0.points[_local13]; if (_local4.id._key == _local12){ _local9[_local13] = true; _local10.normalImpulse = _local4.normalImpulse; _local10.tangentImpulse = _local4.tangentImpulse; _local11 = true; if (_arg1 != null){ _local7.position = _local5.GetWorldPoint(_local10.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local10.separation; _local7.id.key = _local12; _arg1.Persist(_local7); }; break; }; }; _local13++; }; if ((((_local11 == false)) && (!((_arg1 == null))))){ _local7.position = _local5.GetWorldPoint(_local10.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m_manifold.normal); _local7.separation = _local10.separation; _local7.id.key = _local12; _arg1.Add(_local7); }; _local8++; }; m_manifoldCount = 1; } else { m_manifoldCount = 0; }; if (_arg1 == null){ return; }; _local8 = 0; while (_local8 < m0.pointCount) { if (_local9[_local8]){ } else { _local4 = m0.points[_local8]; _local7.position = _local5.GetWorldPoint(_local4.localPoint1); _local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1); _local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2); _local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y)); _local7.normal.SetV(m0.normal); _local7.separation = _local4.separation; _local7.id.key = _local4.id._key; _arg1.Remove(_local7); }; _local8++; }; } override public function GetManifolds():Array{ return (m_manifolds); } public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{ return (new b2PolygonContact(_arg1, _arg2)); } public static function Destroy(_arg1:b2Contact, _arg2):void{ } } }//package Box2D.Dynamics.Contacts
Section 56
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2DistanceJoint extends b2Joint { public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_u:b2Vec2; public var m_frequencyHz:Number; public var m_dampingRatio:Number; public var m_gamma:Number; public var m_bias:Number; public var m_impulse:Number; public var m_mass:Number; public var m_length:Number; public function b2DistanceJoint(_arg1:b2DistanceJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_u = new b2Vec2(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_length = _arg1.length; m_frequencyHz = _arg1.frequencyHz; m_dampingRatio = _arg1.dampingRatio; m_impulse = 0; m_gamma = 0; m_bias = 0; m_inv_dt = 0; } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Mat22; var _local3:Number; var _local4:b2Body; var _local5:b2Body; var _local6:Number; var _local8:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; m_inv_dt = _arg1.inv_dt; _local4 = m_body1; _local5 = m_body2; _local2 = _local4.m_xf.R; _local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local4.m_sweep.localCenter.y); _local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7)); _local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7)); _local6 = _local3; _local2 = _local5.m_xf.R; _local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local5.m_sweep.localCenter.y); _local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9)); _local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9)); _local8 = _local3; m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6); m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7); var _local10:Number = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y))); if (_local10 > b2Settings.b2_linearSlop){ m_u.Multiply((1 / _local10)); } else { m_u.SetZero(); }; var _local11:Number = ((_local6 * m_u.y) - (_local7 * m_u.x)); var _local12:Number = ((_local8 * m_u.y) - (_local9 * m_u.x)); var _local13:Number = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12)); m_mass = (1 / _local13); if (m_frequencyHz > 0){ _local14 = (_local10 - m_length); _local15 = ((2 * Math.PI) * m_frequencyHz); _local16 = (((2 * m_mass) * m_dampingRatio) * _local15); _local17 = ((m_mass * _local15) * _local15); m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17)))); m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma); m_mass = (1 / (_local13 + m_gamma)); }; if (_arg1.warmStarting){ m_impulse = (m_impulse * _arg1.dtRatio); _local18 = (m_impulse * m_u.x); _local19 = (m_impulse * m_u.y); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19)); _local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18)))); _local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18)); _local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19)); _local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18)))); } else { m_impulse = 0; }; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Mat22; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; _local2 = _local3.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); var _local7:Number = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6)); _local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6)); _local5 = _local7; _local2 = _local4.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9)); _local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9)); _local8 = _local7; var _local10:Number = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6)); var _local11:Number = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5)); var _local12:Number = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9)); var _local13:Number = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8)); var _local14:Number = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11))); var _local15:Number = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse))); m_impulse = (m_impulse + _local15); var _local16:Number = (_local15 * m_u.x); var _local17:Number = (_local15 * m_u.y); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16)))); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17)); _local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); } override public function SolvePositionConstraints():Boolean{ var _local1:b2Mat22; if (m_frequencyHz > 0){ return (true); }; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local1 = _local2.m_xf.R; var _local4:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local5:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local6:Number = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5)); _local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5)); _local4 = _local6; _local1 = _local3.m_xf.R; var _local7:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8)); _local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8)); _local7 = _local6; var _local9:Number = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4); var _local10:Number = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5); var _local11:Number = Math.sqrt(((_local9 * _local9) + (_local10 * _local10))); _local9 = (_local9 / _local11); _local10 = (_local10 / _local11); var _local12:Number = (_local11 - m_length); _local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); var _local13:Number = (-(m_mass) * _local12); m_u.Set(_local9, _local10); var _local14:Number = (_local13 * m_u.x); var _local15:Number = (_local13 * m_u.y); _local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14)))); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15)); _local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14)))); _local2.SynchronizeTransform(); _local3.SynchronizeTransform(); return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop)); } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = new b2Vec2(); _local1.SetV(m_u); _local1.Multiply((m_inv_dt * m_impulse)); return (_local1); } override public function GetReactionTorque():Number{ return (0); } } }//package Box2D.Dynamics.Joints
Section 57
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2DistanceJointDef extends b2JointDef { public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var length:Number; public var frequencyHz:Number; public var dampingRatio:Number; public function b2DistanceJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_distanceJoint; length = 1; frequencyHz = 0; dampingRatio = 0; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1.SetV(body1.GetLocalPoint(_arg3)); localAnchor2.SetV(body2.GetLocalPoint(_arg4)); var _local5:Number = (_arg4.x - _arg3.x); var _local6:Number = (_arg4.y - _arg3.y); length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6))); frequencyHz = 0; dampingRatio = 0; } } }//package Box2D.Dynamics.Joints
Section 58
//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_ground1:b2Body; public var m_ground2:b2Body; public var m_revolute1:b2RevoluteJoint; public var m_prismatic1:b2PrismaticJoint; public var m_revolute2:b2RevoluteJoint; public var m_prismatic2:b2PrismaticJoint; public var m_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_J:b2Jacobian; public var m_constant:Number; public var m_ratio:Number; public var m_mass:Number; public var m_force:Number; public function b2GearJoint(_arg1:b2GearJointDef){ var _local4:Number; var _local5:Number; m_groundAnchor1 = new b2Vec2(); m_groundAnchor2 = new b2Vec2(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_J = new b2Jacobian(); super(_arg1); var _local2:int = _arg1.joint1.m_type; var _local3:int = _arg1.joint2.m_type; m_revolute1 = null; m_prismatic1 = null; m_revolute2 = null; m_prismatic2 = null; m_ground1 = _arg1.joint1.m_body1; m_body1 = _arg1.joint1.m_body2; if (_local2 == b2Joint.e_revoluteJoint){ m_revolute1 = (_arg1.joint1 as b2RevoluteJoint); m_groundAnchor1.SetV(m_revolute1.m_localAnchor1); m_localAnchor1.SetV(m_revolute1.m_localAnchor2); _local4 = m_revolute1.GetJointAngle(); } else { m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint); m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1); m_localAnchor1.SetV(m_prismatic1.m_localAnchor2); _local4 = m_prismatic1.GetJointTranslation(); }; m_ground2 = _arg1.joint2.m_body1; m_body2 = _arg1.joint2.m_body2; if (_local3 == b2Joint.e_revoluteJoint){ m_revolute2 = (_arg1.joint2 as b2RevoluteJoint); m_groundAnchor2.SetV(m_revolute2.m_localAnchor1); m_localAnchor2.SetV(m_revolute2.m_localAnchor2); _local5 = m_revolute2.GetJointAngle(); } else { m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint); m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1); m_localAnchor2.SetV(m_prismatic2.m_localAnchor2); _local5 = m_prismatic2.GetJointTranslation(); }; m_ratio = _arg1.ratio; m_constant = (_local4 + (m_ratio * _local5)); m_force = 0; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y)); return (_local1); } override public function GetReactionTorque():Number{ var _local1:b2Mat22 = m_body2.m_xf.R; var _local2:Number = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x); var _local3:Number = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y); var _local4:Number = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3)); _local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3)); _local2 = _local4; _local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x)))); return (_local4); } public function GetRatio():Number{ return (m_ratio); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:b2Mat22; var _local11:b2Vec2; var _local12:Number; var _local13:Number; var _local15:Number; var _local2:b2Body = m_ground1; var _local3:b2Body = m_ground2; var _local4:b2Body = m_body1; var _local5:b2Body = m_body2; var _local14:Number = 0; m_J.SetZero(); if (m_revolute1){ m_J.angular1 = -1; _local14 = (_local14 + _local4.m_invI); } else { _local10 = _local2.m_xf.R; _local11 = m_prismatic1.m_localXAxis1; _local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); _local10 = _local4.m_xf.R; _local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y); _local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9)); _local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9)); _local8 = _local13; _local12 = ((_local8 * _local7) - (_local9 * _local6)); m_J.linear1.Set(-(_local6), -(_local7)); m_J.angular1 = -(_local12); _local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12))); }; if (m_revolute2){ m_J.angular2 = -(m_ratio); _local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI)); } else { _local10 = _local3.m_xf.R; _local11 = m_prismatic2.m_localXAxis1; _local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y)); _local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y)); _local10 = _local5.m_xf.R; _local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x); _local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y); _local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9)); _local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9)); _local8 = _local13; _local12 = ((_local8 * _local7) - (_local9 * _local6)); m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7)); m_J.angular2 = (-(m_ratio) * _local12); _local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12)))); }; m_mass = (1 / _local14); if (_arg1.warmStarting){ _local15 = (_arg1.dt * m_force); _local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x)); _local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y)); _local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1)); _local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x)); _local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y)); _local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2)); } else { m_force = 0; }; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; var _local4:Number = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); var _local5:Number = ((-(_arg1.inv_dt) * m_mass) * _local4); m_force = (m_force + _local5); var _local6:Number = (_arg1.dt * _local5); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2)); } override public function SolvePositionConstraints():Boolean{ var _local4:Number; var _local5:Number; var _local1:Number = 0; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; if (m_revolute1){ _local4 = m_revolute1.GetJointAngle(); } else { _local4 = m_prismatic1.GetJointTranslation(); }; if (m_revolute2){ _local5 = m_revolute2.GetJointAngle(); } else { _local5 = m_prismatic2.GetJointTranslation(); }; var _local6:Number = (m_constant - (_local4 + (m_ratio * _local5))); var _local7:Number = (-(m_mass) * _local6); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y)); _local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1)); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2)); _local2.SynchronizeTransform(); _local3.SynchronizeTransform(); return ((_local1 < b2Settings.b2_linearSlop)); } } }//package Box2D.Dynamics.Joints
Section 59
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef) package Box2D.Dynamics.Joints { public class b2GearJointDef extends b2JointDef { public var joint1:b2Joint; public var joint2:b2Joint; public var ratio:Number; public function b2GearJointDef(){ type = b2Joint.e_gearJoint; joint1 = null; joint2 = null; ratio = 1; } } }//package Box2D.Dynamics.Joints
Section 60
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2Jacobian { public var linear1:b2Vec2; public var angular1:Number; public var linear2:b2Vec2; public var angular2:Number; public function b2Jacobian(){ linear1 = new b2Vec2(); linear2 = new b2Vec2(); super(); } public function SetZero():void{ linear1.SetZero(); angular1 = 0; linear2.SetZero(); angular2 = 0; } public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{ linear1.SetV(_arg1); angular1 = _arg2; linear2.SetV(_arg3); angular2 = _arg4; } 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 61
//b2Joint (Box2D.Dynamics.Joints.b2Joint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2Joint { public var m_type:int; public var m_prev:b2Joint; public var m_next:b2Joint; public var m_node1:b2JointEdge; public var m_node2:b2JointEdge; public var m_body1:b2Body; public var m_body2:b2Body; public var m_inv_dt:Number; public var m_islandFlag:Boolean; public var m_collideConnected:Boolean; public var m_userData; public static const e_unknownJoint:int = 0; public static const e_revoluteJoint:int = 1; public static const e_prismaticJoint:int = 2; public static const e_distanceJoint:int = 3; public static const e_pulleyJoint:int = 4; public static const e_mouseJoint:int = 5; public static const e_gearJoint:int = 6; public static const e_inactiveLimit:int = 0; public static const e_atLowerLimit:int = 1; public static const e_atUpperLimit:int = 2; public static const e_equalLimits:int = 3; public function b2Joint(_arg1:b2JointDef){ m_node1 = new b2JointEdge(); m_node2 = new b2JointEdge(); super(); m_type = _arg1.type; m_prev = null; m_next = null; m_body1 = _arg1.body1; m_body2 = _arg1.body2; m_collideConnected = _arg1.collideConnected; m_islandFlag = false; m_userData = _arg1.userData; } public function GetType():int{ return (m_type); } public function GetAnchor1():b2Vec2{ return (null); } public function GetAnchor2():b2Vec2{ return (null); } public function GetReactionForce():b2Vec2{ return (null); } public function GetReactionTorque():Number{ return (0); } public function GetBody1():b2Body{ return (m_body1); } public function GetBody2():b2Body{ return (m_body2); } public function GetNext():b2Joint{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function InitVelocityConstraints(_arg1:b2TimeStep):void{ } public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ } public function InitPositionConstraints():void{ } public function SolvePositionConstraints():Boolean{ return (false); } public static function Create(_arg1:b2JointDef, _arg2):b2Joint{ var _local3:b2Joint; switch (_arg1.type){ case e_distanceJoint: _local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef)); break; case e_mouseJoint: _local3 = new b2MouseJoint((_arg1 as b2MouseJointDef)); break; case e_prismaticJoint: _local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef)); break; case e_revoluteJoint: _local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef)); break; case e_pulleyJoint: _local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef)); break; case e_gearJoint: _local3 = new b2GearJoint((_arg1 as b2GearJointDef)); break; default: break; }; return (_local3); } public static function Destroy(_arg1:b2Joint, _arg2):void{ } } }//package Box2D.Dynamics.Joints
Section 62
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointDef { public var type:int; public var userData; public var body1:b2Body; public var body2:b2Body; public var collideConnected:Boolean; public function b2JointDef(){ type = b2Joint.e_unknownJoint; userData = null; body1 = null; body2 = null; collideConnected = false; } } }//package Box2D.Dynamics.Joints
Section 63
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge) package Box2D.Dynamics.Joints { import Box2D.Dynamics.*; public class b2JointEdge { public var other:b2Body; public var joint:b2Joint; public var prev:b2JointEdge; public var next:b2JointEdge; } }//package Box2D.Dynamics.Joints
Section 64
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Common.*; import Box2D.Dynamics.*; public class b2MouseJoint extends b2Joint { private var K:b2Mat22; private var K1:b2Mat22; private var K2:b2Mat22; public var m_localAnchor:b2Vec2; public var m_target:b2Vec2; public var m_impulse:b2Vec2; public var m_mass:b2Mat22; public var m_C:b2Vec2; public var m_maxForce:Number; public var m_beta:Number; public var m_gamma:Number; public function b2MouseJoint(_arg1:b2MouseJointDef){ var _local3:Number; K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); m_localAnchor = new b2Vec2(); m_target = new b2Vec2(); m_impulse = new b2Vec2(); m_mass = new b2Mat22(); m_C = new b2Vec2(); super(_arg1); m_target.SetV(_arg1.target); var _local2:Number = (m_target.x - m_body2.m_xf.position.x); _local3 = (m_target.y - m_body2.m_xf.position.y); var _local4:b2Mat22 = m_body2.m_xf.R; m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y)); m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y)); m_maxForce = _arg1.maxForce; m_impulse.SetZero(); var _local5:Number = m_body2.m_mass; var _local6:Number = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz); var _local7:Number = (((2 * _local5) * _arg1.dampingRatio) * _local6); var _local8:Number = ((_arg1.timeStep * _local5) * (_local6 * _local6)); m_gamma = (1 / (_local7 + _local8)); m_beta = (_local8 / (_local7 + _local8)); } override public function GetAnchor1():b2Vec2{ return (m_target); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor)); } override public function GetReactionForce():b2Vec2{ return (m_impulse); } override public function GetReactionTorque():Number{ return (0); } public function SetTarget(_arg1:b2Vec2):void{ if (m_body2.IsSleeping()){ m_body2.WakeUp(); }; m_target = _arg1; } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Mat22; var _local4:Number; var _local5:Number; var _local7:Number; var _local8:Number; _local2 = m_body2; _local3 = _local2.m_xf.R; _local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x); _local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y); var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)); _local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)); _local4 = _local6; _local7 = _local2.m_invMass; _local8 = _local2.m_invI; K1.col1.x = _local7; K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = _local7; K2.col1.x = ((_local8 * _local5) * _local5); K2.col2.x = ((-(_local8) * _local4) * _local5); K2.col1.y = ((-(_local8) * _local4) * _local5); K2.col2.y = ((_local8 * _local4) * _local4); K.SetM(K1); K.AddM(K2); K.col1.x = (K.col1.x + m_gamma); K.col2.y = (K.col2.y + m_gamma); K.Invert(m_mass); m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x); m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y); _local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98); var _local9:Number = (_arg1.dt * m_impulse.x); var _local10:Number = (_arg1.dt * m_impulse.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9)))); } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local3:b2Mat22; var _local4:Number; var _local5:Number; var _local2:b2Body = m_body2; _local3 = _local2.m_xf.R; var _local6:Number = (m_localAnchor.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor.y - _local2.m_sweep.localCenter.y); _local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7)); _local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7)); _local6 = _local4; var _local8:Number = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7)); var _local9:Number = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6)); _local3 = m_mass; _local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x)); _local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y)); var _local10:Number = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5))); var _local11:Number = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5))); var _local12:Number = m_impulse.x; var _local13:Number = m_impulse.y; m_impulse.x = (m_impulse.x + _local10); m_impulse.y = (m_impulse.y + _local11); var _local14:Number = m_impulse.Length(); if (_local14 > m_maxForce){ m_impulse.Multiply((m_maxForce / _local14)); }; _local10 = (m_impulse.x - _local12); _local11 = (m_impulse.y - _local13); var _local15:Number = (_arg1.dt * _local10); var _local16:Number = (_arg1.dt * _local11); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15)))); } override public function SolvePositionConstraints():Boolean{ return (true); } } }//package Box2D.Dynamics.Joints
Section 65
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; public class b2MouseJointDef extends b2JointDef { public var target:b2Vec2; public var maxForce:Number; public var frequencyHz:Number; public var dampingRatio:Number; 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 66
//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_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_localXAxis1:b2Vec2; public var m_localYAxis1:b2Vec2; public var m_refAngle:Number; public var m_linearJacobian:b2Jacobian; public var m_linearMass:Number; public var m_force:Number; public var m_angularMass:Number; public var m_torque:Number; public var m_motorJacobian:b2Jacobian; public var m_motorMass:Number; public var m_motorForce:Number; public var m_limitForce:Number; public var m_limitPositionImpulse:Number; public var m_lowerTranslation:Number; public var m_upperTranslation:Number; public var m_maxMotorForce:Number; public var m_motorSpeed:Number; public var m_enableLimit:Boolean; public var m_enableMotor:Boolean; public var m_limitState:int; public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_localXAxis1 = new b2Vec2(); m_localYAxis1 = new b2Vec2(); m_linearJacobian = new b2Jacobian(); m_motorJacobian = new b2Jacobian(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_localXAxis1.SetV(_arg1.localAxis1); m_localYAxis1.x = -(m_localXAxis1.y); m_localYAxis1.y = m_localXAxis1.x; m_refAngle = _arg1.referenceAngle; m_linearJacobian.SetZero(); m_linearMass = 0; m_force = 0; m_angularMass = 0; m_torque = 0; m_motorJacobian.SetZero(); m_motorMass = 0; m_motorForce = 0; m_limitForce = 0; m_limitPositionImpulse = 0; m_lowerTranslation = _arg1.lowerTranslation; m_upperTranslation = _arg1.upperTranslation; m_maxMotorForce = _arg1.maxMotorForce; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ var _local1:b2Mat22 = m_body1.m_xf.R; var _local2:Number = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y))); var _local3:Number = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y))); var _local4:Number = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y))); var _local5:Number = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y))); return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5)))); } override public function GetReactionTorque():Number{ return (m_torque); } public function GetJointTranslation():Number{ var _local3:b2Mat22; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; var _local4:b2Vec2 = _local1.GetWorldPoint(m_localAnchor1); var _local5:b2Vec2 = _local2.GetWorldPoint(m_localAnchor2); var _local6:Number = (_local5.x - _local4.x); var _local7:Number = (_local5.y - _local4.y); var _local8:b2Vec2 = _local1.GetWorldVector(m_localXAxis1); var _local9:Number = ((_local8.x * _local6) + (_local8.y * _local7)); return (_local9); } public function GetJointSpeed():Number{ var _local3:b2Mat22; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; _local3 = _local1.m_xf.R; var _local4:Number = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); var _local5:Number = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); var _local6:Number = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)); _local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)); _local4 = _local6; _local3 = _local2.m_xf.R; var _local7:Number = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8)); _local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8)); _local7 = _local6; var _local9:Number = (_local1.m_sweep.c.x + _local4); var _local10:Number = (_local1.m_sweep.c.y + _local5); var _local11:Number = (_local2.m_sweep.c.x + _local7); var _local12:Number = (_local2.m_sweep.c.y + _local8); var _local13:Number = (_local11 - _local9); var _local14:Number = (_local12 - _local10); var _local15:b2Vec2 = _local1.GetWorldVector(m_localXAxis1); var _local16:b2Vec2 = _local1.m_linearVelocity; var _local17:b2Vec2 = _local2.m_linearVelocity; var _local18:Number = _local1.m_angularVelocity; var _local19:Number = _local2.m_angularVelocity; var _local20:Number = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4))))); return (_local20); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } public function GetLowerLimit():Number{ return (m_lowerTranslation); } public function GetUpperLimit():Number{ return (m_upperTranslation); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerTranslation = _arg1; m_upperTranslation = _arg2; } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetMotorSpeed():Number{ return (m_motorSpeed); } public function SetMaxMotorForce(_arg1:Number):void{ m_maxMotorForce = _arg1; } public function GetMotorForce():Number{ return (m_motorForce); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local5:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local27:Number; var _local28:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local10:Number = _local2.m_invMass; var _local11:Number = _local3.m_invMass; var _local12:Number = _local2.m_invI; var _local13:Number = _local3.m_invI; _local4 = _local2.m_xf.R; var _local14:Number = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y)); var _local15:Number = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y)); var _local16:Number = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x); var _local17:Number = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y); m_linearJacobian.linear1.x = -(_local14); m_linearJacobian.linear1.y = -(_local15); m_linearJacobian.linear2.x = _local14; m_linearJacobian.linear2.y = _local15; m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14))); m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14)); m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2)); m_linearMass = (1 / m_linearMass); m_angularMass = (_local12 + _local13); if (m_angularMass > Number.MIN_VALUE){ m_angularMass = (1 / m_angularMass); }; if (((m_enableLimit) || (m_enableMotor))){ _local4 = _local2.m_xf.R; _local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y)); _local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y)); m_motorJacobian.linear1.x = -(_local18); m_motorJacobian.linear1.y = -(_local19); m_motorJacobian.linear2.x = _local18; m_motorJacobian.linear2.y = _local19; m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18))); m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18)); m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2)); m_motorMass = (1 / m_motorMass); if (m_enableLimit){ _local20 = (_local16 - _local6); _local21 = (_local17 - _local7); _local22 = ((_local18 * _local20) + (_local19 * _local21)); if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){ m_limitState = e_equalLimits; } else { if (_local22 <= m_lowerTranslation){ if (m_limitState != e_atLowerLimit){ m_limitForce = 0; }; m_limitState = e_atLowerLimit; } else { if (_local22 >= m_upperTranslation){ if (m_limitState != e_atUpperLimit){ m_limitForce = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitForce = 0; }; }; }; }; }; if (m_enableMotor == false){ m_motorForce = 0; }; if (m_enableLimit == false){ m_limitForce = 0; }; if (_arg1.warmStarting){ _local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x))); _local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y))); _local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x))); _local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y))); _local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1))); _local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2))); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28)); } else { m_force = 0; m_torque = 0; m_limitForce = 0; m_motorForce = 0; }; m_limitPositionImpulse = 0; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local8:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; var _local4:Number = _local2.m_invMass; var _local5:Number = _local3.m_invMass; var _local6:Number = _local2.m_invI; var _local7:Number = _local3.m_invI; var _local9:Number = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); var _local10:Number = ((-(_arg1.inv_dt) * m_linearMass) * _local9); m_force = (m_force + _local10); var _local11:Number = (_arg1.dt * _local10); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2)); var _local12:Number = (_local3.m_angularVelocity - _local2.m_angularVelocity); var _local13:Number = ((-(_arg1.inv_dt) * m_angularMass) * _local12); m_torque = (m_torque + _local13); var _local14:Number = (_arg1.dt * _local13); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14)); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed); _local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15); _local17 = m_motorForce; m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce); _local16 = (m_motorForce - _local17); _local11 = (_arg1.dt * _local16); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity); _local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18); if (m_limitState == e_equalLimits){ m_limitForce = (m_limitForce + _local19); } else { if (m_limitState == e_atLowerLimit){ _local8 = m_limitForce; m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0); _local19 = (m_limitForce - _local8); } else { if (m_limitState == e_atUpperLimit){ _local8 = m_limitForce; m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0); _local19 = (m_limitForce - _local8); }; }; }; _local11 = (_arg1.dt * _local19); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1)); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2)); }; } override public function SolvePositionConstraints():Boolean{ var _local1:Number; var _local2:Number; var _local9:b2Mat22; var _local10:Number; var _local29:Number; var _local30:Number; var _local31:Number; var _local32:Number; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; var _local5:Number = _local3.m_invMass; var _local6:Number = _local4.m_invMass; var _local7:Number = _local3.m_invI; var _local8:Number = _local4.m_invI; _local9 = _local3.m_xf.R; var _local11:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local12:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12)); _local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12)); _local11 = _local10; _local9 = _local4.m_xf.R; var _local13:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local14:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14)); _local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14)); _local13 = _local10; var _local15:Number = (_local3.m_sweep.c.x + _local11); var _local16:Number = (_local3.m_sweep.c.y + _local12); var _local17:Number = (_local4.m_sweep.c.x + _local13); var _local18:Number = (_local4.m_sweep.c.y + _local14); var _local19:Number = (_local17 - _local15); var _local20:Number = (_local18 - _local16); _local9 = _local3.m_xf.R; var _local21:Number = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y)); var _local22:Number = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y)); var _local23:Number = ((_local21 * _local19) + (_local22 * _local20)); _local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); var _local24:Number = (-(m_linearMass) * _local23); _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1)); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y)); _local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2)); var _local25:Number = b2Math.b2Abs(_local23); var _local26:Number = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle); _local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); var _local27:Number = (-(m_angularMass) * _local26); _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); var _local28:Number = b2Math.b2Abs(_local26); if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local9 = _local3.m_xf.R; _local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); _local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12)); _local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12)); _local11 = _local10; _local9 = _local4.m_xf.R; _local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); _local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14)); _local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14)); _local13 = _local10; _local15 = (_local3.m_sweep.c.x + _local11); _local16 = (_local3.m_sweep.c.y + _local12); _local17 = (_local4.m_sweep.c.x + _local13); _local18 = (_local4.m_sweep.c.y + _local14); _local19 = (_local17 - _local15); _local20 = (_local18 - _local16); _local9 = _local3.m_xf.R; _local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y)); _local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y)); _local31 = ((_local29 * _local19) + (_local30 * _local20)); _local32 = 0; if (m_limitState == e_equalLimits){ _local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection); _local32 = (-(m_motorMass) * _local1); _local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26)); } else { if (m_limitState == e_atLowerLimit){ _local1 = (_local31 - m_lowerTranslation); _local25 = b2Math.b2Max(_local25, -(_local1)); _local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local32 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0); _local32 = (m_limitPositionImpulse - _local2); } else { if (m_limitState == e_atUpperLimit){ _local1 = (_local31 - m_upperTranslation); _local25 = b2Math.b2Max(_local25, _local1); _local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection); _local32 = (-(m_motorMass) * _local1); _local2 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0); _local32 = (m_limitPositionImpulse - _local2); }; }; }; _local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y)); _local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1)); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y)); _local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); }; return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop)))); } } }//package Box2D.Dynamics.Joints
Section 67
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2PrismaticJointDef extends b2JointDef { public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var localAxis1:b2Vec2; public var referenceAngle:Number; public var enableLimit:Boolean; public var lowerTranslation:Number; public var upperTranslation:Number; public var enableMotor:Boolean; public var maxMotorForce:Number; public var motorSpeed:Number; public function b2PrismaticJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); localAxis1 = new b2Vec2(); super(); type = b2Joint.e_prismaticJoint; localAxis1.Set(1, 0); referenceAngle = 0; enableLimit = false; lowerTranslation = 0; upperTranslation = 0; enableMotor = false; maxMotorForce = 0; motorSpeed = 0; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1 = body1.GetLocalPoint(_arg3); localAnchor2 = body2.GetLocalPoint(_arg3); localAxis1 = body1.GetLocalVector(_arg4); referenceAngle = (body2.GetAngle() - body1.GetAngle()); } } }//package Box2D.Dynamics.Joints
Section 68
//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_groundAnchor1:b2Vec2; public var m_groundAnchor2:b2Vec2; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_u1:b2Vec2; public var m_u2:b2Vec2; public var m_constant:Number; public var m_ratio:Number; public var m_maxLength1:Number; public var m_maxLength2:Number; public var m_pulleyMass:Number; public var m_limitMass1:Number; public var m_limitMass2:Number; public var m_force:Number; public var m_limitForce1:Number; public var m_limitForce2:Number; public var m_positionImpulse:Number; public var m_limitPositionImpulse1:Number; public var m_limitPositionImpulse2:Number; public var m_state:int; public var m_limitState1:int; public var m_limitState2:int; public static const b2_minPulleyLength:Number = 2; public function b2PulleyJoint(_arg1:b2PulleyJointDef){ var _local2:b2Mat22; var _local3:Number; var _local4:Number; m_groundAnchor1 = new b2Vec2(); m_groundAnchor2 = new b2Vec2(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_u1 = new b2Vec2(); m_u2 = new b2Vec2(); super(_arg1); m_ground = m_body1.m_world.m_groundBody; m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x); m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y); m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x); m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_ratio = _arg1.ratio; m_constant = (_arg1.length1 + (m_ratio * _arg1.length2)); m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength))); m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio)); m_force = 0; m_limitForce1 = 0; m_limitForce2 = 0; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ var _local1:b2Vec2 = m_u2.Copy(); _local1.Multiply(m_force); return (_local1); } override public function GetReactionTorque():Number{ return (0); } public function GetGroundAnchor1():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor1); return (_local1); } public function GetGroundAnchor2():b2Vec2{ var _local1:b2Vec2 = m_ground.m_xf.position.Copy(); _local1.Add(m_groundAnchor2); return (_local1); } public function GetLength1():Number{ var _local1:b2Vec2 = m_body1.GetWorldPoint(m_localAnchor1); var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local4:Number = (_local1.x - _local2); var _local5:Number = (_local1.y - _local3); return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); } public function GetLength2():Number{ var _local1:b2Vec2 = m_body2.GetWorldPoint(m_localAnchor2); var _local2:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local3:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); var _local4:Number = (_local1.x - _local2); var _local5:Number = (_local1.y - _local3); return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5)))); } public function GetRatio():Number{ return (m_ratio); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local23:Number; var _local24:Number; var _local25:Number; var _local26:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6)); _local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6)); _local5 = _local7; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local7; var _local10:Number = (_local2.m_sweep.c.x + _local5); var _local11:Number = (_local2.m_sweep.c.y + _local6); var _local12:Number = (_local3.m_sweep.c.x + _local8); var _local13:Number = (_local3.m_sweep.c.y + _local9); var _local14:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local15:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local16:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local17:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); m_u1.Set((_local10 - _local14), (_local11 - _local15)); m_u2.Set((_local12 - _local16), (_local13 - _local17)); var _local18:Number = m_u1.Length(); var _local19:Number = m_u2.Length(); if (_local18 > b2Settings.b2_linearSlop){ m_u1.Multiply((1 / _local18)); } else { m_u1.SetZero(); }; if (_local19 > b2Settings.b2_linearSlop){ m_u2.Multiply((1 / _local19)); } else { m_u2.SetZero(); }; var _local20:Number = ((m_constant - _local18) - (m_ratio * _local19)); if (_local20 > 0){ m_state = e_inactiveLimit; m_force = 0; } else { m_state = e_atUpperLimit; m_positionImpulse = 0; }; if (_local18 < m_maxLength1){ m_limitState1 = e_inactiveLimit; m_limitForce1 = 0; } else { m_limitState1 = e_atUpperLimit; m_limitPositionImpulse1 = 0; }; if (_local19 < m_maxLength2){ m_limitState2 = e_inactiveLimit; m_limitForce2 = 0; } else { m_limitState2 = e_atUpperLimit; m_limitPositionImpulse2 = 0; }; var _local21:Number = ((_local5 * m_u1.y) - (_local6 * m_u1.x)); var _local22:Number = ((_local8 * m_u2.y) - (_local9 * m_u2.x)); m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21)); m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22)); m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2)); m_limitMass1 = (1 / m_limitMass1); m_limitMass2 = (1 / m_limitMass2); m_pulleyMass = (1 / m_pulleyMass); if (_arg1.warmStarting){ _local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x); _local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y); _local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x); _local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25)))); } else { m_force = 0; m_limitForce1 = 0; m_limitForce2 = 0; }; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local5:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local6:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); var _local7:Number = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6)); _local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6)); _local5 = _local7; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local7; if (m_state == e_atUpperLimit){ _local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)); _local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)); _local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13)))); _local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18); _local20 = m_force; m_force = b2Math.b2Max(0, (m_force + _local19)); _local19 = (m_force - _local20); _local14 = ((-(_arg1.dt) * _local19) * m_u1.x); _local15 = ((-(_arg1.dt) * _local19) * m_u1.y); _local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x); _local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); }; if (m_limitState1 == e_atUpperLimit){ _local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6)); _local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5)); _local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11))); _local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18); _local20 = m_limitForce1; m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19)); _local19 = (m_limitForce1 - _local20); _local14 = ((-(_arg1.dt) * _local19) * m_u1.x); _local15 = ((-(_arg1.dt) * _local19) * m_u1.y); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15)); _local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14)))); }; if (m_limitState2 == e_atUpperLimit){ _local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)); _local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)); _local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13))); _local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18); _local20 = m_limitForce2; m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19)); _local19 = (m_limitForce2 - _local20); _local16 = ((-(_arg1.dt) * _local19) * m_u2.x); _local17 = ((-(_arg1.dt) * _local19) * m_u2.y); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16)))); }; } override public function SolvePositionConstraints():Boolean{ var _local3:b2Mat22; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local22:Number; var _local1:b2Body = m_body1; var _local2:b2Body = m_body2; var _local4:Number = (m_ground.m_xf.position.x + m_groundAnchor1.x); var _local5:Number = (m_ground.m_xf.position.y + m_groundAnchor1.y); var _local6:Number = (m_ground.m_xf.position.x + m_groundAnchor2.x); var _local7:Number = (m_ground.m_xf.position.y + m_groundAnchor2.y); var _local23:Number = 0; if (m_state == e_atUpperLimit){ _local3 = _local1.m_xf.R; _local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9)); _local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9)); _local8 = _local22; _local3 = _local2.m_xf.R; _local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); _local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11)); _local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11)); _local10 = _local22; _local12 = (_local1.m_sweep.c.x + _local8); _local13 = (_local1.m_sweep.c.y + _local9); _local14 = (_local2.m_sweep.c.x + _local10); _local15 = (_local2.m_sweep.c.y + _local11); m_u1.Set((_local12 - _local4), (_local13 - _local5)); m_u2.Set((_local14 - _local6), (_local15 - _local7)); _local16 = m_u1.Length(); _local17 = m_u2.Length(); if (_local16 > b2Settings.b2_linearSlop){ m_u1.Multiply((1 / _local16)); } else { m_u1.SetZero(); }; if (_local17 > b2Settings.b2_linearSlop){ m_u2.Multiply((1 / _local17)); } else { m_u2.SetZero(); }; _local18 = ((m_constant - _local16) - (m_ratio * _local17)); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_pulleyMass) * _local18); _local20 = m_positionImpulse; m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19)); _local19 = (m_positionImpulse - _local20); _local12 = (-(_local19) * m_u1.x); _local13 = (-(_local19) * m_u1.y); _local14 = ((-(m_ratio) * _local19) * m_u2.x); _local15 = ((-(m_ratio) * _local19) * m_u2.y); _local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12)); _local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13)); _local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local1.SynchronizeTransform(); _local2.SynchronizeTransform(); }; if (m_limitState1 == e_atUpperLimit){ _local3 = _local1.m_xf.R; _local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x); _local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9)); _local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9)); _local8 = _local22; _local12 = (_local1.m_sweep.c.x + _local8); _local13 = (_local1.m_sweep.c.y + _local9); m_u1.Set((_local12 - _local4), (_local13 - _local5)); _local16 = m_u1.Length(); if (_local16 > b2Settings.b2_linearSlop){ m_u1.x = (m_u1.x * (1 / _local16)); m_u1.y = (m_u1.y * (1 / _local16)); } else { m_u1.SetZero(); }; _local18 = (m_maxLength1 - _local16); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass1) * _local18); _local21 = m_limitPositionImpulse1; m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19)); _local19 = (m_limitPositionImpulse1 - _local21); _local12 = (-(_local19) * m_u1.x); _local13 = (-(_local19) * m_u1.y); _local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12)); _local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13)); _local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12)))); _local1.SynchronizeTransform(); }; if (m_limitState2 == e_atUpperLimit){ _local3 = _local2.m_xf.R; _local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x); _local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y); _local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11)); _local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11)); _local10 = _local22; _local14 = (_local2.m_sweep.c.x + _local10); _local15 = (_local2.m_sweep.c.y + _local11); m_u2.Set((_local14 - _local6), (_local15 - _local7)); _local17 = m_u2.Length(); if (_local17 > b2Settings.b2_linearSlop){ m_u2.x = (m_u2.x * (1 / _local17)); m_u2.y = (m_u2.y * (1 / _local17)); } else { m_u2.SetZero(); }; _local18 = (m_maxLength2 - _local17); _local23 = b2Math.b2Max(_local23, -(_local18)); _local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0); _local19 = (-(m_limitMass2) * _local18); _local21 = m_limitPositionImpulse2; m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19)); _local19 = (m_limitPositionImpulse2 - _local21); _local14 = (-(_local19) * m_u2.x); _local15 = (-(_local19) * m_u2.y); _local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14)); _local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15)); _local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14)))); _local2.SynchronizeTransform(); }; return ((_local23 < b2Settings.b2_linearSlop)); } } }//package Box2D.Dynamics.Joints
Section 69
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2PulleyJointDef extends b2JointDef { public var groundAnchor1:b2Vec2; public var groundAnchor2:b2Vec2; public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var length1:Number; public var maxLength1:Number; public var length2:Number; public var maxLength2:Number; public var ratio:Number; public function b2PulleyJointDef(){ groundAnchor1 = new b2Vec2(); groundAnchor2 = new b2Vec2(); localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_pulleyJoint; groundAnchor1.Set(-1, 1); groundAnchor2.Set(1, 1); localAnchor1.Set(-1, 0); localAnchor2.Set(1, 0); length1 = 0; maxLength1 = 0; length2 = 0; maxLength2 = 0; ratio = 1; collideConnected = true; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{ body1 = _arg1; body2 = _arg2; groundAnchor1.SetV(_arg3); groundAnchor2.SetV(_arg4); localAnchor1 = body1.GetLocalPoint(_arg5); localAnchor2 = body2.GetLocalPoint(_arg6); var _local8:Number = (_arg5.x - _arg3.x); var _local9:Number = (_arg5.y - _arg3.y); length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9))); var _local10:Number = (_arg6.x - _arg4.x); var _local11:Number = (_arg6.y - _arg4.y); length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11))); ratio = _arg7; var _local12:Number = (length1 + (ratio * length2)); maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength)); maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio); } } }//package Box2D.Dynamics.Joints
Section 70
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; import Box2D.Common.*; public class b2RevoluteJoint extends b2Joint { private var K:b2Mat22; private var K1:b2Mat22; private var K2:b2Mat22; private var K3:b2Mat22; public var m_localAnchor1:b2Vec2; public var m_localAnchor2:b2Vec2; public var m_pivotForce:b2Vec2; public var m_motorForce:Number; public var m_limitForce:Number; public var m_limitPositionImpulse:Number; public var m_pivotMass:b2Mat22; public var m_motorMass:Number; public var m_enableMotor:Boolean; public var m_maxMotorTorque:Number; public var m_motorSpeed:Number; public var m_enableLimit:Boolean; public var m_referenceAngle:Number; public var m_lowerAngle:Number; public var m_upperAngle:Number; public var m_limitState:int; public static var tImpulse:b2Vec2 = new b2Vec2(); public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){ K = new b2Mat22(); K1 = new b2Mat22(); K2 = new b2Mat22(); K3 = new b2Mat22(); m_localAnchor1 = new b2Vec2(); m_localAnchor2 = new b2Vec2(); m_pivotForce = new b2Vec2(); m_pivotMass = new b2Mat22(); super(_arg1); m_localAnchor1.SetV(_arg1.localAnchor1); m_localAnchor2.SetV(_arg1.localAnchor2); m_referenceAngle = _arg1.referenceAngle; m_pivotForce.Set(0, 0); m_motorForce = 0; m_limitForce = 0; m_limitPositionImpulse = 0; m_lowerAngle = _arg1.lowerAngle; m_upperAngle = _arg1.upperAngle; m_maxMotorTorque = _arg1.maxMotorTorque; m_motorSpeed = _arg1.motorSpeed; m_enableLimit = _arg1.enableLimit; m_enableMotor = _arg1.enableMotor; } override public function GetAnchor1():b2Vec2{ return (m_body1.GetWorldPoint(m_localAnchor1)); } override public function GetAnchor2():b2Vec2{ return (m_body2.GetWorldPoint(m_localAnchor2)); } override public function GetReactionForce():b2Vec2{ return (m_pivotForce); } override public function GetReactionTorque():Number{ return (m_limitForce); } public function GetJointAngle():Number{ return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle)); } public function GetJointSpeed():Number{ return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity)); } public function IsLimitEnabled():Boolean{ return (m_enableLimit); } public function EnableLimit(_arg1:Boolean):void{ m_enableLimit = _arg1; } public function GetLowerLimit():Number{ return (m_lowerAngle); } public function GetUpperLimit():Number{ return (m_upperAngle); } public function SetLimits(_arg1:Number, _arg2:Number):void{ m_lowerAngle = _arg1; m_upperAngle = _arg2; } public function IsMotorEnabled():Boolean{ return (m_enableMotor); } public function EnableMotor(_arg1:Boolean):void{ m_enableMotor = _arg1; } public function SetMotorSpeed(_arg1:Number):void{ m_motorSpeed = _arg1; } public function GetMotorSpeed():Number{ return (m_motorSpeed); } public function SetMaxMotorTorque(_arg1:Number):void{ m_maxMotorTorque = _arg1; } public function GetMotorTorque():Number{ return (m_motorForce); } override public function InitVelocityConstraints(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Body; var _local4:b2Mat22; var _local5:Number; var _local7:Number; var _local14:Number; _local2 = m_body1; _local3 = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); _local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local10:Number = _local2.m_invMass; var _local11:Number = _local3.m_invMass; var _local12:Number = _local2.m_invI; var _local13:Number = _local3.m_invI; K1.col1.x = (_local10 + _local11); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local10 + _local11); K2.col1.x = ((_local12 * _local7) * _local7); K2.col2.x = ((-(_local12) * _local6) * _local7); K2.col1.y = ((-(_local12) * _local6) * _local7); K2.col2.y = ((_local12 * _local6) * _local6); K3.col1.x = ((_local13 * _local9) * _local9); K3.col2.x = ((-(_local13) * _local8) * _local9); K3.col1.y = ((-(_local13) * _local8) * _local9); K3.col2.y = ((_local13 * _local8) * _local8); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Invert(m_pivotMass); m_motorMass = (1 / (_local12 + _local13)); if (m_enableMotor == false){ m_motorForce = 0; }; if (m_enableLimit){ _local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle); if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){ m_limitState = e_equalLimits; } else { if (_local14 <= m_lowerAngle){ if (m_limitState != e_atLowerLimit){ m_limitForce = 0; }; m_limitState = e_atLowerLimit; } else { if (_local14 >= m_upperAngle){ if (m_limitState != e_atUpperLimit){ m_limitForce = 0; }; m_limitState = e_atUpperLimit; } else { m_limitState = e_inactiveLimit; m_limitForce = 0; }; }; }; } else { m_limitForce = 0; }; if (_arg1.warmStarting){ _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y)); _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce))); } else { m_pivotForce.SetZero(); m_motorForce = 0; m_limitForce = 0; }; m_limitPositionImpulse = 0; } override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{ var _local4:b2Mat22; var _local5:Number; var _local10:Number; var _local16:Number; var _local17:Number; var _local18:Number; var _local19:Number; var _local20:Number; var _local21:Number; var _local2:b2Body = m_body1; var _local3:b2Body = m_body2; _local4 = _local2.m_xf.R; var _local6:Number = (m_localAnchor1.x - _local2.m_sweep.localCenter.x); var _local7:Number = (m_localAnchor1.y - _local2.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7)); _local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7)); _local6 = _local5; _local4 = _local3.m_xf.R; var _local8:Number = (m_localAnchor2.x - _local3.m_sweep.localCenter.x); var _local9:Number = (m_localAnchor2.y - _local3.m_sweep.localCenter.y); _local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9)); _local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9)); _local8 = _local5; var _local11:Number = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7)); var _local12:Number = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6)); var _local13:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12))); var _local14:Number = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12))); m_pivotForce.x = (m_pivotForce.x + _local13); m_pivotForce.y = (m_pivotForce.y + _local14); var _local15:Number = (_arg1.dt * _local13); _local16 = (_arg1.dt * _local14); _local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15)); _local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16)); _local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15)))); _local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15)); _local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16)); _local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15)))); if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){ _local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed); _local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17); _local19 = m_motorForce; m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque); _local18 = (m_motorForce - _local19); _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18)); }; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity); _local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20); if (m_limitState == e_equalLimits){ m_limitForce = (m_limitForce + _local21); } else { if (m_limitState == e_atLowerLimit){ _local10 = m_limitForce; m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0); _local21 = (m_limitForce - _local10); } else { if (m_limitState == e_atUpperLimit){ _local10 = m_limitForce; m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0); _local21 = (m_limitForce - _local10); }; }; }; _local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21)); _local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21)); }; } override public function SolvePositionConstraints():Boolean{ var _local1:Number; var _local2:Number; var _local6:b2Mat22; var _local25:Number; var _local26:Number; var _local3:b2Body = m_body1; var _local4:b2Body = m_body2; var _local5:Number = 0; _local6 = _local3.m_xf.R; var _local7:Number = (m_localAnchor1.x - _local3.m_sweep.localCenter.x); var _local8:Number = (m_localAnchor1.y - _local3.m_sweep.localCenter.y); var _local9:Number = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8)); _local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8)); _local7 = _local9; _local6 = _local4.m_xf.R; var _local10:Number = (m_localAnchor2.x - _local4.m_sweep.localCenter.x); var _local11:Number = (m_localAnchor2.y - _local4.m_sweep.localCenter.y); _local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11)); _local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11)); _local10 = _local9; var _local12:Number = (_local3.m_sweep.c.x + _local7); var _local13:Number = (_local3.m_sweep.c.y + _local8); var _local14:Number = (_local4.m_sweep.c.x + _local10); var _local15:Number = (_local4.m_sweep.c.y + _local11); var _local16:Number = (_local14 - _local12); var _local17:Number = (_local15 - _local13); _local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17))); var _local18:Number = _local3.m_invMass; var _local19:Number = _local4.m_invMass; var _local20:Number = _local3.m_invI; var _local21:Number = _local4.m_invI; K1.col1.x = (_local18 + _local19); K1.col2.x = 0; K1.col1.y = 0; K1.col2.y = (_local18 + _local19); K2.col1.x = ((_local20 * _local8) * _local8); K2.col2.x = ((-(_local20) * _local7) * _local8); K2.col1.y = ((-(_local20) * _local7) * _local8); K2.col2.y = ((_local20 * _local7) * _local7); K3.col1.x = ((_local21 * _local11) * _local11); K3.col2.x = ((-(_local21) * _local10) * _local11); K3.col1.y = ((-(_local21) * _local10) * _local11); K3.col2.y = ((_local21 * _local10) * _local10); K.SetM(K1); K.AddM(K2); K.AddM(K3); K.Solve(tImpulse, -(_local16), -(_local17)); var _local22:Number = tImpulse.x; var _local23:Number = tImpulse.y; _local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22)); _local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23)); _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22)))); _local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22)); _local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22)))); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); var _local24:Number = 0; if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){ _local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle); _local26 = 0; if (m_limitState == e_equalLimits){ _local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection); _local26 = (-(m_motorMass) * _local2); _local24 = b2Math.b2Abs(_local2); } else { if (m_limitState == e_atLowerLimit){ _local2 = (_local25 - m_lowerAngle); _local24 = b2Math.b2Max(0, -(_local2)); _local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0); _local26 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0); _local26 = (m_limitPositionImpulse - _local1); } else { if (m_limitState == e_atUpperLimit){ _local2 = (_local25 - m_upperAngle); _local24 = b2Math.b2Max(0, _local2); _local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection); _local26 = (-(m_motorMass) * _local2); _local1 = m_limitPositionImpulse; m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0); _local26 = (m_limitPositionImpulse - _local1); }; }; }; _local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26)); _local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26)); _local3.SynchronizeTransform(); _local4.SynchronizeTransform(); }; return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop)))); } } }//package Box2D.Dynamics.Joints
Section 71
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef) package Box2D.Dynamics.Joints { import Box2D.Common.Math.*; import Box2D.Dynamics.*; public class b2RevoluteJointDef extends b2JointDef { public var localAnchor1:b2Vec2; public var localAnchor2:b2Vec2; public var referenceAngle:Number; public var enableLimit:Boolean; public var lowerAngle:Number; public var upperAngle:Number; public var enableMotor:Boolean; public var motorSpeed:Number; public var maxMotorTorque:Number; public function b2RevoluteJointDef(){ localAnchor1 = new b2Vec2(); localAnchor2 = new b2Vec2(); super(); type = b2Joint.e_revoluteJoint; localAnchor1.Set(0, 0); localAnchor2.Set(0, 0); referenceAngle = 0; lowerAngle = 0; upperAngle = 0; maxMotorTorque = 0; motorSpeed = 0; enableLimit = false; enableMotor = false; } public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{ body1 = _arg1; body2 = _arg2; localAnchor1 = body1.GetLocalPoint(_arg3); localAnchor2 = body2.GetLocalPoint(_arg3); referenceAngle = (body2.GetAngle() - body1.GetAngle()); } } }//package Box2D.Dynamics.Joints
Section 72
//b2Body (Box2D.Dynamics.b2Body) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Dynamics.Contacts.*; public class b2Body { public var m_flags:uint; public var m_type:int; public var m_xf:b2XForm; public var m_sweep:b2Sweep; public var m_linearVelocity:b2Vec2; public var m_angularVelocity:Number; public var m_force:b2Vec2; public var m_torque:Number; public var m_world:b2World; public var m_prev:b2Body; public var m_next:b2Body; public var m_shapeList:b2Shape; public var m_shapeCount:int; public var m_jointList:b2JointEdge; public var m_contactList:b2ContactEdge; public var m_mass:Number; public var m_invMass:Number; public var m_I:Number; public var m_invI:Number; public var m_linearDamping:Number; public var m_angularDamping:Number; public var m_sleepTime:Number; public var m_userData; private static var s_massData:b2MassData = new b2MassData(); private static var s_xf1:b2XForm = new b2XForm(); public static var e_frozenFlag:uint = 2; public static var e_islandFlag:uint = 4; public static var e_sleepFlag:uint = 8; public static var e_allowSleepFlag:uint = 16; public static var e_bulletFlag:uint = 32; public static var e_fixedRotationFlag:uint = 64; public static var e_staticType:uint = 1; public static var e_dynamicType:uint = 2; public static var e_maxTypes:uint = 3; public function b2Body(_arg1:b2BodyDef, _arg2:b2World){ m_xf = new b2XForm(); m_sweep = new b2Sweep(); m_linearVelocity = new b2Vec2(); m_force = new b2Vec2(); super(); m_flags = 0; if (_arg1.isBullet){ m_flags = (m_flags | e_bulletFlag); }; if (_arg1.fixedRotation){ m_flags = (m_flags | e_fixedRotationFlag); }; if (_arg1.allowSleep){ m_flags = (m_flags | e_allowSleepFlag); }; if (_arg1.isSleeping){ m_flags = (m_flags | e_sleepFlag); }; m_world = _arg2; m_xf.position.SetV(_arg1.position); m_xf.R.Set(_arg1.angle); m_sweep.localCenter.SetV(_arg1.massData.center); m_sweep.t0 = 1; m_sweep.a0 = (m_sweep.a = _arg1.angle); var _local3:b2Mat22 = m_xf.R; var _local4:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); m_jointList = null; m_contactList = null; m_prev = null; m_next = null; m_linearDamping = _arg1.linearDamping; m_angularDamping = _arg1.angularDamping; m_force.Set(0, 0); m_torque = 0; m_linearVelocity.SetZero(); m_angularVelocity = 0; m_sleepTime = 0; m_invMass = 0; m_I = 0; m_invI = 0; m_mass = _arg1.massData.mass; if (m_mass > 0){ m_invMass = (1 / m_mass); }; if ((m_flags & b2Body.e_fixedRotationFlag) == 0){ m_I = _arg1.massData.I; }; if (m_I > 0){ m_invI = (1 / m_I); }; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; m_userData = _arg1.userData; m_shapeList = null; m_shapeCount = 0; } public function CreateShape(_arg1:b2ShapeDef):b2Shape{ var _local2:b2Shape; if (m_world.m_lock == true){ return (null); }; _local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator); _local2.m_next = m_shapeList; m_shapeList = _local2; m_shapeCount++; _local2.m_body = this; _local2.CreateProxy(m_world.m_broadPhase, m_xf); _local2.UpdateSweepRadius(m_sweep.localCenter); return (_local2); } public function DestroyShape(_arg1:b2Shape):void{ if (m_world.m_lock == true){ return; }; _arg1.DestroyProxy(m_world.m_broadPhase); var _local2:b2Shape = m_shapeList; var _local3:b2Shape; var _local4:Boolean; while (_local2 != null) { if (_local2 == _arg1){ if (_local3){ _local3.m_next = _arg1.m_next; } else { m_shapeList = _arg1.m_next; }; _local4 = true; break; }; _local3 = _local2; _local2 = _local2.m_next; }; _arg1.m_body = null; _arg1.m_next = null; m_shapeCount--; b2Shape.Destroy(_arg1, m_world.m_blockAllocator); } public function SetMass(_arg1:b2MassData):void{ var _local2:b2Shape; if (m_world.m_lock == true){ return; }; m_invMass = 0; m_I = 0; m_invI = 0; m_mass = _arg1.mass; if (m_mass > 0){ m_invMass = (1 / m_mass); }; if ((m_flags & b2Body.e_fixedRotationFlag) == 0){ m_I = _arg1.I; }; if (m_I > 0){ m_invI = (1 / m_I); }; m_sweep.localCenter.SetV(_arg1.center); var _local3:b2Mat22 = m_xf.R; var _local4:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)); m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); _local2 = m_shapeList; while (_local2) { _local2.UpdateSweepRadius(m_sweep.localCenter); _local2 = _local2.m_next; }; var _local5:int = m_type; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; if (_local5 != m_type){ _local2 = m_shapeList; while (_local2) { _local2.RefilterProxy(m_world.m_broadPhase, m_xf); _local2 = _local2.m_next; }; }; } public function SetMassFromShapes():void{ var _local1:b2Shape; if (m_world.m_lock == true){ return; }; m_mass = 0; m_invMass = 0; m_I = 0; m_invI = 0; var _local2:Number = 0; var _local3:Number = 0; var _local4:b2MassData = s_massData; _local1 = m_shapeList; while (_local1) { _local1.ComputeMass(_local4); m_mass = (m_mass + _local4.mass); _local2 = (_local2 + (_local4.mass * _local4.center.x)); _local3 = (_local3 + (_local4.mass * _local4.center.y)); m_I = (m_I + _local4.I); _local1 = _local1.m_next; }; if (m_mass > 0){ m_invMass = (1 / m_mass); _local2 = (_local2 * m_invMass); _local3 = (_local3 * m_invMass); }; if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){ m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3)))); m_invI = (1 / m_I); } else { m_I = 0; m_invI = 0; }; m_sweep.localCenter.Set(_local2, _local3); var _local5:b2Mat22 = m_xf.R; var _local6:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y)); m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); _local1 = m_shapeList; while (_local1) { _local1.UpdateSweepRadius(m_sweep.localCenter); _local1 = _local1.m_next; }; var _local7:int = m_type; if ((((m_invMass == 0)) && ((m_invI == 0)))){ m_type = e_staticType; } else { m_type = e_dynamicType; }; if (_local7 != m_type){ _local1 = m_shapeList; while (_local1) { _local1.RefilterProxy(m_world.m_broadPhase, m_xf); _local1 = _local1.m_next; }; }; } public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{ var _local3:b2Shape; var _local7:Boolean; if (m_world.m_lock == true){ return (true); }; if (IsFrozen()){ return (false); }; m_xf.R.Set(_arg2); m_xf.position.SetV(_arg1); var _local4:b2Mat22 = m_xf.R; var _local5:b2Vec2 = m_sweep.localCenter; m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y)); m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y)); m_sweep.c.x = (m_sweep.c.x + m_xf.position.x); m_sweep.c.y = (m_sweep.c.y + m_xf.position.y); m_sweep.c0.SetV(m_sweep.c); m_sweep.a0 = (m_sweep.a = _arg2); var _local6:Boolean; _local3 = m_shapeList; while (_local3) { _local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf); if (_local7 == false){ _local6 = true; break; }; _local3 = _local3.m_next; }; if (_local6 == true){ m_flags = (m_flags | e_frozenFlag); m_linearVelocity.SetZero(); m_angularVelocity = 0; _local3 = m_shapeList; while (_local3) { _local3.DestroyProxy(m_world.m_broadPhase); _local3 = _local3.m_next; }; return (false); }; m_world.m_broadPhase.Commit(); return (true); } public function GetXForm():b2XForm{ return (m_xf); } public function GetPosition():b2Vec2{ return (m_xf.position); } public function GetAngle():Number{ return (m_sweep.a); } public function GetWorldCenter():b2Vec2{ return (m_sweep.c); } public function GetLocalCenter():b2Vec2{ return (m_sweep.localCenter); } public function SetLinearVelocity(_arg1:b2Vec2):void{ m_linearVelocity.SetV(_arg1); } public function GetLinearVelocity():b2Vec2{ return (m_linearVelocity); } public function SetAngularVelocity(_arg1:Number):void{ m_angularVelocity = _arg1; } public function GetAngularVelocity():Number{ return (m_angularVelocity); } public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping()){ WakeUp(); }; m_force.x = (m_force.x + _arg1.x); m_force.y = (m_force.y + _arg1.y); m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))); } public function ApplyTorque(_arg1:Number):void{ if (IsSleeping()){ WakeUp(); }; m_torque = (m_torque + _arg1); } public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{ if (IsSleeping()){ WakeUp(); }; m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x)); m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y)); m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)))); } public function GetMass():Number{ return (m_mass); } public function GetInertia():Number{ return (m_I); } public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{ var _local2:b2Mat22 = m_xf.R; var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y))); _local3.x = (_local3.x + m_xf.position.x); _local3.y = (_local3.y + m_xf.position.y); return (_local3); } public function GetWorldVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulMV(m_xf.R, _arg1)); } public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulXT(m_xf, _arg1)); } public function GetLocalVector(_arg1:b2Vec2):b2Vec2{ return (b2Math.b2MulTMV(m_xf.R, _arg1)); } public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{ return (new b2Vec2((m_linearVelocity.x - (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.y + (m_angularVelocity * (_arg1.x - m_sweep.c.x))))); } public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{ var _local2:b2Mat22 = m_xf.R; var _local3:b2Vec2 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y))); _local3.x = (_local3.x + m_xf.position.x); _local3.y = (_local3.y + m_xf.position.y); return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x))))); } public function IsBullet():Boolean{ return (((m_flags & e_bulletFlag) == e_bulletFlag)); } public function SetBullet(_arg1:Boolean):void{ if (_arg1){ m_flags = (m_flags | e_bulletFlag); } else { m_flags = (m_flags & ~(e_bulletFlag)); }; } public function IsStatic():Boolean{ return ((m_type == e_staticType)); } public function IsDynamic():Boolean{ return ((m_type == e_dynamicType)); } public function IsFrozen():Boolean{ return (((m_flags & e_frozenFlag) == e_frozenFlag)); } public function IsSleeping():Boolean{ return (((m_flags & e_sleepFlag) == e_sleepFlag)); } 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; } public function PutToSleep():void{ m_flags = (m_flags | e_sleepFlag); m_sleepTime = 0; m_linearVelocity.SetZero(); m_angularVelocity = 0; m_force.SetZero(); m_torque = 0; } public function GetShapeList():b2Shape{ return (m_shapeList); } public function GetJointList():b2JointEdge{ return (m_jointList); } public function GetNext():b2Body{ return (m_next); } public function GetUserData(){ return (m_userData); } public function SetUserData(_arg1):void{ m_userData = _arg1; } public function GetWorld():b2World{ return (m_world); } public function SynchronizeShapes():Boolean{ var _local4:b2Shape; var _local1:b2XForm = s_xf1; _local1.R.Set(m_sweep.a0); var _local2:b2Mat22 = _local1.R; var _local3:b2Vec2 = m_sweep.localCenter; _local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y))); _local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y))); var _local5:Boolean = true; _local4 = m_shapeList; while (_local4) { _local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf); if (_local5 == false){ break; }; _local4 = _local4.m_next; }; if (_local5 == false){ m_flags = (m_flags | e_frozenFlag); m_linearVelocity.SetZero(); m_angularVelocity = 0; _local4 = m_shapeList; while (_local4) { _local4.DestroyProxy(m_world.m_broadPhase); _local4 = _local4.m_next; }; return (false); }; return (true); } public function SynchronizeTransform():void{ m_xf.R.Set(m_sweep.a); var _local1:b2Mat22 = m_xf.R; var _local2:b2Vec2 = m_sweep.localCenter; m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y))); m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y))); } public function IsConnected(_arg1:b2Body):Boolean{ var _local2:b2JointEdge = m_jointList; while (_local2) { if (_local2.other == _arg1){ return ((_local2.joint.m_collideConnected == false)); }; _local2 = _local2.next; }; return (false); } public function Advance(_arg1:Number):void{ m_sweep.Advance(_arg1); m_sweep.c.SetV(m_sweep.c0); m_sweep.a = m_sweep.a0; SynchronizeTransform(); } } }//package Box2D.Dynamics
Section 73
//b2BodyDef (Box2D.Dynamics.b2BodyDef) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; public class b2BodyDef { public var massData:b2MassData; public var userData; public var position:b2Vec2; public var angle:Number; public var linearDamping:Number; public var angularDamping:Number; public var allowSleep:Boolean; public var isSleeping:Boolean; public var fixedRotation:Boolean; public var isBullet:Boolean; public function b2BodyDef(){ massData = new b2MassData(); position = new b2Vec2(); super(); massData.center.SetZero(); massData.mass = 0; massData.I = 0; userData = null; position.Set(0, 0); angle = 0; linearDamping = 0; angularDamping = 0; allowSleep = true; isSleeping = false; fixedRotation = false; isBullet = false; } } }//package Box2D.Dynamics
Section 74
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener) package Box2D.Dynamics { public class b2BoundaryListener { public function Violation(_arg1:b2Body):void{ } } }//package Box2D.Dynamics
Section 75
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter) package Box2D.Dynamics { import Box2D.Collision.Shapes.*; public class b2ContactFilter { public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter); ; public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{ var _local3:b2FilterData = _arg1.GetFilterData(); var _local4:b2FilterData = _arg2.GetFilterData(); if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){ return ((_local3.groupIndex > 0)); }; var _local5:Boolean = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0)))); return (_local5); } } }//package Box2D.Dynamics
Section 76
//b2ContactListener (Box2D.Dynamics.b2ContactListener) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Dynamics.Contacts.*; public class b2ContactListener { public function Add(_arg1:b2ContactPoint):void{ } public function Persist(_arg1:b2ContactPoint):void{ } public function Remove(_arg1:b2ContactPoint):void{ } public function Result(_arg1:b2ContactResult):void{ } } }//package Box2D.Dynamics
Section 77
//b2ContactManager (Box2D.Dynamics.b2ContactManager) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Dynamics.Contacts.*; import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Common.*; public class b2ContactManager extends b2PairCallback { public var m_world:b2World; public var m_nullContact:b2NullContact; public var m_destroyImmediate:Boolean; private static const s_evalCP:b2ContactPoint = new b2ContactPoint(); public function b2ContactManager(){ m_nullContact = new b2NullContact(); super(); m_world = null; m_destroyImmediate = false; } override public function PairAdded(_arg1, _arg2){ var _local3:b2Shape = (_arg1 as b2Shape); var _local4:b2Shape = (_arg2 as b2Shape); var _local5:b2Body = _local3.m_body; var _local6:b2Body = _local4.m_body; if (((_local5.IsStatic()) && (_local6.IsStatic()))){ return (m_nullContact); }; if (_local3.m_body == _local4.m_body){ return (m_nullContact); }; if (_local6.IsConnected(_local5)){ return (m_nullContact); }; if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){ return (m_nullContact); }; var _local7:b2Contact = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator); if (_local7 == null){ return (m_nullContact); }; _local3 = _local7.m_shape1; _local4 = _local7.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; _local7.m_prev = null; _local7.m_next = m_world.m_contactList; if (m_world.m_contactList != null){ m_world.m_contactList.m_prev = _local7; }; m_world.m_contactList = _local7; _local7.m_node1.contact = _local7; _local7.m_node1.other = _local6; _local7.m_node1.prev = null; _local7.m_node1.next = _local5.m_contactList; if (_local5.m_contactList != null){ _local5.m_contactList.prev = _local7.m_node1; }; _local5.m_contactList = _local7.m_node1; _local7.m_node2.contact = _local7; _local7.m_node2.other = _local5; _local7.m_node2.prev = null; _local7.m_node2.next = _local6.m_contactList; if (_local6.m_contactList != null){ _local6.m_contactList.prev = _local7.m_node2; }; _local6.m_contactList = _local7.m_node2; m_world.m_contactCount++; return (_local7); } override public function PairRemoved(_arg1, _arg2, _arg3):void{ if (_arg3 == null){ return; }; var _local4:b2Contact = (_arg3 as b2Contact); if (_local4 == m_nullContact){ return; }; Destroy(_local4); } public function Destroy(_arg1:b2Contact):void{ var _local7:b2Body; var _local8:b2Body; var _local9:Array; var _local10:b2ContactPoint; var _local11:int; var _local12:b2Manifold; var _local13:int; var _local14:b2ManifoldPoint; var _local15:b2Vec2; var _local16:b2Vec2; var _local2:b2Shape = _arg1.m_shape1; var _local3:b2Shape = _arg1.m_shape2; var _local4:int = _arg1.m_manifoldCount; if ((((_local4 > 0)) && (m_world.m_contactListener))){ _local7 = _local2.m_body; _local8 = _local3.m_body; _local9 = _arg1.GetManifolds(); _local10 = s_evalCP; _local10.shape1 = _arg1.m_shape1; _local10.shape2 = _arg1.m_shape2; _local10.friction = _arg1.m_friction; _local10.restitution = _arg1.m_restitution; _local11 = 0; while (_local11 < _local4) { _local12 = _local9[_local11]; _local10.normal.SetV(_local12.normal); _local13 = 0; while (_local13 < _local12.pointCount) { _local14 = _local12.points[_local13]; _local10.position = _local7.GetWorldPoint(_local14.localPoint1); _local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1); _local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2); _local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y)); _local10.separation = _local14.separation; _local10.id.key = _local14.id._key; m_world.m_contactListener.Remove(_local10); _local13++; }; _local11++; }; }; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_world.m_contactList){ m_world.m_contactList = _arg1.m_next; }; var _local5:b2Body = _local2.m_body; var _local6:b2Body = _local3.m_body; if (_arg1.m_node1.prev){ _arg1.m_node1.prev.next = _arg1.m_node1.next; }; if (_arg1.m_node1.next){ _arg1.m_node1.next.prev = _arg1.m_node1.prev; }; if (_arg1.m_node1 == _local5.m_contactList){ _local5.m_contactList = _arg1.m_node1.next; }; if (_arg1.m_node2.prev){ _arg1.m_node2.prev.next = _arg1.m_node2.next; }; if (_arg1.m_node2.next){ _arg1.m_node2.next.prev = _arg1.m_node2.prev; }; if (_arg1.m_node2 == _local6.m_contactList){ _local6.m_contactList = _arg1.m_node2.next; }; b2Contact.Destroy(_arg1, m_world.m_blockAllocator); m_world.m_contactCount--; } public function Collide():void{ var _local2:b2Body; var _local3:b2Body; var _local1:b2Contact = m_world.m_contactList; while (_local1) { _local2 = _local1.m_shape1.m_body; _local3 = _local1.m_shape2.m_body; if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){ } else { _local1.Update(m_world.m_contactListener); }; _local1 = _local1.m_next; }; } } }//package Box2D.Dynamics
Section 78
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw) package Box2D.Dynamics { import Box2D.Collision.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; import Box2D.Common.Math.*; import Box2D.Common.*; import flash.display.*; public class b2DebugDraw { public var m_drawFlags:uint; public var m_sprite:Sprite; public var m_drawScale:Number;// = 1 public var m_lineThickness:Number;// = 1 public var m_alpha:Number;// = 1 public var m_fillAlpha:Number;// = 1 public var m_xformScale:Number;// = 1 public static var e_shapeBit:uint = 1; public static var e_jointBit:uint = 2; public static var e_coreShapeBit:uint = 4; public static var e_aabbBit:uint = 8; public static var e_obbBit:uint = 16; public static var e_pairBit:uint = 32; public static var e_centerOfMassBit:uint = 64; public function b2DebugDraw(){ m_drawFlags = 0; } public function SetFlags(_arg1:uint):void{ m_drawFlags = _arg1; } public function GetFlags():uint{ return (m_drawFlags); } public function AppendFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags | _arg1); } public function ClearFlags(_arg1:uint):void{ m_drawFlags = (m_drawFlags & ~(_arg1)); } public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); var _local4:int = 1; while (_local4 < _arg2) { m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale)); _local4++; }; m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); } public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha); var _local4:int = 1; while (_local4 < _arg2) { m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale)); _local4++; }; m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale)); m_sprite.graphics.endFill(); } public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale)); } public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha); m_sprite.graphics.moveTo(0, 0); m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha); m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale)); m_sprite.graphics.endFill(); m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale)); } public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{ m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha); m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale)); m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale)); } public function DrawXForm(_arg1:b2XForm):void{ m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha); m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale)); m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha); m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale)); m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale)); } } }//package Box2D.Dynamics
Section 79
//b2DestructionListener (Box2D.Dynamics.b2DestructionListener) package Box2D.Dynamics { import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; public class b2DestructionListener { public function SayGoodbyeJoint(_arg1:b2Joint):void{ } public function SayGoodbyeShape(_arg1:b2Shape):void{ } } }//package Box2D.Dynamics
Section 80
//b2Island (Box2D.Dynamics.b2Island) package Box2D.Dynamics { import Box2D.Dynamics.Contacts.*; import Box2D.Common.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.*; public class b2Island { public var m_allocator; public var m_listener:b2ContactListener; public var m_bodies:Array; public var m_contacts:Array; public var m_joints:Array; public var m_bodyCount:int; public var m_jointCount:int; public var m_contactCount:int; public var m_bodyCapacity:int; public var m_contactCapacity:int; public var m_jointCapacity:int; public var m_positionIterationCount:int; private static var s_reportCR:b2ContactResult = new b2ContactResult(); public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){ var _local6:int; super(); m_bodyCapacity = _arg1; m_contactCapacity = _arg2; m_jointCapacity = _arg3; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_allocator = _arg4; m_listener = _arg5; m_bodies = new Array(_arg1); _local6 = 0; while (_local6 < _arg1) { m_bodies[_local6] = null; _local6++; }; m_contacts = new Array(_arg2); _local6 = 0; while (_local6 < _arg2) { m_contacts[_local6] = null; _local6++; }; m_joints = new Array(_arg3); _local6 = 0; while (_local6 < _arg3) { m_joints[_local6] = null; _local6++; }; m_positionIterationCount = 0; } public function Clear():void{ m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; } public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{ var _local5:int; var _local6:b2Body; var _local7:b2Joint; var _local9:int; var _local10:Boolean; var _local11:Boolean; var _local12:Boolean; var _local13:Number; var _local14:Number; var _local15:Number; _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.IsStatic()){ } else { _local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x)))); _local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y)))); _local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque)); _local6.m_force.SetZero(); _local6.m_torque = 0; _local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1)); _local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1)); if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){ _local6.m_linearVelocity.Normalize(); _local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity); _local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity); }; if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){ if (_local6.m_angularVelocity < 0){ _local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity); } else { _local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity; }; }; }; _local5++; }; var _local8:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator); _local8.InitVelocityConstraints(_arg1); _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local7.InitVelocityConstraints(_arg1); _local5++; }; _local5 = 0; while (_local5 < _arg1.maxIterations) { _local8.SolveVelocityConstraints(); _local9 = 0; while (_local9 < m_jointCount) { _local7 = m_joints[_local9]; _local7.SolveVelocityConstraints(_arg1); _local9++; }; _local5++; }; _local8.FinalizeVelocityConstraints(); _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.IsStatic()){ } else { _local6.m_sweep.c0.SetV(_local6.m_sweep.c); _local6.m_sweep.a0 = _local6.m_sweep.a; _local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x)); _local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y)); _local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity)); _local6.SynchronizeTransform(); }; _local5++; }; if (_arg3){ _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local7.InitPositionConstraints(); _local5++; }; m_positionIterationCount = 0; while (m_positionIterationCount < _arg1.maxIterations) { _local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte); _local11 = true; _local5 = 0; while (_local5 < m_jointCount) { _local7 = m_joints[_local5]; _local12 = _local7.SolvePositionConstraints(); _local11 = ((_local11) && (_local12)); _local5++; }; if (((_local10) && (_local11))){ break; }; m_positionIterationCount++; }; }; Report(_local8.m_constraints); if (_arg4){ _local13 = Number.MAX_VALUE; _local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance); _local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance); _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; if (_local6.m_invMass == 0){ } else { if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){ _local6.m_sleepTime = 0; _local13 = 0; }; if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){ _local6.m_sleepTime = 0; _local13 = 0; } else { _local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt); _local13 = b2Math.b2Min(_local13, _local6.m_sleepTime); }; }; _local5++; }; if (_local13 >= b2Settings.b2_timeToSleep){ _local5 = 0; while (_local5 < m_bodyCount) { _local6 = m_bodies[_local5]; _local6.m_flags = (_local6.m_flags | b2Body.e_sleepFlag); _local6.m_linearVelocity.SetZero(); _local6.m_angularVelocity = 0; _local5++; }; }; }; } public function SolveTOI(_arg1:b2TimeStep):void{ var _local2:int; var _local5:b2Body; var _local6:Boolean; var _local3:b2ContactSolver = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator); _local2 = 0; while (_local2 < _arg1.maxIterations) { _local3.SolveVelocityConstraints(); _local2++; }; _local2 = 0; while (_local2 < m_bodyCount) { _local5 = m_bodies[_local2]; if (_local5.IsStatic()){ } else { _local5.m_sweep.c0.SetV(_local5.m_sweep.c); _local5.m_sweep.a0 = _local5.m_sweep.a; _local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x)); _local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y)); _local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity)); _local5.SynchronizeTransform(); }; _local2++; }; var _local4:Number = 0.75; _local2 = 0; while (_local2 < _arg1.maxIterations) { _local6 = _local3.SolvePositionConstraints(_local4); if (_local6){ break; }; _local2++; }; Report(_local3.m_constraints); } public function Report(_arg1:Array):void{ var _local2:b2Mat22; var _local3:b2Vec2; var _local5:b2Contact; var _local6:b2ContactConstraint; var _local7:b2ContactResult; var _local8:b2Body; var _local9:int; var _local10:Array; var _local11:int; var _local12:b2Manifold; var _local13:int; var _local14:b2ManifoldPoint; var _local15:b2ContactConstraintPoint; if (m_listener == null){ return; }; var _local4:int; while (_local4 < m_contactCount) { _local5 = m_contacts[_local4]; _local6 = _arg1[_local4]; _local7 = s_reportCR; _local7.shape1 = _local5.m_shape1; _local7.shape2 = _local5.m_shape2; _local8 = _local7.shape1.m_body; _local9 = _local5.m_manifoldCount; _local10 = _local5.GetManifolds(); _local11 = 0; while (_local11 < _local9) { _local12 = _local10[_local11]; _local7.normal.SetV(_local12.normal); _local13 = 0; while (_local13 < _local12.pointCount) { _local14 = _local12.points[_local13]; _local15 = _local6.points[_local13]; _local7.position = _local8.GetWorldPoint(_local14.localPoint1); _local7.normalImpulse = _local15.normalImpulse; _local7.tangentImpulse = _local15.tangentImpulse; _local7.id.key = _local14.id.key; m_listener.Result(_local7); _local13++; }; _local11++; }; _local4++; }; } public function AddBody(_arg1:b2Body):void{ var _local2 = m_bodyCount++; m_bodies[_local2] = _arg1; } public function AddContact(_arg1:b2Contact):void{ var _local2 = m_contactCount++; m_contacts[_local2] = _arg1; } public function AddJoint(_arg1:b2Joint):void{ var _local2 = m_jointCount++; m_joints[_local2] = _arg1; } } }//package Box2D.Dynamics
Section 81
//b2TimeStep (Box2D.Dynamics.b2TimeStep) package Box2D.Dynamics { public class b2TimeStep { public var dt:Number; public var inv_dt:Number; public var dtRatio:Number; public var maxIterations:int; public var warmStarting:Boolean; public var positionCorrection:Boolean; } }//package Box2D.Dynamics
Section 82
//b2World (Box2D.Dynamics.b2World) package Box2D.Dynamics { import Box2D.Common.*; import Box2D.Common.Math.*; import Box2D.Collision.*; import Box2D.Dynamics.Joints.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.Contacts.*; public class b2World { public var m_blockAllocator; public var m_stackAllocator; public var m_lock:Boolean; public var m_broadPhase:b2BroadPhase; public var m_contactManager:b2ContactManager; public var m_bodyList:b2Body; public var m_jointList:b2Joint; public var m_contactList:b2Contact; public var m_bodyCount:int; public var m_contactCount:int; public var m_jointCount:int; public var m_gravity:b2Vec2; public var m_allowSleep:Boolean; public var m_groundBody:b2Body; public var m_destructionListener:b2DestructionListener; public var m_boundaryListener:b2BoundaryListener; public var m_contactFilter:b2ContactFilter; public var m_contactListener:b2ContactListener; public var m_debugDraw:b2DebugDraw; public var m_inv_dt0:Number; public var m_positionIterationCount:int; private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8); private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6); private static var s_xf:b2XForm = new b2XForm(); public static var m_positionCorrection:Boolean; public static var m_warmStarting:Boolean; public static var m_continuousPhysics:Boolean; public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){ m_contactManager = new b2ContactManager(); super(); m_destructionListener = null; m_boundaryListener = null; m_contactFilter = b2ContactFilter.b2_defaultFilter; m_contactListener = null; m_debugDraw = null; m_bodyList = null; m_contactList = null; m_jointList = null; m_bodyCount = 0; m_contactCount = 0; m_jointCount = 0; m_positionCorrection = true; m_warmStarting = true; m_continuousPhysics = true; m_allowSleep = _arg3; m_gravity = _arg2; m_lock = false; m_inv_dt0 = 0; m_contactManager.m_world = this; m_broadPhase = new b2BroadPhase(_arg1, m_contactManager); var _local4:b2BodyDef = new b2BodyDef(); m_groundBody = CreateBody(_local4); } public function SetDestructionListener(_arg1:b2DestructionListener):void{ m_destructionListener = _arg1; } public function SetBoundaryListener(_arg1:b2BoundaryListener):void{ m_boundaryListener = _arg1; } public function SetContactFilter(_arg1:b2ContactFilter):void{ m_contactFilter = _arg1; } public function SetContactListener(_arg1:b2ContactListener):void{ m_contactListener = _arg1; } public function SetDebugDraw(_arg1:b2DebugDraw):void{ m_debugDraw = _arg1; } public function Validate():void{ m_broadPhase.Validate(); } public function GetProxyCount():int{ return (m_broadPhase.m_proxyCount); } public function GetPairCount():int{ return (m_broadPhase.m_pairManager.m_pairCount); } public function CreateBody(_arg1:b2BodyDef):b2Body{ if (m_lock == true){ return (null); }; var _local2:b2Body = new b2Body(_arg1, this); _local2.m_prev = null; _local2.m_next = m_bodyList; if (m_bodyList){ m_bodyList.m_prev = _local2; }; m_bodyList = _local2; m_bodyCount++; return (_local2); } public function DestroyBody(_arg1:b2Body):void{ var _local4:b2JointEdge; var _local5:b2Shape; if (m_lock == true){ return; }; var _local2:b2JointEdge = _arg1.m_jointList; while (_local2) { _local4 = _local2; _local2 = _local2.next; if (m_destructionListener){ m_destructionListener.SayGoodbyeJoint(_local4.joint); }; DestroyJoint(_local4.joint); }; var _local3:b2Shape = _arg1.m_shapeList; while (_local3) { _local5 = _local3; _local3 = _local3.m_next; if (m_destructionListener){ m_destructionListener.SayGoodbyeShape(_local5); }; _local5.DestroyProxy(m_broadPhase); b2Shape.Destroy(_local5, m_blockAllocator); }; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_bodyList){ m_bodyList = _arg1.m_next; }; m_bodyCount--; } public function CreateJoint(_arg1:b2JointDef):b2Joint{ var _local3:b2Body; var _local4:b2Shape; var _local2:b2Joint = b2Joint.Create(_arg1, m_blockAllocator); _local2.m_prev = null; _local2.m_next = m_jointList; if (m_jointList){ m_jointList.m_prev = _local2; }; m_jointList = _local2; m_jointCount++; _local2.m_node1.joint = _local2; _local2.m_node1.other = _local2.m_body2; _local2.m_node1.prev = null; _local2.m_node1.next = _local2.m_body1.m_jointList; if (_local2.m_body1.m_jointList){ _local2.m_body1.m_jointList.prev = _local2.m_node1; }; _local2.m_body1.m_jointList = _local2.m_node1; _local2.m_node2.joint = _local2; _local2.m_node2.other = _local2.m_body1; _local2.m_node2.prev = null; _local2.m_node2.next = _local2.m_body2.m_jointList; if (_local2.m_body2.m_jointList){ _local2.m_body2.m_jointList.prev = _local2.m_node2; }; _local2.m_body2.m_jointList = _local2.m_node2; if (_arg1.collideConnected == false){ _local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2; _local4 = _local3.m_shapeList; while (_local4) { _local4.RefilterProxy(m_broadPhase, _local3.m_xf); _local4 = _local4.m_next; }; }; return (_local2); } public function DestroyJoint(_arg1:b2Joint):void{ var _local5:b2Body; var _local6:b2Shape; var _local2:Boolean = _arg1.m_collideConnected; if (_arg1.m_prev){ _arg1.m_prev.m_next = _arg1.m_next; }; if (_arg1.m_next){ _arg1.m_next.m_prev = _arg1.m_prev; }; if (_arg1 == m_jointList){ m_jointList = _arg1.m_next; }; var _local3:b2Body = _arg1.m_body1; var _local4:b2Body = _arg1.m_body2; _local3.WakeUp(); _local4.WakeUp(); if (_arg1.m_node1.prev){ _arg1.m_node1.prev.next = _arg1.m_node1.next; }; if (_arg1.m_node1.next){ _arg1.m_node1.next.prev = _arg1.m_node1.prev; }; if (_arg1.m_node1 == _local3.m_jointList){ _local3.m_jointList = _arg1.m_node1.next; }; _arg1.m_node1.prev = null; _arg1.m_node1.next = null; if (_arg1.m_node2.prev){ _arg1.m_node2.prev.next = _arg1.m_node2.next; }; if (_arg1.m_node2.next){ _arg1.m_node2.next.prev = _arg1.m_node2.prev; }; if (_arg1.m_node2 == _local4.m_jointList){ _local4.m_jointList = _arg1.m_node2.next; }; _arg1.m_node2.prev = null; _arg1.m_node2.next = null; b2Joint.Destroy(_arg1, m_blockAllocator); m_jointCount--; if (_local2 == false){ _local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4; _local6 = _local5.m_shapeList; while (_local6) { _local6.RefilterProxy(m_broadPhase, _local5.m_xf); _local6 = _local6.m_next; }; }; } public function Refilter(_arg1:b2Shape):void{ _arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf); } public function SetWarmStarting(_arg1:Boolean):void{ m_warmStarting = _arg1; } public function SetPositionCorrection(_arg1:Boolean):void{ m_positionCorrection = _arg1; } public function SetContinuousPhysics(_arg1:Boolean):void{ m_continuousPhysics = _arg1; } public function GetBodyCount():int{ return (m_bodyCount); } public function GetJointCount():int{ return (m_jointCount); } public function GetContactCount():int{ return (m_contactCount); } public function SetGravity(_arg1:b2Vec2):void{ m_gravity = _arg1; } public function GetGroundBody():b2Body{ return (m_groundBody); } public function Step(_arg1:Number, _arg2:int):void{ m_lock = true; var _local3:b2TimeStep = new b2TimeStep(); _local3.dt = _arg1; _local3.maxIterations = _arg2; if (_arg1 > 0){ _local3.inv_dt = (1 / _arg1); } else { _local3.inv_dt = 0; }; _local3.dtRatio = (m_inv_dt0 * _arg1); _local3.positionCorrection = m_positionCorrection; _local3.warmStarting = m_warmStarting; m_contactManager.Collide(); if (_local3.dt > 0){ Solve(_local3); }; if (((m_continuousPhysics) && ((_local3.dt > 0)))){ SolveTOI(_local3); }; DrawDebugData(); m_inv_dt0 = _local3.inv_dt; m_lock = false; } public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{ var _local4:Array = new Array(_arg3); var _local5:int = m_broadPhase.QueryAABB(_arg1, _local4, _arg3); var _local6:int; while (_local6 < _local5) { _arg2[_local6] = _local4[_local6]; _local6++; }; return (_local5); } public function GetBodyList():b2Body{ return (m_bodyList); } public function GetJointList():b2Joint{ return (m_jointList); } public function Solve(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local9:int; var _local10:int; var _local11:b2Body; var _local12:b2ContactEdge; var _local13:b2JointEdge; var _local14:Boolean; m_positionIterationCount = 0; var _local3:b2Island = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener); _local2 = m_bodyList; while (_local2) { _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); _local2 = _local2.m_next; }; var _local4:b2Contact = m_contactList; while (_local4) { _local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag)); _local4 = _local4.m_next; }; var _local5:b2Joint = m_jointList; while (_local5) { _local5.m_islandFlag = false; _local5 = _local5.m_next; }; var _local6:int = m_bodyCount; var _local7:Array = new Array(_local6); var _local8:b2Body = m_bodyList; while (_local8) { if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){ } else { if (_local8.IsStatic()){ } else { _local3.Clear(); _local9 = 0; var _temp1 = _local9; _local9 = (_local9 + 1); var _local15 = _temp1; _local7[_local15] = _local8; _local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag); while (_local9 > 0) { --_local9; _local2 = _local7[_local9]; _local3.AddBody(_local2); _local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag)); if (_local2.IsStatic()){ } else { _local12 = _local2.m_contactList; while (_local12) { if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){ } else { if (_local12.contact.m_manifoldCount == 0){ } else { _local3.AddContact(_local12.contact); _local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag); _local11 = _local12.other; if ((_local11.m_flags & b2Body.e_islandFlag)){ } else { var _temp2 = _local9; _local9 = (_local9 + 1); var _local16 = _temp2; _local7[_local16] = _local11; _local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag); }; }; }; _local12 = _local12.next; }; _local13 = _local2.m_jointList; while (_local13) { if (_local13.joint.m_islandFlag == true){ } else { _local3.AddJoint(_local13.joint); _local13.joint.m_islandFlag = true; _local11 = _local13.other; if ((_local11.m_flags & b2Body.e_islandFlag)){ } else { var _temp3 = _local9; _local9 = (_local9 + 1); _local16 = _temp3; _local7[_local16] = _local11; _local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag); }; }; _local13 = _local13.next; }; }; }; _local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep); if (_local3.m_positionIterationCount > m_positionIterationCount){ m_positionIterationCount = _local3.m_positionIterationCount; }; _local10 = 0; while (_local10 < _local3.m_bodyCount) { _local2 = _local3.m_bodies[_local10]; if (_local2.IsStatic()){ _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); }; _local10++; }; }; }; _local8 = _local8.m_next; }; _local2 = m_bodyList; while (_local2) { if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){ } else { if (_local2.IsStatic()){ } else { _local14 = _local2.SynchronizeShapes(); if ((((_local14 == false)) && (!((m_boundaryListener == null))))){ m_boundaryListener.Violation(_local2); }; }; }; _local2 = _local2.m_next; }; m_broadPhase.Commit(); } public function SolveTOI(_arg1:b2TimeStep):void{ var _local2:b2Body; var _local3:b2Shape; var _local4:b2Shape; var _local5:b2Body; var _local6:b2Body; var _local7:b2ContactEdge; var _local11:b2Contact; var _local12:b2Contact; var _local13:Number; var _local14:b2Body; var _local15:int; var _local16:b2TimeStep; var _local17:int; var _local18:Number; var _local19:Number; var _local20:b2Body; var _local21:Boolean; var _local8:b2Island = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener); var _local9:int = m_bodyCount; var _local10:Array = new Array(_local9); _local2 = m_bodyList; while (_local2) { _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); _local2.m_sweep.t0 = 0; _local2 = _local2.m_next; }; _local11 = m_contactList; while (_local11) { _local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag))); _local11 = _local11.m_next; }; while (true) { _local12 = null; _local13 = 1; _local11 = m_contactList; for (;_local11;(_local11 = _local11.m_next)) { if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){ } else { _local18 = 1; if ((_local11.m_flags & b2Contact.e_toiFlag)){ _local18 = _local11.m_toi; } else { _local3 = _local11.m_shape1; _local4 = _local11.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){ continue; }; _local19 = _local5.m_sweep.t0; if (_local5.m_sweep.t0 < _local6.m_sweep.t0){ _local19 = _local6.m_sweep.t0; _local5.m_sweep.Advance(_local19); } else { if (_local6.m_sweep.t0 < _local5.m_sweep.t0){ _local19 = _local5.m_sweep.t0; _local6.m_sweep.Advance(_local19); }; }; _local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep); if ((((_local18 > 0)) && ((_local18 < 1)))){ _local18 = (((1 - _local18) * _local19) + _local18); if (_local18 > 1){ _local18 = 1; }; }; _local11.m_toi = _local18; _local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag); }; if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){ _local12 = _local11; _local13 = _local18; }; }; }; if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){ break; }; _local3 = _local12.m_shape1; _local4 = _local12.m_shape2; _local5 = _local3.m_body; _local6 = _local4.m_body; _local5.Advance(_local13); _local6.Advance(_local13); _local12.Update(m_contactListener); _local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag)); if (_local12.m_manifoldCount == 0){ } else { _local14 = _local5; if (_local14.IsStatic()){ _local14 = _local6; }; _local8.Clear(); _local15 = 0; var _temp1 = _local15; _local15 = (_local15 + 1); var _local22 = _temp1; _local10[_local22] = _local14; _local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag); while (_local15 > 0) { --_local15; _local2 = _local10[_local15]; _local8.AddBody(_local2); _local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag)); if (_local2.IsStatic()){ } else { _local7 = _local2.m_contactList; while (_local7) { if (_local8.m_contactCount == _local8.m_contactCapacity){ } else { if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){ } else { if (_local7.contact.m_manifoldCount == 0){ } else { _local8.AddContact(_local7.contact); _local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag); _local20 = _local7.other; if ((_local20.m_flags & b2Body.e_islandFlag)){ } else { if (_local20.IsStatic() == false){ _local20.Advance(_local13); _local20.WakeUp(); }; var _temp2 = _local15; _local15 = (_local15 + 1); var _local23 = _temp2; _local10[_local23] = _local20; _local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag); }; }; }; }; _local7 = _local7.next; }; }; }; _local16 = new b2TimeStep(); _local16.dt = ((1 - _local13) * _arg1.dt); _local16.inv_dt = (1 / _local16.dt); _local16.maxIterations = _arg1.maxIterations; _local8.SolveTOI(_local16); _local17 = 0; while (_local17 < _local8.m_bodyCount) { _local2 = _local8.m_bodies[_local17]; _local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag)); if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){ } else { if (_local2.IsStatic()){ } else { _local21 = _local2.SynchronizeShapes(); if ((((_local21 == false)) && (!((m_boundaryListener == null))))){ m_boundaryListener.Violation(_local2); }; _local7 = _local2.m_contactList; while (_local7) { _local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag)); _local7 = _local7.next; }; }; }; _local17++; }; _local17 = 0; while (_local17 < _local8.m_contactCount) { _local11 = _local8.m_contacts[_local17]; _local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag))); _local17++; }; m_broadPhase.Commit(); }; }; } public function DrawJoint(_arg1:b2Joint):void{ var _local11:b2PulleyJoint; var _local12:b2Vec2; var _local13:b2Vec2; var _local2:b2Body = _arg1.m_body1; var _local3:b2Body = _arg1.m_body2; var _local4:b2XForm = _local2.m_xf; var _local5:b2XForm = _local3.m_xf; var _local6:b2Vec2 = _local4.position; var _local7:b2Vec2 = _local5.position; var _local8:b2Vec2 = _arg1.GetAnchor1(); var _local9:b2Vec2 = _arg1.GetAnchor2(); var _local10:b2Color = s_jointColor; switch (_arg1.m_type){ case b2Joint.e_distanceJoint: m_debugDraw.DrawSegment(_local8, _local9, _local10); break; case b2Joint.e_pulleyJoint: _local11 = (_arg1 as b2PulleyJoint); _local12 = _local11.GetGroundAnchor1(); _local13 = _local11.GetGroundAnchor2(); m_debugDraw.DrawSegment(_local12, _local8, _local10); m_debugDraw.DrawSegment(_local13, _local9, _local10); m_debugDraw.DrawSegment(_local12, _local13, _local10); break; case b2Joint.e_mouseJoint: m_debugDraw.DrawSegment(_local8, _local9, _local10); break; default: if (_local2 != m_groundBody){ m_debugDraw.DrawSegment(_local6, _local8, _local10); }; m_debugDraw.DrawSegment(_local8, _local9, _local10); if (_local3 != m_groundBody){ m_debugDraw.DrawSegment(_local7, _local9, _local10); }; }; } public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{ var _local6:b2CircleShape; var _local7:b2Vec2; var _local8:Number; var _local9:b2Vec2; var _local10:int; var _local11:b2PolygonShape; var _local12:int; var _local13:Array; var _local14:Array; var _local15:Array; var _local5:b2Color = s_coreColor; switch (_arg1.m_type){ case b2Shape.e_circleShape: _local6 = (_arg1 as b2CircleShape); _local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition); _local8 = _local6.m_radius; _local9 = _arg2.R.col1; m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3); if (_arg4){ m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5); }; break; case b2Shape.e_polygonShape: _local11 = (_arg1 as b2PolygonShape); _local12 = _local11.GetVertexCount(); _local13 = _local11.GetVertices(); _local14 = new Array(b2Settings.b2_maxPolygonVertices); _local10 = 0; while (_local10 < _local12) { _local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]); _local10++; }; m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3); if (_arg4){ _local15 = _local11.GetCoreVertices(); _local10 = 0; while (_local10 < _local12) { _local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]); _local10++; }; m_debugDraw.DrawPolygon(_local14, _local12, _local5); }; break; }; } public function DrawDebugData():void{ var _local2:int; var _local3:b2Body; var _local4:b2Shape; var _local5:b2Joint; var _local6:b2BroadPhase; var _local11:b2XForm; var _local15:Boolean; var _local16:uint; var _local17:b2Pair; var _local18:b2Proxy; var _local19:b2Proxy; var _local20:b2Vec2; var _local21:b2Vec2; var _local22:b2Proxy; var _local23:b2PolygonShape; var _local24:b2OBB; var _local25:b2Vec2; var _local26:b2Mat22; var _local27:b2Vec2; var _local28:Number; if (m_debugDraw == null){ return; }; m_debugDraw.m_sprite.graphics.clear(); var _local1:uint = m_debugDraw.GetFlags(); var _local7:b2Vec2 = new b2Vec2(); var _local8:b2Vec2 = new b2Vec2(); var _local9:b2Vec2 = new b2Vec2(); var _local10:b2Color = new b2Color(0, 0, 0); var _local12:b2AABB = new b2AABB(); var _local13:b2AABB = new b2AABB(); var _local14:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()]; if ((_local1 & b2DebugDraw.e_shapeBit)){ _local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit); _local3 = m_bodyList; while (_local3) { _local11 = _local3.m_xf; _local4 = _local3.GetShapeList(); while (_local4) { if (_local3.IsStatic()){ DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15); } else { if (_local3.IsSleeping()){ DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15); } else { DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15); }; }; _local4 = _local4.m_next; }; _local3 = _local3.m_next; }; }; if ((_local1 & b2DebugDraw.e_jointBit)){ _local5 = m_jointList; while (_local5) { DrawJoint(_local5); _local5 = _local5.m_next; }; }; if ((_local1 & b2DebugDraw.e_pairBit)){ _local6 = m_broadPhase; _local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y)); _local10.Set(0.9, 0.9, 0.3); _local2 = 0; while (_local2 < b2Pair.b2_tableCapacity) { _local16 = _local6.m_pairManager.m_hashTable[_local2]; while (_local16 != b2Pair.b2_nullPair) { _local17 = _local6.m_pairManager.m_pairs[_local16]; _local18 = _local6.m_proxyPool[_local17.proxyId1]; _local19 = _local6.m_proxyPool[_local17.proxyId2]; _local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value)); _local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value)); _local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value)); _local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value)); _local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value)); _local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value)); _local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value)); _local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value)); _local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x)); _local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y)); _local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x)); _local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y)); m_debugDraw.DrawSegment(_local8, _local9, _local10); _local16 = _local17.next; }; _local2++; }; }; if ((_local1 & b2DebugDraw.e_aabbBit)){ _local6 = m_broadPhase; _local20 = _local6.m_worldAABB.lowerBound; _local21 = _local6.m_worldAABB.upperBound; _local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y)); _local10.Set(0.9, 0.3, 0.9); _local2 = 0; while (_local2 < b2Settings.b2_maxProxies) { _local22 = _local6.m_proxyPool[_local2]; if (_local22.IsValid() == false){ } else { _local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value)); _local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value)); _local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value)); _local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value)); _local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y); _local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y); _local14[2].Set(_local12.upperBound.x, _local12.upperBound.y); _local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y); m_debugDraw.DrawPolygon(_local14, 4, _local10); }; _local2++; }; _local14[0].Set(_local20.x, _local20.y); _local14[1].Set(_local21.x, _local20.y); _local14[2].Set(_local21.x, _local21.y); _local14[3].Set(_local20.x, _local21.y); m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9)); }; if ((_local1 & b2DebugDraw.e_obbBit)){ _local10.Set(0.5, 0.3, 0.5); _local3 = m_bodyList; while (_local3) { _local11 = _local3.m_xf; _local4 = _local3.GetShapeList(); while (_local4) { if (_local4.m_type != b2Shape.e_polygonShape){ } else { _local23 = (_local4 as b2PolygonShape); _local24 = _local23.GetOBB(); _local25 = _local24.extents; _local14[0].Set(-(_local25.x), -(_local25.y)); _local14[1].Set(_local25.x, -(_local25.y)); _local14[2].Set(_local25.x, _local25.y); _local14[3].Set(-(_local25.x), _local25.y); _local2 = 0; while (_local2 < 4) { _local26 = _local24.R; _local27 = _local14[_local2]; _local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y))); _local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y))); _local14[_local2].x = _local28; _local26 = _local11.R; _local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y))); _local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y))); _local14[_local2].x = _local28; _local2++; }; m_debugDraw.DrawPolygon(_local14, 4, _local10); }; _local4 = _local4.m_next; }; _local3 = _local3.m_next; }; }; if ((_local1 & b2DebugDraw.e_centerOfMassBit)){ _local3 = m_bodyList; while (_local3) { _local11 = s_xf; _local11.R = _local3.m_xf.R; _local11.position = _local3.GetWorldCenter(); m_debugDraw.DrawXForm(_local11); _local3 = _local3.m_next; }; }; } } }//package Box2D.Dynamics
Section 83
//PropTween (com.greensock.core.PropTween) package com.greensock.core { public class PropTween { public var target:Object; public var property:String; public var start:Number; public var change:Number; public var name:String; public var priority:int; public var isPlugin:Boolean; public var nextNode:PropTween; public var prevNode:PropTween; public function PropTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean, _arg7:PropTween=null, _arg8:int=0){ this.target = _arg1; this.property = _arg2; this.start = _arg3; this.change = _arg4; this.name = _arg5; this.isPlugin = _arg6; if (_arg7){ _arg7.prevNode = this; this.nextNode = _arg7; }; this.priority = _arg8; } } }//package com.greensock.core
Section 84
//SimpleTimeline (com.greensock.core.SimpleTimeline) package com.greensock.core { public class SimpleTimeline extends TweenCore { protected var _firstChild:TweenCore; protected var _lastChild:TweenCore; public var autoRemoveChildren:Boolean; public function SimpleTimeline(_arg1:Object=null){ super(0, _arg1); } public function addChild(_arg1:TweenCore):void{ if (((!(_arg1.gc)) && (_arg1.timeline))){ _arg1.timeline.remove(_arg1, true); }; _arg1.timeline = this; if (_arg1.gc){ _arg1.setEnabled(true, true); }; if (_firstChild){ _firstChild.prevNode = _arg1; }; _arg1.nextNode = _firstChild; _firstChild = _arg1; _arg1.prevNode = null; } public function remove(_arg1:TweenCore, _arg2:Boolean=false):void{ if (((!(_arg1.gc)) && (!(_arg2)))){ _arg1.setEnabled(false, true); }; if (_arg1.nextNode){ _arg1.nextNode.prevNode = _arg1.prevNode; } else { if (_lastChild == _arg1){ _lastChild = _arg1.prevNode; }; }; if (_arg1.prevNode){ _arg1.prevNode.nextNode = _arg1.nextNode; } else { if (_firstChild == _arg1){ _firstChild = _arg1.nextNode; }; }; } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local5:Number; var _local6:TweenCore; var _local4:TweenCore = _firstChild; this.cachedTotalTime = _arg1; this.cachedTime = _arg1; while (_local4) { _local6 = _local4.nextNode; if (((_local4.active) || ((((((_arg1 >= _local4.cachedStartTime)) && (!(_local4.cachedPaused)))) && (!(_local4.gc)))))){ if (!(_local4.cachedReversed)){ _local4.renderTime(((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale), _arg2, false); } else { _local5 = (_local4.cacheIsDirty) ? _local4.totalDuration : _local4.cachedTotalDuration; _local4.renderTime((_local5 - ((_arg1 - _local4.cachedStartTime) * _local4.cachedTimeScale)), _arg2, false); }; }; _local4 = _local6; }; } public function get rawTime():Number{ return (this.cachedTotalTime); } } }//package com.greensock.core
Section 85
//TweenCore (com.greensock.core.TweenCore) package com.greensock.core { import com.greensock.*; public class TweenCore { protected var _delay:Number; protected var _hasUpdate:Boolean; protected var _rawPrevTime:Number;// = -1 protected var _pauseTime:Number; public var vars:Object; public var active:Boolean; public var gc:Boolean; public var initted:Boolean; public var timeline:SimpleTimeline; public var cachedStartTime:Number; public var cachedTime:Number; public var cachedTotalTime:Number; public var cachedDuration:Number; public var cachedTotalDuration:Number; public var cachedTimeScale:Number; public var cachedReversed:Boolean; public var nextNode:TweenCore; public var prevNode:TweenCore; public var cacheIsDirty:Boolean; public var cachedPaused:Boolean; public var data; public static const version:Number = 1.13; protected static var _classInitted:Boolean; public function TweenCore(_arg1:Number=0, _arg2:Object=null){ this.vars = ((_arg2) || ({})); this.cachedDuration = (this.cachedTotalDuration = ((_arg1) || (0))); _delay = ((this.vars.delay) || (0)); this.cachedTimeScale = ((this.vars.timeScale) || (1)); this.active = Boolean((((((_arg1 == 0)) && ((_delay == 0)))) && (!((this.vars.immediateRender == false))))); this.cachedTotalTime = (this.cachedTime = 0); this.data = this.vars.data; if (!(_classInitted)){ if (isNaN(TweenLite.rootFrame)){ TweenLite.initClass(); _classInitted = true; } else { return; }; }; var _local3:SimpleTimeline = ((this.vars.timeline is SimpleTimeline)) ? this.vars.timeline : (this.vars.useFrames) ? TweenLite.rootFramesTimeline : TweenLite.rootTimeline; this.cachedStartTime = (_local3.cachedTotalTime + _delay); _local3.addChild(this); if (this.vars.reversed){ this.cachedReversed = true; }; if (this.vars.paused){ this.paused = true; }; } public function play():void{ this.reversed = false; this.paused = false; } public function pause():void{ this.paused = true; } public function resume():void{ this.paused = false; } public function restart(_arg1:Boolean=false, _arg2:Boolean=true):void{ this.reversed = false; this.paused = false; this.setTotalTime((_arg1) ? -(_delay) : 0, _arg2); } public function reverse(_arg1:Boolean=true):void{ this.reversed = true; if (_arg1){ this.paused = false; } else { if (this.gc){ this.setEnabled(true, false); }; }; } public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ } public function complete(_arg1:Boolean=false, _arg2:Boolean=false):void{ if (!(_arg1)){ renderTime(this.cachedTotalDuration, _arg2, false); return; }; if (this.timeline.autoRemoveChildren){ this.setEnabled(false, false); } else { this.active = false; }; if (!(_arg2)){ if (((((this.vars.onComplete) && ((this.cachedTotalTime == this.cachedTotalDuration)))) && (!(this.cachedReversed)))){ this.vars.onComplete.apply(null, this.vars.onCompleteParams); } else { if (((((this.cachedReversed) && ((this.cachedTotalTime == 0)))) && (this.vars.onReverseComplete))){ this.vars.onReverseComplete.apply(null, this.vars.onReverseCompleteParams); }; }; }; } public function invalidate():void{ } public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ if (_arg1){ this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); if (((!(_arg2)) && (this.gc))){ this.timeline.addChild(this); }; } else { this.active = false; if (!(_arg2)){ this.timeline.remove(this, true); }; }; this.gc = !(_arg1); return (false); } public function kill():void{ setEnabled(false, false); } protected function setDirtyCache(_arg1:Boolean=true):void{ var _local2:TweenCore = (_arg1) ? this : this.timeline; while (_local2) { _local2.cacheIsDirty = true; _local2 = _local2.timeline; }; } protected function setTotalTime(_arg1:Number, _arg2:Boolean=false):void{ var _local3:Number; var _local4:Number; if (this.timeline){ _local3 = (((_pauseTime) || ((_pauseTime == 0)))) ? _pauseTime : this.timeline.cachedTotalTime; if (this.cachedReversed){ _local4 = (this.cacheIsDirty) ? this.totalDuration : this.cachedTotalDuration; this.cachedStartTime = (_local3 - ((_local4 - _arg1) / this.cachedTimeScale)); } else { this.cachedStartTime = (_local3 - (_arg1 / this.cachedTimeScale)); }; if (!(this.timeline.cacheIsDirty)){ setDirtyCache(false); }; if (this.cachedTotalTime != _arg1){ renderTime(_arg1, _arg2, false); }; }; } public function get delay():Number{ return (_delay); } public function set delay(_arg1:Number):void{ this.startTime = (this.startTime + (_arg1 - _delay)); _delay = _arg1; } public function get duration():Number{ return (this.cachedDuration); } public function set duration(_arg1:Number):void{ this.cachedDuration = (this.cachedTotalDuration = _arg1); setDirtyCache(false); } public function get totalDuration():Number{ return (this.cachedTotalDuration); } public function set totalDuration(_arg1:Number):void{ this.duration = _arg1; } public function get currentTime():Number{ return (this.cachedTime); } public function set currentTime(_arg1:Number):void{ setTotalTime(_arg1, false); } public function get totalTime():Number{ return (this.cachedTotalTime); } public function set totalTime(_arg1:Number):void{ setTotalTime(_arg1, false); } public function get startTime():Number{ return (this.cachedStartTime); } public function set startTime(_arg1:Number):void{ var _local2:Boolean = Boolean(((!((this.timeline == null))) && (((!((_arg1 == this.cachedStartTime))) || (this.gc))))); this.cachedStartTime = _arg1; if (_local2){ this.timeline.addChild(this); }; } public function get reversed():Boolean{ return (this.cachedReversed); } public function set reversed(_arg1:Boolean):void{ if (_arg1 != this.cachedReversed){ this.cachedReversed = _arg1; setTotalTime(this.cachedTotalTime, true); }; } public function get paused():Boolean{ return (this.cachedPaused); } public function set paused(_arg1:Boolean):void{ if (((!((_arg1 == this.cachedPaused))) && (this.timeline))){ if (_arg1){ _pauseTime = this.timeline.rawTime; } else { this.cachedStartTime = (this.cachedStartTime + (this.timeline.rawTime - _pauseTime)); _pauseTime = NaN; setDirtyCache(false); }; this.cachedPaused = _arg1; this.active = Boolean(((((!(this.cachedPaused)) && ((this.cachedTotalTime > 0)))) && ((this.cachedTotalTime < this.cachedTotalDuration)))); }; if (((!(_arg1)) && (this.gc))){ this.setTotalTime(this.cachedTotalTime, false); this.setEnabled(true, false); }; } } }//package com.greensock.core
Section 86
//Back (com.greensock.easing.Back) package com.greensock.easing { public class Back { public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{ _arg1 = (_arg1 / _arg4); return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2)); } public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{ _arg1 = ((_arg1 / _arg4) - 1); return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2)); } public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{ _arg1 = (_arg1 / (_arg4 * 0.5)); if (_arg1 < 1){ _arg5 = (_arg5 * 1.525); return ((((_arg3 * 0.5) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2)); }; _arg1 = (_arg1 - 2); _arg5 = (_arg5 * 1.525); return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2)); } } }//package com.greensock.easing
Section 87
//TweenLite (com.greensock.TweenLite) package com.greensock { import flash.utils.*; import flash.display.*; import com.greensock.core.*; import flash.events.*; import com.greensock.plugins.*; public class TweenLite extends TweenCore { public var target:Object; public var propTweenLookup:Object; public var ratio:Number;// = 0 public var cachedPT1:PropTween; protected var _ease:Function; protected var _overwrite:uint; protected var _overwrittenProps:Object; protected var _hasPlugins:Boolean; protected var _notifyPluginsOfEnabled:Boolean; public static const version:Number = 11.131; public static var plugins:Object = {}; public static var fastEaseLookup:Dictionary = new Dictionary(false); public static var onPluginEvent:Function; public static var killDelayedCallsTo:Function = TweenLite.killTweensOf; public static var defaultEase:Function = TweenLite.easeOut; public static var overwriteManager:Object; public static var rootFrame:Number; public static var rootTimeline:SimpleTimeline; public static var rootFramesTimeline:SimpleTimeline; public static var masterList:Dictionary = new Dictionary(false); private static var _shape:Shape = new Shape(); protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, useFrames:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, onReverseComplete:1, onReverseCompleteParams:1, onRepeat:1, onRepeatParams:1, proxiedEase:1, easeParams:1, yoyo:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, onReverseCompleteListener:1, onRepeatListener:1, orientToBezier:1, timeScale:1, immediateRender:1, repeat:1, repeatDelay:1, timeline:1, data:1, paused:1}; public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){ var _local5:TweenLite; super(_arg2, _arg3); this.target = _arg1; if ((((this.target is TweenCore)) && (("timeScale" in this.vars)))){ this.cachedTimeScale = 1; }; propTweenLookup = {}; _ease = defaultEase; _overwrite = (((!((Number(_arg3.overwrite) > -1))) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite); var _local4:Array = masterList[_arg1]; if (!(_local4)){ masterList[_arg1] = [this]; } else { if (_overwrite == 1){ for each (_local5 in _local4) { if (!(_local5.gc)){ _local5.setEnabled(false, false); }; }; masterList[_arg1] = [this]; } else { _local4[_local4.length] = this; }; }; if (((this.active) || (this.vars.immediateRender))){ renderTime(0, false, true); }; } protected function init():void{ var _local1:String; var _local2:int; var _local3:*; var _local4:Boolean; var _local5:Array; var _local6:PropTween; if (typeof(this.vars.ease) == "function"){ _ease = this.vars.ease; }; if (this.vars.easeParams){ this.vars.proxiedEase = _ease; _ease = easeProxy; }; this.cachedPT1 = null; this.propTweenLookup = {}; for (_local1 in this.vars) { if ((((_local1 in _reservedProps)) && (!((((_local1 == "timeScale")) && ((this.target is TweenCore))))))){ } else { if ((((_local1 in plugins)) && (new ((plugins[_local1] as Class)).onInitTween(this.target, this.vars[_local1], this)))){ this.cachedPT1 = new PropTween(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true, this.cachedPT1); if (this.cachedPT1.name == "_MULTIPLE_"){ _local2 = _local3.overwriteProps.length; while (_local2--) { this.propTweenLookup[_local3.overwriteProps[_local2]] = this.cachedPT1; }; } else { this.propTweenLookup[this.cachedPT1.name] = this.cachedPT1; }; if (_local3.priority){ this.cachedPT1.priority = _local3.priority; _local4 = true; }; if (((_local3.onDisable) || (_local3.onEnable))){ _notifyPluginsOfEnabled = true; }; _hasPlugins = true; } else { this.cachedPT1 = new PropTween(this.target, _local1, Number(this.target[_local1]), ((typeof(this.vars[_local1]))=="number") ? (Number(this.vars[_local1]) - this.target[_local1]) : Number(this.vars[_local1]), _local1, false, this.cachedPT1); this.propTweenLookup[_local1] = this.cachedPT1; }; }; }; if (_local4){ onPluginEvent("onInit", this); }; if (this.vars.runBackwards){ _local6 = this.cachedPT1; while (_local6) { _local6.start = (_local6.start + _local6.change); _local6.change = -(_local6.change); _local6 = _local6.nextNode; }; }; _hasUpdate = Boolean(!((this.vars.onUpdate == null))); if (_overwrittenProps){ killVars(_overwrittenProps); if (this.cachedPT1 == null){ this.setEnabled(false, false); }; }; if ((((((((_overwrite > 1)) && (this.cachedPT1))) && (masterList[this.target]))) && ((_local5.length > 1)))){ if (overwriteManager.manageOverwrites(this, this.propTweenLookup, _local5, _overwrite)){ init(); }; }; this.initted = true; } override public function renderTime(_arg1:Number, _arg2:Boolean=false, _arg3:Boolean=false):void{ var _local4:Boolean; var _local5:Number = this.cachedTime; if (_arg1 >= this.cachedDuration){ this.cachedTotalTime = (this.cachedTime = this.cachedDuration); this.ratio = 1; _local4 = true; if (this.cachedDuration == 0){ if ((((((_arg1 == 0)) || ((_rawPrevTime < 0)))) && (!((_rawPrevTime == _arg1))))){ _arg3 = true; }; _rawPrevTime = _arg1; }; } else { if (_arg1 <= 0){ this.cachedTotalTime = (this.cachedTime = (this.ratio = 0)); if (_arg1 < 0){ this.active = false; if (this.cachedDuration == 0){ if (_rawPrevTime > 0){ _arg3 = true; _local4 = true; }; _rawPrevTime = _arg1; }; }; if (((this.cachedReversed) && (!((_local5 == 0))))){ _local4 = true; }; } else { this.cachedTotalTime = (this.cachedTime = _arg1); this.ratio = _ease(_arg1, 0, 1, this.cachedDuration); }; }; if ((((this.cachedTime == _local5)) && (!(_arg3)))){ return; }; if (!(this.initted)){ init(); if (((!(_local4)) && (this.cachedTime))){ this.ratio = _ease(this.cachedTime, 0, 1, this.cachedDuration); }; }; if (((!(this.active)) && (!(this.cachedPaused)))){ this.active = true; }; if ((((((((_local5 == 0)) && (this.vars.onStart))) && (!((this.cachedTime == 0))))) && (!(_arg2)))){ this.vars.onStart.apply(null, this.vars.onStartParams); }; var _local6:PropTween = this.cachedPT1; while (_local6) { _local6.target[_local6.property] = (_local6.start + (this.ratio * _local6.change)); _local6 = _local6.nextNode; }; if (((_hasUpdate) && (!(_arg2)))){ this.vars.onUpdate.apply(null, this.vars.onUpdateParams); }; if (_local4){ if (((_hasPlugins) && (this.cachedPT1))){ onPluginEvent("onComplete", this); }; complete(true, _arg2); }; } public function killVars(_arg1:Object, _arg2:Boolean=true):Boolean{ var _local3:String; var _local4:PropTween; var _local5:Boolean; if (_overwrittenProps == null){ _overwrittenProps = {}; }; for (_local3 in _arg1) { if ((_local3 in propTweenLookup)){ _local4 = propTweenLookup[_local3]; if (((_local4.isPlugin) && ((_local4.name == "_MULTIPLE_")))){ _local4.target.killProps(_arg1); if (_local4.target.overwriteProps.length == 0){ _local4.name = ""; }; }; if (_local4.name != "_MULTIPLE_"){ if (_local4.nextNode){ _local4.nextNode.prevNode = _local4.prevNode; }; if (_local4.prevNode){ _local4.prevNode.nextNode = _local4.nextNode; } else { if (this.cachedPT1 == _local4){ this.cachedPT1 = _local4.nextNode; }; }; if (((_local4.isPlugin) && (_local4.target.onDisable))){ _local4.target.onDisable(); if (_local4.target.activeDisable){ _local5 = true; }; }; delete propTweenLookup[_local3]; }; }; if (_arg2){ _overwrittenProps[_local3] = 1; }; }; return (_local5); } override public function invalidate():void{ if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ onPluginEvent("onDisable", this); }; this.cachedPT1 = null; _overwrittenProps = null; _hasUpdate = (this.initted = (this.active = (_notifyPluginsOfEnabled = false))); this.propTweenLookup = {}; } override public function setEnabled(_arg1:Boolean, _arg2:Boolean=false):Boolean{ var _local3:Array; if (_arg1){ _local3 = TweenLite.masterList[this.target]; if (!(_local3)){ TweenLite.masterList[this.target] = [this]; } else { _local3[_local3.length] = this; }; }; super.setEnabled(_arg1, _arg2); if (((_notifyPluginsOfEnabled) && (this.cachedPT1))){ return (onPluginEvent((_arg1) ? "onEnable" : "onDisable", this)); }; return (false); } protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams))); } public static function initClass():void{ rootFrame = 0; rootTimeline = new SimpleTimeline(null); rootFramesTimeline = new SimpleTimeline(null); rootTimeline.cachedStartTime = (getTimer() * 0.001); rootFramesTimeline.cachedStartTime = rootFrame; rootTimeline.autoRemoveChildren = true; rootFramesTimeline.autoRemoveChildren = true; _shape.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true); if (overwriteManager == null){ overwriteManager = {mode:1, enabled:false}; }; } public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ return (new TweenLite(_arg1, _arg2, _arg3)); } public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{ _arg3.runBackwards = true; if (!(("immediateRender" in _arg3))){ _arg3.immediateRender = true; }; return (new TweenLite(_arg1, _arg2, _arg3)); } public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenLite{ return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, immediateRender:false, useFrames:_arg4, overwrite:0})); } protected static function updateAll(_arg1:Event=null):void{ var _local2:Dictionary; var _local3:Object; var _local4:Array; var _local5:int; rootTimeline.renderTime((((getTimer() * 0.001) - rootTimeline.cachedStartTime) * rootTimeline.cachedTimeScale), false, false); rootFrame++; rootFramesTimeline.renderTime(((rootFrame - rootFramesTimeline.cachedStartTime) * rootFramesTimeline.cachedTimeScale), false, false); if (!((rootFrame % 60))){ _local2 = masterList; for (_local3 in _local2) { _local4 = _local2[_local3]; _local5 = _local4.length; while (_local5--) { if (TweenLite(_local4[_local5]).gc){ _local4.splice(_local5, 1); }; }; if (_local4.length == 0){ delete _local2[_local3]; }; }; }; } public static function killTweensOf(_arg1:Object, _arg2:Boolean=false):void{ var _local3:Array; var _local4:int; if ((_arg1 in masterList)){ _local3 = masterList[_arg1]; _local4 = _local3.length; while (_local4--) { if (!(TweenLite(_local3[_local4]).gc)){ if (_arg2){ TweenLite(_local3[_local4]).complete(false, false); } else { TweenLite(_local3[_local4]).setEnabled(false, false); }; }; }; delete masterList[_arg1]; }; } protected static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{ _arg1 = (1 - (_arg1 / _arg4)); return ((1 - (_arg1 * _arg1))); } } }//package com.greensock
Section 88
//AnimatedBitmap (com.hexagonstar.display.bitmaps.AnimatedBitmap) package com.hexagonstar.display.bitmaps { import flash.display.*; import flash.geom.*; import com.hexagonstar.display.*; import flash.events.*; import com.hexagonstar.env.event.*; public class AnimatedBitmap extends Bitmap implements IAnimatedDisplayObject { private var _buffer:BitmapData; private var _timer:FrameRateTimer; private var _frameAmount:int; private var _frameNr:int; private var _isPlaying:Boolean; private var _point:Point; private var _rect:Rectangle; private var _wCount:int; public function AnimatedBitmap(_arg1:BitmapData, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:FrameRateTimer, _arg7:Boolean=true, _arg8:String="auto", _arg9:Boolean=false){ super(new BitmapData(_arg2, _arg3, _arg7, 0), _arg8, _arg9); _buffer = _arg1.clone(); _wCount = _arg4; _frameAmount = _arg5; _frameNr = 1; _isPlaying = false; _timer = _arg6; _point = new Point(0, 0); _rect = new Rectangle(0, 0, width, height); bitmapData.copyPixels(_buffer, _rect, _point); play(); } public function setFrameRateTimer(_arg1:FrameRateTimer):void{ if (_isPlaying){ stop(); _timer = _arg1; play(); } else { _timer = _arg1; }; } public function getFrameRate():int{ return (_timer.getFrameRate()); } public function getCurrentFrame():int{ return (_frameNr); } public function getTotalFrames():int{ return (_frameAmount); } public function isPlaying():Boolean{ return (_isPlaying); } public function play():void{ if (!(_isPlaying)){ _isPlaying = true; _timer.addEventListener(TimerEvent.TIMER, playForward); } else { stop(); play(); }; } public function stop():void{ if (_isPlaying){ _timer.removeEventListener(TimerEvent.TIMER, playForward); _isPlaying = false; }; } public function gotoAndPlay(_arg1:int):void{ _frameNr = (_arg1 - 1); play(); } public function gotoAndStop(_arg1:int):void{ if (_arg1 >= _frameNr){ _frameNr = (_arg1 - 1); nextFrame(); } else { _frameNr = (_arg1 + 1); prevFrame(); }; } public function nextFrame():void{ if (_isPlaying){ stop(); }; _frameNr++; if (_frameNr > _frameAmount){ _frameNr = _frameAmount; }; draw(); } public function prevFrame():void{ if (_isPlaying){ stop(); }; _frameNr--; if (_frameNr < 1){ _frameNr = 1; }; draw(); } private function playForward(_arg1:TimerEvent=null):void{ _frameNr++; if (_frameNr > _frameAmount){ _frameNr = 1; } else { if (_frameNr < 1){ _frameNr = _frameAmount; }; }; draw(); } private function draw():void{ dispatchEvent(new FrameEvent(FrameEvent.ENTER)); _rect = new Rectangle((((_frameNr - 1) % _wCount) * width), (int(((_frameNr - 1) / _wCount)) * height), width, height); bitmapData.copyPixels(_buffer, _rect, _point); } public function destroy():void{ stop(); _timer = null; _buffer = null; } } }//package com.hexagonstar.display.bitmaps
Section 89
//FrameRateTimer (com.hexagonstar.display.FrameRateTimer) package com.hexagonstar.display { import flash.utils.*; public class FrameRateTimer extends Timer { private var _fps:int; public function FrameRateTimer(_arg1:int=-1){ _fps = ((_arg1)>-1) ? _arg1 : 24; super(Math.round((1000 / _fps)), 0); start(); } public function getFrameRate():int{ return (_fps); } } }//package com.hexagonstar.display
Section 90
//IAnimatedDisplayObject (com.hexagonstar.display.IAnimatedDisplayObject) package com.hexagonstar.display { public interface IAnimatedDisplayObject { function setFrameRateTimer(_arg1:FrameRateTimer):void; function getFrameRate():int; function getCurrentFrame():int; function getTotalFrames():int; function isPlaying():Boolean; function play():void; function stop():void; function gotoAndPlay(_arg1:int):void; function gotoAndStop(_arg1:int):void; function nextFrame():void; function prevFrame():void; } }//package com.hexagonstar.display
Section 91
//FrameEvent (com.hexagonstar.env.event.FrameEvent) package com.hexagonstar.env.event { import flash.events.*; public class FrameEvent extends Event { public static const ENTER:String = "enter"; public function FrameEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } } }//package com.hexagonstar.env.event
Section 92
//AwardsService (com.spilgames.api.AwardsService) package com.spilgames.api { public class AwardsService { public static function submitAward(_arg1:String, _arg2:Function=null):int{ return (SpilGamesServices.getInstance().send("Awards", "submitAward", _arg2, {tag:_arg1, userName:User.getUserName(), userHash:User.getUserHash()})); } } }//package com.spilgames.api
Section 93
//ScoreService (com.spilgames.api.ScoreService) package com.spilgames.api { public class ScoreService { public static function submitScore(_arg1:int, _arg2:Function=null):int{ return (SpilGamesServices.getInstance().send("Score", "submitScore", _arg2, {score:_arg1, userName:User.getUserName(), userHash:User.getUserHash()})); } } }//package com.spilgames.api
Section 94
//SpilGamesServices (com.spilgames.api.SpilGamesServices) package com.spilgames.api { import flash.events.*; import flash.net.*; import flash.display.*; import flash.system.*; import flash.utils.*; public class SpilGamesServices extends MovieClip { private const DEFAULT_CONNECTION_LOCATION:String = "http://www8.agame.com/games/flash/services/ServicesConnection.swf"; private var _servicesConnection;// = null private var _loader:Loader; private var _connecting:Boolean;// = false private var _connected:Boolean;// = false private var _request:URLRequest; private var _numConnectionLoadTries:uint;// = 0 private var _alwaysInFront:Boolean;// = false private var currentDelay:Number;// = 0 private var previousFrameTime:Number; public static const INVALID_ID:int = -1; public static const INVALID_DOMAIN:String = "invalidDomain"; public static const CONFIGURATION_FAILED:String = "configurationFailure"; private static const MAX_CONNECTION_LOAD_RETRIES:uint = 99; private static var _instance:SpilGamesServices = null; public function SpilGamesServices(_arg1:Private=null){ if (!(_arg1)){ throw (new Error("Cannot instantiate this class, use SpilGamesServices.getInstance")); }; } public function get version():String{ return ("1.1"); } public function get connecting():Boolean{ return (_connecting); } public function get connection(){ return (_servicesConnection); } public function set alwaysInFront(_arg1:Boolean):void{ if (_alwaysInFront != _arg1){ _alwaysInFront = _arg1; if (_alwaysInFront){ addEventListener(Event.ENTER_FRAME, bringToFront); } else { removeEventListener(Event.ENTER_FRAME, bringToFront); }; }; } public function get alwaysInFront():Boolean{ return (_alwaysInFront); } public function connect(_arg1:DisplayObjectContainer, ... _args):void{ var _local3:String; var _local4:URLVariables; var _local5:Date; if (((!(_connecting)) && (!(_connected)))){ if (!(_arg1.stage)){ throw (new Error("The given clip must be present in the display list (added to stage)")); }; _connecting = true; _arg1.stage.addChild(this); addEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage); if (((root.loaderInfo.parameters["servicesLoc"]) && ((root.loaderInfo.parameters["servicesLoc"].length > 0)))){ _local3 = root.loaderInfo.parameters["servicesLoc"]; _request = new URLRequest(_local3); } else { _local3 = DEFAULT_CONNECTION_LOCATION; _local4 = new URLVariables(); _local5 = new Date(); _local4.nocache = ((((_local5.fullYear * 12) + (_local5.month + 1)) * 31) + _local5.day); _request = new URLRequest(_local3); _request.data = _local4; }; allowDomain(_local3); _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(Event.COMPLETE, handleLoadComplete); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, handleIOError); _loader.load(_request); }; } public function disconnect():void{ if (_servicesConnection){ _servicesConnection.removeEventListener(Event.COMPLETE, handleServicesReady); _servicesConnection.removeEventListener(ErrorEvent.ERROR, handleServicesFailed); _servicesConnection.removeEventListener("serviceError", handleServiceError); if (_connected){ _servicesConnection.disconnect(); }; removeChild(_servicesConnection); }; _servicesConnection = null; if (_loader){ try { _loader.close(); } catch(e:Error) { } finally { _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete); _loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError); }; _loader = null; }; removeEventListener(Event.ENTER_FRAME, bringToFront); removeEventListener(Event.REMOVED_FROM_STAGE, handleRemovedFromStage); if (parent){ parent.removeChild(this); }; _connected = (_connecting = false); } public function getChannelID():int{ if (_servicesConnection != null){ return (_servicesConnection.getChannelID()); }; return (INVALID_ID); } public function getSiteID():int{ if (_servicesConnection != null){ return (_servicesConnection.getSiteID()); }; return (INVALID_ID); } public function getItemID():int{ if (_servicesConnection != null){ return (_servicesConnection.getItemID()); }; return (INVALID_ID); } public function isReady():Boolean{ return (((!((_servicesConnection == null))) && (_servicesConnection.isReady()))); } public function isDomainAllowed():Boolean{ return (((!((_servicesConnection == null))) && (_servicesConnection.isDomainValid()))); } public function isServiceAvailable(_arg1:String):Boolean{ return (((isReady()) && (_servicesConnection.isServiceAvailable(_arg1)))); } public function send(_arg1:String, _arg2:String, _arg3:Function, _arg4:Object=null):int{ if (isReady()){ return (_servicesConnection.send(_arg1, _arg2, _arg3, _arg4)); }; return (INVALID_ID); } public function bringToFront(_arg1:Event=null):void{ var e = _arg1; if (parent){ try { parent.setChildIndex(this, (parent.numChildren - 1)); } catch(e:Error) { removeEventListener(Event.ENTER_FRAME, bringToFront); }; }; } public function allowDomain(_arg1:String):void{ Security.allowDomain("*"); Security.allowInsecureDomain("*"); } private function handleRemovedFromStage(_arg1:Event):void{ trace("WARNING: please do not remove SpilGamesServices from the stage"); } private function handleLoadComplete(_arg1:Event):void{ _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete); _loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError); _servicesConnection = LoaderInfo(_arg1.target).content; _servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady); _servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed); _servicesConnection.addEventListener("serviceError", handleServiceError); addChild(_servicesConnection); } private function handleIOError(_arg1:IOErrorEvent):void{ _numConnectionLoadTries++; if (_numConnectionLoadTries > MAX_CONNECTION_LOAD_RETRIES){ _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete); _loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError); _connecting = false; trace("ERROR: SpilGamesServices failed to load the connection object"); if (hasEventListener(_arg1.type)){ dispatchEvent(_arg1); }; } else { trace(("WARN: SpilGamesServices failed to load the connection object, retry #" + _numConnectionLoadTries)); previousFrameTime = getTimer(); addEventListener(Event.ENTER_FRAME, updateConnectionRetry); }; } private function updateConnectionRetry(_arg1:Event):void{ var _local2:Number = getTimer(); var _local3:Number = ((_local2 - previousFrameTime) / 1000); currentDelay = (currentDelay + _local3); if (currentDelay >= 2){ trace(("WARN: SpilGamesServices trying to reconnect after: " + currentDelay)); _loader.load(_request); removeEventListener(Event.ENTER_FRAME, updateConnectionRetry); currentDelay = 0; }; previousFrameTime = _local2; } private function handleServicesReady(_arg1:Event):void{ _loader.contentLoaderInfo.removeEventListener(Event.COMPLETE, handleLoadComplete); _loader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, handleIOError); _connected = true; _connecting = false; dispatchEvent(new Event("servicesReady")); } private function handleServicesFailed(_arg1:ErrorEvent):void{ _servicesConnection.addEventListener(Event.COMPLETE, handleServicesReady); _servicesConnection.addEventListener(ErrorEvent.ERROR, handleServicesFailed); _servicesConnection.addEventListener("serviceError", handleServiceError); _connecting = false; if (hasEventListener("servicesFailed")){ dispatchEvent(new ErrorEvent("servicesFailed", false, false, _arg1.text)); }; } private function handleServiceError(_arg1:Event):void{ var _local2:String; if (hasEventListener("serviceError")){ _local2 = ""; if ((_arg1 is ErrorEvent)){ _local2 = ErrorEvent(_arg1).text; } else { _local2 = _arg1.toString(); }; dispatchEvent(new ErrorEvent("serviceError", false, false, _local2)); }; } public static function getInstance():SpilGamesServices{ if (!(_instance)){ _instance = new SpilGamesServices(new Private()); }; return (_instance); } } }//package com.spilgames.api class Private { private function Private(){ } }
Section 95
//User (com.spilgames.api.User) package com.spilgames.api { import flash.display.*; public class User { public static function isGuest():Boolean{ var _local2:DisplayObject; var _local3:Object; var _local1:* = SpilGamesServices.getInstance().connection; if (_local1 != null){ return (_local1.isGuest()); }; _local2 = SpilGamesServices.getInstance().root; if (_local2.loaderInfo != null){ _local3 = _local2.loaderInfo.parameters; return (((((((!(_local3.username)) || ((_local3.username == "")))) || (!(_local3.hash)))) || ((_local3.hash == "")))); }; return (false); } public static function getUserName():String{ var _local1:* = SpilGamesServices.getInstance().connection; if (_local1 != null){ return (_local1.getUserName()); }; return (""); } public static function getUserHash():String{ var _local1:* = SpilGamesServices.getInstance().connection; if (_local1 != null){ return (_local1.getUserHash()); }; return (""); } } }//package com.spilgames.api
Section 96
//Actor (com.tinime.actors.Actor) package com.tinime.actors { import Box2D.Dynamics.*; import flash.display.*; import com.tinime.data.*; import flash.geom.*; import flash.events.*; public class Actor extends EventDispatcher { public var isAlive:Boolean;// = true protected var _body:b2Body; protected var _costume:DisplayObjectContainer; public function Actor(_arg1:b2Body, _arg2:DisplayObjectContainer){ _body = _arg1; _body.SetUserData(this); _costume = _arg2; updateMyLook(); } public function update():void{ if (!(_body.IsStatic())){ updateMyLook(); childSpecificUpdate(); }; } public function destroy():void{ isAlive = false; cleanUpBeforeRemoving(); _costume.parent.removeChild(_costume); PhysicsVals.world.DestroyBody(_body); _body = null; _costume = null; } public function getCostumeLoc():Point{ return (new Point(_costume.x, _costume.y)); } protected function cleanUpBeforeRemoving():void{ } protected function childSpecificUpdate():void{ } protected function updateMyLook():void{ _costume.x = (_body.GetPosition().x * PhysicsVals.RATIO); _costume.y = (_body.GetPosition().y * PhysicsVals.RATIO); _costume.rotation = ((_body.GetAngle() * 180) / Math.PI); } public function get body():b2Body{ return (_body); } public function set body(_arg1:b2Body):void{ _body = _arg1; } public function get costume():DisplayObjectContainer{ return (_costume); } public function set costume(_arg1:DisplayObjectContainer):void{ _costume = _arg1; } } }//package com.tinime.actors
Section 97
//AnimalActor (com.tinime.actors.AnimalActor) package com.tinime.actors { import com.tinime.event.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.display.*; import com.tinime.control.*; import com.tinime.view.*; import flash.geom.*; import flash.events.*; import Box2D.Dynamics.Contacts.*; import Box2D.Common.Math.*; import Box2D.Collision.Shapes.*; import com.hexagonstar.display.bitmaps.*; import Box2D.Collision.*; import com.tinime.interfaces.*; public class AnimalActor extends Actor implements Liftable, LevelDataRecordable { protected var _walkDir:Number; protected var _flipCount:int;// = 0 protected var _scale:Number; protected var _isStopped:Boolean;// = false protected var _originBodyDensity:Number; protected var _originWheelDensity:Number; protected var _curMass:Number; protected var _isFalling:Boolean;// = false protected var _deadAnim:MovieClip; protected var _gameEventDispatcher:GameEventDispatcher; protected var _isMovable:Boolean; protected var _animatedBitmap:AnimatedBitmap; protected var _walkSprite:Sprite; protected var _halfWidth:Number; public var isLifted:Boolean;// = false public var waitToDie:Boolean;// = false public var isAbsorbing:Boolean;// = false private var _tweenTime:Number; private var _moveForce:Number; private var _recordNum:int; private var _prevX:Number; private var _checkXPosCount:int; public function AnimalActor(_arg1:b2Body, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){ _gameEventDispatcher = GameEventDispatcher.getInstance(); _halfWidth = _arg6; _moveForce = _arg5; _isMovable = true; _originBodyDensity = _arg3; _scale = _arg4; _arg1.GetShapeList().m_filter.categoryBits = PhysicsVals.NPC_CATAGORY; _arg1.GetShapeList().m_filter.maskBits = (((((PhysicsVals.BOMB_CATAGORY | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.UFO_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.TUNNEL_BLOCK); super(_arg1, _arg2); if (_costume.scaleX < 0){ _walkDir = -1; } else { _walkDir = 1; }; _prevX = _arg2.x; } public function contactCar():void{ if (!(isLifted)){ _isMovable = false; _animatedBitmap.gotoAndStop(1); }; } public function die():void{ if (_deadAnim != null){ return; }; if (isLifted){ LevelController._ufo.removeLiftedObject(); }; isAlive = false; var _local1:Camera = Camera.getInstance(); _local1.isCameraLocked = true; CommonVals.gameLocked = true; CommonVals.gamePaused = true; _deadAnim = getDeadMc(); _deadAnim.x = _costume.x; _deadAnim.y = _costume.y; _deadAnim.scaleX = _costume.scaleX; _deadAnim.scaleY = _costume.scaleY; _deadAnim.rotation = 0; _costume.visible = false; _costume.parent.addChild(_deadAnim); _deadAnim.gotoAndStop(1); _tweenTime = (Math.sqrt((Math.pow(((-(_local1.frontLayer.x) + (CommonVals.STAGE_WIDTH * 0.5)) - _costume.x), 2) + Math.pow(((-(_local1.frontLayer.y) + (CommonVals.STAGE_HEIGHT * 0.5)) - _costume.y), 2))) / 400); if (_tweenTime > 0.5){ _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); _local1.tweenTo(new Point((_costume.x - (CommonVals.STAGE_WIDTH * 0.5)), (_costume.y - (CommonVals.STAGE_HEIGHT * 0.5))), 1); } else { _gameEventDispatcher.onTweenComplete(); _deadAnim.addEventListener(Event.ENTER_FRAME, onDeadAnim); _deadAnim.gotoAndPlay(1); SoundManager.playCowScream(); }; } protected function getDeadMc():MovieClip{ return (null); } private function onTweenComplete(_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); _costume.parent.addChild(_deadAnim); _deadAnim.addEventListener(Event.ENTER_FRAME, onDeadAnim); _deadAnim.gotoAndPlay(1); SoundManager.playCowScream(); } public function getLiftable():Boolean{ if (((!((_deadAnim == null))) || (isAbsorbing))){ return (false); }; return (true); } private function onDeadAnim(_arg1:Event):void{ if (_deadAnim.currentFrame == _deadAnim.totalFrames){ _deadAnim.removeEventListener(Event.ENTER_FRAME, onDeadAnim); _deadAnim.parent.removeChild(_deadAnim); if ((this is CowActor)){ _gameEventDispatcher.onCowDead(); } else { if (_tweenTime > 0.5){ _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, onTweenBack); Camera.getInstance().tweenTo(new Point((LevelController._ufo.costume.x - 320), (LevelController._ufo.costume.y - 240)), _tweenTime); } else { Camera.getInstance().isCameraLocked = false; CommonVals.gameLocked = false; CommonVals.gamePaused = false; ActorsManager.getInstance().remove(this); }; }; }; } private function onTweenBack(_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenBack); Camera.getInstance().isCameraLocked = false; CommonVals.gameLocked = false; CommonVals.gamePaused = false; ActorsManager.getInstance().remove(this); } public function getMass():Number{ return (_body.GetMass()); } public function getBody():b2Body{ return (_body); } public function getPos():Point{ return (new Point(_costume.x, _costume.y)); } public function getLiftHeight():Number{ return (0); } public function prepareLiftStatus():void{ _curMass = _body.GetMass(); setLightWeight(); _animatedBitmap.play(); } public function restoreOriginStatus():void{ restoreMove(); restoreWeight(); } private function setLightWeight():void{ var _local1:Number = 0.001; _body.GetShapeList().m_density = _local1; _body.SetMassFromShapes(); _curMass = _body.GetMass(); } private function restoreWeight():void{ body.GetShapeList().m_density = _originBodyDensity; _body.SetMassFromShapes(); _curMass = _body.GetMass(); } public function stopMove():void{ _isStopped = true; isLifted = true; } protected function restoreMove():void{ _isStopped = false; isLifted = false; var _local1:DisplayObjectContainer = _costume.parent; var _local2:Number = _local1.getChildIndex(_costume); _local1.removeChild(_costume); _walkSprite.x = _costume.x; _walkSprite.y = _costume.y; _local1.addChildAt(_walkSprite, _local2); _costume = _walkSprite; } public function setFalling():void{ _isFalling = true; } private function move():void{ var _local1:b2ContactEdge; var _local2:Boolean; if (!(_isMovable)){ _local1 = _body.m_contactList; _local2 = false; while (_local1 != null) { if ((_local1.other.GetUserData() is CarActor)){ return; }; _local1 = _local1.next; }; _isMovable = true; _animatedBitmap.play(); }; if (Math.abs(_body.GetLinearVelocity().x) > (20 / PhysicsVals.RATIO)){ return; }; if (_walkDir == 1){ _costume.scaleX = _scale; _body.ApplyForce(new b2Vec2((_body.m_mass * _moveForce), 0), _body.GetWorldCenter()); } else { _body.ApplyForce(new b2Vec2((-(_body.m_mass) * _moveForce), 0), _body.GetWorldCenter()); _costume.scaleX = -(_scale); }; } override protected function childSpecificUpdate():void{ var _local1:b2MassData; var _local2:b2ContactEdge; var _local3:Boolean; var _local4:Number; var _local5:Number; if (waitToDie){ ActorsManager.getInstance().remove(this); return; }; if (((!((_deadAnim == null))) && (!((_body.m_mass == 0))))){ _local1 = new b2MassData(); _local1.mass = 0; _body.SetMass(_local1); _body.AllowSleeping(true); _body.PutToSleep(); _animatedBitmap.stop(); }; if (_body.m_mass == 0){ return; }; if (_isMovable){ _body.m_sweep.a = 0; }; if (_isStopped){ return; }; if (_isFalling){ _local2 = _body.m_contactList; _local3 = false; while (_local2 != null) { if (((!((_local2.other.GetUserData() is UfoActor))) && (!((_local2.other.GetUserData() is HaloActor))))){ _local3 = true; break; }; _local2 = _local2.next; }; if (_local3){ _isFalling = false; _flipCount = 0; move(); } else { return; }; } else { if ((this is CowActor)){ _local4 = (_costume.y + 20); } else { _local4 = (_costume.y - 3); }; if (_walkDir > 0){ _local5 = ((_costume.x + _halfWidth) + 5); } else { _local5 = ((_costume.x - _halfWidth) - 5); }; if (checkIfContactBlockAtPos(_local5, _local4)){ if (++_flipCount > 10){ _checkXPosCount = 0; _flipCount = 0; _walkDir = (_walkDir * -1); }; } else { if ((((Math.abs((_prevX - _costume.x)) < 0.1)) && ((++_checkXPosCount > 30)))){ _checkXPosCount = 0; _walkDir = (_walkDir * -1); }; }; move(); _prevX = _costume.x; }; } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.destroy(); _animatedBitmap = null; } public function setRecordNum(_arg1:int):void{ _recordNum = _arg1; } public function getRecordNum():int{ return (_recordNum); } public function get animatedBitmap():AnimatedBitmap{ return (_animatedBitmap); } public function set animatedBitmap(_arg1:AnimatedBitmap):void{ _animatedBitmap = _arg1; } private function checkIfContactBlockAtPos(_arg1:Number, _arg2:Number):Boolean{ var _local10:b2Shape; var _local11:Object; var _local12:Boolean; var _local3:b2Vec2 = new b2Vec2((_arg1 / PhysicsVals.RATIO), (_arg2 / PhysicsVals.RATIO)); var _local4:b2AABB = new b2AABB(); _local4.lowerBound.Set((_local3.x - 0.001), (_local3.y - 0.001)); _local4.upperBound.Set((_local3.x + 0.001), (_local3.y + 0.001)); var _local5:int = 10; var _local6:Array = new Array(); var _local7:int = PhysicsVals.world.Query(_local4, _local6, _local5); var _local8:b2Body; var _local9:int; while (_local9 < _local7) { _local10 = (_local6[_local9] as b2Shape); _local11 = _local10.GetBody().GetUserData(); if ((((((((((((((((((((_local11 is int)) && ((_local11 == CommonVals.LASER_BEAM)))) || ((_local11 is StarTokenActor)))) || ((_local11 is TeleTransmissionActor)))) || ((_local11 is AnimalActor)))) || ((_local11 is FloatBombActor)))) || ((_local11 is HiddenBlockActor)))) || ((_local11 is TriggerActor)))) || ((_local11 is KeyActor)))) || ((_local11 is SpinyBallActor)))){ } else { _local12 = _local10.TestPoint(_local10.m_body.GetXForm(), _local3); if (_local12){ return (true); }; }; _local9++; }; return (false); } } }//package com.tinime.actors
Section 98
//AnimalCarSpawner (com.tinime.actors.AnimalCarSpawner) package com.tinime.actors { import Box2D.Dynamics.*; import com.tinime.data.*; import flash.display.*; import flash.geom.*; import com.tinime.control.*; import com.tinime.interfaces.*; public class AnimalCarSpawner extends Actor implements Triggered { private var _parent:DisplayObjectContainer; private var _location:Point; private var _animalType:int; private var _waitTime:Number; private var _watiTimeCount:Number; private var _carSpeed:Number; private var _isTriggered:Boolean; private var _isGenerated:Boolean; public function AnimalCarSpawner(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:int, _arg4:Number, _arg5:Number){ _parent = _arg1; _location = _arg2; _animalType = _arg3; _waitTime = _arg4; _carSpeed = _arg5; _isTriggered = false; _isGenerated = false; _watiTimeCount = 0; var _local6:b2BodyDef = new b2BodyDef(); _body = PhysicsVals.world.CreateBody(_local6); super(_body, new Sprite()); } public function onTriggered():void{ _isTriggered = true; } override public function update():void{ if (_isGenerated){ return; }; if (_isTriggered){ if (_watiTimeCount < _waitTime){ _watiTimeCount++; } else { generateAnimalCar(); }; }; } private function generateAnimalCar():void{ var _local2:Point; var _local3:Number; var _local5:CowActor; var _local6:CatActor; var _local7:DogActor; _isGenerated = true; var _local1:ActorsManager = ActorsManager.getInstance(); _local2 = new Point(_location.x, (_location.y - 20)); _local3 = (_carSpeed / Math.abs(_carSpeed)); switch (_animalType){ case CommonVals.COW: _local5 = new CowActor(_parent, _local2, (1 * _local3)); _local1.add(_local5); break; case CommonVals.CAT: _local6 = new CatActor(_parent, _local2, (1 * _local3)); _local1.add(_local6); break; case CommonVals.DOG: _local7 = new DogActor(_parent, _local2, (1 * _local3)); _local1.add(_local7); break; default: break; }; var _local4:CarActor = new CarActor(_parent, _location, _carSpeed); _local1.add(_local4); } override public function destroy():void{ PhysicsVals.world.DestroyBody(_body); } } }//package com.tinime.actors
Section 99
//BreakableSquareActor (com.tinime.actors.BreakableSquareActor) package com.tinime.actors { import com.tinime.control.*; import flash.geom.*; import flash.display.*; import Box2D.Common.Math.*; import com.tinime.interfaces.*; public class BreakableSquareActor extends Actor implements Explosive { private var _waitToEjectDebris:Boolean;// = false private var _setAlpha:Boolean;// = false public function BreakableSquareActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number){ var _local5:Sprite = Box2dObjSpawner.buildBitmapSprite(_arg1, new BreakableSquareSprLib(), _arg2, _arg3, new Point(45, 44), new Point(0, 0), _arg4); _body = Box2dObjSpawner.buildBody([[0, 0], [42, 0], [42, 42], [0, 42]], this, _arg2, 0, 0.7, 0, _arg3, _arg4); super(_body, _local5); } public function explode():void{ _waitToEjectDebris = true; _setAlpha = true; } override public function update():void{ if (_waitToEjectDebris){ _body.GetShapeList().m_isSensor = true; _waitToEjectDebris = false; ejectDebris(); ScoreManager.addScore(50, new Point(_costume.x, (_costume.y - 10))); }; if (_setAlpha){ if (_costume.alpha > 0.1){ _costume.alpha = (_costume.alpha - 0.05); } else { ActorsManager.getInstance().remove(this); }; }; } private function ejectDebris():void{ var _local3:DebrisActor; var _local1:Number = ((Math.ceil(Math.random()) * 3) + 2); var _local2:int; while (_local2 < _local1) { _local3 = new DebrisActor(_costume.parent, new Point(((_costume.x + (Math.random() * 6)) - 3), ((_costume.y + (Math.random() * 6)) - 3))); _local3.body.ApplyImpulse(new b2Vec2((((Math.random() * 6) - 3) * _local3.body.m_mass), (-(((Math.random() * 5) + 2)) * _local3.body.m_mass)), _local3.body.GetWorldCenter()); _local2++; }; } } }//package com.tinime.actors
Section 100
//BumperActor (com.tinime.actors.BumperActor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.geom.*; import com.tinime.control.*; import flash.events.*; import com.hexagonstar.display.bitmaps.*; public class BumperActor extends Actor { private var _animatedBitmap:AnimatedBitmap; private var _touchAnim:MovieClip; private var _scale:Number; public function BumperActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ var _local4:b2CircleDef; _costume = new Sprite(); _costume.x = _arg2.x; _costume.y = _arg2.y; switch (_arg3){ case 1: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.BUMPER); break; case 0.53: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.BUMPER_53); break; default: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.BUMPER); break; }; _animatedBitmap.x = (-36 * _arg3); _animatedBitmap.y = (-36 * _arg3); _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); _scale = _arg3; _local4 = new b2CircleDef(); _local4.radius = ((30 * _arg3) / PhysicsVals.RATIO); _local4.density = 0; _local4.restitution = 4; var _local5:b2BodyDef = new b2BodyDef(); _local5.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _body = PhysicsVals.world.CreateBody(_local5); _body.CreateShape(_local4); _body.SetMassFromShapes(); _body.GetShapeList().m_filter.categoryBits = PhysicsVals.TUNNEL_BLOCK; _body.GetShapeList().m_filter.maskBits = (((PhysicsVals.BOMB_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); super(_body, _costume); } public function touch():void{ if (_touchAnim != null){ return; }; SoundManager.playBumperHit(); _touchAnim = new BumperHittedMcLib(); _touchAnim.x = _costume.x; _touchAnim.y = _costume.y; _touchAnim.scaleX = _scale; _touchAnim.scaleY = _scale; var _local1:int = _costume.parent.getChildIndex(_costume); _costume.parent.addChildAt(_touchAnim, _local1); _costume.visible = false; _touchAnim.addEventListener(Event.ENTER_FRAME, onTouchAnimEnterFrame); _touchAnim.gotoAndPlay(1); } private function onTouchAnimEnterFrame(_arg1:Event):void{ if (_touchAnim.currentFrame == _touchAnim.totalFrames){ _costume.visible = true; _touchAnim.removeEventListener(Event.ENTER_FRAME, onTouchAnimEnterFrame); _touchAnim.parent.removeChild(_touchAnim); _touchAnim = null; }; } override protected function cleanUpBeforeRemoving():void{ if (_touchAnim != null){ _touchAnim.removeEventListener(Event.ENTER_FRAME, onTouchAnimEnterFrame); _touchAnim.parent.removeChild(_touchAnim); _touchAnim = null; }; _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 101
//CannonActor (com.tinime.actors.CannonActor) package com.tinime.actors { import com.tinime.control.*; import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import flash.geom.*; import flash.events.*; import Box2D.Common.Math.*; import com.hexagonstar.display.bitmaps.*; public class CannonActor extends Actor { private var _fireForce:Object; private var _fireTimeInterval:Number; private var _timeCount:Number;// = 0 private var _scale:Number; private var _cannonMuzzlePos:Point; private var _cannonBallExplodeTime:Number; private var _animatedBitmap:AnimatedBitmap; private var _actorsManager:ActorsManager; public function CannonActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Object, _arg6:Number, _arg7:Number){ _actorsManager = ActorsManager.getInstance(); _costume = new Sprite(); _costume.x = _arg2.x; _costume.y = _arg2.y; _costume.rotation = _arg4; switch (_arg3){ case 0.6: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.CANNON_60); break; case 1: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.CANNON); break; case 1.5: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.CANNON_150); break; default: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.CANNON); break; }; _animatedBitmap.x = (-43 * _arg3); _animatedBitmap.y = (-97 * _arg3); _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); _animatedBitmap.gotoAndStop(1); _body = Box2dObjSpawner.buildBody([[6, -24], [92, -22], [89, 15], [14, 26], [-10, 5], [-8, -14]], this, _arg2, 0, 0.7, 0, _arg3, _arg4); _fireForce = _arg5; _fireTimeInterval = _arg6; _scale = _arg3; _cannonBallExplodeTime = _arg7; super(_body, _costume); _cannonMuzzlePos = new Point(); _cannonMuzzlePos.x = (((101 * _arg3) * Math.cos(((_arg4 * Math.PI) / 180))) + _arg2.x); _cannonMuzzlePos.y = (((101 * _arg3) * Math.sin(((_arg4 * Math.PI) / 180))) + _arg2.y); } override public function update():void{ _timeCount++; if (_timeCount > _fireTimeInterval){ _timeCount = 0; spawnACannonBall(); }; } private function spawnACannonBall():void{ var _local5:Number; if (_animatedBitmap.isPlaying()){ return; }; _animatedBitmap.gotoAndPlay(2); _animatedBitmap.addEventListener(Event.ENTER_FRAME, onAnimEnterFrame); var _local1:Number = (-(Camera.getInstance().frontLayer.x) - 150); var _local2:Number = ((_local1 + CommonVals.STAGE_WIDTH) + 300); var _local3:Number = (-(Camera.getInstance().frontLayer.y) - 150); var _local4:Number = ((_local3 + CommonVals.STAGE_HEIGHT) + 300); if ((((((((_costume.x > _local1)) && ((_costume.x < _local2)))) && ((_costume.y > _local3)))) && ((_costume.y < _local4)))){ SoundManager.playCannon(); }; if ((_fireForce is Number)){ _local5 = Number(_fireForce); } else { if ((_fireForce is Array)){ _local5 = ((Math.random() * (_fireForce[1] - _fireForce[0])) + _fireForce[0]); }; }; var _local6:CannonBallActor = new CannonBallActor(_costume.parent, _cannonMuzzlePos, _scale, _costume.rotation, _cannonBallExplodeTime); _local6.body.ApplyImpulse(new b2Vec2((_local5 * Math.cos(_body.GetAngle())), (_local5 * Math.sin(_body.GetAngle()))), _local6.body.GetWorldCenter()); _actorsManager.add(_local6); } private function onAnimEnterFrame(_arg1:Event):void{ if (_animatedBitmap.getCurrentFrame() == _animatedBitmap.getTotalFrames()){ _animatedBitmap.gotoAndStop(1); _animatedBitmap.removeEventListener(Event.ENTER_FRAME, onAnimEnterFrame); }; } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.removeEventListener(Event.ENTER_FRAME, onAnimEnterFrame); _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 102
//CannonBallActor (com.tinime.actors.CannonBallActor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import com.tinime.event.*; import com.tinime.control.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.display.*; import flash.geom.*; import Box2D.Common.Math.*; import flash.events.*; import com.tinime.view.*; import Box2D.Dynamics.Contacts.*; import com.tinime.interfaces.*; public class CannonBallActor extends Actor implements Liftable, Explosive { private var _explodeTime:Number; private var _explodeCount:Number;// = 0 private var _isPrepareExplosion:Boolean;// = false private var _waiteToCreateExplosionCircle:Boolean;// = false private var _explosionAnim:MovieClip; private var _scale:Number; private var _explosionCircle:b2Body; private var _gameEventDispatcher:GameEventDispatcher; public var _immediateExplode:Boolean;// = false private var _cannonBallParticle:MovieClip; private var _explodePos:b2Vec2; public function CannonBallActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number){ var _local6:b2CircleDef; _gameEventDispatcher = GameEventDispatcher.getInstance(); _explodeTime = _arg5; _costume = Box2dObjSpawner.buildCostume(_arg1, new CannonBallMcLib(), _arg2, _arg3, _arg4); _scale = _arg3; _local6 = new b2CircleDef(); _local6.radius = ((15 * _arg3) / PhysicsVals.RATIO); _local6.density = 10; _local6.friction = 0.7; _local6.restitution = 0.4; _local6.filter.categoryBits = PhysicsVals.BOMB_CATAGORY; _local6.filter.maskBits = ((((((PhysicsVals.BOMB_CATAGORY | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.NPC_CATAGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.TUNNEL_BLOCK) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.UFO_CATEGORY); var _local7:b2BodyDef = new b2BodyDef(); _local7.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _local7.angle = ((_arg4 * Math.PI) / 180); _body = PhysicsVals.world.CreateBody(_local7); _body.CreateShape(_local6); _body.SetMassFromShapes(); _body.AllowSleeping(false); super(_body, _costume); _cannonBallParticle = new CannonBallParticleMcLib(); _cannonBallParticle.x = 4.3; _cannonBallParticle.y = -19.6; _costume.addChild(_cannonBallParticle); } override public function update():void{ super.update(); _cannonBallParticle.rotation = -(_costume.rotation); if (_waiteToCreateExplosionCircle){ createExplosionCircle(); _body.GetShapeList().m_filter.maskBits = 0; _waiteToCreateExplosionCircle = false; return; }; if (_isPrepareExplosion){ if (_explosionCircle != null){ _explosionCircle.ApplyForce(new b2Vec2(0, (-(_explosionCircle.m_mass) * PhysicsVals.GRAVITY)), _explosionCircle.GetWorldCenter()); _explosionCircle.SetXForm(_explodePos, _explosionCircle.GetAngle()); }; return; }; _explodeCount++; if (_explodeCount > _explodeTime){ explode(); }; } private function createExplosionCircle():void{ _explodePos = new b2Vec2((_costume.x / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)); var _local1:b2CircleDef = new b2CircleDef(); _local1.radius = ((43 * _scale) / PhysicsVals.RATIO); _local1.density = 0.1; _local1.isSensor = true; var _local2:b2BodyDef = new b2BodyDef(); _local2.position.Set(_explodePos.x, _explodePos.y); _explosionCircle = PhysicsVals.world.CreateBody(_local2); _explosionCircle.CreateShape(_local1); _explosionCircle.SetMassFromShapes(); _explosionCircle.ApplyForce(new b2Vec2(0, (-(_explosionCircle.m_mass) * PhysicsVals.GRAVITY)), _explosionCircle.GetWorldCenter()); _explosionCircle.SetXForm(_explodePos, _explosionCircle.GetAngle()); } override protected function cleanUpBeforeRemoving():void{ _costume.removeEventListener(Event.ENTER_FRAME, onEnterFrame); if (_explosionAnim != null){ _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _explosionAnim.parent.removeChild(_explosionAnim); }; if (_explosionCircle != null){ PhysicsVals.world.DestroyBody(_explosionCircle); }; _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); } public function explode():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; if (_isPrepareExplosion){ return; }; _isPrepareExplosion = true; if (_immediateExplode){ _local1 = (-(Camera.getInstance().frontLayer.x) - 100); _local2 = ((_local1 + CommonVals.STAGE_WIDTH) + 200); _local3 = (-(Camera.getInstance().frontLayer.y) - 100); _local4 = ((_local3 + CommonVals.STAGE_HEIGHT) + 200); if ((((((((_costume.x > _local1)) && ((_costume.x < _local2)))) && ((_costume.y > _local3)))) && ((_costume.y < _local4)))){ SoundManager.playExplosion(); }; isAlive = false; _explosionAnim = new FloatBombExplosion(); _explosionAnim.x = _costume.x; _explosionAnim.y = _costume.y; _explosionAnim.scaleX = _scale; _explosionAnim.scaleY = _scale; _costume.visible = false; _explosionAnim.rotation = _costume.rotation; _costume.parent.addChild(_explosionAnim); _explosionAnim.addEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _explosionAnim.gotoAndPlay(1); _waiteToCreateExplosionCircle = true; } else { _costume.addEventListener(Event.ENTER_FRAME, onEnterFrame); MovieClip(_costume).gotoAndPlay(5); }; } private function onEnterFrame(_arg1:Event):void{ var _local2:Number; var _local3:Number; var _local4:Number; var _local5:Number; if (MovieClip(_costume).currentFrame == MovieClip(_costume).totalFrames){ _costume.removeEventListener(Event.ENTER_FRAME, onEnterFrame); _local2 = ((-(Camera.getInstance().frontLayer.x) - 30) - _costume.width); _local3 = (((_local2 + CommonVals.STAGE_WIDTH) + 60) + (_costume.width * 2)); _local4 = ((-(Camera.getInstance().frontLayer.y) - 30) - _costume.height); _local5 = (((_local4 + CommonVals.STAGE_HEIGHT) + 60) + (_costume.height * 2)); if ((((((((_costume.x > _local2)) && ((_costume.x < _local3)))) && ((_costume.y > _local4)))) && ((_costume.y < _local5)))){ SoundManager.playExplosion(); }; isAlive = false; _explosionAnim = new FloatBombExplosion(); _explosionAnim.x = _costume.x; _explosionAnim.y = _costume.y; _explosionAnim.scaleX = _scale; _explosionAnim.scaleY = _scale; _costume.visible = false; _explosionAnim.rotation = _costume.rotation; _costume.parent.addChild(_explosionAnim); _explosionAnim.addEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _explosionAnim.gotoAndPlay(1); _waiteToCreateExplosionCircle = true; }; } public function getLiftable():Boolean{ if (_isPrepareExplosion){ return (false); }; return (true); } private function onExplosionEnterFrame(_arg1:Event):void{ var _local2:ActorsManager; var _local3:b2ContactEdge; var _local4:Object; if (_explosionAnim.currentFrame == _explosionAnim.totalFrames){ _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _explosionAnim.parent.removeChild(_explosionAnim); _explosionAnim = null; _local2 = ActorsManager.getInstance(); _local2.remove(this); } else { if ((((_explosionAnim.currentFrame == 3)) && (!((_explosionCircle == null))))){ _local3 = _explosionCircle.m_contactList; while (_local3 != null) { _local4 = _local3.other.GetUserData(); if ((_local4 is Explosive)){ Explosive(_local4).explode(); } else { if ((_local4 is AnimalActor)){ _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); _explosionAnim.gotoAndStop(4); AnimalActor(_local4).die(); }; }; _local3 = _local3.next; }; }; }; } private function onTweenComplete(_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); _explosionAnim.play(); } public function prepareLiftStatus():void{ var _local1:Number = 0.001; _body.GetShapeList().m_density = _local1; _body.SetMassFromShapes(); } public function restoreOriginStatus():void{ body.GetShapeList().m_density = 200; _body.SetMassFromShapes(); } public function getLiftHeight():Number{ return ((30 * _scale)); } public function getPos():Point{ return (new Point(_costume.x, _costume.y)); } public function stopMove():void{ } public function getBody():b2Body{ return (_body); } public function getMass():Number{ return (_body.m_mass); } public function setFalling():void{ } } }//package com.tinime.actors
Section 103
//CarActor (com.tinime.actors.CarActor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import com.tinime.control.*; import flash.geom.*; import flash.display.*; import com.tinime.data.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; public class CarActor extends Actor { private var _wheel1Body:b2Body; private var _wheel2Body:b2Body; private var _wheel1Costume:Sprite; private var _wheel2Costume:Sprite; private var _wheel1Joint:b2RevoluteJoint; private var _wheel2Joint:b2RevoluteJoint; private var _speed:Number; public function CarActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ var _local7:b2PolygonDef; _speed = _arg3; var _local4:Sprite = Box2dObjSpawner.buildBitmapSprite(_arg1, new CarBodySprLib(), _arg2, 1, new Point(96, 36), new Point(-48, -37), 0); var _local5:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-44, -12], [44, -12], [44, 0], [-44, 0]]); var _local6:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[36, -26], [44, -26], [44, 0], [36, 0]]); _local7 = Box2dObjSpawner.buildPolygonDef([[-44, -26], [-36, -26], [-36, 0], [-44, 0]]); _local5.filter.categoryBits = PhysicsVals.BOMB_CATAGORY; _local5.filter.maskBits = (((((PhysicsVals.NPC_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.BOMB_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); _local6.filter.categoryBits = PhysicsVals.BOMB_CATAGORY; _local6.filter.maskBits = (((((PhysicsVals.NPC_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.BOMB_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); _local7.filter.categoryBits = PhysicsVals.BOMB_CATAGORY; _local7.filter.maskBits = (((((PhysicsVals.NPC_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.BOMB_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); _local5.density = 200; _local6.density = 200; _local7.density = 200; var _local8:b2BodyDef = new b2BodyDef(); _local8.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); var _local9:b2Body = PhysicsVals.world.CreateBody(_local8); _local9.CreateShape(_local5); _local9.CreateShape(_local6); _local9.CreateShape(_local7); _local9.SetMassFromShapes(); var _local10:b2CircleDef = new b2CircleDef(); _local10.radius = (6 / PhysicsVals.RATIO); _local10.density = 1000; _local10.friction = 1; var _local11:b2BodyDef = new b2BodyDef(); _local11.position.Set(((_arg2.x - 22) / PhysicsVals.RATIO), ((_arg2.y - 3) / PhysicsVals.RATIO)); _wheel1Body = PhysicsVals.world.CreateBody(_local11); _wheel1Body.CreateShape(_local10); _wheel1Body.SetMassFromShapes(); _wheel1Costume = Box2dObjSpawner.buildBitmapSprite(_arg1, new CarWheelSprLib(), new Point((_arg2.x - 22), (_arg2.y - 1)), 1, new Point(18, 18), new Point(-9, -9), 0); var _local12:b2BodyDef = new b2BodyDef(); _local12.position.Set(((_arg2.x + 22) / PhysicsVals.RATIO), ((_arg2.y - 3) / PhysicsVals.RATIO)); _wheel2Body = PhysicsVals.world.CreateBody(_local12); _wheel2Body.CreateShape(_local10); _wheel2Body.SetMassFromShapes(); _wheel2Costume = Box2dObjSpawner.buildBitmapSprite(_arg1, new CarWheelSprLib(), new Point((_arg2.x - 22), (_arg2.y - 1)), 1, new Point(18, 18), new Point(-9, -9), 0); var _local13:b2RevoluteJointDef = new b2RevoluteJointDef(); if (_arg3 > 0){ _local13.Initialize(_local9, _wheel1Body, _wheel1Body.GetWorldCenter()); } else { _local13.Initialize(_wheel1Body, _local9, _wheel1Body.GetWorldCenter()); }; _local13.enableMotor = true; _local13.motorSpeed = 500; _local13.maxMotorTorque = Math.abs(_arg3); _wheel1Joint = (PhysicsVals.world.CreateJoint(_local13) as b2RevoluteJoint); var _local14:b2RevoluteJointDef = new b2RevoluteJointDef(); if (_arg3 > 0){ _local14.Initialize(_local9, _wheel2Body, _wheel2Body.GetWorldCenter()); } else { _local14.Initialize(_wheel2Body, _local9, _wheel2Body.GetWorldCenter()); }; _local14.enableMotor = true; _local14.motorSpeed = 500; _local14.maxMotorTorque = Math.abs(_arg3); _wheel2Joint = (PhysicsVals.world.CreateJoint(_local14) as b2RevoluteJoint); super(_local9, _local4); } override protected function updateMyLook():void{ _wheel1Costume.x = (_wheel1Body.GetPosition().x * PhysicsVals.RATIO); _wheel1Costume.y = (_wheel1Body.GetPosition().y * PhysicsVals.RATIO); _wheel1Costume.rotation = ((_wheel1Body.GetAngle() * 180) / Math.PI); _wheel2Costume.x = (_wheel2Body.GetPosition().x * PhysicsVals.RATIO); _wheel2Costume.y = (_wheel2Body.GetPosition().y * PhysicsVals.RATIO); _wheel2Costume.rotation = ((_wheel2Body.GetAngle() * 180) / Math.PI); super.updateMyLook(); } override protected function cleanUpBeforeRemoving():void{ PhysicsVals.world.DestroyJoint(_wheel1Joint); PhysicsVals.world.DestroyJoint(_wheel2Joint); PhysicsVals.world.DestroyBody(_wheel1Body); PhysicsVals.world.DestroyBody(_wheel2Body); _wheel1Costume.parent.removeChild(_wheel1Costume); _wheel2Costume.parent.removeChild(_wheel2Costume); } } }//package com.tinime.actors
Section 104
//CatActor (com.tinime.actors.CatActor) package com.tinime.actors { import com.tinime.view.*; import com.tinime.data.*; import flash.display.*; import com.tinime.control.*; import Box2D.Dynamics.*; import flash.geom.*; public class CatActor extends AnimalActor { public function CatActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ var _local4:Number; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.CAT); _local4 = Math.abs(_arg3); _animatedBitmap.x = -16; _animatedBitmap.y = -26; _walkSprite = new Sprite(); _walkSprite.x = _arg2.x; _walkSprite.y = _arg2.y; _walkSprite.scaleX = _arg3; _walkSprite.scaleY = _local4; _walkSprite.addChild(_animatedBitmap); _arg1.addChild(_walkSprite); var _local5:Number = 100; var _local6:b2Body = Box2dObjSpawner.buildBody([[-9, -9], [9, -9], [9, -1], [-9, -1]], this, _arg2, _local5, 0.5, 0, Math.abs(_arg3)); _halfWidth = 9; super(_local6, _walkSprite, _local5, _arg3, 25, _halfWidth); } override public function stopMove():void{ super.stopMove(); var _local1:MovieClip = new LiftedCatMcLib(); _local1.scaleX = _costume.scaleX; _local1.scaleY = _costume.scaleY; _local1.rotation = _costume.rotation; _local1.x = _costume.x; _local1.y = _costume.y; var _local2:DisplayObjectContainer = _costume.parent; var _local3:Number = _local2.getChildIndex(_costume); _local2.removeChild(_costume); _local2.addChildAt(_local1, _local3); _costume = _local1; } override public function getLiftHeight():Number{ return (20); } override protected function getDeadMc():MovieClip{ return (new CatDeadMcLib()); } } }//package com.tinime.actors
Section 105
//CowActor (com.tinime.actors.CowActor) package com.tinime.actors { import com.tinime.view.*; import com.tinime.data.*; import flash.display.*; import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import flash.geom.*; public class CowActor extends AnimalActor { public function CowActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ var _local4:Number; var _local5:Number; _local4 = 100; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.COW); _local5 = Math.abs(_arg3); _animatedBitmap.x = -51; _animatedBitmap.y = -34; _walkSprite = new Sprite(); _walkSprite.x = _arg2.x; _walkSprite.y = _arg2.y; _walkSprite.scaleX = _arg3; _walkSprite.scaleY = _local5; _walkSprite.addChild(_animatedBitmap); _arg1.addChild(_walkSprite); var _local6:b2PolygonDef = new b2PolygonDef(); _local6.vertexCount = 4; b2Vec2(_local6.vertices[0]).Set(((-33 * _local5) / PhysicsVals.RATIO), ((-24 * _local5) / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[1]).Set(((27 * _local5) / PhysicsVals.RATIO), ((-24 * _local5) / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[2]).Set(((27 * _local5) / PhysicsVals.RATIO), ((25 * _local5) / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[3]).Set(((-33 * _local5) / PhysicsVals.RATIO), ((25 * _local5) / PhysicsVals.RATIO)); _local6.density = _local4; _local6.friction = 0.5; _local6.restitution = 0; _halfWidth = ((27 + 33) / 2); var _local7:b2BodyDef = new b2BodyDef(); _local7.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); var _local8:b2Body = PhysicsVals.world.CreateBody(_local7); _local8.CreateShape(_local6); _local8.SetMassFromShapes(); super(_local8, _walkSprite, _local4, _local5, 25, _halfWidth); } override public function getLiftHeight():Number{ return (35); } override public function stopMove():void{ super.stopMove(); var _local1:MovieClip = new LiftedCowMcLib(); _local1.scaleX = _costume.scaleX; _local1.scaleY = _costume.scaleY; _local1.rotation = _costume.rotation; _local1.x = _costume.x; _local1.y = _costume.y; var _local2:DisplayObjectContainer = _costume.parent; var _local3:Number = _local2.getChildIndex(_costume); _local2.removeChild(_costume); _local2.addChildAt(_local1, _local3); _costume = _local1; } override protected function getDeadMc():MovieClip{ return (new CowDeadMcLib()); } } }//package com.tinime.actors
Section 106
//DebrisActor (com.tinime.actors.DebrisActor) package com.tinime.actors { import com.tinime.control.*; import flash.display.*; import flash.geom.*; import com.tinime.interfaces.*; public class DebrisActor extends Actor implements Explosive { private var prepareToExplode:Boolean;// = false private var waitCount:int;// = 80 private var waitTime:int;// = 0 public function DebrisActor(_arg1:DisplayObjectContainer, _arg2:Point){ var _local3:Number = Math.ceil((Math.random() * 4)); switch (_local3){ case 1: _costume = Box2dObjSpawner.buildCostume(_arg1, new Debris1SprLib(), _arg2); _body = Box2dObjSpawner.buildBody([[-6.8, 0.5], [-3.5, -4.1], [1.8, -6.5], [6.4, -3.6], [4.5, 4.6], [-2, 5.3]], this, _arg2, 2); break; case 2: _costume = Box2dObjSpawner.buildCostume(_arg1, new Debris2SprLib(), _arg2); _body = Box2dObjSpawner.buildBody([[-4.4, -1.5], [0, -4.5], [3.9, -2.3], [4, 2.4], [0.9, 4], [-4.3, 2.3]], this, _arg2, 2); break; case 3: _costume = Box2dObjSpawner.buildCostume(_arg1, new Debris3SprLib(), _arg2); _body = Box2dObjSpawner.buildBody([[-6.5, -0.8], [-3.4, -4.8], [2.3, -4.6], [6.3, -1.6], [6.5, 1], [2.1, 5.5], [-4.5, 5.3]], this, _arg2, 2); break; case 4: _costume = Box2dObjSpawner.buildCostume(_arg1, new Debris4SprLib(), _arg2); _body = Box2dObjSpawner.buildBody([[-3.6, -3.3], [4.4, -3.3], [4.4, 2.4], [1.1, 3.3], [-3.6, 2.8]], this, _arg2, 2); break; default: break; }; super(_body, _costume); ActorsManager.getInstance().add(this); } public function explode():void{ prepareToExplode = true; } override protected function childSpecificUpdate():void{ if (prepareToExplode){ if (_costume.alpha > 0.1){ _costume.alpha = (_costume.alpha * 0.7); } else { ActorsManager.getInstance().remove(this); }; } else { if (waitTime < waitCount){ waitTime++; } else { prepareToExplode = true; }; }; } } }//package com.tinime.actors
Section 107
//DogActor (com.tinime.actors.DogActor) package com.tinime.actors { import com.tinime.view.*; import com.tinime.data.*; import flash.display.*; import com.tinime.control.*; import Box2D.Dynamics.*; import flash.geom.*; public class DogActor extends AnimalActor { public function DogActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ var _local4:Number; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.DOG); _local4 = Math.abs(_arg3); _animatedBitmap.x = -29; _animatedBitmap.y = -33; _walkSprite = new Sprite(); _walkSprite.x = _arg2.x; _walkSprite.y = _arg2.y; _walkSprite.scaleX = _arg3; _walkSprite.scaleY = _local4; _walkSprite.addChild(_animatedBitmap); _arg1.addChild(_walkSprite); var _local5:Number = 100; var _local6:b2Body = Box2dObjSpawner.buildBody([[-16, -28], [16, -28], [16, -1], [-16, -1]], this, _arg2, _local5, 0.5, 0, Math.abs(_arg3)); _halfWidth = 16; super(_local6, _walkSprite, _local5, Math.abs(_arg3), 20, _halfWidth); } override public function stopMove():void{ super.stopMove(); var _local1:MovieClip = new LiftedDogMcLib(); _local1.scaleX = _costume.scaleX; _local1.scaleY = _costume.scaleY; _local1.rotation = _costume.rotation; _local1.x = _costume.x; _local1.y = _costume.y; var _local2:DisplayObjectContainer = _costume.parent; var _local3:Number = _local2.getChildIndex(_costume); _local2.removeChild(_costume); _local2.addChildAt(_local1, _local3); _costume = _local1; } override public function getLiftHeight():Number{ return (26); } override protected function getDeadMc():MovieClip{ return (new DogDeadMcLib()); } } }//package com.tinime.actors
Section 108
//DoorActor (com.tinime.actors.DoorActor) package com.tinime.actors { import flash.display.*; import com.tinime.control.*; import flash.geom.*; import Box2D.Dynamics.*; import com.tinime.data.*; import Box2D.Common.Math.*; import com.tinime.interfaces.*; public class DoorActor extends Actor implements Triggered { private var _isTriggered:Boolean;// = false private var _moveSpeed:Number;// = 1 private var _angle:Number; private var _rotation:Number; private var _startX:Number; private var _startY:Number; private var _endY:Number; private var _endX:Number; private var _scale:Number; private var _isClosed:Boolean;// = true private var _useOnce:Boolean;// = false public function DoorActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Boolean, _arg6:Number){ var _local9:DisplayObjectContainer; _scale = _arg3; _useOnce = _arg5; if (_arg5){ _local9 = Box2dObjSpawner.buildBitmapSprite(_arg1, new DoorSprLib(), _arg2, _arg3, new Point(25, 99), new Point(0, 0), _arg4); } else { _local9 = Box2dObjSpawner.buildBitmapSprite(_arg1, new Door2SprLib(), _arg2, _arg3, new Point(25, 99), new Point(0, 0), _arg4); }; var _local7:b2Body = Box2dObjSpawner.buildBody([[0, 0], [28, 0], [28, 97], [0, 97]], this, _arg2, 0, 0.7, 0, _arg3, _arg4); _local7.GetShapeList().m_filter.categoryBits = PhysicsVals.DOOR_CATEGORY; _local7.GetShapeList().m_filter.maskBits = ((((PhysicsVals.UFO_CATEGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.BOMB_CATAGORY) | PhysicsVals.TUNNEL_BLOCK); super(_local7, _local9); _rotation = _arg4; _moveSpeed = ((_moveSpeed * _arg6) * _arg3); var _local8:DisplayObjectContainer = Box2dObjSpawner.buildBitmapSprite(_arg1, new DoorSprLib(), _arg2, _arg3, new Point(25, 99), new Point(0, 0), _arg4); _local9.mask = _local8; _startX = _arg2.x; _startY = _arg2.y; if (_rotation == 0){ if (_moveSpeed < 0){ _endY = (_arg2.y - _local9.height); } else { _endY = (_arg2.y + _local9.height); }; } else { if (_rotation == 90){ if (_moveSpeed < 0){ _endX = (_arg2.x - _local9.width); } else { _endX = (_arg2.x + _local9.width); }; }; }; } public function onTriggered():void{ if (_isTriggered){ _isClosed = !(_isClosed); }; _isTriggered = true; } public function activeBody():void{ _body.GetShapeList().m_density = 1000000; _body.SetMassFromShapes(); _body.AllowSleeping(false); } public function sleepBody():void{ _body.GetShapeList().m_density = 0; _body.SetMassFromShapes(); _body.AllowSleeping(true); } override public function update():void{ if (_isTriggered){ if (_isClosed){ activeBody(); if (_rotation == 0){ if (_moveSpeed < 0){ if (_costume.y > _endY){ _body.SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y + _moveSpeed) / PhysicsVals.RATIO)), 0); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { if (_useOnce){ ActorsManager.getInstance().remove(this); } else { _isClosed = false; _isTriggered = false; sleepBody(); _costume.y = _endY; }; }; } else { if (_costume.y < _endY){ _body.SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y + _moveSpeed) / PhysicsVals.RATIO)), 0); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { if (_useOnce){ ActorsManager.getInstance().remove(this); } else { _isClosed = false; _isTriggered = false; sleepBody(); _costume.y = _endY; }; }; }; } else { if (_rotation == 90){ if (_moveSpeed < 0){ if (_costume.x > _endX){ _body.SetXForm(new b2Vec2(((_costume.x + _moveSpeed) / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)), ((_rotation * Math.PI) / 180)); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { if (_useOnce){ ActorsManager.getInstance().remove(this); } else { _costume.x = _endX; _isClosed = false; _isTriggered = false; sleepBody(); }; }; } else { if (_costume.x < _endX){ _body.SetXForm(new b2Vec2(((_costume.x + _moveSpeed) / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)), ((_rotation * Math.PI) / 180)); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { if (_useOnce){ ActorsManager.getInstance().remove(this); } else { _costume.x = _endX; _isClosed = false; _isTriggered = false; sleepBody(); }; }; }; }; }; } else { activeBody(); if (_rotation == 0){ if (_moveSpeed < 0){ if (_costume.y < _startY){ _body.SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y - _moveSpeed) / PhysicsVals.RATIO)), 0); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { _costume.y = _startY; _isClosed = true; _isTriggered = false; sleepBody(); }; } else { if (_costume.y > _startY){ _body.SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y - _moveSpeed) / PhysicsVals.RATIO)), 0); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { _costume.y = _startY; _isClosed = true; _isTriggered = false; sleepBody(); }; }; } else { if (_rotation == 90){ if (_moveSpeed < 0){ if (_costume.x < _startX){ _body.SetXForm(new b2Vec2(((_costume.x - _moveSpeed) / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)), ((_rotation * Math.PI) / 180)); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { _costume.x = _startX; _isClosed = true; _isTriggered = false; sleepBody(); }; } else { if (_costume.x > _startX){ _body.SetXForm(new b2Vec2(((_costume.x - _moveSpeed) / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)), ((_rotation * Math.PI) / 180)); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); updateMyLook(); } else { _costume.x = _startX; _isClosed = true; _isTriggered = false; sleepBody(); }; }; }; }; }; }; } } }//package com.tinime.actors
Section 109
//FloatBombActor (com.tinime.actors.FloatBombActor) package com.tinime.actors { import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import flash.geom.*; import com.tinime.control.*; import flash.events.*; import Box2D.Common.Math.*; import Box2D.Dynamics.Contacts.*; import com.tinime.interfaces.*; import com.hexagonstar.display.bitmaps.*; public class FloatBombActor extends Actor implements Explosive { private var _explosionAnim:MovieClip; private var _explosionCircle:b2Body; private var _scale:Number; private var _animatedBitmap:AnimatedBitmap; public function FloatBombActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ _costume = new Sprite(); _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.FLOAT_BOMB); _animatedBitmap.x = -23; _animatedBitmap.y = -23; _costume.x = _arg2.x; _costume.y = _arg2.y; _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); var _local4:b2CircleDef = new b2CircleDef(); _local4.radius = ((14 * _arg3) / PhysicsVals.RATIO); _local4.density = 0; var _local5:b2BodyDef = new b2BodyDef(); _local5.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); var _local6:b2Body = PhysicsVals.world.CreateBody(_local5); _local6.CreateShape(_local4); _scale = _arg3; super(_local6, _costume); } public function explode():void{ if (_explosionAnim != null){ return; }; isAlive = false; SoundManager.playExplosion(); _explosionAnim = new FloatBombExplosion(); _explosionAnim.x = _costume.x; _explosionAnim.y = _costume.y; _explosionAnim.scaleX = _scale; _explosionAnim.scaleY = _scale; _costume.visible = false; _costume.parent.addChild(_explosionAnim); _explosionAnim.addEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _explosionAnim.gotoAndPlay(1); } override public function update():void{ var _local1:b2CircleDef; var _local2:b2BodyDef; if (((!((_explosionAnim == null))) && ((_explosionCircle == null)))){ _local1 = new b2CircleDef(); _local1.radius = ((35 * _scale) / PhysicsVals.RATIO); _local1.density = 0.1; _local1.isSensor = true; _local2 = new b2BodyDef(); _local2.position.Set((_costume.x / PhysicsVals.RATIO), (_costume.y / PhysicsVals.RATIO)); _explosionCircle = PhysicsVals.world.CreateBody(_local2); _explosionCircle.CreateShape(_local1); _explosionCircle.SetMassFromShapes(); _explosionCircle.ApplyForce(new b2Vec2(0, (-(_explosionCircle.m_mass) * PhysicsVals.GRAVITY)), _explosionCircle.GetWorldCenter()); } else { if (_explosionCircle != null){ _explosionCircle.ApplyForce(new b2Vec2(0, (-(_explosionCircle.m_mass) * PhysicsVals.GRAVITY)), _explosionCircle.GetWorldCenter()); }; }; } private function onExplosionEnterFrame(_arg1:Event):void{ var _local2:ActorsManager; var _local3:b2ContactEdge; var _local4:Object; if (_explosionAnim.currentFrame == _explosionAnim.totalFrames){ _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _costume.parent.removeChild(_explosionAnim); _explosionAnim = null; _local2 = ActorsManager.getInstance(); _local2.remove(this); } else { if ((((_explosionAnim.currentFrame == 3)) && (!((_explosionCircle == null))))){ _local3 = _explosionCircle.m_contactList; ScoreManager.addScore(10, new Point(_costume.x, _costume.y)); while (_local3 != null) { _local4 = _local3.other.GetUserData(); if ((_local4 is Explosive)){ if ((_local4 is UfoActor)){ if (UfoActor(_local4)._isLiftJointCreated){ UfoActor(_local4).explode(); }; } else { Explosive(_local4).explode(); }; }; _local3 = _local3.next; }; }; }; } override protected function cleanUpBeforeRemoving():void{ if (_explosionAnim != null){ _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _costume.parent.removeChild(_explosionAnim); _explosionAnim = null; }; if (_explosionCircle != null){ PhysicsVals.world.DestroyBody(_explosionCircle); }; _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 110
//Gear1Actor (com.tinime.actors.Gear1Actor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import com.tinime.control.*; import flash.geom.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.display.*; public class Gear1Actor extends GearActor { public function Gear1Actor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){ var _local8:b2PolygonDef; _costume = Box2dObjSpawner.buildBitmapSprite(_arg1, new GearWheel1SprLib(), _arg2, _arg3, new Point(422, 418), new Point(-209, -209), _arg4); var _local7:b2CircleDef = new b2CircleDef(); _local7.radius = ((146 * _arg3) / PhysicsVals.RATIO); _local7.density = 9999999999; _local8 = Box2dObjSpawner.buildPolygonDef([[-200, -28], [200, -28], [200, 28], [-200, 28]], _arg3); _local8.density = 9999999999; var _local9:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-28, -200], [28, -200], [28, 200], [-28, 200]], _arg3); _local9.density = 9999999999; var _local10:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-161, -121], [-121, -161], [161, 121], [121, 161]], _arg3); _local10.density = 9999999999; var _local11:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[121, -161], [161, -121], [-121, 161], [-161, 121]], _arg3); _local11.density = 9999999999; var _local12:b2BodyDef = new b2BodyDef(); _local12.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _local12.angle = ((Math.PI * _arg4) / 180); var _local13:b2Body = PhysicsVals.world.CreateBody(_local12); _local13.CreateShape(_local7); _local13.CreateShape(_local8); _local13.CreateShape(_local9); _local13.CreateShape(_local10); _local13.CreateShape(_local11); _local13.SetMassFromShapes(); super(_local13, _costume, _arg5, _arg6); } } }//package com.tinime.actors
Section 111
//Gear2Actor (com.tinime.actors.Gear2Actor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import com.tinime.control.*; import flash.geom.*; import flash.display.*; import com.tinime.data.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; public class Gear2Actor extends GearActor { private var _malicBody:b2Body; public function Gear2Actor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){ var _local9:b2PolygonDef; var _local7:DisplayObjectContainer = Box2dObjSpawner.buildBitmapSprite(_arg1, new GearWhee2SprLib(), _arg2, _arg3, new Point(421, 412), new Point(-211, -203), _arg4); var _local8:b2CircleDef = new b2CircleDef(); _local8.radius = ((143 * _arg3) / PhysicsVals.RATIO); _local8.density = 9999999999; _local9 = Box2dObjSpawner.buildPolygonDef([[-200, -28], [200, -28], [200, 28], [-200, 28]], _arg3); _local9.density = 9999999999; var _local10:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-28, -134], [0, -171], [28, -134], [28, 200], [-28, 200]], _arg3); _local10.density = 9999999999; var _local11:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-161, -121], [-121, -161], [161, 121], [121, 161]], _arg3); _local11.density = 9999999999; var _local12:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[121, -161], [161, -121], [-121, 161], [-161, 121]], _arg3); _local12.density = 9999999999; var _local13:b2BodyDef = new b2BodyDef(); _local13.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _local13.angle = ((Math.PI * _arg4) / 180); var _local14:b2Body = PhysicsVals.world.CreateBody(_local13); _local14.CreateShape(_local8); _local14.CreateShape(_local9); _local14.CreateShape(_local10); _local14.CreateShape(_local11); _local14.CreateShape(_local12); _local14.SetMassFromShapes(); super(_local14, _local7, _arg5, _arg6); _malicBody = Box2dObjSpawner.buildBody([[-27, -197], [19, -198], [30, -133], [-27, -133]], CommonVals.MALICIOUS_BLOCK, _arg2, 20000, 0.7, 0, _arg3, _arg4); var _local15:b2RevoluteJointDef = new b2RevoluteJointDef(); _local15.Initialize(_local14, _malicBody, _malicBody.GetWorldCenter()); _local15.enableLimit = true; _local15.upperAngle = 0; _local15.lowerAngle = 0; var _local16:b2RevoluteJoint = (PhysicsVals.world.CreateJoint(_local15) as b2RevoluteJoint); } override protected function cleanUpBeforeRemoving():void{ PhysicsVals.world.DestroyBody(_malicBody); } } }//package com.tinime.actors
Section 112
//GearActor (com.tinime.actors.GearActor) package com.tinime.actors { import Box2D.Common.Math.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.display.*; public class GearActor extends Actor { private var _startPos:b2Vec2; private var _speedAngle:Number; private var _dirChangeTime:Number; private var _dirChangeCount:Number;// = 0 public function GearActor(_arg1:b2Body, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number){ super(_arg1, _arg2); _arg1.ApplyForce(new b2Vec2(0, (-(_arg1.m_mass) * PhysicsVals.GRAVITY)), _arg1.GetWorldCenter()); _startPos = new b2Vec2((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _speedAngle = ((_arg3 * Math.PI) / 180); _dirChangeTime = _arg4; } override protected function childSpecificUpdate():void{ var _local1:Number; _body.ApplyForce(new b2Vec2(0, (-(body.m_mass) * PhysicsVals.GRAVITY)), body.GetWorldCenter()); if (_body.GetAngle() > (Math.PI * 2)){ _local1 = ((_body.GetAngle() + _speedAngle) - (Math.PI * 2)); } else { if (_body.GetAngle() < (-(Math.PI) * 2)){ _local1 = ((_body.GetAngle() + _speedAngle) + (Math.PI * 2)); } else { _local1 = (_body.GetAngle() + _speedAngle); }; }; _body.SetXForm(_startPos, _local1); if (_dirChangeTime != 0){ if (_dirChangeCount < _dirChangeTime){ _dirChangeCount++; } else { _speedAngle = (_speedAngle * -1); _dirChangeCount = 0; }; }; } } }//package com.tinime.actors
Section 113
//HaloActor (com.tinime.actors.HaloActor) package com.tinime.actors { import flash.display.*; import Box2D.Collision.Shapes.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.geom.*; public class HaloActor extends Actor { public var moveCount:int;// = 0 public var updateAlphaMutlply:Number;// = 0.96 public function HaloActor(_arg1:DisplayObjectContainer, _arg2:Number, _arg3:Point, _arg4:Number){ var _local5:Sprite; _local5 = new HaloSprLib(); _local5.scaleX = _arg2; _local5.scaleY = _arg2; _local5.x = _arg3.x; _local5.y = _arg3.y; _arg1.addChild(_local5); _local5.alpha = 0.8; _local5.rotation = _arg4; var _local6:b2PolygonDef = new b2PolygonDef(); _local6.SetAsBox(((34 * _arg2) / PhysicsVals.RATIO), ((12 * _arg2) / PhysicsVals.RATIO)); _local6.restitution = 0; _local6.density = 0.1; _local6.friction = 0; _local6.isSensor = true; var _local7:b2BodyDef = new b2BodyDef(); _local7.fixedRotation = true; _local7.angle = ((_arg4 * Math.PI) / 180); _local7.position.Set((_arg3.x / PhysicsVals.RATIO), (_arg3.y / PhysicsVals.RATIO)); var _local8:b2Body = PhysicsVals.world.CreateBody(_local7); _local8.CreateShape(_local6); _local8.SetUserData(this); _local8.SetMassFromShapes(); super(_local8, _local5); } public function hide():void{ _costume.visible = false; } public function show():void{ _costume.visible = true; } override protected function childSpecificUpdate():void{ moveCount++; _costume.scaleX = (_costume.scaleX * 1.037); _costume.scaleY = (_costume.scaleY * 1.037); _costume.alpha = (_costume.alpha * updateAlphaMutlply); } } }//package com.tinime.actors
Section 114
//HiddenBlockActor (com.tinime.actors.HiddenBlockActor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import flash.utils.*; import flash.display.*; import com.tinime.control.*; import flash.geom.*; import Box2D.Dynamics.*; import com.tinime.data.*; import flash.events.*; import Box2D.Dynamics.Contacts.*; public class HiddenBlockActor extends Actor { private var _isContacted:Boolean;// = false public function HiddenBlockActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Array, _arg4:Number, _arg5:Number){ var _local13:Array; var _local14:b2PolygonDef; var _local6:Class = (getDefinitionByName(((("Level" + _arg5) + "Hidden") + _arg4)) as Class); var _local7:Sprite = new (_local6); var _local8:Number = (_local7.width + 50); var _local9:Number = (_local7.height + 50); _costume = Box2dObjSpawner.buildBitmapSprite(_arg1, _local7, _arg2, 1, new Point(_local8, _local9), new Point(0, 0), 0); var _local10:int = _arg3.length; var _local11:b2BodyDef = new b2BodyDef(); _local11.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _body = PhysicsVals.world.CreateBody(_local11); var _local12:int; while (_local12 < _local10) { _local13 = _arg3[_local12]; _local14 = Box2dObjSpawner.buildPolygonDef(_local13); _local14.isSensor = true; _body.CreateShape(_local14); _local12++; }; _body.SetUserData(this); super(_body, _costume); } public function onContact():void{ if (_isContacted){ return; }; _costume.removeEventListener(Event.ENTER_FRAME, onLeaveContactEnterFrame); _isContacted = true; _costume.addEventListener(Event.ENTER_FRAME, onContactEnterFrame); MedalsManager.checkExplorerAchievements(); } public function onLeaveContact():void{ if (!(_isContacted)){ return; }; _costume.removeEventListener(Event.ENTER_FRAME, onContactEnterFrame); _isContacted = false; _costume.addEventListener(Event.ENTER_FRAME, onLeaveContactEnterFrame); } private function onLeaveContactEnterFrame(_arg1:Event):void{ if (_costume.alpha <= 1){ _costume.alpha = (_costume.alpha + 0.1); } else { _costume.removeEventListener(Event.ENTER_FRAME, onLeaveContactEnterFrame); }; } private function onContactEnterFrame(_arg1:Event):void{ if (_costume.alpha > 0){ _costume.alpha = (_costume.alpha - 0.1); } else { _costume.removeEventListener(Event.ENTER_FRAME, onContactEnterFrame); }; } override public function update():void{ var _local1:b2ContactEdge; var _local2:Boolean; if (_isContacted){ _local1 = _body.m_contactList; _local2 = false; while (_local1 != null) { if ((_local1.other.GetUserData() is UfoActor)){ _local2 = true; break; }; _local1 = _local1.next; }; if (!(_local2)){ onLeaveContact(); _isContacted = false; }; }; } override protected function cleanUpBeforeRemoving():void{ _costume.removeEventListener(Event.ENTER_FRAME, onContactEnterFrame); _costume.removeEventListener(Event.ENTER_FRAME, onLeaveContactEnterFrame); } } }//package com.tinime.actors
Section 115
//KeyActor (com.tinime.actors.KeyActor) package com.tinime.actors { import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import com.tinime.control.*; import Box2D.Dynamics.*; import flash.filters.*; import flash.geom.*; import com.hexagonstar.display.bitmaps.*; public class KeyActor extends Actor { private var _linkCodeArr:Array; private var _waitToTrigger:Boolean;// = false private var _isTriggered:Boolean;// = false private var _timeCount:int;// = 0 private var _timeToWait:int;// = 150 private var _ifNeverComeBack:Boolean;// = false private var _keyFadeMc:MovieClip; private var _animatedBitmap:AnimatedBitmap; private var _isReturning:Boolean; public function KeyActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Boolean, _arg4:Array){ _costume = new Sprite(); _costume.x = _arg2.x; _costume.y = _arg2.y; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.KEY); _animatedBitmap.x = 2; _animatedBitmap.y = -10; _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); var _local5:b2Body = Box2dObjSpawner.buildBody([[8, 1], [36, -4], [48, 9], [36, 22], [8, 12]], this, _arg2, 0, 0.7, 0, 1); _local5.GetShapeList().m_isSensor = true; super(_local5, _costume); _isReturning = false; _linkCodeArr = _arg4; _ifNeverComeBack = _arg3; if (!(_ifNeverComeBack)){ _costume.filters = new Array(new GlowFilter(0xFFFF00, 1, 19, 19, 1)); }; } public function trigger():void{ var _local1:Number; if (_isTriggered){ return; }; SoundManager.playKeySound(); _isTriggered = true; _waitToTrigger = true; for each (_local1 in _linkCodeArr) { TriggerController.trigger(_local1); }; _costume.alpha = 0; if (_keyFadeMc == null){ _keyFadeMc = new keyFadeAnim(); _keyFadeMc.x = _costume.x; _keyFadeMc.y = _costume.y; _costume.parent.addChild(_keyFadeMc); _keyFadeMc.gotoAndPlay(1); }; } override public function update():void{ if (_keyFadeMc != null){ if (_keyFadeMc.currentFrame == _keyFadeMc.totalFrames){ _keyFadeMc.parent.removeChild(_keyFadeMc); _keyFadeMc = null; if (_ifNeverComeBack){ ActorsManager.getInstance().remove(this); }; }; }; if (_ifNeverComeBack){ return; }; if (_isReturning){ if (_costume.alpha < 1){ _costume.alpha = (_costume.alpha + 0.1); } else { _isReturning = false; _isTriggered = false; }; } else { if (_isTriggered){ if (_timeCount < _timeToWait){ _timeCount++; } else { _timeCount = 0; _isReturning = true; }; }; }; } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 116
//LifterSensor (com.tinime.actors.LifterSensor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import com.tinime.data.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; public class LifterSensor { private var _parent:UfoActor; public var body:b2Body; private var _liftJoint:b2RevoluteJoint; public function LifterSensor(_arg1:UfoActor, _arg2:b2Vec2){ _parent = _arg1; var _local3:b2PolygonDef = new b2PolygonDef(); _local3.vertexCount = 3; b2Vec2(_local3.vertices[0]).Set(0, (-5 / PhysicsVals.RATIO)); b2Vec2(_local3.vertices[1]).Set((1 / PhysicsVals.RATIO), (30 / PhysicsVals.RATIO)); b2Vec2(_local3.vertices[2]).Set((-1 / PhysicsVals.RATIO), (30 / PhysicsVals.RATIO)); _local3.density = 0.001; _local3.friction = 0; _local3.restitution = 0; _local3.isSensor = true; var _local4:b2PolygonDef = new b2PolygonDef(); _local4.vertexCount = 3; b2Vec2(_local4.vertices[0]).Set(0, (29 / PhysicsVals.RATIO)); b2Vec2(_local4.vertices[1]).Set((40 / PhysicsVals.RATIO), (110 / PhysicsVals.RATIO)); b2Vec2(_local4.vertices[2]).Set((-40 / PhysicsVals.RATIO), (110 / PhysicsVals.RATIO)); _local4.density = 0.001; _local4.friction = 0; _local4.restitution = 0; _local4.isSensor = true; var _local5:b2BodyDef = new b2BodyDef(); _local5.position.Set(_arg2.x, _arg2.y); body = PhysicsVals.world.CreateBody(_local5); body.CreateShape(_local3); body.CreateShape(_local4); body.SetMassFromShapes(); body.SetUserData(this); var _local6:b2RevoluteJointDef = new b2RevoluteJointDef(); _local6.Initialize(body, _arg1.body, _arg2); _local6.enableLimit = true; _local6.lowerAngle = 0; _local6.upperAngle = 0; _liftJoint = (PhysicsVals.world.CreateJoint(_local6) as b2RevoluteJoint); } public function destroy():void{ PhysicsVals.world.DestroyJoint(_liftJoint); PhysicsVals.world.DestroyBody(body); body = null; _liftJoint = null; } public function get parent():UfoActor{ return (_parent); } public function set parent(_arg1:UfoActor):void{ _parent = _arg1; } } }//package com.tinime.actors
Section 117
//MovableStickBlockActor (com.tinime.actors.MovableStickBlockActor) package com.tinime.actors { import Box2D.Collision.Shapes.*; import flash.geom.*; import com.tinime.control.*; import com.tinime.view.*; import com.tinime.data.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; import Box2D.Common.Math.*; import flash.display.*; public class MovableStickBlockActor extends Actor { private var _moveLen:Number; private var _speed:Number; private var _spikeBody:b2Body; private var _startLoc:Point; private var _endLoc:Point; private var _curLoc:Point; private var _stickLen:Number;// = 362 private var _angle:Number; private var _isMovingToEnd:Boolean; public function MovableStickBlockActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number){ var _local9:b2PolygonDef; _moveLen = _arg5; _speed = _arg6; _startLoc = _arg2; _stickLen = (_stickLen * _arg3); _angle = ((_arg4 * Math.PI) / 180); _endLoc = new Point((_startLoc.x - (_arg5 * Math.sin(_angle))), (_startLoc.y + (_arg5 * Math.cos(_angle)))); _curLoc = new Point((_startLoc.x - (_arg7 * Math.sin(_angle))), (_startLoc.y + (_arg7 * Math.cos(_angle)))); if (_speed > 0){ _isMovingToEnd = true; } else { _isMovingToEnd = false; }; _costume = Box2dObjSpawner.buildBitmapSprite(_arg1, new StickBarrierSprLib(), _arg2, _arg3, new Point(81, 386), new Point(0, 0), _arg4); var _local8:Number = Camera.getInstance().frontLayer.getChildIndex(Camera.getInstance().frontLayerBitMap); _arg1.addChildAt(_costume, _local8); _local9 = Box2dObjSpawner.buildPolygonDef([[0, 0], [80, 0], [80, 362], [0, 362]], _arg3); _local9.density = 20000; _local9.filter.categoryBits = PhysicsVals.DOOR_CATEGORY; _local9.filter.maskBits = (((PhysicsVals.UFO_CATEGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.BOMB_CATAGORY); var _local10:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[3, 362], [77, 362], [77, 374], [3, 374]], _arg3); _local10.density = 20000; _local10.filter.categoryBits = PhysicsVals.DOOR_CATEGORY; _local10.filter.maskBits = (((PhysicsVals.UFO_CATEGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.BOMB_CATAGORY); var _local11:b2BodyDef = new b2BodyDef(); _local11.position.Set((_curLoc.x / PhysicsVals.RATIO), (_curLoc.y / PhysicsVals.RATIO)); _body = PhysicsVals.world.CreateBody(_local11); _body.CreateShape(_local9); _body.CreateShape(_local10); _body.SetMassFromShapes(); super(_body, _costume); _spikeBody = Box2dObjSpawner.buildBody([[1, 362], [39, 200], [79, 362], [79, 379], [1, 379]], CommonVals.MALICIOUS_BLOCK, _curLoc, 20000, 1, 0, _arg3, 0); _spikeBody.GetShapeList().m_filter.categoryBits = PhysicsVals.DOOR_CATEGORY; _spikeBody.GetShapeList().m_filter.maskBits = (((PhysicsVals.UFO_CATEGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.BOMB_CATAGORY); var _local12:b2RevoluteJointDef = new b2RevoluteJointDef(); _local12.Initialize(_spikeBody, _body, _spikeBody.GetWorldCenter()); _local12.enableLimit = true; _local12.lowerAngle = 0; _local12.upperAngle = 0; var _local13:b2RevoluteJoint = (PhysicsVals.world.CreateJoint(_local12) as b2RevoluteJoint); _body.ApplyForce(new b2Vec2(0, (-(_body.GetMass()) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); _spikeBody.ApplyForce(new b2Vec2(0, (-(_spikeBody.GetMass()) * PhysicsVals.GRAVITY)), _spikeBody.GetWorldCenter()); } override protected function childSpecificUpdate():void{ var _local3:Number; _body.ApplyForce(new b2Vec2(0, (-(_body.GetMass()) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); _spikeBody.ApplyForce(new b2Vec2(0, (-(_spikeBody.GetMass()) * PhysicsVals.GRAVITY)), _spikeBody.GetWorldCenter()); var _local1:Number = (_curLoc.x - (_speed * Math.sin(_angle))); var _local2:Number = (_curLoc.y + (_speed * Math.cos(_angle))); if (_isMovingToEnd){ _local3 = Math.sqrt((Math.pow((_local1 - _endLoc.x), 2) + Math.pow((_local2 - _endLoc.y), 2))); if (_local3 <= Math.abs(_speed)){ _local1 = _endLoc.x; _local2 = _endLoc.y; _speed = (_speed * -1); _isMovingToEnd = false; }; } else { _local3 = Math.sqrt((Math.pow((_local1 - _startLoc.x), 2) + Math.pow((_local2 - _startLoc.y), 2))); if (_local3 <= Math.abs(_speed)){ _local1 = _startLoc.x; _local2 = _startLoc.y; _speed = (_speed * -1); _isMovingToEnd = true; }; }; _body.SetXForm(new b2Vec2((_local1 / PhysicsVals.RATIO), (_local2 / PhysicsVals.RATIO)), _angle); _curLoc.x = _local1; _curLoc.y = _local2; } override protected function cleanUpBeforeRemoving():void{ PhysicsVals.world.DestroyBody(_spikeBody); } } }//package com.tinime.actors
Section 118
//SpinyBallActor (com.tinime.actors.SpinyBallActor) package com.tinime.actors { import flash.geom.*; import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import Box2D.Common.Math.*; import com.hexagonstar.display.bitmaps.*; public class SpinyBallActor extends Actor { private var _movePosChain:Array; private var _nextEndIterNum:Number; private var _nextEndPoint:Point; private var _isCircularChain:Boolean; private var _moveSpeed:Number; private var _prevAngle:Number; private var _targetAngle:Number; private var _rotateTime:int;// = 10 private var _rotateCount:int;// = 0 private var _rotateAngle:Number;// = 0 private var _isRotating:Boolean;// = false private var _animatedBitmap:AnimatedBitmap; public function SpinyBallActor(_arg1:DisplayObjectContainer, _arg2:Array, _arg3:Number=1, _arg4:Number=4){ var _local12:Array; _movePosChain = new Array(); var _local5:int = _arg2.length; var _local6:int; while (_local6 < _local5) { _local12 = _arg2[_local6]; _movePosChain.push([_local12[0], _local12[1]]); _local6++; }; _moveSpeed = _arg4; if ((((_movePosChain[0][0] == _movePosChain[(_movePosChain.length - 1)][0])) && ((_movePosChain[0][1] == _movePosChain[(_movePosChain.length - 1)][1])))){ _isCircularChain = true; }; _nextEndIterNum = 1; _nextEndPoint = new Point(_movePosChain[_nextEndIterNum][0], _movePosChain[_nextEndIterNum][1]); var _local7:Point = new Point(_movePosChain[0][0], _movePosChain[0][1]); _costume = new Sprite(); _costume.x = _local7.x; _costume.y = _local7.y; switch (_arg3){ case 1: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.SPINY_BALL); break; case 1.5: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.SPINY_BALL_150); break; case 1.8: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.SPINY_BALL_180); break; default: _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.SPINY_BALL); break; }; _animatedBitmap.x = (-42 * _arg3); _animatedBitmap.y = (-39 * _arg3); _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); var _local8:b2CircleDef = new b2CircleDef(); _local8.radius = ((28 * _arg3) / PhysicsVals.RATIO); _local8.density = 100000; _local8.friction = 1; _local8.restitution = 0.3; _local8.filter.categoryBits = PhysicsVals.TUNNEL_BLOCK; _local8.filter.maskBits = (((((PhysicsVals.BOMB_CATAGORY | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.UFO_CATEGORY) | PhysicsVals.NPC_CATAGORY); var _local9:b2BodyDef = new b2BodyDef(); _local9.position.Set((_local7.x / PhysicsVals.RATIO), (_local7.y / PhysicsVals.RATIO)); var _local10:b2Body = PhysicsVals.world.CreateBody(_local9); _local10.CreateShape(_local8); _local10.SetMassFromShapes(); super(_local10, _costume); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); var _local11:Number = Math.atan2((_nextEndPoint.y - _costume.y), (_nextEndPoint.x - _costume.x)); if (_local11 == Number.NEGATIVE_INFINITY){ _local11 = Math.PI; } else { if (_local11 == Number.POSITIVE_INFINITY){ _local11 = 0; }; }; _costume.rotation = ((_local11 * 180) / Math.PI); _prevAngle = _local11; } override protected function childSpecificUpdate():void{ var _local1:Number; var _local2:Number; var _local3:Number; var _local4:Number; if (_isRotating){ if (_rotateCount < _rotateTime){ _costume.rotation = (_costume.rotation + _rotateAngle); _rotateCount++; } else { _rotateCount = 0; _isRotating = false; }; _local1 = _costume.x; _local2 = _costume.y; } else { _local3 = Math.sqrt((Math.pow((_nextEndPoint.y - _costume.y), 2) + Math.pow((_nextEndPoint.x - _costume.x), 2))); if (_local3 <= _moveSpeed){ _costume.x = _nextEndPoint.x; _costume.y = _nextEndPoint.y; if ((_nextEndIterNum + 1) == _movePosChain.length){ if (!(_isCircularChain)){ _movePosChain.reverse(); }; _nextEndIterNum = 1; } else { _nextEndIterNum++; }; _nextEndPoint = new Point(_movePosChain[_nextEndIterNum][0], _movePosChain[_nextEndIterNum][1]); }; _local4 = Math.atan2((_nextEndPoint.y - _costume.y), (_nextEndPoint.x - _costume.x)); if (_local4 == Number.NEGATIVE_INFINITY){ _local4 = Math.PI; } else { if (_local4 == Number.POSITIVE_INFINITY){ _local4 = 0; }; }; if (_local3 <= _moveSpeed){ if (Math.abs((_local4 - _prevAngle)) > 0.1){ _isRotating = true; _rotateAngle = (((Math.abs((_local4 - _prevAngle)) / _rotateTime) * 180) / Math.PI); _prevAngle = Math.abs(_local4); _costume.rotation = (_costume.rotation + _rotateAngle); _rotateCount++; }; _local1 = _costume.x; _local2 = _costume.y; } else { _local1 = ((_moveSpeed * Math.cos(_local4)) + _costume.x); _local2 = ((_moveSpeed * Math.sin(_local4)) + _costume.y); }; }; _body.SetXForm(new b2Vec2((_local1 / PhysicsVals.RATIO), (_local2 / PhysicsVals.RATIO)), 0); _body.ApplyForce(new b2Vec2(0, (-(_body.m_mass) * PhysicsVals.GRAVITY)), _body.GetWorldCenter()); } override protected function updateMyLook():void{ _costume.x = (_body.GetPosition().x * PhysicsVals.RATIO); _costume.y = (_body.GetPosition().y * PhysicsVals.RATIO); } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 119
//SpinyStickActor (com.tinime.actors.SpinyStickActor) package com.tinime.actors { import com.tinime.control.*; import flash.geom.*; import com.tinime.data.*; import Box2D.Dynamics.Joints.*; import flash.display.*; import com.tinime.interfaces.*; import Box2D.Common.Math.*; public class SpinyStickActor extends Actor implements Triggered { private var _isRotating:Boolean;// = false private var _startPos:b2Vec2; private var _angleSpeed:Number; public function SpinyStickActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean){ _isRotating = _arg6; _costume = Box2dObjSpawner.buildBitmapSprite(_arg1, new SpinyStickSprLib(), _arg2, _arg3, new Point(358, 59), new Point(-180, -32), _arg4); _body = Box2dObjSpawner.buildBody([[-175, 0], [0, -16], [175, 0], [0, 16]], this, _arg2, 0, 0.7, 0, _arg3, _arg4); _body.GetShapeList().m_filter.categoryBits = PhysicsVals.TUNNEL_BLOCK; _body.GetShapeList().m_filter.maskBits = (((PhysicsVals.BOMB_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); var _local7:b2RevoluteJointDef = new b2RevoluteJointDef(); _local7.Initialize(PhysicsVals.world.GetGroundBody(), _body, _body.GetWorldCenter()); var _local8:b2RevoluteJoint = (PhysicsVals.world.CreateJoint(_local7) as b2RevoluteJoint); _startPos = _body.GetWorldCenter(); _angleSpeed = ((_arg5 * Math.PI) / 180); super(_body, _costume); if (_isRotating){ _body.GetShapeList().m_density = 10000; }; } public function onTriggered():void{ _isRotating = !(_isRotating); } override public function update():void{ var _local1:Number; if (_isRotating){ if (_body.GetShapeList().m_density == 0){ _body.GetShapeList().m_density = 10000; }; if (_body.GetAngle() > (Math.PI * 2)){ _local1 = ((_body.GetAngle() + _angleSpeed) - (Math.PI * 2)); } else { if (_body.GetAngle() < (-(Math.PI) * 2)){ _local1 = ((_body.GetAngle() + _angleSpeed) + (Math.PI * 2)); } else { _local1 = (_body.GetAngle() + _angleSpeed); }; }; _body.SetXForm(_startPos, _local1); updateMyLook(); } else { if (_body.GetShapeList().m_density == 10000){ _body.GetShapeList().m_density = 0; }; }; } } }//package com.tinime.actors
Section 120
//StarTokenActor (com.tinime.actors.StarTokenActor) package com.tinime.actors { import com.tinime.control.*; import com.tinime.view.*; import com.tinime.data.*; import flash.display.*; import Box2D.Dynamics.*; import flash.geom.*; import flash.events.*; import com.tinime.interfaces.*; import com.hexagonstar.display.bitmaps.*; public class StarTokenActor extends Actor implements LevelDataRecordable { private var _isTouched:Boolean;// = false private var _animatedBitmap:AnimatedBitmap; private var _actorsManager:ActorsManager; private var _parent:DisplayObjectContainer; private var _recordNum:int; public function StarTokenActor(_arg1:DisplayObjectContainer, _arg2:Point){ _actorsManager = ActorsManager.getInstance(); _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.STAR_TOKEN); _animatedBitmap.x = -53; _animatedBitmap.y = -43; var _local3:Sprite = new Sprite(); _local3.x = _arg2.x; _local3.y = _arg2.y; _local3.addChild(_animatedBitmap); _arg1.addChildAt(_local3, 0); _parent = _arg1; var _local4:b2Body = Box2dObjSpawner.buildBody([[-16, -2], [1, -19], [17, -1], [0, 14]], this, _arg2); _local4.GetShapeList().m_isSensor = true; super(_local4, _local3); } public function touch():void{ _isTouched = true; } override public function update():void{ var _local1:MovieClip; var _local2:int; if (_isTouched){ _local1 = new StarVanishMcLib(); _local2 = _parent.getChildIndex(_costume); _parent.addChildAt(_local1, _local2); _local1.x = _costume.x; _local1.y = _costume.y; _local1.addEventListener(Event.ENTER_FRAME, onVanishEnterFrame); _local1.play(); ScoreManager.addScore(20, new Point(_costume.x, _costume.y)); LivesControl.addStar(new Point(_costume.x, _costume.y)); LevelController.getInstance().starSavedNum = (LevelController.getInstance().starSavedNum + 1); LevelController.getInstance().updateObjRecordArr(_recordNum); _actorsManager.remove(this); }; } private function onVanishEnterFrame(_arg1:Event):void{ var _local2:MovieClip; if (_arg1.target != null){ _local2 = MovieClip(_arg1.target); if (_local2.currentFrame == _local2.totalFrames){ _local2.removeEventListener(Event.ENTER_FRAME, onVanishEnterFrame); if (_parent.contains(_local2)){ _parent.removeChild(_local2); }; _local2 = null; }; }; } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } public function setRecordNum(_arg1:int):void{ _recordNum = _arg1; } public function getRecordNum():int{ return (_recordNum); } } }//package com.tinime.actors
Section 121
//TeleTransmissionActor (com.tinime.actors.TeleTransmissionActor) package com.tinime.actors { import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import com.tinime.control.*; import flash.geom.*; import flash.events.*; import com.tinime.event.*; import Box2D.Dynamics.*; import com.hexagonstar.display.bitmaps.*; public class TeleTransmissionActor extends Actor { private var _baseBody:b2Body; private var _animalCostume:DisplayObjectContainer; private var _teleTransmissionAnim:MovieClip; private var _capturedAnimalPos:Point; private var _curAnimal:int; private var _isAbsorbing:Boolean;// = false private var _animatedBitmap:AnimatedBitmap; private static var COW:int = 0; private static var DOG:int = 1; private static var CAT:int = 2; public function TeleTransmissionActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number){ var _local5:Sprite; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.TELE_TRANSMISSION); _local5 = new Sprite(); _animatedBitmap.x = -71; _animatedBitmap.y = -61; _local5.addChild(_animatedBitmap); _local5.x = _arg2.x; _local5.y = _arg2.y; _arg1.addChild(_local5); _baseBody = Box2dObjSpawner.buildBody([[-70, -1], [-50, -10], [50, -10], [70, -1]], "", _arg2, 0, 0, 0, _arg3, _arg4); _body = Box2dObjSpawner.buildBody([[-25, -38], [25, -38], [25, -10], [-25, -10]], this, _arg2, 0, 0, 0, _arg3, _arg4); _body.GetShapeList().m_isSensor = true; super(_body, _local5); } override public function update():void{ var _local1:Boolean; var _local2:Boolean; var _local3:Boolean; var _local4:Number; if (_animalCostume != null){ _local1 = false; _local2 = false; _local3 = false; if (_animalCostume.rotation > (_costume.rotation + 10)){ _animalCostume.rotation = (_animalCostume.rotation - 15); } else { if (_animalCostume.rotation < (_costume.rotation - 15)){ _animalCostume.rotation = (_animalCostume.rotation + 10); } else { _local3 = true; _animalCostume.rotation = _costume.rotation; }; }; if (Math.abs((_animalCostume.x - _capturedAnimalPos.x)) > 3){ if (_animalCostume.x < _capturedAnimalPos.x){ _animalCostume.x = (_animalCostume.x + 2); } else { _animalCostume.x = (_animalCostume.x - 2); }; } else { _local1 = true; _animalCostume.x = _capturedAnimalPos.x; }; if (Math.abs((_animalCostume.y - _capturedAnimalPos.y)) > 3){ if (_animalCostume.y < _capturedAnimalPos.y){ _animalCostume.y = (_animalCostume.y + 2); } else { _animalCostume.y = (_animalCostume.y - 2); }; } else { _local2 = true; _animalCostume.y = _capturedAnimalPos.y; }; if (((((_local1) && (_local2))) && (_local3))){ _teleTransmissionAnim = new TeleTransmissionAnimMcLib(); _teleTransmissionAnim.x = _costume.x; _teleTransmissionAnim.y = _costume.y; _teleTransmissionAnim.rotation = _costume.rotation; _teleTransmissionAnim.scaleX = _costume.scaleX; _teleTransmissionAnim.scaleY = _costume.scaleY; switch (_curAnimal){ case COW: _teleTransmissionAnim.dog.visible = false; _teleTransmissionAnim.cat.visible = false; MovieClip(_teleTransmissionAnim.cow).scaleX = _animalCostume.scaleX; MovieClip(_teleTransmissionAnim.cow).scaleY = _animalCostume.scaleY; ScoreManager.addScore(100, new Point(_costume.x, (_costume.y - 10))); break; case CAT: _teleTransmissionAnim.cow.visible = false; _teleTransmissionAnim.dog.visible = false; MovieClip(_teleTransmissionAnim.cat).scaleX = _animalCostume.scaleX; MovieClip(_teleTransmissionAnim.cat).scaleY = _animalCostume.scaleY; LivesControl.addLife(new Point(_costume.x, (_costume.y - 10))); LevelController.getInstance().catSavedNum = (LevelController.getInstance().catSavedNum + 1); break; case DOG: _teleTransmissionAnim.cow.visible = false; _teleTransmissionAnim.cat.visible = false; MovieClip(_teleTransmissionAnim.dog).scaleX = _animalCostume.scaleX; MovieClip(_teleTransmissionAnim.dog).scaleY = _animalCostume.scaleY; LivesControl.addLife(new Point(_costume.x, (_costume.y - 10))); LevelController.getInstance().dogSavedNum = (LevelController.getInstance().dogSavedNum + 1); break; default: break; }; _local4 = _costume.parent.getChildIndex(_costume); _costume.parent.addChildAt(_teleTransmissionAnim, (_local4 + 1)); _costume.visible = false; _teleTransmissionAnim.addEventListener(Event.ENTER_FRAME, onTunnelAnimEnterFrame); SoundManager.playLidClosing(); _animalCostume.parent.removeChild(_animalCostume); _animalCostume = null; _teleTransmissionAnim.gotoAndPlay(1); }; }; } private function onTunnelAnimEnterFrame(_arg1:Event):void{ var _local2:GameEventDispatcher; if (_teleTransmissionAnim.currentFrame == _teleTransmissionAnim.totalFrames){ _teleTransmissionAnim.removeEventListener(Event.ENTER_FRAME, onTunnelAnimEnterFrame); _costume.visible = true; _teleTransmissionAnim.parent.removeChild(_teleTransmissionAnim); _teleTransmissionAnim = null; if (_curAnimal == COW){ _local2 = GameEventDispatcher.getInstance(); _local2.onCowTransfered(); }; _isAbsorbing = false; }; } public function absorbAnimal(_arg1:AnimalActor):void{ var _local3:Number; if (((_arg1.isLifted) || (!((_animalCostume == null))))){ return; }; if (_isAbsorbing){ return; }; _isAbsorbing = true; var _local2:Number = ((_costume.rotation * Math.PI) / 180); if ((_arg1 is CowActor)){ _curAnimal = COW; _local3 = Math.sqrt(((2 * 2) + (38 * 38))); _local2 = (-(_local2) + Math.acos((-2 / _local3))); } else { if ((_arg1 is CatActor)){ _curAnimal = CAT; _local3 = Math.sqrt(((2.58 * 2.58) + (10.5 * 10.5))); _local2 = (-(_local2) + Math.acos((-2.58 / _local3))); } else { if ((_arg1 is DogActor)){ _curAnimal = DOG; _local3 = Math.sqrt(((3.5 * 3.5) + (11 * 11))); _local2 = (-(_local2) + Math.acos((-3.5 / _local3))); }; }; }; _capturedAnimalPos = new Point((((_local3 * Math.cos(_local2)) * _costume.scaleX) + _costume.x), (((-(_local3) * Math.sin(_local2)) * _costume.scaleX) + _costume.y)); _arg1.isAbsorbing = true; _arg1.animatedBitmap.stop(); _animalCostume = _arg1.costume; _arg1.costume = new Sprite(); _animalCostume.parent.addChild(_arg1.costume); _arg1.waitToDie = true; _animalCostume.parent.addChildAt(_animalCostume, (_costume.parent.getChildIndex(_costume) + 1)); LevelController.getInstance().updateActorRecordArr(_arg1.getRecordNum()); } override protected function cleanUpBeforeRemoving():void{ if (_animalCostume != null){ _animalCostume.parent.removeChild(_animalCostume); _animalCostume = null; }; if (_teleTransmissionAnim != null){ _teleTransmissionAnim.removeEventListener(Event.ENTER_FRAME, onTunnelAnimEnterFrame); _teleTransmissionAnim.parent.removeChild(_teleTransmissionAnim); _teleTransmissionAnim = null; }; PhysicsVals.world.DestroyBody(_baseBody); _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 122
//TrashCanActor (com.tinime.actors.TrashCanActor) package com.tinime.actors { import flash.display.*; import com.tinime.control.*; import flash.geom.*; import Box2D.Dynamics.*; import com.tinime.data.*; import com.tinime.interfaces.*; public class TrashCanActor extends Actor implements Liftable { private var _scale:Number; public function TrashCanActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number){ var _local5:Sprite; _scale = _arg3; _local5 = Box2dObjSpawner.buildBitmapSprite(_arg1, new TrashCanSprLib(), _arg2, _arg3, new Point(36, 51), new Point(-18, -47), _arg4); var _local6:b2Body = Box2dObjSpawner.buildBody([[-14, -1.5], [-14, -39], [0, -46], [14, -39], [14, -1.5]], this, _arg2, 900, 1, 0.5, _arg3, _arg4); _local6.GetShapeList().m_filter.categoryBits = PhysicsVals.OBJECT_CATEGORY; _local6.AllowSleeping(false); _local6.GetShapeList().m_filter.maskBits = ((((((PhysicsVals.BOMB_CATAGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.UFO_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.TUNNEL_BLOCK); super(_local6, _local5); } public function prepareLiftStatus():void{ var _local1:Number = 0.001; _body.GetShapeList().m_density = _local1; _body.SetMassFromShapes(); } public function restoreOriginStatus():void{ body.GetShapeList().m_density = 200; _body.SetMassFromShapes(); } public function getLiftable():Boolean{ return (true); } public function getLiftHeight():Number{ return ((44 * _scale)); } public function getPos():Point{ return (new Point(_costume.x, _costume.y)); } public function getBody():b2Body{ return (_body); } public function getMass():Number{ return (_body.m_mass); } public function stopMove():void{ } public function setFalling():void{ } } }//package com.tinime.actors
Section 123
//TriggerActor (com.tinime.actors.TriggerActor) package com.tinime.actors { import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import flash.filters.*; import com.tinime.control.*; import flash.geom.*; import flash.events.*; import Box2D.Dynamics.Contacts.*; import com.hexagonstar.display.bitmaps.*; public class TriggerActor extends Actor { private var _linkCode:Number; private var _isTriggered:Boolean;// = false private var _animatedBitmap:AnimatedBitmap; public function TriggerActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number){ _linkCode = _arg3; _costume = new Sprite(); _costume.x = _arg2.x; _costume.y = _arg2.y; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.TRIGGER); _animatedBitmap.x = -20; _animatedBitmap.y = -33; _costume.addChild(_animatedBitmap); _arg1.addChild(_costume); _animatedBitmap.gotoAndStop(1); _costume.filters = new Array(new GlowFilter(0xFFFFFF, 1, 20, 20, 0.67)); _body = Box2dObjSpawner.buildBody([[-11, -20], [0, -26], [11, -20], [11, -1], [-11, -1]], this, _arg2); _body.GetShapeList().m_isSensor = true; super(_body, _costume); } public function trigger():void{ if (_isTriggered){ return; }; SoundManager.playTriggerSfx(); _isTriggered = true; _animatedBitmap.addEventListener(Event.ENTER_FRAME, onAnimatedBitmapEnterFrame); _animatedBitmap.gotoAndPlay(2); TriggerController.trigger(_linkCode); } private function onAnimatedBitmapEnterFrame(_arg1:Event):void{ if (_animatedBitmap.getCurrentFrame() == _animatedBitmap.getTotalFrames()){ _animatedBitmap.stop(); }; } override public function update():void{ var _local1:b2ContactEdge; var _local2:int; var _local3:Object; if (_isTriggered){ _local1 = _body.m_contactList; _local2 = 0; while (_local1 != null) { _local3 = _local1.other.GetUserData(); if ((_local3 is UfoActor)){ if ((_local3 is UfoActor)){ if ((_costume.y - UfoActor(_local3).costume.y) > 26){ _isTriggered = false; _animatedBitmap.gotoAndStop(1); TriggerController.trigger(_linkCode); return; }; }; return; }; _local1 = _local1.next; }; _isTriggered = false; _animatedBitmap.gotoAndStop(1); TriggerController.trigger(_linkCode); SoundManager.playTriggerSfx(); }; } override protected function cleanUpBeforeRemoving():void{ _animatedBitmap.removeEventListener(Event.ENTER_FRAME, onAnimatedBitmapEnterFrame); _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } } }//package com.tinime.actors
Section 124
//UfoActor (com.tinime.actors.UfoActor) package com.tinime.actors { import com.tinime.event.*; import Box2D.Common.Math.*; import flash.display.*; import com.tinime.view.*; import com.tinime.data.*; import Box2D.Collision.Shapes.*; import Box2D.Dynamics.*; import flash.geom.*; import com.tinime.control.*; import flash.events.*; import com.tinime.interfaces.*; import Box2D.Dynamics.Contacts.*; import Box2D.Dynamics.Joints.*; import com.hexagonstar.display.bitmaps.*; public class UfoActor extends Actor implements Explosive { private var _mouseJoint:b2MouseJoint; private var _activated:Boolean; private var _activatedDensity:Number;// = 0.3 private var _engineForce:b2Vec2; private var _keyMoveForce:b2Vec2; private var _camera:Camera; private var _haloCount:int;// = 2 private var _haloCountTotal:int;// = 2 private var _haloArray:Array; private var _liftSensor:LifterSensor; private var _curLiftedObject:Liftable; private var _waitToLiftObject:Boolean;// = false public var _isLiftJointCreated:Boolean;// = false private var _liftJoint:b2RevoluteJoint; private var _curEnergy:int; private var _maxEnergy:int;// = 300 private var _isOverHeated:Boolean;// = false private var _isExploded:Boolean;// = false private var _explosionAnim:MovieClip; private var _revivePos:Point; private var _ufoReviveAnim:MovieClip; private var _isPreparingRevive:Boolean;// = false private var _shakePos:Point; private var _animatedBitmap:AnimatedBitmap; private var _angle1:Number;// = 0.0174532925199433 private var _angle20:Number;// = 0.698131700797732 private var _angleTransferMulti:Number;// = 0.0174532925199433 private var _mouseMoveForce:b2Vec2; public var isWait:Boolean;// = true public var waitCount:int;// = 0 private var _moveIndicSpr:Sprite; private static var _gameEventDispatcher:GameEventDispatcher = GameEventDispatcher.getInstance(); public function UfoActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Camera){ _haloArray = []; _camera = _arg3; _camera.prepareEnergyDisplay(); _engineForce = new b2Vec2(0, 0); _keyMoveForce = new b2Vec2(10500, 10500); _mouseMoveForce = new b2Vec2(10500, 10500); _moveIndicSpr = new MoveIndicSprLib(); _moveIndicSpr.visible = false; _arg1.addChild(_moveIndicSpr); var _local4:Sprite = new Sprite(); _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.UFO); _animatedBitmap.x = -29; _animatedBitmap.y = -35; _local4.addChild(_animatedBitmap); _arg1.addChild(_local4); var _local5:b2PolygonDef = new b2PolygonDef(); _local5.vertexCount = 4; b2Vec2(_local5.vertices[0]).Set((-26 / PhysicsVals.RATIO), (-11 / PhysicsVals.RATIO)); b2Vec2(_local5.vertices[1]).Set((0 / PhysicsVals.RATIO), (-29 / PhysicsVals.RATIO)); b2Vec2(_local5.vertices[2]).Set((26 / PhysicsVals.RATIO), (-11 / PhysicsVals.RATIO)); b2Vec2(_local5.vertices[3]).Set((0 / PhysicsVals.RATIO), (-1 / PhysicsVals.RATIO)); _local5.density = 0; _local5.friction = 0; _local5.restitution = 0; _local5.filter.categoryBits = PhysicsVals.UFO_CATEGORY; _local5.filter.maskBits = (((((PhysicsVals.BOMB_CATAGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.SCENE_BLOCK_CATEGORY) | PhysicsVals.DOOR_CATEGORY) | PhysicsVals.TUNNEL_BLOCK) | PhysicsVals.OBJECT_CATEGORY); var _local6:b2PolygonDef = new b2PolygonDef(); _local6.vertexCount = 4; b2Vec2(_local6.vertices[0]).Set((-1 / PhysicsVals.RATIO), (-1 / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[1]).Set((1 / PhysicsVals.RATIO), (-1 / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[2]).Set((1 / PhysicsVals.RATIO), (1 / PhysicsVals.RATIO)); b2Vec2(_local6.vertices[3]).Set((-1 / PhysicsVals.RATIO), (1 / PhysicsVals.RATIO)); _local6.density = 1E-6; _local6.isSensor = true; var _local7:b2BodyDef = new b2BodyDef(); _local7.isBullet = true; _local7.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _local7.fixedRotation = true; var _local8:b2Body = PhysicsVals.world.CreateBody(_local7); _local8.CreateShape(_local5); _local8.CreateShape(_local6); _local8.SetMassFromShapes(); super(_local8, _local4); } public function activate():void{ _body.WakeUp(); _activated = true; var _local1:b2Shape = _body.GetShapeList().GetNext(); _body.AllowSleeping(false); _local1.m_density = 3600; _body.SetMassFromShapes(); _engineForce = new b2Vec2(0, (-(PhysicsVals.GRAVITY) * _body.m_mass)); } private function addLifterSensor():void{ SoundManager.playUfoBeam(); _liftSensor = new LifterSensor(this, _body.GetWorldCenter()); _costume.addEventListener(Event.ENTER_FRAME, checkSound); } private function checkSound(_arg1:Event):void{ if (((CommonVals.gameLocked) || (CommonVals.gamePaused))){ SoundManager.stopUfoBeam(); } else { if ((((SoundManager.ufoBeamSfxChannel == null)) && (!((_liftSensor == null))))){ SoundManager.playUfoBeam(); }; }; } private function removeLifterSensor():void{ SoundManager.stopUfoBeam(); _liftSensor.destroy(); _liftSensor = null; _costume.removeEventListener(Event.ENTER_FRAME, checkSound); } public function liftObject(_arg1:Liftable):void{ if (_curLiftedObject != null){ return; }; if (!(_arg1.getLiftable())){ return; }; _curLiftedObject = _arg1; _curLiftedObject.stopMove(); _waitToLiftObject = true; } public function removeLiftedObject():void{ _curLiftedObject.restoreOriginStatus(); _curLiftedObject.setFalling(); _curLiftedObject = null; _body.DestroyShape(_body.GetShapeList()); var _local1:b2PolygonDef = new b2PolygonDef(); _local1.vertexCount = 4; b2Vec2(_local1.vertices[0]).Set((-1 / PhysicsVals.RATIO), (-1 / PhysicsVals.RATIO)); b2Vec2(_local1.vertices[1]).Set((1 / PhysicsVals.RATIO), (-1 / PhysicsVals.RATIO)); b2Vec2(_local1.vertices[2]).Set((1 / PhysicsVals.RATIO), (1 / PhysicsVals.RATIO)); b2Vec2(_local1.vertices[3]).Set((-1 / PhysicsVals.RATIO), (1 / PhysicsVals.RATIO)); _local1.density = 1E-6; _local1.isSensor = true; _body.CreateShape(_local1); _waitToLiftObject = false; if (_isLiftJointCreated){ PhysicsVals.world.DestroyJoint(_liftJoint); _isLiftJointCreated = false; }; } override protected function childSpecificUpdate():void{ var _local1:b2Vec2; var _local2:Number; var _local3:Number; var _local4:b2Vec2; if (((_activated) && (!(_isExploded)))){ _local1 = checkMoveKeys(); checkEnergy(); checkSpaceKey(); renderHaloes(); checkLiftedObj(); _local2 = (_costume.rotation * _angleTransferMulti); _local3 = _body.GetAngle(); if (Math.abs((_local3 - _local2)) < _angle1){ if (_body.GetAngularVelocity() != 0){ _body.SetAngularVelocity(0); }; } else { if (_local3 > _local2){ _body.SetAngularVelocity(-(_angle20)); } else { _body.SetAngularVelocity(_angle20); }; }; _body.ApplyForce(_local1, _body.GetWorldCenter()); _local4 = _body.GetLinearVelocity().Copy(); _local4.Multiply(0.94); _body.SetLinearVelocity(_local4); _camera.moveTo(new Point((_costume.x - 320), (_costume.y - 240))); } else { if (_isPreparingRevive){ _isExploded = false; _body.SetXForm(new b2Vec2((_revivePos.x / PhysicsVals.RATIO), (_revivePos.y / PhysicsVals.RATIO)), 0); _body.SetLinearVelocity(new b2Vec2(0, 0)); _costume.x = _revivePos.x; _costume.y = _revivePos.y; _costume.y = _revivePos.y; _costume.visible = true; _isPreparingRevive = false; destroyAllHaloes(); _curEnergy = 0; _camera.setEnergyDisplay(0); if (_liftSensor != null){ removeLifterSensor(); }; if (_curLiftedObject != null){ removeLiftedObject(); }; }; }; } public function explode():void{ if (_isExploded){ return; }; isAlive = false; _moveIndicSpr.visible = false; SoundManager.playExplosion(); _isExploded = true; CommonVals.gamePaused = true; var _local1:Number = _costume.x; var _local2:Number = _costume.y; _costume.visible = false; _camera.setVisualEnergy(false); _explosionAnim = new UfoExplosion(); _explosionAnim.x = _local1; _explosionAnim.y = _local2; _costume.parent.addChild(_explosionAnim); _explosionAnim.gotoAndPlay(1); _body.GetShapeList().m_isSensor = true; _shakePos = new Point(_camera.frontLayer.x, _camera.frontLayer.y); _explosionAnim.addEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); } public function revive(_arg1:Point):void{ _revivePos = _arg1; isAlive = true; _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); _camera.tweenTo(new Point((_arg1.x - 320), (_arg1.y - 240)), 1); } private function onTweenComplete(_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); CommonVals.gamePaused = true; _ufoReviveAnim = new UfoSpawningMcLib(); _ufoReviveAnim.x = _revivePos.x; _ufoReviveAnim.y = _revivePos.y; _camera.frontLayer.addChild(_ufoReviveAnim); _costume.rotation = 0; _ufoReviveAnim.addEventListener(Event.ENTER_FRAME, onReviveAnimEnterFrame); _ufoReviveAnim.gotoAndPlay(1); } private function onReviveAnimEnterFrame(_arg1:Event):void{ if (_ufoReviveAnim.currentFrame == _ufoReviveAnim.totalFrames){ _ufoReviveAnim.removeEventListener(Event.ENTER_FRAME, onReviveAnimEnterFrame); _camera.frontLayer.removeChild(_ufoReviveAnim); _ufoReviveAnim = null; CommonVals.gamePaused = false; _isPreparingRevive = true; }; } private function onExplosionEnterFrame(_arg1:Event):void{ _camera.frontLayer.x = ((_shakePos.x + (Math.random() * 8)) - 4); _camera.frontLayer.y = ((_shakePos.y + (Math.random() * 8)) - 4); if (_explosionAnim.currentFrame == _explosionAnim.totalFrames){ CommonVals.gamePaused = true; _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _costume.parent.removeChild(_explosionAnim); _explosionAnim = null; _gameEventDispatcher.onUfoExploded(); }; } private function checkLiftedObj():void{ var _local1:b2ContactEdge; var _local2:Boolean; var _local3:Number; var _local4:Number; var _local5:Number; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:b2RevoluteJointDef; var _local10:b2PolygonDef; var _local11:Array; var _local12:Liftable; var _local13:int; var _local14:Number; var _local15:Number; var _local16:Number; var _local17:Liftable; var _local18:int; var _local19:Liftable; var _local20:Number; var _local21:Number; var _local22:Number; if (_isOverHeated){ return; }; if (_curLiftedObject != null){ if (_isLiftJointCreated){ } else { _local1 = _curLiftedObject.getBody().m_contactList; _local2 = false; while (_local1 != null) { if (_local1.other == _liftSensor.body){ _local2 = true; break; }; _local1 = _local1.next; }; if (!(_local2)){ removeLiftedObject(); return; }; _local3 = _costume.x; _local4 = (_costume.y + _curLiftedObject.getLiftHeight()); _local5 = _curLiftedObject.getPos().x; _local6 = _curLiftedObject.getPos().y; if ((_local6 - 4) > _local4){ _local8 = (_local6 - 2); if (Math.abs((_local5 - _local3)) > 1){ _local7 = ((2 * (_local3 - _local5)) / Math.abs((_local3 - _local5))); } else { _local7 = (_local3 - _local5); }; _curLiftedObject.getBody().ApplyForce(new b2Vec2(((_local7 * _curLiftedObject.getMass()) * PhysicsVals.GRAVITY), ((-(_curLiftedObject.getMass()) * PhysicsVals.GRAVITY) * 3)), _curLiftedObject.getBody().GetWorldCenter()); _curLiftedObject.getBody().SetAngularVelocity(-(_curLiftedObject.getBody().GetAngle())); } else { _local8 = _local4; _curLiftedObject.getBody().ApplyForce(new b2Vec2(0, (-(_curLiftedObject.getMass()) * PhysicsVals.GRAVITY)), _curLiftedObject.getBody().GetWorldCenter()); _curLiftedObject.getBody().SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), (_local8 / PhysicsVals.RATIO)), 0); _curLiftedObject.prepareLiftStatus(); _local9 = new b2RevoluteJointDef(); _local9.Initialize(_body, _curLiftedObject.getBody(), new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y + 6) / PhysicsVals.RATIO))); _local9.enableLimit = true; _local9.lowerAngle = 0; _local9.upperAngle = 0; _liftJoint = (PhysicsVals.world.CreateJoint(_local9) as b2RevoluteJoint); _isLiftJointCreated = true; if ((_curLiftedObject is CowActor)){ _body.DestroyShape(_body.GetShapeList()); _local10 = new b2PolygonDef(); _local10.vertexCount = 4; b2Vec2(_local10.vertices[0]).Set((-24 / PhysicsVals.RATIO), (-4 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[1]).Set((24 / PhysicsVals.RATIO), (-4 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[2]).Set((24 / PhysicsVals.RATIO), (50 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[3]).Set((-24 / PhysicsVals.RATIO), (50 / PhysicsVals.RATIO)); _local10.density = 1E-6; _body.CreateShape(_local10); } else { _body.DestroyShape(_body.GetShapeList()); _local10 = new b2PolygonDef(); _local10.vertexCount = 4; b2Vec2(_local10.vertices[0]).Set((-14 / PhysicsVals.RATIO), (-4 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[1]).Set((14 / PhysicsVals.RATIO), (-4 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[2]).Set((14 / PhysicsVals.RATIO), (30 / PhysicsVals.RATIO)); b2Vec2(_local10.vertices[3]).Set((-14 / PhysicsVals.RATIO), (30 / PhysicsVals.RATIO)); _local10.density = 1E-6; _body.CreateShape(_local10); }; }; }; } else { if (_liftSensor != null){ _local1 = _liftSensor.body.m_contactList; _local11 = []; while (_local1 != null) { if ((_local1.other.GetUserData() is Liftable)){ _local12 = _local1.other.GetUserData(); _local11.push(_local12); }; _local1 = _local1.next; }; _local13 = _local11.length; if (_local13 >= 1){ _local14 = _body.GetWorldCenter().x; _local15 = _body.GetWorldCenter().y; _local16 = 10000000000; _local17 = _local11[0]; _local18 = 0; while (_local18 < _local13) { _local19 = _local11[_local18]; _local20 = _local19.getBody().GetWorldCenter().x; _local21 = _local19.getBody().GetWorldCenter().y; _local22 = (((_local20 - _local14) * (_local20 - _local14)) + ((_local21 - _local15) * (_local21 - _local15))); if (_local22 < _local16){ _local16 = _local22; _local17 = _local19; }; _local18++; }; _local12 = _local17; }; if (_local12 != null){ liftObject(_local12); }; }; }; } private function checkMoveKeys():b2Vec2{ var _local2:Number; var _local3:Boolean; var _local4:Boolean; var _local5:int; var _local6:Number; var _local7:Number; var _local8:Number; var _local9:Number; var _local10:Number; var _local11:Number; var _local12:Number; var _local13:Number; var _local14:Number; var _local1:b2Vec2 = _engineForce.Copy(); if (!(LevelController.getInstance().isConntrolledByMouse)){ if (_moveIndicSpr.visible){ _moveIndicSpr.visible = false; }; _local2 = Input.ctrKeyArr.length; if (_local2 != 0){ _local3 = false; _local4 = false; _local5 = 0; while (_local5 < _local2) { if (((_local3) && (_local4))){ break; }; switch (Input.ctrKeyArr[_local5]){ case Input.UP: case Input.W: if (!(_local3)){ _local1.y = (_local1.y - _keyMoveForce.y); }; break; case Input.DOWN: case Input.S: if (!(_local3)){ _local1.y = (_local1.y + _keyMoveForce.y); _local3 = true; }; break; case Input.LEFT: case Input.A: if (!(_local4)){ _local1.x = (_local1.x - _keyMoveForce.x); _local4 = true; _costume.rotation = -15; }; break; case Input.RIGHT: case Input.D: if (!(_local4)){ _local1.x = (_local1.x + _keyMoveForce.x); _local4 = true; _costume.rotation = 15; }; break; default: break; }; _local5++; }; } else { if (Math.abs(_costume.rotation) > 1){ _costume.rotation = (_costume.rotation * 0.8); } else { _costume.rotation = 0; }; }; } else { if (isWait){ if (++waitCount > 40){ isWait = false; }; return (_local1); }; _local6 = _costume.parent.mouseX; _local7 = _costume.parent.mouseY; _local8 = 20; if (!(_moveIndicSpr.visible)){ _moveIndicSpr.visible = true; }; _local9 = (_local6 - _costume.x); _local10 = (_local7 - _costume.y); _local11 = Math.atan2(_local10, _local9); if (_local9 < 0){ }; _moveIndicSpr.rotation = ((180 * _local11) / Math.PI); _local12 = 40; _moveIndicSpr.x = (_costume.x + (_local12 * Math.cos(_local11))); _moveIndicSpr.y = (_costume.y + (_local12 * Math.sin(_local11))); if ((((((((((_local6 < (_costume.x + _local8))) && ((_local6 > (_costume.x - _local8))))) && ((_local7 < (_costume.y + _local8))))) && ((_local7 > (_costume.y - _local8))))) || (CommonVals.ufoMouseLocked))){ if (Math.abs(_costume.rotation) > 1){ _costume.rotation = (_costume.rotation * 0.8); } else { _costume.rotation = 0; }; _moveIndicSpr.visible = false; } else { _local13 = (_local9 / Math.abs(_local9)); _local14 = (_local10 / Math.abs(_local10)); if (Math.abs(_local9) < _local8){ _local13 = 0; } else { if (Math.abs(_local10) < _local8){ _local14 = 0; }; }; _local1.x = (_local1.x + (_local13 * _mouseMoveForce.x)); _local1.y = (_local1.y + (_local14 * _mouseMoveForce.y)); if (_local13 > 0){ _costume.rotation = 15; } else { if (_local13 < 0){ _costume.rotation = -15; }; }; }; }; return (_local1); } private function checkSpaceKey():void{ var _local1:HaloActor; if (((((!(LevelController.getInstance().isConntrolledByMouse)) && (Input.spaceHold))) || (((LevelController.getInstance().isConntrolledByMouse) && (Input.MouseDown))))){ _camera.setVisualEnergy(true); if (_isOverHeated){ return; }; if (_liftSensor == null){ addLifterSensor(); }; if (_haloCount >= _haloCountTotal){ _local1 = new HaloActor(_camera.frontLayer, 0.4, new Point(_costume.x, (_costume.y + 100)), _costume.rotation); _haloArray.push(_local1); _camera.frontLayer.addChild(_costume); _haloCount = 0; } else { _haloCount++; }; } else { if (_liftSensor != null){ removeLifterSensor(); }; if (_curLiftedObject != null){ removeLiftedObject(); }; if (_haloArray.length != 0){ if (_haloArray[0].updateAlphaMutlply != 0.9){ for each (_local1 in _haloArray) { _local1.updateAlphaMutlply = 0.9; }; }; }; }; } private function checkEnergy():void{ if (_isOverHeated){ if (_curEnergy < 0){ _isOverHeated = false; _curEnergy = 0; _camera.setEnergyDisplay(0); } else { _curEnergy = (_curEnergy - 2); _camera.setEnergyDisplay((_curEnergy / _maxEnergy)); }; } else { if (((((!(LevelController.getInstance().isConntrolledByMouse)) && (Input.spaceHold))) || (((LevelController.getInstance().isConntrolledByMouse) && (Input.MouseDown))))){ if (_curEnergy < _maxEnergy){ _curEnergy++; _camera.setEnergyDisplay((_curEnergy / _maxEnergy)); } else { _isOverHeated = true; _curEnergy = _maxEnergy; _camera.setEnergyDisplay(1); Input.spaceHold = false; if (_isLiftJointCreated){ removeLiftedObject(); }; }; } else { if (_curEnergy > 0){ _curEnergy--; _camera.setEnergyDisplay((_curEnergy / _maxEnergy)); }; }; }; _camera.setEnergyPos(_costume.x, _costume.y); } private function renderHaloes():void{ var _local2:HaloActor; var _local1:int; while (_local1 < _haloArray.length) { _local2 = _haloArray[_local1]; if (_local2.costume.y > (_costume.y + 100)){ _local2.destroy(); _haloArray.splice(_local1, 1); _local1--; } else { _local2.body.SetXForm(new b2Vec2((_costume.x / PhysicsVals.RATIO), ((_costume.y + (_local2.moveCount * 3)) / PhysicsVals.RATIO)), _local2.body.GetAngle()); _local2.update(); }; _local1++; }; } private function destroyAllHaloes():void{ var _local1:int; while (_local1 < _haloArray.length) { _haloArray[_local1].destroy(); _local1++; }; _haloArray = new Array(); } override protected function updateMyLook():void{ _costume.x = (_body.GetPosition().x * PhysicsVals.RATIO); _costume.y = (_body.GetPosition().y * PhysicsVals.RATIO); } override protected function cleanUpBeforeRemoving():void{ if (_explosionAnim != null){ _explosionAnim.removeEventListener(Event.ENTER_FRAME, onExplosionEnterFrame); _costume.parent.removeChild(_explosionAnim); _explosionAnim = null; }; _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); if (_ufoReviveAnim != null){ _ufoReviveAnim.removeEventListener(Event.ENTER_FRAME, onReviveAnimEnterFrame); }; if (_liftSensor != null){ removeLifterSensor(); }; destroyAllHaloes(); _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; _costume.removeEventListener(Event.ENTER_FRAME, checkSound); _moveIndicSpr.parent.removeChild(_moveIndicSpr); } } }//package com.tinime.actors
Section 125
//WindmillFanActor (com.tinime.actors.WindmillFanActor) package com.tinime.actors { import flash.display.*; import com.tinime.control.*; import flash.geom.*; import Box2D.Collision.Shapes.*; import com.tinime.data.*; import Box2D.Dynamics.*; import Box2D.Dynamics.Joints.*; import Box2D.Common.Math.*; public class WindmillFanActor extends Actor { private var _speedAngle:Number; private var _starPos:b2Vec2; private var _floatingYForce:Number; public function WindmillFanActor(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Number){ var _local6:Sprite; _speedAngle = ((_arg5 * Math.PI) / 180); _local6 = Box2dObjSpawner.buildBitmapSprite(_arg1, new WindmillFanSprLib(), _arg2, _arg3, new Point(275, 279), new Point(-138, -138), _arg4); var _local7:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-133, -17], [133, -17], [133, 17], [-133, 17]], _arg3); var _local8:b2PolygonDef = Box2dObjSpawner.buildPolygonDef([[-17, -133], [17, -133], [17, 133], [-17, 133]], _arg3); _local7.density = 100000; _local8.density = 100000; _local7.filter.categoryBits = PhysicsVals.TUNNEL_BLOCK; _local7.filter.maskBits = (((PhysicsVals.BOMB_CATAGORY | PhysicsVals.UFO_CATEGORY) | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); _local8.filter.categoryBits = PhysicsVals.TUNNEL_BLOCK; _local8.filter.maskBits = ((PhysicsVals.UFO_CATEGORY | PhysicsVals.NPC_CATAGORY) | PhysicsVals.OBJECT_CATEGORY); var _local9:b2BodyDef = new b2BodyDef(); _local9.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _local9.angle = ((_arg4 * Math.PI) / 180); var _local10:b2Body = PhysicsVals.world.CreateBody(_local9); _local10.CreateShape(_local7); _local10.CreateShape(_local8); _local10.SetMassFromShapes(); super(_local10, _local6); _starPos = _body.GetWorldCenter(); var _local11:b2RevoluteJointDef = new b2RevoluteJointDef(); _local11.Initialize(PhysicsVals.world.GetGroundBody(), _local10, _local10.GetWorldCenter()); var _local12:b2RevoluteJoint = (PhysicsVals.world.CreateJoint(_local11) as b2RevoluteJoint); } override protected function childSpecificUpdate():void{ var _local1:Number; if (_body.GetAngle() > (Math.PI * 2)){ _local1 = ((_body.GetAngle() + _speedAngle) - (Math.PI * 2)); } else { if (_body.GetAngle() < (-(Math.PI) * 2)){ _local1 = ((_body.GetAngle() + _speedAngle) + (Math.PI * 2)); } else { _local1 = (_body.GetAngle() + _speedAngle); }; }; _body.SetXForm(_starPos, _local1); } } }//package com.tinime.actors
Section 126
//ActorsManager (com.tinime.control.ActorsManager) package com.tinime.control { import com.tinime.actors.*; public class ActorsManager { private var updateArray:Array; private var destroyArray:Array; private static var _instance:ActorsManager; public function ActorsManager(_arg1:SingletonEnforcer){ updateArray = new Array(); destroyArray = new Array(); } public function add(_arg1:Actor):void{ updateArray.push(_arg1); } public function remove(_arg1:Actor):void{ destroyArray.push(_arg1); } public function update():void{ var _local1:Actor; var _local2:Actor; var _local3:int; for each (_local1 in updateArray) { _local1.update(); }; for each (_local2 in destroyArray) { _local3 = updateArray.indexOf(_local2); if (_local3 != -1){ updateArray.splice(_local3, 1); }; _local2.destroy(); _local2 = null; }; destroyArray = new Array(); } public function removeAllActors():void{ var _local1:Actor; for each (_local1 in updateArray) { _local1.destroy(); _local1 = null; }; destroyArray = new Array(); updateArray = new Array(); } public static function getInstance():ActorsManager{ if (_instance == null){ _instance = new ActorsManager(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.control class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 127
//Box2dObjSpawner (com.tinime.control.Box2dObjSpawner) package com.tinime.control { import Box2D.Collision.Shapes.*; import Box2D.Common.Math.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.geom.*; import flash.display.*; public class Box2dObjSpawner { public static function buildBody(_arg1:Array, _arg2:Object, _arg3:Point, _arg4:Number=0, _arg5:Number=0.7, _arg6:Number=0, _arg7:Number=1, _arg8:Number=0):b2Body{ var _local9:int = _arg1.length; var _local10:b2PolygonDef = new b2PolygonDef(); _local10.vertexCount = _local9; var _local11:int; while (_local11 < _local9) { b2Vec2(_local10.vertices[_local11]).Set(((_arg1[_local11][0] * _arg7) / PhysicsVals.RATIO), ((_arg1[_local11][1] * _arg7) / PhysicsVals.RATIO)); _local11++; }; _local10.friction = _arg5; _local10.density = _arg4; _local10.restitution = _arg6; var _local12:b2BodyDef = new b2BodyDef(); _local12.position.Set((_arg3.x / PhysicsVals.RATIO), (_arg3.y / PhysicsVals.RATIO)); _local12.angle = ((_arg8 * Math.PI) / 180); var _local13:b2Body = PhysicsVals.world.CreateBody(_local12); _local13.CreateShape(_local10); _local13.SetMassFromShapes(); _local13.SetUserData(_arg2); return (_local13); } public static function buildPolygonDef(_arg1:Array, _arg2:Number=1):b2PolygonDef{ var _local3:b2PolygonDef = new b2PolygonDef(); var _local4:int = _arg1.length; _local3.vertexCount = _local4; var _local5:int; while (_local5 < _local4) { b2Vec2(_local3.vertices[_local5]).Set(((_arg1[_local5][0] * _arg2) / PhysicsVals.RATIO), ((_arg1[_local5][1] * _arg2) / PhysicsVals.RATIO)); _local5++; }; _local3.restitution = 0; _local3.friction = 0.7; return (_local3); } public static function buildCostume(_arg1:DisplayObjectContainer, _arg2:DisplayObjectContainer, _arg3:Point, _arg4:Number=1, _arg5:Number=0):DisplayObjectContainer{ _arg2.scaleX = _arg4; _arg2.scaleY = _arg4; _arg2.x = _arg3.x; _arg2.y = _arg3.y; _arg2.rotation = _arg5; _arg1.addChild(_arg2); return (_arg2); } public static function buildBitmapSprite(_arg1:DisplayObjectContainer, _arg2:DisplayObjectContainer, _arg3:Point, _arg4:Number, _arg5:Point, _arg6:Point, _arg7:Number=0):Sprite{ var _local8:BitmapData = new BitmapData((_arg5.x * _arg4), (_arg5.y * _arg4), true, 0xFF0000); var _local9:Matrix = new Matrix(); _local9.scale(_arg4, _arg4); _local8.draw(_arg2, _local9); var _local10:Bitmap = new Bitmap(_local8, "auto", true); var _local11:Sprite = new Sprite(); _local10.x = (_arg6.x * _arg4); _local10.y = (_arg6.y * _arg4); _local11.addChild(_local10); _local11.x = _arg3.x; _local11.y = _arg3.y; _local11.rotation = _arg7; _arg1.addChild(_local11); return (_local11); } } }//package com.tinime.control
Section 128
//CameraModeControl (com.tinime.control.CameraModeControl) package com.tinime.control { import com.tinime.event.*; import com.tinime.view.*; import flash.events.*; import com.tinime.data.*; import flash.geom.*; import flash.display.*; public class CameraModeControl { private var _cameraBtn:MovieClip; private var _cameraMode:Boolean; private var _cameraModeLock:Boolean; private var _gameEventDispatcher:GameEventDispatcher; private var _camera:Camera; private static var _instance:CameraModeControl; public function CameraModeControl(_arg1:SingletonEnforcer){ _gameEventDispatcher = GameEventDispatcher.getInstance(); _camera = Camera.getInstance(); super(); } public function addCameraButton():void{ _cameraMode = false; _cameraModeLock = false; _cameraBtn = new CameraBtnMcLib(); _cameraBtn.x = 3; _cameraBtn.y = 437; UIManager.stage.addChild(_cameraBtn); _cameraBtn.buttonMode = true; _cameraBtn.useHandCursor = true; _cameraBtn.mouseEnabled = true; _cameraBtn.gotoAndStop(1); _cameraBtn.addEventListener(Event.REMOVED_FROM_STAGE, onBtnRemoved); _cameraBtn.addEventListener(MouseEvent.CLICK, onBtnClicked); _cameraBtn.addEventListener(MouseEvent.ROLL_OVER, onBtnRollOver); _cameraBtn.addEventListener(MouseEvent.ROLL_OUT, onBtnRollOut); } public function onSwitchCameraMode():void{ var onLeaveCameraMode:Function; var onEnterCameraMode:Function; if (_cameraBtn == null){ return; }; if (_cameraModeLock){ return; }; if (_cameraMode){ onLeaveCameraMode = function (_arg1:UIEvent):void{ var onTweenToStartComplete:Function; var e = _arg1; onTweenToStartComplete = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenToStartComplete); CommonVals.gamePaused = false; CommonVals.gameLocked = false; _cameraModeLock = false; }; UIEventDispatcher.getInstance().removeEventListener(UIEvent.CAMERA_MASK_REMOVED, onLeaveCameraMode); _camera.tweenTo(_camera.cameraModeStartPos, 1); _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, onTweenToStartComplete); }; _cameraModeLock = true; _cameraMode = false; if (!(_cameraBtn.hitTestPoint(_cameraBtn.parent.mouseX, _cameraBtn.parent.mouseY))){ _cameraBtn.gotoAndStop(1); }; _camera.stage.removeEventListener(Event.ENTER_FRAME, onCameraMode); UIEventDispatcher.getInstance().addEventListener(UIEvent.CAMERA_MASK_REMOVED, onLeaveCameraMode); _camera.removeCameraMask(); } else { onEnterCameraMode = function (_arg1:UIEvent):void{ UIEventDispatcher.getInstance().removeEventListener(UIEvent.CAMERA_MASK_ADDED, onEnterCameraMode); _cameraModeLock = false; }; if (((CommonVals.gameLocked) || (CommonVals.gamePaused))){ return; }; _cameraModeLock = true; _cameraMode = true; _cameraBtn.gotoAndStop(2); CommonVals.gamePaused = true; CommonVals.gameLocked = true; UIEventDispatcher.getInstance().addEventListener(UIEvent.CAMERA_MASK_ADDED, onEnterCameraMode); _camera.addCameraMask(); _camera.stage.addEventListener(Event.ENTER_FRAME, onCameraMode); }; } private function onCameraMode(_arg1:Event):void{ var _local2:uint; if (Input.ctrKeyArr.length == 0){ return; }; for each (_local2 in Input.ctrKeyArr) { switch (_local2){ case Input.UP: case Input.W: _camera.moveTo(new Point(-(_camera.frontLayer.x), (-(_camera.frontLayer.y) - 6))); break; case Input.DOWN: case Input.S: _camera.moveTo(new Point(-(_camera.frontLayer.x), (-(_camera.frontLayer.y) + 6))); break; case Input.LEFT: case Input.A: _camera.moveTo(new Point((-(_camera.frontLayer.x) - 6), -(_camera.frontLayer.y))); break; case Input.RIGHT: case Input.D: _camera.moveTo(new Point((-(_camera.frontLayer.x) + 6), -(_camera.frontLayer.y))); break; default: break; }; }; } private function onBtnRemoved(_arg1:Event):void{ _cameraBtn.removeEventListener(Event.REMOVED_FROM_STAGE, onBtnRemoved); _cameraBtn.removeEventListener(MouseEvent.CLICK, onBtnClicked); _cameraBtn.removeEventListener(MouseEvent.ROLL_OVER, onBtnRollOver); _cameraBtn.removeEventListener(MouseEvent.ROLL_OUT, onBtnRollOut); while (_cameraBtn.numChildren) { _cameraBtn.removeChildAt(0); }; _cameraBtn = null; } private function onBtnClicked(_arg1:MouseEvent):void{ onSwitchCameraMode(); } private function onBtnRollOver(_arg1:MouseEvent):void{ if (((((((CommonVals.gameLocked) || (CommonVals.gamePaused))) || (_cameraModeLock))) && (!(_cameraMode)))){ _cameraBtn.gotoAndStop(1); } else { _cameraBtn.gotoAndStop(2); }; } private function onBtnRollOut(_arg1:MouseEvent):void{ if (_cameraMode){ _cameraBtn.gotoAndStop(2); } else { _cameraBtn.gotoAndStop(1); }; } public static function getInstance():CameraModeControl{ if (_instance == null){ _instance = new CameraModeControl(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.control class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 129
//GameContactListener (com.tinime.control.GameContactListener) package com.tinime.control { import com.tinime.actors.*; import com.tinime.data.*; import com.tinime.objects.*; import Box2D.Collision.*; import Box2D.Dynamics.*; public class GameContactListener extends b2ContactListener { override public function Add(_arg1:b2ContactPoint):void{ var _local2:Object = _arg1.shape1.GetBody().GetUserData(); var _local3:Object = _arg1.shape2.GetBody().GetUserData(); if ((((_local2 is TeleTransmissionActor)) && ((_local3 is AnimalActor)))){ TeleTransmissionActor(_local2).absorbAnimal(AnimalActor(_local3)); }; if ((((_local3 is TeleTransmissionActor)) && ((_local2 is AnimalActor)))){ TeleTransmissionActor(_local3).absorbAnimal(AnimalActor(_local2)); }; if ((((((_local2 is HaloActor)) && ((_local3 is String)))) && ((_local3 == CommonVals.SCENE_BLOCK)))){ HaloActor(_local2).hide(); }; if ((((((_local3 is HaloActor)) && ((_local2 is String)))) && ((_local2 == CommonVals.SCENE_BLOCK)))){ HaloActor(_local3).hide(); }; if ((((((((_local2 is UfoActor)) && ((_local3 is String)))) && ((_local3 == CommonVals.MALICIOUS_BLOCK)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ UfoActor(_local2).explode(); }; if ((((((((_local3 is UfoActor)) && ((_local2 is String)))) && ((_local2 == CommonVals.MALICIOUS_BLOCK)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ UfoActor(_local3).explode(); }; if ((((((_local2 is UfoActor)) && ((_local3 == CommonVals.LASER_BEAM)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ UfoActor(_local2).explode(); }; if ((((((_local3 is UfoActor)) && ((_local2 == CommonVals.LASER_BEAM)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ UfoActor(_local3).explode(); }; if ((((((_local2 is UfoActor)) && ((_local3 is HiddenBlockActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ HiddenBlockActor(_local3).onContact(); }; if ((((((_local3 is UfoActor)) && ((_local2 is HiddenBlockActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ HiddenBlockActor(_local2).onContact(); }; if ((((((_local2 is AnimalActor)) && ((_local3 is String)))) && ((_local3 == CommonVals.MALICIOUS_BLOCK)))){ AnimalActor(_local2).die(); }; if ((((((_local3 is AnimalActor)) && ((_local2 is String)))) && ((_local2 == CommonVals.MALICIOUS_BLOCK)))){ AnimalActor(_local3).die(); }; if ((((_local2 is AnimalActor)) && ((_local3 == CommonVals.LASER_BEAM)))){ AnimalActor(_local2).die(); }; if ((((_local3 is AnimalActor)) && ((_local2 == CommonVals.LASER_BEAM)))){ AnimalActor(_local3).die(); }; if ((((_local2 is AnimalActor)) && ((_local3 is SpinyStickActor)))){ AnimalActor(_local2).die(); }; if ((((_local3 is AnimalActor)) && ((_local2 is SpinyStickActor)))){ AnimalActor(_local3).die(); }; if ((((_local2 is CannonBallActor)) && ((_local3 == CommonVals.LASER_BEAM)))){ CannonBallActor(_local2)._immediateExplode = true; CannonBallActor(_local2).explode(); }; if ((((_local3 is CannonBallActor)) && ((_local2 == CommonVals.LASER_BEAM)))){ CannonBallActor(_local3)._immediateExplode = true; CannonBallActor(_local3).explode(); }; if ((((_local2 is DebrisActor)) && ((_local3 == CommonVals.LASER_BEAM)))){ DebrisActor(_local2).explode(); }; if ((((_local3 is DebrisActor)) && ((_local2 == CommonVals.LASER_BEAM)))){ DebrisActor(_local3).explode(); }; if ((((_local2 is StarTokenActor)) && ((_local3 is UfoActor)))){ if (_arg1.shape2 != UfoActor(_local3).body.GetShapeList()){ StarTokenActor(_local2).touch(); }; }; if ((((_local3 is StarTokenActor)) && ((_local2 is UfoActor)))){ if (_arg1.shape1 != UfoActor(_local2).body.GetShapeList()){ StarTokenActor(_local3).touch(); }; }; if ((((_local2 is CannonBallActor)) && ((_local3 is UfoActor)))){ if (_arg1.shape2 != UfoActor(_local3).body.GetShapeList()){ CannonBallActor(_local2)._immediateExplode = true; CannonBallActor(_local2).explode(); UfoActor(_local3).explode(); }; }; if ((((_local3 is CannonBallActor)) && ((_local2 is UfoActor)))){ if (_arg1.shape1 != UfoActor(_local2).body.GetShapeList()){ CannonBallActor(_local3)._immediateExplode = true; CannonBallActor(_local3).explode(); UfoActor(_local2).explode(); }; }; if ((((_local2 is UfoSpawner)) && ((_local3 is UfoActor)))){ if (_arg1.shape2 != UfoActor(_local3).body.GetShapeList()){ UfoSpawner(_local2).touch(); }; }; if ((((_local3 is UfoSpawner)) && ((_local2 is UfoActor)))){ if (_arg1.shape1 != UfoActor(_local2).body.GetShapeList()){ UfoSpawner(_local3).touch(); }; }; if ((((_local2 is BumperActor)) && ((_local3 is UfoActor)))){ if (_arg1.shape2 != UfoActor(_local3).body.GetShapeList()){ BumperActor(_local2).touch(); }; }; if ((((_local3 is BumperActor)) && ((_local2 is UfoActor)))){ if (_arg1.shape1 != UfoActor(_local2).body.GetShapeList()){ BumperActor(_local3).touch(); }; }; if ((((_local2 is BumperActor)) && ((_local3 is AnimalActor)))){ BumperActor(_local2).touch(); }; if ((((_local3 is BumperActor)) && ((_local2 is AnimalActor)))){ BumperActor(_local3).touch(); }; if ((((_local2 is BumperActor)) && ((_local3 is TrashCanActor)))){ BumperActor(_local2).touch(); }; if ((((_local3 is BumperActor)) && ((_local2 is TrashCanActor)))){ BumperActor(_local3).touch(); }; if ((((((_local2 is FloatBombActor)) && ((_local3 is UfoActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ UfoActor(_local3).explode(); }; if ((((((_local3 is FloatBombActor)) && ((_local2 is UfoActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ UfoActor(_local2).explode(); }; if ((((((_local2 is KeyActor)) && ((_local3 is UfoActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ KeyActor(_local2).trigger(); }; if ((((((_local3 is KeyActor)) && ((_local2 is UfoActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ KeyActor(_local3).trigger(); }; if ((((((_local2 is TriggerActor)) && ((_local3 is UfoActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ TriggerActor(_local2).trigger(); }; if ((((((_local3 is TriggerActor)) && ((_local2 is UfoActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ TriggerActor(_local3).trigger(); }; if ((((((_local2 is SpinyBallActor)) && ((_local3 is UfoActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ UfoActor(_local3).explode(); }; if ((((((_local3 is SpinyBallActor)) && ((_local2 is UfoActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ UfoActor(_local2).explode(); }; if ((((((_local2 is SpinyStickActor)) && ((_local3 is UfoActor)))) && (!((_arg1.shape2 == UfoActor(_local3).body.GetShapeList()))))){ UfoActor(_local3).explode(); }; if ((((((_local3 is SpinyStickActor)) && ((_local2 is UfoActor)))) && (!((_arg1.shape1 == UfoActor(_local2).body.GetShapeList()))))){ UfoActor(_local2).explode(); }; if ((((_local2 is FloatBombActor)) && ((_local3 is AnimalActor)))){ AnimalActor(_local3).die(); }; if ((((_local3 is FloatBombActor)) && ((_local2 is AnimalActor)))){ AnimalActor(_local2).die(); }; if ((((_local2 is CarActor)) && ((_local3 is AnimalActor)))){ AnimalActor(_local3).contactCar(); }; if ((((_local3 is CarActor)) && ((_local2 is AnimalActor)))){ AnimalActor(_local2).contactCar(); }; if ((((_local2 is SpinyBallActor)) && ((_local3 is AnimalActor)))){ AnimalActor(_local3).die(); }; if ((((_local3 is SpinyBallActor)) && ((_local2 is AnimalActor)))){ AnimalActor(_local2).die(); }; if ((((_local2 is FloatBombActor)) && ((_local3 is TrashCanActor)))){ FloatBombActor(_local2).explode(); }; if ((((_local3 is FloatBombActor)) && ((_local2 is TrashCanActor)))){ FloatBombActor(_local3).explode(); }; if ((((_local2 is FloatBombActor)) && ((_local3 is SpinyBallActor)))){ FloatBombActor(_local2).explode(); }; if ((((_local3 is FloatBombActor)) && ((_local2 is SpinyBallActor)))){ FloatBombActor(_local3).explode(); }; super.Add(_arg1); } } }//package com.tinime.control
Section 130
//GameLoopControl (com.tinime.control.GameLoopControl) package com.tinime.control { import com.tinime.event.*; import FGL.GameTracker.*; import com.tinime.view.*; import com.tinime.levels.*; import flash.display.*; import com.tinime.data.*; import flash.events.*; public class GameLoopControl { private var _actorsManager:ActorsManager; private var _ifNeedReplayMenuMusic:Boolean;// = true private var _gameEventDispatcher:GameEventDispatcher; private var _uiEventListener:UIEventDispatcher; public var gameTracker:GameTracker; private static var _instance:GameLoopControl; public function GameLoopControl(_arg1:SingletonEnforcer){ _gameEventDispatcher = GameEventDispatcher.getInstance(); _uiEventListener = UIEventDispatcher.getInstance(); gameTracker = new GameTracker(); super(); } public function initGame(_arg1:Sprite):void{ Input.initialize(_arg1); UIManager.stage = _arg1; Camera.stage = _arg1; TimeController.initial(); LivesControl.initiateLives(); LevelsData.init(); SaveManager.readLevelInfo(); SaveManager.readMedalsInfo(); gameTracker.beginGame(0); _actorsManager = ActorsManager.getInstance(); enterLogoScreen(); } private function enterLogoScreen():void{ var onLogoScreenReady:Function; var onBitmapAnimDataReady:Function; onLogoScreenReady = function (_arg1:UIEvent):void{ _uiEventListener.removeEventListener(UIEvent.LOGO_SCREEN_READY, onLogoScreenReady); _gameEventDispatcher.addEventListener(GameEvent.ANIMATED_BITMAP_DATA_READY, onBitmapAnimDataReady); BitmapAnimManager.getInstance().initBitmapAnimData(); UIManager.showAnimBitmapInitStatus(); }; onBitmapAnimDataReady = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.ANIMATED_BITMAP_DATA_READY, onBitmapAnimDataReady); enterMenuScreen(); }; _uiEventListener.addEventListener(UIEvent.LOGO_SCREEN_READY, onLogoScreenReady); UIManager.showLogoScreen(); } private function enterMenuScreen(_arg1:GameEvent=null):void{ CommonVals.allLevelComplete = false; _gameEventDispatcher.removeEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); TutorialManager.resetTutorial(); UIManager.showMenuScreen(_ifNeedReplayMenuMusic); addMenuEvent(); CommonVals.controllerSetted = false; } private function enterScoresScreen(_arg1:GameEvent=null):void{ _ifNeedReplayMenuMusic = false; clearMenuEvent(); UIManager.showScoresScreen(); _gameEventDispatcher.addEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); } private function enterCreditsScreen(_arg1:GameEvent=null):void{ _ifNeedReplayMenuMusic = false; clearMenuEvent(); UIManager.showCreditsScreen(); _gameEventDispatcher.addEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); } private function enterMedalScreen(_arg1:GameEvent=null):void{ _ifNeedReplayMenuMusic = false; clearMenuEvent(); UIManager.showMedalScreen(); _gameEventDispatcher.addEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); } private function enterLevelScreen(_arg1:GameEvent=null):void{ _ifNeedReplayMenuMusic = false; clearMenuEvent(); UIManager.showLevelScreen(); _gameEventDispatcher.addEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); _gameEventDispatcher.addEventListener(GameEvent.SHOW_GAME_PLAY_SCREEN, enterGamePlayScreen); } private function enterGamePlayScreen(_arg1:GameEvent=null):void{ var onPlayScreenReady:Function; var onQuitControllerPanel:Function; var onMouseMove:Function; var e = _arg1; onPlayScreenReady = function (_arg1:UIEvent):void{ UIEventDispatcher.getInstance().removeEventListener(UIEvent.PLAY_SCREEN_READY, onPlayScreenReady); SoundManager.playGameLoop(); CommonVals.gamePaused = false; CommonVals.gameLocked = false; CommonVals.ufoMouseLocked = true; if (CommonVals.controllerSetted == false){ UIEventDispatcher.getInstance().addEventListener(UIEvent.QUIT_CONTROLLER_PANEL, onQuitControllerPanel); Camera.getInstance().showControllerPanel(); } else { TutorialManager.displayTutorial(); startGamePlayListeners(); LevelController.getInstance().checkCurCowNum(); UIManager.stage.addEventListener(Event.ENTER_FRAME, onMouseMove); }; }; onQuitControllerPanel = function (_arg1:UIEvent):void{ UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_CONTROLLER_PANEL, onQuitControllerPanel); TutorialManager.displayTutorial(); startGamePlayListeners(); LevelController.getInstance().checkCurCowNum(); }; onMouseMove = function (_arg1:Event):void{ if (++moveCount > 60){ UIManager.stage.removeEventListener(Event.ENTER_FRAME, onMouseMove); CommonVals.ufoMouseLocked = false; }; }; _ifNeedReplayMenuMusic = true; if (_gameEventDispatcher.hasEventListener(GameEvent.SHOW_GAME_PLAY_SCREEN)){ _gameEventDispatcher.removeEventListener(GameEvent.SHOW_GAME_PLAY_SCREEN, enterGamePlayScreen); }; if (_gameEventDispatcher.hasEventListener(GameEvent.SHOW_MENU_SCREEN)){ _gameEventDispatcher.removeEventListener(GameEvent.SHOW_MENU_SCREEN, enterMenuScreen); }; stopGamePlayListeners(); TriggerController.initial(); UfoSpawnController.initial(); if (Input.inputStopped){ Input.resumeInput(); }; UIEventDispatcher.getInstance().addEventListener(UIEvent.PLAY_SCREEN_READY, onPlayScreenReady); UIManager.showGamePlayScreen(); var moveCount:int; } private function onLevelComplete(_arg1:GameEvent=null):void{ var onStartNextLevel:Function; var onQuitGame:Function; var e = _arg1; onStartNextLevel = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.START_NEXT_LEVEL, onStartNextLevel); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); ScoreManager.levelScoreNum = 0; LevelController.curLevelNum = (LevelController.curLevelNum + 1); gameTracker.beginLevel(LevelController.curLevelNum, ScoreManager.scoreNum); enterGamePlayScreen(); }; onQuitGame = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.START_NEXT_LEVEL, onStartNextLevel); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); quitGame(); }; CommonVals.gamePaused = true; CommonVals.gameLocked = true; MedalsManager.checkLevelAchievements(); gameTracker.endLevel(ScoreManager.scoreNum, null, null); Camera.getInstance().showLevelCompletePanel(); _gameEventDispatcher.addEventListener(GameEvent.START_NEXT_LEVEL, onStartNextLevel); _gameEventDispatcher.addEventListener(GameEvent.QUIT_GAME, onQuitGame); } private function onRebuildLevel(_arg1:GameEvent=null):void{ CommonVals.gamePaused = true; CommonVals.gameLocked = true; enterGamePlayScreen(); } private function onGameOver(_arg1:GameEvent):void{ var onRestartGame:Function; var onQuitGame:Function; var e = _arg1; onRestartGame = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.RESTART_LEVEL, onRestartGame); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); LivesControl.initiateLives(); LivesControl.starCount = 0; ScoreManager.scoreNum = 0; ScoreManager.levelScoreNum = 0; onRebuildLevel(); }; onQuitGame = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.RESTART_LEVEL, onRestartGame); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); LivesControl.initiateLives(); LivesControl.starCount = 0; ScoreManager.scoreNum = 0; ScoreManager.levelScoreNum = 0; quitGame(); }; CommonVals.gamePaused = true; CommonVals.gameLocked = true; stopGamePlayListeners(); _gameEventDispatcher.addEventListener(GameEvent.RESTART_LEVEL, onRestartGame); _gameEventDispatcher.addEventListener(GameEvent.QUIT_GAME, onQuitGame); Camera.getInstance().showGameOverPanel(); } private function onGamePaused(_arg1:GameEvent):void{ var onRestartLevel:Function; var onQuitGame:Function; var onGameResume:Function; var e = _arg1; onRestartLevel = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.RESTART_LEVEL, onRestartLevel); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); _gameEventDispatcher.removeEventListener(GameEvent.GAME_RESUMED, onGameResume); LivesControl.initiateLives(); ScoreManager.scoreNum = 0; ScoreManager.levelScoreNum = 0; onRebuildLevel(); }; onQuitGame = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.RESTART_LEVEL, onRestartLevel); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); _gameEventDispatcher.removeEventListener(GameEvent.GAME_RESUMED, onGameResume); quitGame(); }; onGameResume = function (_arg1:GameEvent):void{ _gameEventDispatcher.removeEventListener(GameEvent.RESTART_LEVEL, onRestartLevel); _gameEventDispatcher.removeEventListener(GameEvent.QUIT_GAME, onQuitGame); _gameEventDispatcher.removeEventListener(GameEvent.GAME_RESUMED, onGameResume); startGamePlayListeners(); Camera.getInstance().hideGamePausedPanel(); }; if (((CommonVals.gameLocked) || (CommonVals.gamePaused))){ return; }; CommonVals.gamePaused = true; CommonVals.gameLocked = true; stopGamePlayListeners(); Camera.getInstance().showGamePausedPanel(); _gameEventDispatcher.addEventListener(GameEvent.RESTART_LEVEL, onRestartLevel); _gameEventDispatcher.addEventListener(GameEvent.QUIT_GAME, onQuitGame); _gameEventDispatcher.addEventListener(GameEvent.GAME_RESUMED, onGameResume); } private function onAllLevelComplete(_arg1:GameEvent):void{ CommonVals.gamePaused = true; CommonVals.gameLocked = true; UIManager.showAllLevelComplete(); } private function quitGame():void{ var onScreenCovered:Function; onScreenCovered = function (_arg1:Event):void{ _uiEventListener.removeEventListener(UIEvent.SCREEN_COVERED, onScreenCovered); LevelController.getInstance().removeData(); Camera.getInstance().removeAllLayers(); }; CommonVals.gamePaused = true; CommonVals.gameLocked = true; _uiEventListener.addEventListener(UIEvent.SCREEN_COVERED, onScreenCovered); LivesControl.initiateLives(); ScoreManager.scoreNum = 0; ScoreManager.levelScoreNum = 0; enterMenuScreen(); } private function stepGame(_arg1:Event):void{ if (((CommonVals.gamePaused) || (CommonVals.gameLocked))){ return; }; PhysicsVals.world.Step(TimeController.getTimeStep(), 15); _actorsManager.update(); } private function startGamePlayListeners():void{ UIManager.stage.addEventListener(Event.ENTER_FRAME, stepGame); _gameEventDispatcher.addEventListener(GameEvent.LEVEL_COMPLETE, onLevelComplete); _gameEventDispatcher.addEventListener(GameEvent.REBUILD_LEVEL, onRebuildLevel); _gameEventDispatcher.addEventListener(GameEvent.GAME_OVER, onGameOver); _gameEventDispatcher.addEventListener(GameEvent.GAME_PAUSED, onGamePaused); _gameEventDispatcher.addEventListener(GameEvent.ALL_LEVELS_COMPLETE, onAllLevelComplete); } private function stopGamePlayListeners():void{ UIManager.stage.removeEventListener(Event.ENTER_FRAME, stepGame); _gameEventDispatcher.removeEventListener(GameEvent.LEVEL_COMPLETE, onLevelComplete); _gameEventDispatcher.removeEventListener(GameEvent.REBUILD_LEVEL, onRebuildLevel); _gameEventDispatcher.removeEventListener(GameEvent.GAME_OVER, onGameOver); _gameEventDispatcher.removeEventListener(GameEvent.GAME_PAUSED, onGamePaused); _gameEventDispatcher.removeEventListener(GameEvent.ALL_LEVELS_COMPLETE, onAllLevelComplete); } private function addMenuEvent():void{ _gameEventDispatcher.addEventListener(GameEvent.SHOW_LEVEL_SCREEN, enterLevelScreen); _gameEventDispatcher.addEventListener(GameEvent.SHOW_CREDITS_SCREEN, enterCreditsScreen); _gameEventDispatcher.addEventListener(GameEvent.SHOW_MEDAL_SCREEN, enterMedalScreen); _gameEventDispatcher.addEventListener(GameEvent.SHOW_SCORE_SCREEN, enterScoresScreen); } private function clearMenuEvent():void{ _gameEventDispatcher.removeEventListener(GameEvent.SHOW_LEVEL_SCREEN, enterLevelScreen); _gameEventDispatcher.removeEventListener(GameEvent.SHOW_CREDITS_SCREEN, enterCreditsScreen); _gameEventDispatcher.removeEventListener(GameEvent.SHOW_MEDAL_SCREEN, enterMedalScreen); _gameEventDispatcher.removeEventListener(GameEvent.SHOW_SCORE_SCREEN, enterScoresScreen); } public static function getInstance():GameLoopControl{ if (_instance == null){ _instance = new GameLoopControl(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.control class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 131
//Input (com.tinime.control.Input) package com.tinime.control { import flash.events.*; import flash.display.*; import com.tinime.data.*; import com.tinime.event.*; public class Input extends EventDispatcher { public static const UP:uint = 38; public static const DOWN:uint = 40; public static const LEFT:uint = 37; public static const RIGHT:uint = 39; public static const W:uint = 87; public static const A:uint = 65; public static const S:uint = 83; public static const D:uint = 68; public static const SPACE:uint = 32; public static const ENTER:uint = 13; public static const ESC:uint = 27; public static var ctrKeyArr:Array; private static var validCtrKeys:Array; private static var _stage:Stage; public static var spaceHold:Boolean = false; public static var inputStopped:Boolean = false; public static var isControledByMouse:Boolean = false; public static var MouseDown:Boolean = false; public static function initialize(_arg1:Sprite):void{ _stage = _arg1.stage; ctrKeyArr = new Array(); validCtrKeys = [UP, DOWN, LEFT, RIGHT, W, A, S, D]; _stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPress); _stage.addEventListener(KeyboardEvent.KEY_UP, keyRelease); _stage.addEventListener(Event.DEACTIVATE, onDeactive); _stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); _stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); } private static function onMouseUp(_arg1:MouseEvent):void{ MouseDown = false; } private static function onMouseDown(_arg1:MouseEvent):void{ MouseDown = true; } private static function onDeactive(_arg1:Event):void{ MouseDown = false; spaceHold = false; ctrKeyArr = []; } public static function stopInput():void{ inputStopped = true; _stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPress); _stage.removeEventListener(KeyboardEvent.KEY_UP, keyRelease); _stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); _stage.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp); spaceHold = false; ctrKeyArr = []; } public static function resumeInput():void{ inputStopped = false; _stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPress); _stage.addEventListener(KeyboardEvent.KEY_UP, keyRelease); _stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown); _stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUp); } private static function keyRelease(_arg1:KeyboardEvent):void{ var _local2:uint = _arg1.keyCode; var _local3:int = ctrKeyArr.indexOf(_local2); if (_local3 != -1){ ctrKeyArr.splice(_local3, 1); } else { if (_local2 == SPACE){ spaceHold = false; }; }; } private static function keyPress(_arg1:KeyboardEvent):void{ var _local2:uint = _arg1.keyCode; if (validCtrKeys.indexOf(_local2) != -1){ if (ctrKeyArr.indexOf(_local2) == -1){ ctrKeyArr.push(_local2); }; } else { if (_local2 == SPACE){ spaceHold = true; } else { if (_local2 == ENTER){ CameraModeControl.getInstance().onSwitchCameraMode(); } else { if (_local2 == ESC){ if (!(CommonVals.gameLocked)){ GameEventDispatcher.getInstance().onGamePaused(); }; }; }; }; }; } } }//package com.tinime.control
Section 132
//LevelController (com.tinime.control.LevelController) package com.tinime.control { import com.tinime.event.*; import flash.display.*; import com.tinime.view.*; import com.tinime.levels.*; import Box2D.Dynamics.*; import com.tinime.actors.*; import com.tinime.objects.*; import SWFStats.*; import flash.geom.*; import com.tinime.data.*; import flash.utils.*; import flash.events.*; public class LevelController extends EventDispatcher { private var _levelSprite:Sprite; private var _curLevelLowerBound:Point; private var _curLevelUpperBound:Point; private var _curLevelWidth:int; private var _curLevelHeight:int; private var _camera:Camera; private var _curLevel:LevelDataPrototype; private var _stillBodyArr:Array; private var _objectArr:Array; private var _cow:CowActor; private var _curCowNum:int;// = 0 private var _totalCowNum:int;// = 0 private var _catSavedNum:int;// = 0 private var _dogSavedNum:int;// = 0 private var _starSavedNum:int;// = 0 private var _gameEventDispatcher:GameEventDispatcher; private var _actorsManager:ActorsManager; private var _objRecordArr:Array; private var _actorRecordArr:Array; private var _isInitialWithRecord:Boolean;// = false private var _isConntrolledByMouse:Boolean;// = true public static var curLevelNum:int = 1; public static var _ufo:UfoActor; public static var isGameLocked:Boolean = false; public static var levelUnleashed:int = 1; private static var _instance:LevelController; public function LevelController(_arg1:SingletonEnforcer){ _gameEventDispatcher = GameEventDispatcher.getInstance(); _actorsManager = ActorsManager.getInstance(); super(); } public function initialize():void{ _levelSprite = new Sprite(); _camera = Camera.getInstance(); _curLevel = LevelsData.getLevelData((curLevelNum - 1)); if (curLevelNum > levelUnleashed){ levelUnleashed = curLevelNum; SaveManager.saveLevelInfo(); }; if (((!(_isInitialWithRecord)) || ((curLevelNum == 20)))){ _objRecordArr = new Array(); _actorRecordArr = new Array(); _starSavedNum = 0; _curCowNum = 0; _totalCowNum = 0; _catSavedNum = 0; _dogSavedNum = 0; }; } public function buildLevel():void{ var _local5:Class; var _local6:Sprite; var _local16:Array; var _local17:b2Body; var _local18:Array; var _local19:b2Body; var _local20:Array; var _local21:TeleTransmissionActor; var _local22:StarTokenActor; var _local23:FloatBombActor; var _local24:LaserProjector; var _local25:HiddenBlockActor; var _local26:BumperActor; var _local27:UfoSpawner; var _local28:UfoBlock; var _local29:Array; var _local30:CowActor; var _local31:DogActor; var _local32:CatActor; var _local33:TrashCanActor; var _local34:SpinyBallActor; var _local35:KeyActor; var _local36:WindmillFanActor; var _local37:DoorActor; var _local38:CarActor; var _local39:CannonActor; var _local40:BreakableSquareActor; var _local41:TriggerActor; var _local42:SpinyStickActor; var _local43:MovableStickBlockActor; var _local44:Gear1Actor; var _local45:Gear2Actor; var _local46:AnimalCarSpawner; Log.LevelCounterMetric("StartPlayLevel", ("Level" + curLevelNum)); _curLevelWidth = _curLevel.levelWidth; _curLevelHeight = _curLevel.levelHeight; _camera.setSceneBounds(_curLevelWidth, _curLevelHeight); _camera.setBglayerBounds(_curLevel.bgLayerWidth, _curLevel.bgLayerHeight); _camera.moveTo(new Point((_curLevel.ufoPos.x - (CommonVals.STAGE_WIDTH * 0.5)), (_curLevel.ufoPos.y - (CommonVals.STAGE_HEIGHT * 0.5)))); var _local1:Class = (getDefinitionByName(("FrontLayerLevel" + curLevelNum)) as Class); var _local2:Sprite = new (_local1); var _local3:BitmapData = new BitmapData(_curLevelWidth, _curLevelHeight, true, 0xFF0000); _local3.draw(_local2); var _local4:Bitmap = new Bitmap(_local3); _camera.frontLayer.addChild(_local4); _camera.frontLayerBitMap = _local4; _camera.prepareNightBgLayer(_curLevel.sceneType); _stillBodyArr = new Array(); var _local7:Array = _curLevel.stillTerrain; var _local8:int = _local7.length; var _local9:int; while (_local9 < _local8) { _local16 = _local7[_local9]; _local17 = Box2dObjSpawner.buildBody(_local16, CommonVals.SCENE_BLOCK, new Point(0, 0), 0, 0.7); _stillBodyArr.push(_local17); _local9++; }; var _local10:Array = _curLevel.maliciousRegion; var _local11:int = _local10.length; _local9 = 0; while (_local9 < _local11) { _local18 = _local10[_local9]; _local19 = Box2dObjSpawner.buildBody(_local18, CommonVals.MALICIOUS_BLOCK, new Point(0, 0), 0, 10); _stillBodyArr.push(_local19); _local9++; }; if (_curLevel.ufoSpawnable){ UfoSpawnController.add(new UfoSpawner(_camera.frontLayer, _curLevel.ufoPos, true)); }; _objectArr = new Array(); var _local12:Array = _curLevel.objects; var _local13:int = _local12.length; _local9 = 0; while (_local9 < _local13) { if (_isInitialWithRecord){ //unresolved if } else { _local20 = _local12[_local9]; switch (_local20[0]){ case CommonVals.TELE_TRANSMISSION: _local21 = new TeleTransmissionActor(_camera.frontLayer, new Point(_local20[1], _local20[2]), _local20[3], _local20[4]); _actorsManager.add(_local21); break; case CommonVals.STAR_TOKEN: _local22 = new StarTokenActor(_camera.frontLayer, new Point(_local20[1], _local20[2])); _actorsManager.add(_local22); _local22.setRecordNum(_local9); break; case CommonVals.FLOAT_BOMB: _local23 = new FloatBombActor(_camera.frontLayer, new Point(_local20[1], _local20[2]), _local20[3]); _actorsManager.add(_local23); break; case CommonVals.LASER_PROJECTOR: _local24 = new LaserProjector(_camera.frontLayer, new Point(_local20[1], _local20[2]), _local20[3], _local20[4], _local20[5]); TriggerController.triggeredTargetArr[_local20[6]].push(_local24); _objectArr.push(_local24); break; case CommonVals.HIDDEN_BLOCK_OBJECT: _local25 = new HiddenBlockActor(_camera.topLayer, new Point(_local20[1], _local20[2]), _local20[3], _local20[4], curLevelNum); _actorsManager.add(_local25); break; case CommonVals.BUMPER: _local26 = new BumperActor(_camera.frontLayer, new Point(_local20[1], _local20[2]), _local20[3]); _actorsManager.add(_local26); break; case CommonVals.UFO_SPAWNER_INACTIVE: _local27 = new UfoSpawner(_camera.frontLayer, new Point(_local20[1], _local20[2]), _local20[3]); UfoSpawnController.add(_local27); _objectArr.push(_local27); break; case CommonVals.UFO_BLOCK: _local28 = new UfoBlock(_local20[1]); _objectArr.push(_local28); break; default: break; }; }; _local9++; }; var _local14:Array = _curLevel.actors; var _local15:int = _local14.length; _local9 = 0; while (_local9 < _local15) { if (_isInitialWithRecord){ //unresolved if } else { _local29 = _local14[_local9]; switch (_local29[0]){ case CommonVals.COW: _local30 = new CowActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3]); _actorsManager.add(_local30); _local30.setRecordNum(_local9); if (((!(_isInitialWithRecord)) || ((curLevelNum == 20)))){ _curCowNum++; _totalCowNum++; }; break; case CommonVals.DOG: _local31 = new DogActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3]); _actorsManager.add(_local31); _local31.setRecordNum(_local9); break; case CommonVals.CAT: _local32 = new CatActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3]); _actorsManager.add(_local32); _local32.setRecordNum(_local9); break; case CommonVals.TrashCan: _local33 = new TrashCanActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4]); _actorsManager.add(_local33); break; case CommonVals.SPINY_BALL: _local34 = new SpinyBallActor(_camera.frontLayer, _local29[1], _local29[2], _local29[3]); _actorsManager.add(_local34); break; case CommonVals.KEY: _local35 = new KeyActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4]); _actorsManager.add(_local35); break; case CommonVals.WINDMILL_FAN: _local36 = new WindmillFanActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5]); _actorsManager.add(_local36); break; case CommonVals.DOOR: _local37 = new DoorActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6]); TriggerController.triggeredTargetArr[_local29[7]].push(_local37); _actorsManager.add(_local37); break; case CommonVals.CAR: _local38 = new CarActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3]); _actorsManager.add(_local38); break; case CommonVals.CANNON: _local39 = new CannonActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6], _local29[7]); _actorsManager.add(_local39); break; case CommonVals.BREAKABLE_SQUARE: _local40 = new BreakableSquareActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4]); _actorsManager.add(_local40); break; case CommonVals.TRIGGER: _local41 = new TriggerActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3]); _actorsManager.add(_local41); break; case CommonVals.SPINY_STICK: _local42 = new SpinyStickActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6]); TriggerController.triggeredTargetArr[_local29[7]].push(_local42); _actorsManager.add(_local42); break; case CommonVals.MOVABLE_STICK_BLOCK: _local43 = new MovableStickBlockActor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6], _local29[7]); _actorsManager.add(_local43); break; case CommonVals.GEAR1: _local44 = new Gear1Actor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6]); _actorsManager.add(_local44); break; case CommonVals.GEAR2: _local45 = new Gear2Actor(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5], _local29[6]); _actorsManager.add(_local45); break; case CommonVals.ANIMAL_CAR_SPAWNER: _local46 = new AnimalCarSpawner(_camera.frontLayer, new Point(_local29[1], _local29[2]), _local29[3], _local29[4], _local29[5]); if (_local29[3] == CommonVals.COW){ _curCowNum++; _totalCowNum++; }; _actorsManager.add(_local46); TriggerController.triggeredTargetArr[_local29[6]].push(_local46); break; default: break; }; }; _local9++; }; _ufo = new UfoActor(_camera.frontLayer, _curLevel.ufoPos, _camera); _actorsManager.add(_ufo); _gameEventDispatcher.addEventListener(GameEvent.COW_TRANSFERED, onCowTransfered); _gameEventDispatcher.addEventListener(GameEvent.UFO_EXPLODED, onUfoExploded); _gameEventDispatcher.addEventListener(GameEvent.COW_DEAD, onCowDead); _isInitialWithRecord = false; _ufo.activate(); _camera.updateCowNum(_curCowNum, _totalCowNum); } public function removeData():void{ var _local1:b2Body; var _local2:GameObject; _actorsManager.removeAllActors(); for each (_local1 in _stillBodyArr) { PhysicsVals.world.DestroyBody(_local1); }; for each (_local2 in _objectArr) { _local2.destroy(); }; _stillBodyArr = []; _objectArr = []; if (_gameEventDispatcher.hasEventListener(GameEvent.COW_TRANSFERED)){ _gameEventDispatcher.removeEventListener(GameEvent.COW_TRANSFERED, onCowTransfered); _gameEventDispatcher.removeEventListener(GameEvent.UFO_EXPLODED, onUfoExploded); _gameEventDispatcher.removeEventListener(GameEvent.COW_DEAD, onCowDead); }; } public function updateObjRecordArr(_arg1:int):void{ _objRecordArr.push(_arg1); } public function updateActorRecordArr(_arg1:int):void{ _actorRecordArr.push(_arg1); } private function onCowDead(_arg1:GameEvent):void{ Log.LevelCounterMetric("Death", ("Level" + curLevelNum)); LivesControl.lostLife(true); if (LivesControl.curLives > 0){ _isInitialWithRecord = true; _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.REBUILD_LEVEL)); } else { _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.GAME_OVER)); }; } private function onUfoExploded(_arg1:GameEvent):void{ Log.LevelCounterMetric("Death", ("Level" + curLevelNum)); LivesControl.lostLife(false); if (LivesControl.curLives > 0){ if (_curLevel.ufoSpawnable){ UfoSpawnController.spawnNewUfo(_ufo); } else { _isInitialWithRecord = true; _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.REBUILD_LEVEL)); }; } else { _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.GAME_OVER)); }; } public function checkCurCowNum():void{ if (_curCowNum == 0){ _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE)); }; } private function onCowTransfered(_arg1:GameEvent):void{ _curCowNum--; if (_curCowNum == 0){ _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE)); }; _camera.updateCowNum(_curCowNum, _totalCowNum); } public function get catSavedNum():int{ return (_catSavedNum); } public function set catSavedNum(_arg1:int):void{ _catSavedNum = _arg1; } public function get dogSavedNum():int{ return (_dogSavedNum); } public function set dogSavedNum(_arg1:int):void{ _dogSavedNum = _arg1; } public function get starSavedNum():int{ return (_starSavedNum); } public function set starSavedNum(_arg1:int):void{ _starSavedNum = _arg1; } public function get totalCowNum():int{ return (_totalCowNum); } public function set totalCowNum(_arg1:int):void{ _totalCowNum = _arg1; } public function get isInitialWithRecord():Boolean{ return (_isInitialWithRecord); } public function set isInitialWithRecord(_arg1:Boolean):void{ _isInitialWithRecord = _arg1; } public function get isConntrolledByMouse():Boolean{ return (_isConntrolledByMouse); } public function set isConntrolledByMouse(_arg1:Boolean):void{ _isConntrolledByMouse = _arg1; } public static function getInstance():LevelController{ if (_instance == null){ _instance = new LevelController(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.control class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 133
//LivesControl (com.tinime.control.LivesControl) package com.tinime.control { import com.tinime.view.*; import flash.geom.*; public class LivesControl { public static var curLives:Number; public static var starCount:Number; public static var starNeedToAddLife:Number = 40; private static var totalStar:Number; private static var ufoDeadCount:Number = 0; private static var cowDeadCount:Number = 0; public static function initiateLives():void{ curLives = 5; starCount = 0; totalStar = 0; } public static function lostLife(_arg1:Boolean):void{ if (_arg1){ MedalsManager.checkButcherAchievements(++cowDeadCount); } else { MedalsManager.checkTormentAchievements(++ufoDeadCount); }; curLives--; Camera.getInstance().updateLives(); } public static function addLife(_arg1:Point):void{ curLives++; var _local2:Camera = Camera.getInstance(); _local2.updateLives(); _local2.displayOneUp(_arg1); SoundManager.playLifeCollect(); } public static function addStar(_arg1:Point):void{ starCount++; totalStar++; MedalsManager.checkStarAchievements(totalStar); if (starCount >= starNeedToAddLife){ starCount = 0; addLife(_arg1); } else { SoundManager.playStarTokenCollect(); }; Camera.getInstance().updateLifeUpDisplay(starCount); } } }//package com.tinime.control
Section 134
//MedalsManager (com.tinime.control.MedalsManager) package com.tinime.control { import flash.utils.*; import flash.display.*; import com.tinime.view.*; import com.spilgames.api.*; public class MedalsManager { public static var totalMedalsNum:Number = 10; public static var earnedMedals:Array = []; private static var ROOKIE:int = 0; private static var PILOT:int = 1; private static var COW_SAVER:int = 2; private static var EXPLORER:int = 3; private static var RICH:int = 4; private static var WEALTHY:int = 5; private static var TORMENTED:int = 6; private static var BUTCHER:int = 7; private static var SUPER_STAR:int = 8; private static var MASTER_PILOT:int = 9; public static var medalsText:Array = [{title:"{rookie}", depict:"{rookieDes}"}, {title:"{pilot}", depict:"{pilotDes}"}, {title:"{cowSavior}", depict:"{cowSaviorDes}"}, {title:"{explorer}", depict:"{explorerDes}"}, {title:"{richAlien}", depict:"{richAlienDes}"}, {title:"{wealthyAlien}", depict:"{wealthyAlienDes}"}, {title:"{tormentedAlien}", depict:"{tormentedAlienDes}"}, {title:"{butcher}", depict:"{butcherDes}"}, {title:"{superStar}", depict:"{superStarDes}"}, {title:"{masterPilot}", depict:"{masterPilotDes}"}]; public static function getMedalSprite(_arg1:int):Sprite{ var _local2:Class = (getDefinitionByName(("Medal" + _arg1)) as Class); var _local3:Sprite = new (_local2); return (_local3); } public static function checkButcherAchievements(_arg1:Number):void{ if (_arg1 >= 20){ if (earnedMedals.indexOf(BUTCHER) == -1){ earnedMedals.push(BUTCHER); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(BUTCHER), medalsText[BUTCHER].title, medalsText[BUTCHER].depict); }; }; } public static function checkSuperStarAchicevements(_arg1:Number):void{ if (_arg1 > 20000){ if (earnedMedals.indexOf(SUPER_STAR) == -1){ AwardsService.submitAward("award4"); earnedMedals.push(SUPER_STAR); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(SUPER_STAR), medalsText[SUPER_STAR].title, medalsText[SUPER_STAR].depict); }; }; } public static function checkTormentAchievements(_arg1:Number):void{ if (_arg1 >= 20){ if (earnedMedals.indexOf(TORMENTED) == -1){ earnedMedals.push(TORMENTED); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(TORMENTED), medalsText[TORMENTED].title, medalsText[TORMENTED].depict); }; }; } public static function checkStarAchievements(_arg1:Number):void{ if (_arg1 == 50){ if (earnedMedals.indexOf(RICH) == -1){ earnedMedals.push(RICH); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(RICH), medalsText[RICH].title, medalsText[RICH].depict); }; } else { if (_arg1 == 200){ if (earnedMedals.indexOf(WEALTHY) == -1){ AwardsService.submitAward("award2"); earnedMedals.push(WEALTHY); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(WEALTHY), medalsText[WEALTHY].title, medalsText[WEALTHY].depict); }; }; }; } public static function checkExplorerAchievements():void{ if (earnedMedals.indexOf(EXPLORER) == -1){ earnedMedals.push(EXPLORER); AwardsService.submitAward("award1"); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(EXPLORER), medalsText[EXPLORER].title, medalsText[EXPLORER].depict); }; } public static function checkLevelAchievements():void{ switch (LevelController.curLevelNum){ case 1: if (earnedMedals.indexOf(ROOKIE) == -1){ earnedMedals.push(ROOKIE); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(ROOKIE), medalsText[ROOKIE].title, medalsText[ROOKIE].depict); }; break; case 12: if (earnedMedals.indexOf(PILOT) == -1){ earnedMedals.push(PILOT); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(PILOT), medalsText[PILOT].title, medalsText[PILOT].depict); }; break; case 15: if (earnedMedals.indexOf(COW_SAVER) == -1){ AwardsService.submitAward("award3"); earnedMedals.push(COW_SAVER); SaveManager.saveMedalsInfo(); UIManager.showMedalEarned(getMedalSprite(COW_SAVER), medalsText[COW_SAVER].title, medalsText[COW_SAVER].depict); }; break; case 25: if (earnedMedals.indexOf(MASTER_PILOT) == -1){ AwardsService.submitAward("award5"); earnedMedals.push(MASTER_PILOT); SaveManager.saveLevelInfo(); UIManager.showMedalEarned(getMedalSprite(MASTER_PILOT), medalsText[MASTER_PILOT].title, medalsText[MASTER_PILOT].depict); }; }; } } }//package com.tinime.control
Section 135
//PhysicsWorldControl (com.tinime.control.PhysicsWorldControl) package com.tinime.control { import Box2D.Collision.*; import com.tinime.data.*; import Box2D.Common.Math.*; import Box2D.Dynamics.*; import com.hexagonstar.display.*; import flash.display.*; import com.tinime.view.*; public class PhysicsWorldControl { public static function setupPhysicsWorld():void{ var _local1:b2AABB = new b2AABB(); _local1.lowerBound.Set((-5000 / PhysicsVals.RATIO), (-5000 / PhysicsVals.RATIO)); _local1.upperBound.Set((5000 / PhysicsVals.RATIO), (5000 / PhysicsVals.RATIO)); var _local2:b2Vec2 = new b2Vec2(0, PhysicsVals.GRAVITY); var _local3:Boolean = true; PhysicsVals.world = null; PhysicsVals.world = new b2World(_local1, _local2, _local3); PhysicsVals.world.SetContactListener(new GameContactListener()); if (PhysicsVals.ANIMATED_BITMAP_TIMER != null){ PhysicsVals.ANIMATED_BITMAP_TIMER.stop(); PhysicsVals.ANIMATED_BITMAP_TIMER = null; }; PhysicsVals.ANIMATED_BITMAP_TIMER = new FrameRateTimer(PhysicsVals.FRAME_RATE); } public static function setupDebugDraw():void{ var _local1:b2DebugDraw; _local1 = new b2DebugDraw(); var _local2:Sprite = new Sprite(); Camera.getInstance().frontLayer.addChild(_local2); _local1.m_sprite = _local2; _local1.m_drawScale = PhysicsVals.RATIO; _local1.m_fillAlpha = 0; _local1.m_lineThickness = 1; _local1.m_drawFlags = (b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit); PhysicsVals.world.SetDebugDraw(_local1); } } }//package com.tinime.control
Section 136
//SaveManager (com.tinime.control.SaveManager) package com.tinime.control { import flash.net.*; public class SaveManager { private static var _userInfo:SharedObject; private static var _localName:String = "alienThief_Tinime_ver_0.1"; public static function saveMedalsInfo():void{ _userInfo = SharedObject.getLocal(_localName); _userInfo.data.Medals = MedalsManager.earnedMedals; } public static function saveLevelInfo():void{ _userInfo = SharedObject.getLocal(_localName); _userInfo.data.levelUnleashed = LevelController.levelUnleashed; } public static function readMedalsInfo():void{ _userInfo = SharedObject.getLocal(_localName); MedalsManager.earnedMedals = _userInfo.data.Medals; if (MedalsManager.earnedMedals == null){ MedalsManager.earnedMedals = []; }; } public static function readLevelInfo():void{ _userInfo = SharedObject.getLocal(_localName); LevelController.levelUnleashed = _userInfo.data.levelUnleashed; } } }//package com.tinime.control
Section 137
//ScoreManager (com.tinime.control.ScoreManager) package com.tinime.control { import com.tinime.view.*; import flash.geom.*; public class ScoreManager { private static var _scoreNum:int = 0; private static var _levelScoreNum:int = 0; public static var _camera:Camera = Camera.getInstance(); public static function addScore(_arg1:Number, _arg2:Point):void{ _scoreNum = (_scoreNum + _arg1); _levelScoreNum = (_levelScoreNum + _arg1); MedalsManager.checkSuperStarAchicevements(_scoreNum); if (LivesControl.starCount != (LivesControl.starNeedToAddLife - 1)){ _camera.displayScore(_arg1, _arg2); }; } public static function get scoreNum():int{ return (_scoreNum); } public static function set scoreNum(_arg1:int):void{ _scoreNum = _arg1; } public static function get levelScoreNum():int{ return (_levelScoreNum); } public static function set levelScoreNum(_arg1:int):void{ _levelScoreNum = _arg1; } } }//package com.tinime.control
Section 138
//SoundManager (com.tinime.control.SoundManager) package com.tinime.control { import flash.media.*; public class SoundManager { private static var _menuLoop:Sound = new menuLoop(); private static var _gameLoop:Sound = new gameLoop(); private static var _isSoundMute:Boolean = false; private static var _isMusicMute:Boolean = false; private static var _ufoBeamSfxChannel:SoundChannel; private static var isPlayingMenuLoop:Boolean = false; private static var isPlayingGameLoop:Boolean = false; private static var _curLoopChannel:SoundChannel; public static function playMenuLoop():void{ if (_isMusicMute){ return; }; if (_curLoopChannel != null){ _curLoopChannel.stop(); _curLoopChannel = null; }; _curLoopChannel = _menuLoop.play(0, 10000); isPlayingMenuLoop = true; isPlayingGameLoop = false; } public static function playGameLoop():void{ if (_isMusicMute){ return; }; if (_curLoopChannel != null){ _curLoopChannel.stop(); _curLoopChannel = null; }; _curLoopChannel = _gameLoop.play(0, 10000, new SoundTransform(0.4)); isPlayingGameLoop = true; isPlayingMenuLoop = false; } public static function playStarTokenCollect():void{ if (_isSoundMute){ return; }; var _local1:Sound = new starTokenCollectSfx(); _local1.play(); } public static function playUfoBeam():void{ if (_isSoundMute){ return; }; stopUfoBeam(); var _local1:Sound = new ufoBeamSfx(); _ufoBeamSfxChannel = _local1.play(0, 1000, new SoundTransform(1.3)); } public static function stopUfoBeam():void{ if (_ufoBeamSfxChannel != null){ _ufoBeamSfxChannel.stop(); _ufoBeamSfxChannel = null; }; } public static function playLifeCollect():void{ if (_isSoundMute){ return; }; var _local1:Sound = new lifeCollectSfx(); _local1.play(0, 0, new SoundTransform(1)); } public static function playExplosion():void{ if (_isSoundMute){ return; }; var _local1:Sound = new explosionSfx(); _local1.play(0, 0, new SoundTransform(0.1)); } public static function playCannon():void{ if (_isSoundMute){ return; }; var _local1:Sound = new cannonSfx(); _local1.play(0, 0, new SoundTransform(0.8)); } public static function playCowScream():void{ if (_isSoundMute){ return; }; var _local1:Sound = new cowYellSfx(); _local1.play(0, 0, new SoundTransform(1)); } public static function playButtonClick():void{ if (_isSoundMute){ return; }; var _local1:Sound = new btnClickSfx(); _local1.play(0, 0, new SoundTransform(2)); } public static function playKeySound():void{ if (_isSoundMute){ return; }; var _local1:Sound = new collectKeySfx(); _local1.play(0, 0, new SoundTransform(1)); } public static function playBumperHit():void{ if (_isSoundMute){ return; }; var _local1:Sound = new bumpHitSfx(); _local1.play(0, 0, new SoundTransform(0.25)); } public static function playTriggerSfx():void{ if (_isSoundMute){ return; }; var _local1:Sound = new triggerSfx(); _local1.play(0, 0, new SoundTransform(0.7)); } public static function playLidClosing():void{ if (_isSoundMute){ return; }; var _local1:Sound = new lidClosingSfx(); _local1.play(0, 0, new SoundTransform(1)); } public static function playNewPortal():void{ if (_isSoundMute){ return; }; var _local1:Sound = new newPortalSfx(); _local1.play(0, 0, new SoundTransform(0.5)); } public static function get isSoundMute():Boolean{ return (_isSoundMute); } public static function set isSoundMute(_arg1:Boolean):void{ _isSoundMute = _arg1; } public static function get isMusicMute():Boolean{ return (_isMusicMute); } public static function set isMusicMute(_arg1:Boolean):void{ _isMusicMute = _arg1; if (_curLoopChannel == null){ return; }; if (_isMusicMute){ _curLoopChannel.stop(); } else { if (isPlayingGameLoop){ playGameLoop(); } else { playMenuLoop(); }; }; } public static function get ufoBeamSfxChannel():SoundChannel{ return (_ufoBeamSfxChannel); } public static function set ufoBeamSfxChannel(_arg1:SoundChannel):void{ _ufoBeamSfxChannel = _arg1; } } }//package com.tinime.control
Section 139
//TimeController (com.tinime.control.TimeController) package com.tinime.control { import com.tinime.data.*; public class TimeController { private static var _frameRate:int; public static function initial():void{ _frameRate = PhysicsVals.FRAME_RATE; } public static function getTimeStep():Number{ return ((1 / _frameRate)); } } }//package com.tinime.control
Section 140
//TriggerController (com.tinime.control.TriggerController) package com.tinime.control { import com.tinime.interfaces.*; public class TriggerController { public static var triggeredTargetArr:Array; public static function initial():void{ triggeredTargetArr = new Array(20); var _local1:int; while (_local1 < 20) { triggeredTargetArr[_local1] = []; _local1++; }; } public static function trigger(_arg1:Number):void{ var _local3:Triggered; var _local2:Array = triggeredTargetArr[_arg1]; for each (_local3 in _local2) { _local3.onTriggered(); }; } } }//package com.tinime.control
Section 141
//TutorialManager (com.tinime.control.TutorialManager) package com.tinime.control { import flash.geom.*; import flash.events.*; import com.tinime.data.*; import flash.utils.*; import com.tinime.view.*; import com.tinime.event.*; public class TutorialManager { private static var _maxTurNum:int; private static var _curTurNum:int; private static var _curTutorial:TutorialDialog; private static var _isTutorialPresentedArr:Array; private static var _tutorialInfo:Array = [[new Point(18, 42), null], [new Point(220, 184), new Point(369, 0)], [new Point(320, 26), new Point(369, 0)], [new Point(18, 42), null], [new Point(320, 26), new Point(369, 0)], [new Point(10, 293), null]]; private static var _startPos:Point; public static function resetTutorial():void{ _isTutorialPresentedArr = [false, false, false]; } public static function displayTutorial():void{ var onTimerComplete:Function; var timer:Timer; onTimerComplete = function (_arg1:TimerEvent):void{ timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); timer = null; CommonVals.gamePaused = true; CommonVals.gameLocked = true; onDisplayCurTutor(); }; var levelNum:int = LevelController.curLevelNum; var isTutorialLvl:Boolean; if ((((levelNum == 1)) && (!(_isTutorialPresentedArr[0])))){ _isTutorialPresentedArr[0] = true; if (LevelController.getInstance().isConntrolledByMouse){ _curTurNum = 4; _maxTurNum = 5; } else { _curTurNum = 1; _maxTurNum = 3; }; isTutorialLvl = true; } else { if ((((levelNum == 2)) && (!(_isTutorialPresentedArr[1])))){ _isTutorialPresentedArr[2] = true; _curTurNum = 6; _maxTurNum = 6; isTutorialLvl = true; }; }; if (isTutorialLvl){ timer = new Timer(500, 1); _startPos = new Point(Camera.getInstance().frontLayer.x, Camera.getInstance().frontLayer.y); timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); timer.start(); }; } private static function onDisplayCurTutor(_arg1:Event=null):void{ if (_arg1 != null){ _curTurNum++; _curTutorial.removeEventListener(Event.CLOSE, onDisplayCurTutor); }; if (_curTurNum > _maxTurNum){ onTutorialEnd(); return; }; var _local2:Array = _tutorialInfo[(_curTurNum - 1)]; _curTutorial = new TutorialDialog(_local2[0], _curTurNum, _local2[1]); _curTutorial.addEventListener(Event.CLOSE, onDisplayCurTutor); } private static function onTutorialEnd():void{ var onTweenComplete:Function; onTweenComplete = function ():void{ GameEventDispatcher.getInstance().removeEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); CommonVals.gamePaused = false; CommonVals.gameLocked = false; }; _curTutorial = null; if (((!((_startPos.x == Camera.getInstance().frontLayer.x))) || (!((_startPos.y == Camera.getInstance().frontLayer.y))))){ GameEventDispatcher.getInstance().addEventListener(GameEvent.TWEEN_COMPLETE, onTweenComplete); Camera.getInstance().tweenTo(_startPos, 0.5); } else { CommonVals.gamePaused = false; CommonVals.gameLocked = false; }; } } }//package com.tinime.control
Section 142
//UfoSpawnController (com.tinime.control.UfoSpawnController) package com.tinime.control { import com.tinime.objects.*; import flash.geom.*; import com.tinime.actors.*; public class UfoSpawnController { private static var _ufoSpawners:Array; private static var _curSpawnerIndexPos:Number; public static function initial():void{ _ufoSpawners = new Array(); } public static function add(_arg1:UfoSpawner):void{ _ufoSpawners.push(_arg1); if (_arg1.isActive){ _curSpawnerIndexPos = (_ufoSpawners.length - 1); }; } public static function changeSpawner(_arg1:UfoSpawner):void{ var _local3:UfoSpawner; SoundManager.playNewPortal(); var _local2:int; while (_local2 < _ufoSpawners.length) { _local3 = _ufoSpawners[_local2]; if (_local3 == _arg1){ _curSpawnerIndexPos = _local2; _local3.updateDisplay(true); } else { _local3.isActive = false; _local3.updateDisplay(false); }; _local2++; }; } public static function spawnNewUfo(_arg1:UfoActor):void{ var _local2:UfoSpawner = _ufoSpawners[_curSpawnerIndexPos]; var _local3:Point = _local2.getPosition(); _arg1.revive(_local3); } } }//package com.tinime.control
Section 143
//BitmapAnimDataBlock (com.tinime.data.BitmapAnimDataBlock) package com.tinime.data { import flash.display.*; public class BitmapAnimDataBlock { public var bitmapData:BitmapData; public var width:int; public var height:int; public var wCount:int; public var frameAmount:int; } }//package com.tinime.data
Section 144
//BitmapAnimDataCollection (com.tinime.data.BitmapAnimDataCollection) package com.tinime.data { public class BitmapAnimDataCollection { public static var cowAnimPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var catAnimPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var dogAnimPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var ufoAnimPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var teleTransmissionPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var starTokenPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var ufoSpawnerActivePrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var ufoSpawnerInactivePrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var floatBombPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var spinyBallPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var spinyBallScale150Prototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var spinyBallScale180prototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var keyPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var triggerPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var laserBeamPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var cannonPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var cannonScale60Prototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var cannonScale150Prototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var bumperPrototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); public static var bumperScale53Prototype:BitmapAnimDataBlock = new BitmapAnimDataBlock(); } }//package com.tinime.data
Section 145
//CommonVals (com.tinime.data.CommonVals) package com.tinime.data { public class CommonVals { public static const COW:int = 1; public static const LaserBeam:int = 2; public static const TrashCan:int = 3; public static const TELE_TRANSMISSION:int = 4; public static const STAR_TOKEN:int = 5; public static const FLOAT_BOMB:int = 6; public static const SPINY_BALL:int = 7; public static const KEY:int = 8; public static const LASER_PROJECTOR:int = 9; public static const HIDDEN_BLOCK_OBJECT:int = 10; public static const WINDMILL_FAN:int = 11; public static const DOOR:int = 12; public static const BUMPER:int = 13; public static const CAR:int = 14; public static const CANNON:int = 15; public static const BREAKABLE_SQUARE:int = 16; public static const TRIGGER:int = 17; public static const SPINY_STICK:int = 18; public static const UFO:int = 19; public static const DOG:int = 20; public static const CAT:int = 21; public static const MOVABLE_STICK_BLOCK:int = 22; public static const GEAR1:int = 23; public static const GEAR2:int = 24; public static const ANIMAL_CAR_SPAWNER:int = 25; public static const UFO_BLOCK:int = 26; public static const UFO_SPAWNER_ACTIVE:int = 27; public static const UFO_SPAWNER_INACTIVE:int = 28; public static const LASER_BEAM:int = 29; public static const CANNON_60:int = 6015; public static const CANNON_150:int = 15015; public static const BUMPER_53:int = 5313; public static const SPINY_BALL_150:int = 15007; public static const SPINY_BALL_180:int = 18007; public static const YellowColor:uint = 0xFFFF00; public static const GreenColor:uint = 0xFF00; public static const Hint1:int = 0; public static const Hint2:int = 1; public static const Hint3:int = 2; public static const Hint4:int = 3; public static const SCENE_BLOCK:String = "SceneBlock"; public static const MALICIOUS_BLOCK:String = "MaliciousBlock"; public static const STAGE_WIDTH:Number = 640; public static const STAGE_HEIGHT:Number = 480; public static var currentDomain:String; public static var controllerSetted:Boolean = false; public static var allLevelComplete:Boolean = false; public static var ufoMouseLocked:Boolean = true; private static var _gamePaused:Boolean = false; public static var gameLocked:Boolean = false; public static function get gamePaused():Boolean{ return (_gamePaused); } public static function set gamePaused(_arg1:Boolean):void{ _gamePaused = _arg1; if (_arg1){ PhysicsVals.ANIMATED_BITMAP_TIMER.stop(); } else { PhysicsVals.ANIMATED_BITMAP_TIMER.start(); }; } } }//package com.tinime.data
Section 146
//PhysicsVals (com.tinime.data.PhysicsVals) package com.tinime.data { import com.hexagonstar.display.*; import Box2D.Dynamics.*; public class PhysicsVals { public static const RATIO:Number = 45; public static const FRAME_RATE:Number = 30; public static const GRAVITY:Number = 9.8; public static const SCENE_BLOCK_CATEGORY:Number = 1; public static const UFO_CATEGORY:Number = 2; public static const OBJECT_CATEGORY:Number = 4; public static const NPC_CATAGORY:Number = 8; public static const NPC_PASS_BLOCK:Number = 16; public static const TUNNEL_BLOCK:Number = 32; public static const DOOR_CATEGORY:Number = 64; public static const BOMB_CATAGORY:Number = 128; public static var ANIMATED_BITMAP_TIMER:FrameRateTimer = new FrameRateTimer(30); private static var _world:b2World; public static function get world():b2World{ return (_world); } public static function set world(_arg1:b2World):void{ _world = _arg1; } } }//package com.tinime.data
Section 147
//GameEvent (com.tinime.event.GameEvent) package com.tinime.event { import flash.events.*; public class GameEvent extends Event { public static var MOUSE_RELEASE:String = "mouseRelease"; public static var CAMERA_PREPARED:String = "cameraPrepared"; public static var COW_TRANSFERED:String = "cowTransfered"; public static var LEVEL_COMPLETE:String = "levelComplete"; public static var REBUILD_LEVEL:String = "rebuildLevel"; public static var RESTART_LEVEL:String = "restartLevel"; public static var START_NEXT_LEVEL:String = "startNextLevel"; public static var GAME_OVER:String = "gameOver"; public static var TWEEN_COMPLETE:String = "tweenComplete"; public static var UFO_EXPLODED:String = "ufoExploded"; public static var COW_DEAD:String = "cowDead"; public static var QUIT_GAME:String = "quitGame"; public static var GAME_PAUSED:String = "pauseGame"; public static var GAME_RESUMED:String = "resumeGame"; public static var GAME_RESTART:String = "restartGame"; public static var SWITCH_CAMERA_MODE:String = "enterPressed"; public static var SHOW_MENU_SCREEN:String = "showMenuScreen"; public static var SHOW_LEVEL_SCREEN:String = "showLevelScreen"; public static var SHOW_MEDAL_SCREEN:String = "showMedalScreen"; public static var SHOW_SCORE_SCREEN:String = "showScoreScreen"; public static var SHOW_CREDITS_SCREEN:String = "showCreditsScreen"; public static var SHOW_GAME_PLAY_SCREEN:String = "showGamePlayScreen"; public static var ALL_LEVELS_COMPLETE:String = "allLevelsComplete"; public static var ANIMATED_BITMAP_DATA_READY:String = "animatedBitmapDataReady"; public function GameEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function clone():Event{ return (new GameEvent(type, bubbles, cancelable)); } override public function toString():String{ return (formatToString("GameEvent", "type", "bubbles", "cancelable", "eventPhase")); } } }//package com.tinime.event
Section 148
//GameEventDispatcher (com.tinime.event.GameEventDispatcher) package com.tinime.event { import flash.events.*; public class GameEventDispatcher extends EventDispatcher { private static var _instance:GameEventDispatcher; public function GameEventDispatcher(_arg1:SingletonEnforcer){ } public function onMouseRelease():void{ dispatchEvent(new GameEvent(GameEvent.MOUSE_RELEASE)); } public function onCameraPrepared():void{ dispatchEvent(new GameEvent(GameEvent.CAMERA_PREPARED)); } public function onCowTransfered():void{ dispatchEvent(new GameEvent(GameEvent.COW_TRANSFERED)); } public function onLevelComplete():void{ dispatchEvent(new GameEvent(GameEvent.LEVEL_COMPLETE)); } public function onGameOver():void{ dispatchEvent(new GameEvent(GameEvent.GAME_OVER)); } public function onTweenComplete():void{ dispatchEvent(new GameEvent(GameEvent.TWEEN_COMPLETE)); } public function onUfoExploded():void{ dispatchEvent(new GameEvent(GameEvent.UFO_EXPLODED)); } public function onCowDead():void{ dispatchEvent(new GameEvent(GameEvent.COW_DEAD)); } public function onQuitGame():void{ dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); } public function onGamePaused():void{ dispatchEvent(new GameEvent(GameEvent.GAME_PAUSED)); } public function onGameResumed():void{ dispatchEvent(new GameEvent(GameEvent.GAME_RESUMED)); } public function onGameRestart():void{ dispatchEvent(new GameEvent(GameEvent.GAME_RESTART)); } public static function getInstance():GameEventDispatcher{ if (_instance == null){ _instance = new GameEventDispatcher(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.event class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 149
//UIEvent (com.tinime.event.UIEvent) package com.tinime.event { import flash.events.*; public class UIEvent extends Event { public static var LOGO_SCREEN_READY:String = "logoScreenReady"; public static var PLAY_SCREEN_READY:String = "playScreenReady"; public static var PREVIOUS_SCREEN_CLEARED:String = "previousScreenCleared"; public static var CIRCLE_TRANSITION_COMPLETE:String = "circleTransitionComplete"; public static var SCREEN_COVERED:String = "screenCovered"; public static var CAMERA_MASK_REMOVED:String = "cameraMaskRemoved"; public static var CAMERA_MASK_ADDED:String = "cameraMaskAdded"; public static var QUIT_SCORE_SUBMIT_PANEL:String = "quitScoreSubmitPanel"; public static var QUIT_CONTROLLER_PANEL:String = "quitControllerPanel"; public function UIEvent(_arg1:String, _arg2:Boolean=false, _arg3:Boolean=false){ super(_arg1, _arg2, _arg3); } override public function clone():Event{ return (new GameEvent(type, bubbles, cancelable)); } override public function toString():String{ return (formatToString("GameEvent", "type", "bubbles", "cancelable", "eventPhase")); } } }//package com.tinime.event
Section 150
//UIEventDispatcher (com.tinime.event.UIEventDispatcher) package com.tinime.event { import flash.events.*; public class UIEventDispatcher extends EventDispatcher { private static var _instance:UIEventDispatcher; public function UIEventDispatcher(_arg1:SingletonEnforcer){ } public static function getInstance():UIEventDispatcher{ if (_instance == null){ _instance = new UIEventDispatcher(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.event class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 151
//ClickEventWaitable (com.tinime.interfaces.ClickEventWaitable) package com.tinime.interfaces { public interface ClickEventWaitable { function setClickable(_arg1:Boolean):void; } }//package com.tinime.interfaces
Section 152
//Explosive (com.tinime.interfaces.Explosive) package com.tinime.interfaces { public interface Explosive { function explode():void; } }//package com.tinime.interfaces
Section 153
//LevelDataRecordable (com.tinime.interfaces.LevelDataRecordable) package com.tinime.interfaces { public interface LevelDataRecordable { function setRecordNum(_arg1:int):void; function getRecordNum():int; } }//package com.tinime.interfaces
Section 154
//Liftable (com.tinime.interfaces.Liftable) package com.tinime.interfaces { import flash.geom.*; import Box2D.Dynamics.*; public interface Liftable { function prepareLiftStatus():void; function restoreOriginStatus():void; function getLiftHeight():Number; function getPos():Point; function stopMove():void; function getBody():b2Body; function getMass():Number; function setFalling():void; function getLiftable():Boolean; } }//package com.tinime.interfaces
Section 155
//Triggered (com.tinime.interfaces.Triggered) package com.tinime.interfaces { public interface Triggered { function onTriggered():void; } }//package com.tinime.interfaces
Section 156
//LevelDataPrototype (com.tinime.levels.LevelDataPrototype) package com.tinime.levels { import flash.geom.*; public class LevelDataPrototype { public var levelWidth:Number; public var levelHeight:Number; public var stillTerrain:Array; public var maliciousRegion:Array; public var objects:Array; public var actors:Array; public var ufoPos:Point; public var initCameraPos:Point; public var sceneType:Number; public var bgLayerWidth:Number; public var bgLayerHeight:Number; public var ufoSpawnable:Boolean;// = true public function LevelDataPrototype():void{ stillTerrain = []; maliciousRegion = []; objects = []; actors = []; } } }//package com.tinime.levels
Section 157
//LevelsData (com.tinime.levels.LevelsData) package com.tinime.levels { import flash.geom.*; import com.tinime.data.*; public class LevelsData { public static const NIGHT_SCENE:int = 0; public static const SNOW_SCENE:int = 1; public static const DAY_SCENE:int = 0; public static var allLevels:Array; public static function init():void{ allLevels = new Array(); var _local1:LevelDataPrototype = new LevelDataPrototype(); _local1.levelWidth = 1087; _local1.levelHeight = 480; _local1.bgLayerWidth = 929; _local1.bgLayerHeight = 480; _local1.initCameraPos = new Point(0, 0); _local1.ufoPos = new Point(66, 0x0101); _local1.sceneType = NIGHT_SCENE; _local1.stillTerrain.push([[-30, 0], [0, 0], [0, 480], [-30, 480]]); _local1.stillTerrain.push([[-30, -30], [1117, -30], [1117, 0], [-30, 0]]); _local1.stillTerrain.push([[1087, 0], [1117, 0], [1117, 480], [1087, 480]]); _local1.stillTerrain.push([[0, 437], [1087, 437], [1087, 480], [0, 480]]); _local1.stillTerrain.push([[105, 309], [281, 309], [281, 335], [105, 335]]); _local1.stillTerrain.push([[378, 254], [554, 254], [551, 280], [381, 280]]); _local1.stillTerrain.push([[821, 201], [1003, 201], [1003, 228], [821, 228]]); _local1.objects.push([CommonVals.TELE_TRANSMISSION, 908, 210, 1, 0]); _local1.objects.push([CommonVals.STAR_TOKEN, 419, 163]); _local1.objects.push([CommonVals.STAR_TOKEN, 488, 163]); _local1.objects.push([CommonVals.STAR_TOKEN, 440, 300]); _local1.objects.push([CommonVals.STAR_TOKEN, 859, 259]); _local1.actors.push([CommonVals.COW, 776, 410, 1]); allLevels.push(_local1); var _local2:LevelDataPrototype = new LevelDataPrototype(); _local2.levelWidth = 640; _local2.levelHeight = 960; _local2.bgLayerWidth = 1099; _local2.bgLayerHeight = 568; _local2.initCameraPos = new Point(0, 0); _local2.ufoPos = new Point(250, 219); _local2.sceneType = NIGHT_SCENE; _local2.stillTerrain.push([[0, 915], [640, 915], [640, 960], [0, 960]]); _local2.stillTerrain.push([[-40, 0], [0, 0], [0, 960], [-40, 960]]); _local2.stillTerrain.push([[640, 0], [680, 0], [680, 960], [640, 960]]); _local2.stillTerrain.push([[0, -40], [640, -40], [640, 0], [0, 0]]); _local2.stillTerrain.push([[0, 873], [42, 915], [0, 915]]); _local2.stillTerrain.push([[598, 915], [640, 872], [640, 915]]); _local2.stillTerrain.push([[517, 772], [640, 772], [640, 799], [522, 799]]); _local2.stillTerrain.push([[522, 739], [535, 742], [553, 759], [553, 772], [517, 772]]); _local2.stillTerrain.push([[0x0100, 519], [434, 519], [425, 545], [264, 545]]); _local2.stillTerrain.push([[391, 519], [397, 485], [407, 487], [429, 504], [434, 519]]); _local2.stillTerrain.push([[381, 325], [557, 325], [547, 351], [390, 351]]); _local2.stillTerrain.push([[529, 324], [527, 317], [548, 307], [554, 324]]); _local2.stillTerrain.push([[0, 355], [120, 355], [117, 379], [0, 379]]); _local2.stillTerrain.push([[74, 354], [81, 319], [90, 321], [115, 338], [117, 354]]); _local2.stillTerrain.push([[150, 263], [329, 263], [319, 289], [159, 289]]); _local2.stillTerrain.push([[151, 263], [158, 230], [166, 231], [188, 253], [187, 263]]); _local2.stillTerrain.push([[398, 124], [575, 124], [566, 149], [408, 149]]); _local2.maliciousRegion.push([[42, 896], [589, 896], [589, 915], [42, 915]]); _local2.objects.push([CommonVals.STAR_TOKEN, 571, 828]); _local2.objects.push([CommonVals.STAR_TOKEN, 98, 774]); _local2.objects.push([CommonVals.STAR_TOKEN, 306, 638]); _local2.objects.push([CommonVals.STAR_TOKEN, 545, 461]); _local2.objects.push([CommonVals.STAR_TOKEN, 600, 388]); _local2.objects.push([CommonVals.STAR_TOKEN, 428, 418]); _local2.objects.push([CommonVals.STAR_TOKEN, 210, 468]); _local2.objects.push([CommonVals.STAR_TOKEN, 600, 329]); _local2.objects.push([CommonVals.STAR_TOKEN, 559, 272]); _local2.objects.push([CommonVals.STAR_TOKEN, 320, 334]); _local2.objects.push([CommonVals.STAR_TOKEN, 370, 174]); _local2.objects.push([CommonVals.STAR_TOKEN, 59, 0x0100]); _local2.objects.push([CommonVals.STAR_TOKEN, 21, 0x0100]); _local2.objects.push([CommonVals.FLOAT_BOMB, 122, 169, 1]); _local2.objects.push([CommonVals.FLOAT_BOMB, 122, 102, 1]); _local2.objects.push([CommonVals.FLOAT_BOMB, 603, 236, 1]); _local2.objects.push([CommonVals.TELE_TRANSMISSION, 485, 128, 1, 0]); _local2.actors.push([CommonVals.DOG, 46, 356, 1]); _local2.actors.push([CommonVals.COW, 580, 735, 1]); _local2.actors.push([CommonVals.TrashCan, 302, 510, 1, 90]); allLevels.push(_local2); var _local3:LevelDataPrototype = new LevelDataPrototype(); _local3.levelWidth = 0x0500; _local3.levelHeight = 480; _local3.bgLayerWidth = 929; _local3.bgLayerHeight = 480; _local3.initCameraPos = new Point(0, 0); _local3.ufoPos = new Point(83, 316); _local3.sceneType = NIGHT_SCENE; _local3.stillTerrain.push([[0, 445], [0x0500, 445], [0x0500, 480], [0, 480]]); _local3.stillTerrain.push([[158, 413], [511, 413], [511, 445], [158, 445]]); _local3.stillTerrain.push([[280, 412], [287, 378], [296, 375], [327, 397], [327, 412]]); _local3.stillTerrain.push([[511, 413], [511, 0x0101], [524, 247], [539, 249], [548, 0x0101], [548, 413]]); _local3.stillTerrain.push([[548, 351], [799, 351], [799, 445], [548, 445]]); _local3.stillTerrain.push([[1170, 391], [0x0500, 391], [0x0500, 445], [1170, 445]]); _local3.stillTerrain.push([[972, 329], [0x0500, 329], [0x0500, 391], [972, 391]]); _local3.stillTerrain.push([[972, 183], [1027, 183], [1027, 329], [972, 329]]); _local3.stillTerrain.push([[972, 127], [1161, 127], [1161, 183], [972, 183]]); _local3.stillTerrain.push([[972, 0], [0x0500, 0], [0x0500, 55], [972, 55]]); _local3.stillTerrain.push([[1218, 55], [0x0500, 55], [0x0500, 329], [1218, 329]]); _local3.stillTerrain.push([[641, 0], [700, 0], [700, 232], [671, 241], [641, 232]]); _local3.stillTerrain.push([[700, 95], [833, 95], [842, 112], [834, 127], [700, 127]]); _local3.stillTerrain.push([[311, 0], [357, 0], [357, 220], [333, 227], [311, 219]]); _local3.stillTerrain.push([[0, 189], [216, 189], [229, 208], [216, 227], [0, 227]]); _local3.stillTerrain.push([[0, -25], [0x0500, -25], [0x0500, 0], [0, 0]]); _local3.stillTerrain.push([[-25, 0], [0, 0], [0, 480], [-25, 480]]); _local3.maliciousRegion.push([[799, 433], [1169, 433], [1169, 445], [799, 445]]); _local3.objects.push([CommonVals.UFO_SPAWNER_INACTIVE, 769, 283, false]); _local3.objects.push([CommonVals.STAR_TOKEN, 135, 425]); _local3.objects.push([CommonVals.STAR_TOKEN, 54, 55]); _local3.objects.push([CommonVals.STAR_TOKEN, 104, 55]); _local3.objects.push([CommonVals.STAR_TOKEN, 54, 110]); _local3.objects.push([CommonVals.STAR_TOKEN, 104, 110]); _local3.objects.push([CommonVals.STAR_TOKEN, 987, 413]); _local3.objects.push([CommonVals.STAR_TOKEN, 1037, 413]); _local3.objects.push([CommonVals.STAR_TOKEN, 1087, 413]); _local3.objects.push([CommonVals.STAR_TOKEN, 1052, 241]); _local3.objects.push([CommonVals.STAR_TOKEN, 1052, 291]); _local3.objects.push([CommonVals.STAR_TOKEN, 1097, 241]); _local3.objects.push([CommonVals.STAR_TOKEN, 1097, 291]); _local3.objects.push([CommonVals.STAR_TOKEN, 1142, 241]); _local3.objects.push([CommonVals.STAR_TOKEN, 1142, 291]); _local3.objects.push([CommonVals.STAR_TOKEN, 1187, 241]); _local3.objects.push([CommonVals.STAR_TOKEN, 1187, 291]); _local3.objects.push([CommonVals.STAR_TOKEN, 476, 387]); _local3.objects.push([CommonVals.STAR_TOKEN, 463, 33]); _local3.objects.push([CommonVals.STAR_TOKEN, 543, 33]); _local3.objects.push([CommonVals.FLOAT_BOMB, 152, 398, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 195, 398, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 241, 398, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 241, 361, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 241, 325, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 241, 289, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 241, 251, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 365, 327, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 169, 162, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 169, 98, 1]); _local3.objects.push([CommonVals.FLOAT_BOMB, 169, 33, 1]); _local3.objects.push([CommonVals.LASER_PROJECTOR, 716, 185, 0, 3, true, 0]); _local3.objects.push([CommonVals.TELE_TRANSMISSION, 770, 101, 1, 0]); _local3.objects.push([CommonVals.HIDDEN_BLOCK_OBJECT, 963, 33, [[[13, 16], [276, 16], [276, 321], [13, 321]]], 1]); _local3.actors.push([CommonVals.TrashCan, 100, 447, 1, 0]); _local3.actors.push([CommonVals.DOG, 1166, 293, 1]); _local3.actors.push([CommonVals.CAT, 1124, 293, 1]); _local3.actors.push([CommonVals.COW, 392, 395, 1]); _local3.actors.push([CommonVals.SPINY_BALL, [[429, 175], [429, 67], [600, 67], [600, 300]], 1, 3]); _local3.actors.push([CommonVals.KEY, 822, 405, true, [0]]); allLevels.push(_local3); var _local4:LevelDataPrototype = new LevelDataPrototype(); _local4.levelWidth = 1180; _local4.levelHeight = 638; _local4.bgLayerWidth = 1099; _local4.bgLayerHeight = 568; _local4.initCameraPos = new Point(283, 0); _local4.ufoPos = new Point(603, 123); _local4.sceneType = NIGHT_SCENE; _local4.stillTerrain.push([[0, 596], [1180, 596], [1180, 638], [0, 638]]); _local4.stillTerrain.push([[0, 415], [144, 415], [144, 537], [0, 537]]); _local4.stillTerrain.push([[744, 0x0200], [770, 0x0200], [770, 596], [744, 596]]); _local4.stillTerrain.push([[873, 599], [880, 560], [889, 561], [918, 579], [919, 599]]); _local4.stillTerrain.push([[782, 0], [1180, 0], [1180, 81], [782, 81]]); _local4.stillTerrain.push([[1118, 81], [1180, 81], [1180, 238], [1118, 238]]); _local4.stillTerrain.push([[218, 279], [252, 279], [252, 354], [218, 354]]); _local4.stillTerrain.push([[215, 354], [483, 354], [483, 386], [215, 386]]); _local4.stillTerrain.push([[430, 354], [875, 354], [875, 413], [430, 413]]); _local4.stillTerrain.push([[430, 413], [462, 413], [462, 530], [430, 530]]); _local4.stillTerrain.push([[430, 502], [599, 502], [599, 529], [430, 529]]); _local4.stillTerrain.push([[216, 140], [254, 140], [254, 191], [216, 191]]); _local4.stillTerrain.push([[254, 140], [422, 140], [422, 163], [254, 163]]); _local4.stillTerrain.push([[377, 164], [422, 164], [422, 259], [377, 259]]); _local4.stillTerrain.push([[422, 190], [680, 190], [680, 260], [422, 260]]); _local4.stillTerrain.push([[661, 188], [782, 170], [782, 237], [680, 261]]); _local4.stillTerrain.push([[782, 170], [847, 172], [847, 221], [782, 237]]); _local4.stillTerrain.push([[307, 0], [383, 0], [383, 140], [307, 140]]); _local4.stillTerrain.push([[-30, 0], [0, 0], [0, 638], [-30, 638]]); _local4.stillTerrain.push([[0, -30], [1180, -30], [1180, 0], [0, 0]]); _local4.stillTerrain.push([[1180, 0], [1210, 0], [1210, 638], [1180, 638]]); _local4.maliciousRegion.push([[567, 259], [678, 259], [670, 284], [567, 284]]); _local4.maliciousRegion.push([[590, 170], [653, 170], [660, 196], [586, 196]]); _local4.maliciousRegion.push([[14, 397], [134, 397], [140, 428], [7, 426]]); _local4.objects.push([CommonVals.STAR_TOKEN, 65, 46]); _local4.objects.push([CommonVals.STAR_TOKEN, 125, 46]); _local4.objects.push([CommonVals.STAR_TOKEN, 185, 46]); _local4.objects.push([CommonVals.STAR_TOKEN, 245, 46]); _local4.objects.push([CommonVals.STAR_TOKEN, 65, 94]); _local4.objects.push([CommonVals.STAR_TOKEN, 125, 94]); _local4.objects.push([CommonVals.STAR_TOKEN, 185, 94]); _local4.objects.push([CommonVals.STAR_TOKEN, 245, 94]); _local4.objects.push([CommonVals.STAR_TOKEN, 65, 147]); _local4.objects.push([CommonVals.STAR_TOKEN, 125, 147]); _local4.objects.push([CommonVals.STAR_TOKEN, 185, 147]); _local4.objects.push([CommonVals.STAR_TOKEN, 559, 327]); _local4.objects.push([CommonVals.STAR_TOKEN, 619, 327]); _local4.objects.push([CommonVals.STAR_TOKEN, 679, 327]); _local4.objects.push([CommonVals.STAR_TOKEN, 829, 454]); _local4.objects.push([CommonVals.STAR_TOKEN, 889, 454]); _local4.objects.push([CommonVals.STAR_TOKEN, 949, 454]); _local4.objects.push([CommonVals.STAR_TOKEN, 1092, 273]); _local4.objects.push([CommonVals.STAR_TOKEN, 1152, 273]); _local4.objects.push([CommonVals.STAR_TOKEN, 1092, 318]); _local4.objects.push([CommonVals.STAR_TOKEN, 1152, 318]); _local4.objects.push([CommonVals.STAR_TOKEN, 1092, 428]); _local4.objects.push([CommonVals.STAR_TOKEN, 1152, 428]); _local4.objects.push([CommonVals.STAR_TOKEN, 1092, 474]); _local4.objects.push([CommonVals.STAR_TOKEN, 1152, 474]); _local4.objects.push([CommonVals.STAR_TOKEN, 27, 569]); _local4.objects.push([CommonVals.STAR_TOKEN, 87, 569]); _local4.objects.push([CommonVals.STAR_TOKEN, 147, 569]); _local4.objects.push([CommonVals.FLOAT_BOMB, 431, 282, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 501, 284, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 972, 533, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1019, 533, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1063, 533, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1107, 533, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1149, 533, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1019, 573, 1]); _local4.objects.push([CommonVals.FLOAT_BOMB, 1019, 573, 1]); _local4.objects.push([CommonVals.LASER_PROJECTOR, 863, 197, 0, 3, true, 0]); _local4.objects.push([CommonVals.LASER_PROJECTOR, 555, 185, -135, 5, true, 1]); _local4.objects.push([CommonVals.TELE_TRANSMISSION, 484, 189, 1, 0]); _local4.actors.push([CommonVals.KEY, 1051, 104, true, [0]]); _local4.actors.push([CommonVals.KEY, 1106, 553, true, [1]]); _local4.actors.push([CommonVals.KEY, 414, 319, true, [2]]); _local4.actors.push([CommonVals.KEY, 267, 479, true, [3]]); _local4.actors.push([CommonVals.SPINY_BALL, [[200, 565], [373, 565], [373, 425], [200, 425], [200, 565]], 1, 3]); _local4.actors.push([CommonVals.SPINY_BALL, [[373, 425], [200, 425], [200, 565], [373, 565], [373, 425]], 1, 3]); _local4.actors.push([CommonVals.TrashCan, 560, 501, 1, 0]); _local4.actors.push([CommonVals.DOOR, 381, 260, 1, 0, true, -1, 2]); _local4.actors.push([CommonVals.DOOR, 743, 414, 1, 0, true, 1, 3]); _local4.actors.push([CommonVals.WINDMILL_FAN, 1031, 358, 1, 0, 2]); _local4.actors.push([CommonVals.WINDMILL_FAN, 111, 280, 0.62, 0, 2]); _local4.actors.push([CommonVals.DOG, 299, 334, 1]); _local4.actors.push([CommonVals.COW, 491, 482, 1]); _local4.actors.push([CommonVals.CAT, 797, 570, 1]); allLevels.push(_local4); var _local5:LevelDataPrototype = new LevelDataPrototype(); _local5.levelWidth = 1100; _local5.levelHeight = 800; _local5.bgLayerWidth = 1099; _local5.bgLayerHeight = 568; _local5.initCameraPos = new Point(187, 361); _local5.ufoPos = new Point(507, 601); _local5.sceneType = NIGHT_SCENE; _local5.stillTerrain.push([[0, 765], [1100, 765], [1100, 800], [0, 800]]); _local5.stillTerrain.push([[154, 748], [202, 748], [202, 765], [154, 765]]); _local5.stillTerrain.push([[810, 753], [882, 753], [882, 765], [810, 765]]); _local5.stillTerrain.push([[711, 85], [733, 85], [733, 130], [711, 130]]); _local5.stillTerrain.push([[834, 88], [860, 88], [860, 130], [834, 130]]); _local5.stillTerrain.push([[711, 102], [860, 102], [860, 130], [711, 130]]); _local5.stillTerrain.push([[291, 93], [315, 93], [315, 109], [291, 109]]); _local5.stillTerrain.push([[415, 95], [442, 95], [442, 109], [415, 109]]); _local5.stillTerrain.push([[291, 109], [442, 109], [442, 138], [291, 138]]); _local5.stillTerrain.push([[-30, 0], [0, 0], [0, 800], [-30, 800]]); _local5.stillTerrain.push([[0, -30], [1100, -30], [1100, 0], [0, 0]]); _local5.stillTerrain.push([[1100, 0], [1130, 0], [1130, 800], [1100, 800]]); _local5.objects.push([CommonVals.STAR_TOKEN, 74, 0x0200]); _local5.objects.push([CommonVals.STAR_TOKEN, 74, 571]); _local5.objects.push([CommonVals.STAR_TOKEN, 126, 602]); _local5.objects.push([CommonVals.STAR_TOKEN, 175, 0x0200]); _local5.objects.push([CommonVals.STAR_TOKEN, 175, 571]); _local5.objects.push([CommonVals.STAR_TOKEN, 233, 425]); _local5.objects.push([CommonVals.STAR_TOKEN, 233, 478]); _local5.objects.push([CommonVals.STAR_TOKEN, 335, 425]); _local5.objects.push([CommonVals.STAR_TOKEN, 335, 478]); _local5.objects.push([CommonVals.STAR_TOKEN, 287, 393]); _local5.objects.push([CommonVals.STAR_TOKEN, 287, 505]); _local5.objects.push([CommonVals.STAR_TOKEN, 919, 520]); _local5.objects.push([CommonVals.STAR_TOKEN, 868, 552]); _local5.objects.push([CommonVals.STAR_TOKEN, 868, 609]); _local5.objects.push([CommonVals.STAR_TOKEN, 967, 609]); _local5.objects.push([CommonVals.STAR_TOKEN, 919, 636]); _local5.objects.push([CommonVals.STAR_TOKEN, 814, 391]); _local5.objects.push([CommonVals.STAR_TOKEN, 814, 507]); _local5.objects.push([CommonVals.STAR_TOKEN, 763, 423]); _local5.objects.push([CommonVals.STAR_TOKEN, 763, 480]); _local5.objects.push([CommonVals.STAR_TOKEN, 919, 636]); _local5.objects.push([CommonVals.STAR_TOKEN, 862, 423]); _local5.objects.push([CommonVals.STAR_TOKEN, 862, 480]); _local5.objects.push([CommonVals.STAR_TOKEN, 989, 280]); _local5.objects.push([CommonVals.STAR_TOKEN, 989, 396]); _local5.objects.push([CommonVals.STAR_TOKEN, 938, 312]); _local5.objects.push([CommonVals.STAR_TOKEN, 938, 369]); _local5.objects.push([CommonVals.STAR_TOKEN, 1037, 313]); _local5.objects.push([CommonVals.STAR_TOKEN, 1037, 369]); _local5.objects.push([CommonVals.STAR_TOKEN, 995, 47]); _local5.objects.push([CommonVals.STAR_TOKEN, 995, 163]); _local5.objects.push([CommonVals.STAR_TOKEN, 944, 80]); _local5.objects.push([CommonVals.STAR_TOKEN, 944, 136]); _local5.objects.push([CommonVals.STAR_TOKEN, 1043, 80]); _local5.objects.push([CommonVals.STAR_TOKEN, 1043, 136]); _local5.objects.push([CommonVals.STAR_TOKEN, 781, 269]); _local5.objects.push([CommonVals.STAR_TOKEN, 730, 185]); _local5.objects.push([CommonVals.STAR_TOKEN, 730, 241]); _local5.objects.push([CommonVals.STAR_TOKEN, 829, 185]); _local5.objects.push([CommonVals.STAR_TOKEN, 829, 241]); _local5.objects.push([CommonVals.STAR_TOKEN, 588, 250]); _local5.objects.push([CommonVals.STAR_TOKEN, 588, 366]); _local5.objects.push([CommonVals.STAR_TOKEN, 539, 282]); _local5.objects.push([CommonVals.STAR_TOKEN, 539, 338]); _local5.objects.push([CommonVals.STAR_TOKEN, 638, 282]); _local5.objects.push([CommonVals.STAR_TOKEN, 638, 338]); _local5.objects.push([CommonVals.STAR_TOKEN, 535, 63]); _local5.objects.push([CommonVals.STAR_TOKEN, 535, 119]); _local5.objects.push([CommonVals.STAR_TOKEN, 634, 63]); _local5.objects.push([CommonVals.STAR_TOKEN, 634, 119]); _local5.objects.push([CommonVals.STAR_TOKEN, 584, 31]); _local5.objects.push([CommonVals.STAR_TOKEN, 584, 147]); _local5.objects.push([CommonVals.STAR_TOKEN, 311, 191]); _local5.objects.push([CommonVals.STAR_TOKEN, 311, 247]); _local5.objects.push([CommonVals.STAR_TOKEN, 410, 191]); _local5.objects.push([CommonVals.STAR_TOKEN, 410, 247]); _local5.objects.push([CommonVals.STAR_TOKEN, 362, 159]); _local5.objects.push([CommonVals.STAR_TOKEN, 362, 275]); _local5.objects.push([CommonVals.STAR_TOKEN, 130, 252]); _local5.objects.push([CommonVals.STAR_TOKEN, 130, 372]); _local5.objects.push([CommonVals.STAR_TOKEN, 83, 288]); _local5.objects.push([CommonVals.STAR_TOKEN, 83, 345]); _local5.objects.push([CommonVals.STAR_TOKEN, 182, 288]); _local5.objects.push([CommonVals.STAR_TOKEN, 182, 345]); _local5.objects.push([CommonVals.STAR_TOKEN, 94, 61]); _local5.objects.push([CommonVals.STAR_TOKEN, 94, 117]); _local5.objects.push([CommonVals.STAR_TOKEN, 193, 61]); _local5.objects.push([CommonVals.STAR_TOKEN, 193, 117]); _local5.objects.push([CommonVals.STAR_TOKEN, 144, 29]); _local5.objects.push([CommonVals.STAR_TOKEN, 144, 145]); _local5.objects.push([CommonVals.FLOAT_BOMB, 170, 729, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 839, 737, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 839, 737, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 123, 472, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 71, 214, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 212, 211, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 359, 333, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 582, 194, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 792, 342, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 927, 205, 1]); _local5.objects.push([CommonVals.FLOAT_BOMB, 968, 555, 1]); _local5.objects.push([CommonVals.TELE_TRANSMISSION, 511, 769, 1, 0]); _local5.objects.push([CommonVals.BUMPER, 920, 578, 1]); _local5.objects.push([CommonVals.BUMPER, 815, 449, 1]); _local5.objects.push([CommonVals.BUMPER, 990, 338, 1]); _local5.objects.push([CommonVals.BUMPER, 996, 105, 1]); _local5.objects.push([CommonVals.BUMPER, 782, 207, 1]); _local5.objects.push([CommonVals.BUMPER, 585, 87, 1]); _local5.objects.push([CommonVals.BUMPER, 589, 306, 1]); _local5.objects.push([CommonVals.BUMPER, 920, 578, 1]); _local5.objects.push([CommonVals.BUMPER, 363, 216, 1]); _local5.objects.push([CommonVals.BUMPER, 145, 82, 1]); _local5.objects.push([CommonVals.BUMPER, 131, 309, 1]); _local5.objects.push([CommonVals.BUMPER, 288, 449, 1]); _local5.objects.push([CommonVals.BUMPER, 127, 542, 1]); _local5.actors.push([CommonVals.WINDMILL_FAN, 722, 636, 0.726, 0, 2]); _local5.actors.push([CommonVals.WINDMILL_FAN, 286, 636, 0.726, 0, 2]); _local5.actors.push([CommonVals.CAT, 79, 737, 1]); _local5.actors.push([CommonVals.COW, 974, 740, 1]); _local5.actors.push([CommonVals.DOG, 779, 71, 1]); _local5.actors.push([CommonVals.COW, 355, 79, 1]); allLevels.push(_local5); var _local6:LevelDataPrototype = new LevelDataPrototype(); _local6.levelWidth = 2500; _local6.levelHeight = 480; _local6.bgLayerWidth = 666.67; _local6.bgLayerHeight = 500; _local6.initCameraPos = new Point(0, 0); _local6.ufoPos = new Point(221, 352); _local6.sceneType = SNOW_SCENE; _local6.ufoSpawnable = false; _local6.stillTerrain = [[[-30, 0], [0, 0], [0, 480], [-30, 480]], [[0, -30], [2500, -30], [2500, 0], [0, 0]], [[2500, 0], [2530, 0], [2530, 480], [2500, 480]], [[0, 445], [2500, 445], [2500, 480], [0, 480]], [[0, 178], [2095, 178], [2188, 200], [2188, 247], [0, 247]], [[279, 247], [375, 247], [344, 344], [298, 344]], [[565, 344], [612, 344], [657, 445], [525, 445]], [[811, 247], [959, 247], [921, 338], [865, 338]], [[1197, 247], [1351, 247], [1309, 334], [1237, 334]], [[1516, 330], [1593, 330], [1644, 445], [1446, 445]], [[1796, 337], [1852, 337], [2107, 444], [1737, 444]], [[807, 178], [1086, 155], [2031, 155], [2097, 178]], [[1533, 155], [1718, 133], [1996, 133], [2027, 155]]]; _local6.maliciousRegion = [[[607, 245], [749, 245], [733, 265], [617, 266]], [[733, 445], [735, 427], [860, 427], [875, 444]], [[978, 445], [978, 426], [1243, 424], [1257, 445]], [[1622, 247], [1763, 247], [1747, 266], [1630, 266]]]; _local6.objects = [[CommonVals.STAR_TOKEN, 387, 349], [CommonVals.STAR_TOKEN, 471, 420], [CommonVals.STAR_TOKEN, 521, 298], [CommonVals.STAR_TOKEN, 708, 338], [CommonVals.STAR_TOKEN, 689, 427], [CommonVals.STAR_TOKEN, 989, 292], [CommonVals.STAR_TOKEN, 974, 378], [CommonVals.STAR_TOKEN, 1183, 405], [CommonVals.STAR_TOKEN, 1331, 420], [CommonVals.STAR_TOKEN, 1403, 317], [CommonVals.STAR_TOKEN, 1415, 413], [CommonVals.STAR_TOKEN, 1687, 412], [CommonVals.STAR_TOKEN, 1740, 345], [CommonVals.STAR_TOKEN, 1894, 298], [CommonVals.STAR_TOKEN, 2086, 407], [CommonVals.STAR_TOKEN, 2252, 314], [CommonVals.STAR_TOKEN, 2373, 341], [CommonVals.STAR_TOKEN, 2443, 74], [CommonVals.STAR_TOKEN, 2411, 165], [CommonVals.STAR_TOKEN, 2312, 148], [CommonVals.FLOAT_BOMB, 521, 363, 1], [CommonVals.FLOAT_BOMB, 791, 289, 1], [CommonVals.FLOAT_BOMB, 2047, 273, 1], [CommonVals.FLOAT_BOMB, 2112, 315, 1], [CommonVals.FLOAT_BOMB, 2175, 361, 1], [CommonVals.FLOAT_BOMB, 2175, 361, 1], [CommonVals.TELE_TRANSMISSION, 2392, 447, 1, 0], [CommonVals.LASER_PROJECTOR, 653, 209, -90, 4, true, 2], [CommonVals.LASER_PROJECTOR, 1523, 206, -90, 4, true, 4], [CommonVals.LASER_PROJECTOR, 2175, 224, 0, 6, true, 6]]; _local6.actors = [[CommonVals.KEY, 25, 300, true, [0]], [CommonVals.DOOR, 308, 344, 1.02, 0, true, -1, 0], [CommonVals.DOOR, 316, 81, 1, 0, true, 1, 0], [CommonVals.KEY, 433, 289, true, [1]], [CommonVals.DOOR, 578, 247, 1, 0, true, 1, 1], [CommonVals.KEY, 774, 374, true, [2]], [CommonVals.DOOR, 878, 338, 1.08, 0, true, -1, 2], [CommonVals.KEY, 1099, 352, true, [3]], [CommonVals.DOOR, 1257, 333, 1.14, 0, true, -1, 3], [CommonVals.KEY, 1425, 321, true, [4]], [CommonVals.DOOR, 1546, 247, 0.86, 0, true, 1, 4], [CommonVals.KEY, 1707, 288, true, [5]], [CommonVals.DOOR, 1809, 247, 0.928, 0, true, 1, 5], [CommonVals.KEY, 2447, 381, true, [6]], [CommonVals.CANNON, 1258, 215, 1, 135, 10, 200, 350], [CommonVals.COW, 267, 140, 1], [CommonVals.DOG, 1688, 425, 1], [CommonVals.CAT, 1658, 425, 1], [CommonVals.CAR, 270, 172, 9.5]]; allLevels.push(_local6); var _local7:LevelDataPrototype = new LevelDataPrototype(); _local7.levelWidth = 900; _local7.levelHeight = 1055; _local7.bgLayerWidth = 700; _local7.bgLayerHeight = 568; _local7.initCameraPos = new Point(0, 0); _local7.ufoPos = new Point(330, 207); _local7.sceneType = NIGHT_SCENE; _local7.stillTerrain.push([[0, 0], [43, 0], [43, 1055], [0, 1055]]); _local7.stillTerrain.push([[0, -30], [900, -30], [900, 0], [0, 0]]); _local7.stillTerrain.push([[838, 0], [900, 0], [900, 1055], [838, 1055]]); _local7.stillTerrain.push([[0, 977], [900, 977], [900, 1055], [0, 1055]]); _local7.stillTerrain.push([[316, 682], [838, 682], [838, 764], [316, 764]]); _local7.stillTerrain.push([[688, 495], [838, 495], [838, 549], [688, 549]]); _local7.stillTerrain.push([[0, 426], [199, 426], [199, 473], [0, 473]]); _local7.stillTerrain.push([[154, 281], [269, 281], [269, 319], [154, 319]]); _local7.stillTerrain.push([[154, 319], [191, 319], [191, 430], [154, 430]]); _local7.stillTerrain.push([[191, 426], [520, 426], [520, 473], [191, 473]]); _local7.stillTerrain.push([[477, 319], [520, 319], [520, 426], [477, 426]]); _local7.stillTerrain.push([[394, 281], [520, 281], [520, 319], [394, 319]]); _local7.objects.push([CommonVals.STAR_TOKEN, 603, 398]); _local7.objects.push([CommonVals.STAR_TOKEN, 715, 441]); _local7.objects.push([CommonVals.STAR_TOKEN, 814, 472]); _local7.objects.push([CommonVals.STAR_TOKEN, 553, 807]); _local7.objects.push([CommonVals.STAR_TOKEN, 593, 807]); _local7.objects.push([CommonVals.STAR_TOKEN, 633, 807]); _local7.objects.push([CommonVals.STAR_TOKEN, 673, 807]); _local7.objects.push([CommonVals.STAR_TOKEN, 95, 686]); _local7.objects.push([CommonVals.STAR_TOKEN, 135, 686]); _local7.objects.push([CommonVals.STAR_TOKEN, 175, 686]); _local7.objects.push([CommonVals.STAR_TOKEN, 215, 686]); _local7.objects.push([CommonVals.STAR_TOKEN, 117, 726]); _local7.objects.push([CommonVals.STAR_TOKEN, 157, 726]); _local7.objects.push([CommonVals.STAR_TOKEN, 197, 726]); _local7.objects.push([CommonVals.STAR_TOKEN, 137, 763]); _local7.objects.push([CommonVals.STAR_TOKEN, 177, 763]); _local7.objects.push([CommonVals.STAR_TOKEN, 157, 797]); _local7.objects.push([CommonVals.LASER_PROJECTOR, 523, 412, 22.7, 3, true, 0]); _local7.objects.push([CommonVals.LASER_PROJECTOR, 453, 464, 92.9, 3, true, 1]); _local7.objects.push([CommonVals.TELE_TRANSMISSION, 770, 984, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 266, 278, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 307, 278, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 349, 278, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 712, 84, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 754, 84, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 797, 84, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 712, 126, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 712, 169, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 712, 211, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 755, 211, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 795, 211, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 698, 597, 1, 0]); _local7.actors.push([CommonVals.BREAKABLE_SQUARE, 698, 639, 1, 0]); _local7.actors.push([CommonVals.KEY, 772, 162, true, [0]]); _local7.actors.push([CommonVals.KEY, 775, 590, true, [1]]); _local7.actors.push([CommonVals.CANNON, 10, -13, 1, 72.6, 50, 100, 250]); _local7.actors.push([CommonVals.CANNON, 503, 311, 0.6, 0, [12, 20], 100, 250]); _local7.actors.push([CommonVals.CANNON, 878, 806, 1.5, 180, [77, 90], 100, 250]); _local7.actors.push([CommonVals.COW, 305, 401, 1]); _local7.actors.push([CommonVals.DOG, 811, 666, 1]); allLevels.push(_local7); var _local8:LevelDataPrototype = new LevelDataPrototype(); _local8.levelWidth = 2800; _local8.levelHeight = 480; _local8.bgLayerWidth = 929; _local8.bgLayerHeight = 480; _local8.initCameraPos = new Point(0, 0); _local8.ufoPos = new Point(87, 262); _local8.sceneType = NIGHT_SCENE; _local8.ufoSpawnable = true; _local8.stillTerrain = [[[-30, 0], [0, 0], [0, 480], [-30, 480]], [[0, -30], [2800, -30], [2800, 0], [0, 0]], [[2800, 0], [2850, 0], [2850, 480], [2800, 480]], [[0, 480], [2800, 480], [2800, 550], [0, 550]], [[0, 0], [689, 0], [583, 105], [0, 105]], [[0, 382], [601, 382], [699, 480], [0, 480]], [[934, 480], [1032, 382], [1480, 382], [1480, 480]], [[1480, 472], [1593, 472], [1593, 480], [1480, 480]], [[1593, 382], [2034, 382], [2127, 480], [1593, 480]], [[1039, 105], [934, 0], [2113, 0], [2022, 105]], [[2463, 105], [2348, 0], [2800, 0], [2800, 105]], [[2348, 480], [2442, 382], [2800, 382], [2800, 480]]]; _local8.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 1071, 262, false], [CommonVals.LASER_PROJECTOR, 2547, 376, -90, 4, true, 0], [CommonVals.STAR_TOKEN, 336, 186], [CommonVals.STAR_TOKEN, 405, 296], [CommonVals.STAR_TOKEN, 475, 226], [CommonVals.STAR_TOKEN, 335, 346], [CommonVals.STAR_TOKEN, 725, 433], [CommonVals.STAR_TOKEN, 905, 433], [CommonVals.STAR_TOKEN, 1092, 318], [CommonVals.STAR_TOKEN, 1189, 300], [CommonVals.STAR_TOKEN, 1286, 303], [CommonVals.STAR_TOKEN, 1426, 353], [CommonVals.STAR_TOKEN, 0x0600, 233], [CommonVals.STAR_TOKEN, 1707, 253], [CommonVals.STAR_TOKEN, 1706, 346], [CommonVals.STAR_TOKEN, 1817, 323], [CommonVals.STAR_TOKEN, 2327, 43], [CommonVals.STAR_TOKEN, 2437, 153], [CommonVals.TELE_TRANSMISSION, 2704, 389, 1, 0]]; _local8.actors = [[CommonVals.MOVABLE_STICK_BLOCK, 306, -258, 1, 0, 265, 3, 200], [CommonVals.MOVABLE_STICK_BLOCK, 386, -258, 1, 0, 265, 3, 100], [CommonVals.MOVABLE_STICK_BLOCK, 466, -258, 1, 0, 265, 3, 0], [CommonVals.MOVABLE_STICK_BLOCK, 1224, 743, 1, 180, 265, 3, 200], [CommonVals.MOVABLE_STICK_BLOCK, 1304, 743, 1, 180, 265, 3, 100], [CommonVals.MOVABLE_STICK_BLOCK, 1384, 743, 1, 180, 265, 3, 50], [CommonVals.MOVABLE_STICK_BLOCK, 1384, -258, 1, 0, 265, -2, 0], [CommonVals.MOVABLE_STICK_BLOCK, 1464, -258, 1, 0, 265, -2, 50], [CommonVals.MOVABLE_STICK_BLOCK, 1544, -258, 1, 0, 265, -2, 100], [CommonVals.MOVABLE_STICK_BLOCK, 1624, -258, 1, 0, 265, -2, 150], [CommonVals.MOVABLE_STICK_BLOCK, 1704, -258, 1, 0, 265, -2, 200], [CommonVals.MOVABLE_STICK_BLOCK, 1784, -258, 1, 0, 265, -2, 250], [CommonVals.KEY, 2142, 26, true, [0]], [CommonVals.GEAR1, 814, 238, 1.18, 0, 1, 0], [CommonVals.GEAR1, 2238, 238, 1.18, 0, -1, 0], [CommonVals.COW, 1518, 432, 1]]; allLevels.push(_local8); var _local9:LevelDataPrototype = new LevelDataPrototype(); _local9.levelWidth = 773; _local9.levelHeight = 1636; _local9.bgLayerWidth = 700; _local9.bgLayerHeight = 568; _local9.initCameraPos = new Point(0, 0); _local9.ufoPos = new Point(200, 136); _local9.sceneType = NIGHT_SCENE; _local9.ufoSpawnable = false; _local9.stillTerrain = [[[-30, 0], [0, 0], [0, 1636], [-30, 1636]], [[0, -30], [773, -30], [773, 0], [0, 0]], [[701, 0], [773, 0], [773, 1636], [701, 1636]], [[0, 1596], [773, 1596], [773, 1636], [0, 1636]], [[0, 206], [399, 206], [399, 293], [0, 293]], [[399, 206], [509, 0x0100], [509, 293], [399, 293]], [[345, 432], [701, 432], [701, 518], [345, 518]], [[188, 481], [345, 432], [345, 518], [188, 518]], [[437, 639], [701, 639], [701, 766], [437, 766]], [[325, 688], [437, 639], [437, 766], [325, 766]], [[324, 895], [701, 895], [701, 1050], [324, 1050]], [[324, 1050], [452, 1050], [452, 1154], [324, 1154]], [[543, 1050], [701, 1050], [701, 1208], [543, 1208]], [[0, 1279], [146, 1381], [146, 1596], [0, 1596]], [[195, 1317], [340, 1208], [701, 1208], [701, 1596], [195, 1596]]]; _local9.maliciousRegion = [[[147, 1397], [147, 1433], [142, 1433], [151, 1397]]]; _local9.objects = [[CommonVals.STAR_TOKEN, 523, 795], [CommonVals.STAR_TOKEN, 650, 795], [CommonVals.STAR_TOKEN, 73, 878], [CommonVals.STAR_TOKEN, 242, 878], [CommonVals.STAR_TOKEN, 158, 864], [CommonVals.STAR_TOKEN, 19, 952], [CommonVals.STAR_TOKEN, 117, 947], [CommonVals.STAR_TOKEN, 202, 947], [CommonVals.STAR_TOKEN, 71, 1016], [CommonVals.STAR_TOKEN, 159, 1015], [CommonVals.STAR_TOKEN, 243, 1018], [CommonVals.STAR_TOKEN, 19, 1078], [CommonVals.STAR_TOKEN, 116, 1077], [CommonVals.STAR_TOKEN, 199, 1079], [CommonVals.STAR_TOKEN, 289, 1081], [CommonVals.STAR_TOKEN, 69, 1141], [CommonVals.STAR_TOKEN, 159, 1141], [CommonVals.STAR_TOKEN, 241, 1147], [CommonVals.STAR_TOKEN, 116, 1206], [CommonVals.STAR_TOKEN, 199, 1201], [CommonVals.STAR_TOKEN, 57, 1258], [CommonVals.STAR_TOKEN, 208, 1254], [CommonVals.FLOAT_BOMB, 69, 820, 1.2], [CommonVals.FLOAT_BOMB, 158, 820, 1.2], [CommonVals.FLOAT_BOMB, 239, 820, 1.2], [CommonVals.FLOAT_BOMB, 327, 820, 1.2], [CommonVals.FLOAT_BOMB, 29, 890, 1.2], [CommonVals.FLOAT_BOMB, 118, 890, 1.2], [CommonVals.FLOAT_BOMB, 199, 890, 1.2], [CommonVals.FLOAT_BOMB, 288, 890, 1.2], [CommonVals.FLOAT_BOMB, 69, 950, 1.2], [CommonVals.FLOAT_BOMB, 158, 950, 1.2], [CommonVals.FLOAT_BOMB, 246, 950, 1.2], [CommonVals.FLOAT_BOMB, 29, 1020, 1.2], [CommonVals.FLOAT_BOMB, 118, 1020, 1.2], [CommonVals.FLOAT_BOMB, 199, 1020, 1.2], [CommonVals.FLOAT_BOMB, 288, 1020, 1.2], [CommonVals.FLOAT_BOMB, 69, 1080, 1.2], [CommonVals.FLOAT_BOMB, 158, 1080, 1.2], [CommonVals.FLOAT_BOMB, 239, 1080, 1.2], [CommonVals.FLOAT_BOMB, 29, 1150, 1.2], [CommonVals.FLOAT_BOMB, 118, 1150, 1.2], [CommonVals.FLOAT_BOMB, 199, 1150, 1.2], [CommonVals.FLOAT_BOMB, 72, 1210, 1.2], [CommonVals.FLOAT_BOMB, 161, 1210, 1.2], [CommonVals.FLOAT_BOMB, 242, 1210, 1.2], [CommonVals.FLOAT_BOMB, 123, 1270, 1.2], [CommonVals.TELE_TRANSMISSION, 89, 210, 1, 0]]; _local9.actors = [[CommonVals.TrashCan, 595, 642, 1, 0], [CommonVals.SPINY_STICK, 622, 271, 1, 180, 0.7, false, 0], [CommonVals.WINDMILL_FAN, 22, 433, 1, 0, -1], [CommonVals.SPINY_STICK, 178, 711, 1.247, -179, -1, true, 2], [CommonVals.DOOR, 507, 765, 1.34, 0, true, -1, 1], [CommonVals.TRIGGER, 336, 84, 0], [CommonVals.TRIGGER, 400, 424, 0], [CommonVals.KEY, 466, 1062, true, [1]], [CommonVals.COW, 626, 869, 1]]; allLevels.push(_local9); var _local10:LevelDataPrototype = new LevelDataPrototype(); _local10.levelWidth = 1685; _local10.levelHeight = 1060; _local10.bgLayerWidth = 1099; _local10.bgLayerHeight = 568; _local10.initCameraPos = new Point(0, 0); _local10.ufoPos = new Point(280, 34); _local10.sceneType = NIGHT_SCENE; _local10.stillTerrain = [[[0, -30], [1685, -30], [1685, 0], [0, 0]], [[-30, 0], [0, 0], [0, 1060], [-30, 1060]], [[0, 55], [68, 55], [68, 106], [0, 106]], [[0, 106], [522, 106], [522, 268], [296, 268], [0, 214]], [[522, 193], [701, 193], [701, 268], [522, 268]], [[701, 161], [1256, 161], [1256, 268], [701, 268]], [[1563, 0], [1685, 0], [1685, 373], [1394, 373]], [[1394, 373], [1685, 373], [1685, 549], [1142, 549]], [[221, 549], [1685, 549], [1685, 640], [221, 640]], [[0, 408], [81, 461], [81, 532], [0, 576]], [[0, 576], [42, 683], [42, 869], [0, 961]], [[0, 992], [243, 992], [243, 1060], [0, 1060]], [[243, 1060], [243, 992], [438, 779], [973, 779], [973, 1060]], [[973, 949], [1404, 949], [1404, 1060], [973, 1060]], [[1404, 656], [1685, 656], [1685, 1060], [1404, 1060]], [[1013, 657], [1022, 640], [1685, 640], [1685, 657]], [[483, 439], [585, 439], [585, 468], [483, 468]], [[900, 416], [1022, 416], [1022, 447], [900, 447]]]; _local10.maliciousRegion = [[[522, 173], [700, 173], [700, 191], [522, 191]]]; _local10.objects = [[CommonVals.STAR_TOKEN, 1054, 313], [CommonVals.STAR_TOKEN, 921, 344], [CommonVals.STAR_TOKEN, 759, 362], [CommonVals.STAR_TOKEN, 574, 389], [CommonVals.STAR_TOKEN, 388, 372], [CommonVals.STAR_TOKEN, 1068, 820], [CommonVals.STAR_TOKEN, 1123, 738], [CommonVals.STAR_TOKEN, 1162, 858], [CommonVals.STAR_TOKEN, 1193, 780], [CommonVals.STAR_TOKEN, 1315, 838], [CommonVals.STAR_TOKEN, 1152, 785], [CommonVals.STAR_TOKEN, 1330, 745], [CommonVals.STAR_TOKEN, 1236, 713], [CommonVals.STAR_TOKEN, 1301, 894], [CommonVals.FLOAT_BOMB, 1378, 347, 1], [CommonVals.FLOAT_BOMB, 1345, 379, 1], [CommonVals.FLOAT_BOMB, 1301, 397, 1], [CommonVals.FLOAT_BOMB, 1067, 690, 1], [CommonVals.FLOAT_BOMB, 1032, 726, 1], [CommonVals.FLOAT_BOMB, 997, 761, 1], [CommonVals.LASER_PROJECTOR, 236, 584, -90, 5, true, 1], [CommonVals.BUMPER, 95, 664, 1], [CommonVals.TELE_TRANSMISSION, 36, 0x0300, 1, 90], [CommonVals.HIDDEN_BLOCK_OBJECT, 900, 638, [[[128, 6], [510, 6], [510, 332], [2, 332], [2, 172]]], 1]]; _local10.actors = [[CommonVals.BREAKABLE_SQUARE, 1114, 332, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1044, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 843, 384, 1, 0], [CommonVals.BREAKABLE_SQUARE, 779, 427, 1, 0], [CommonVals.BREAKABLE_SQUARE, 702, 405, 1, 0], [CommonVals.BREAKABLE_SQUARE, 633, 427, 1, 0], [CommonVals.BREAKABLE_SQUARE, 409, 433, 1, 0], [CommonVals.BREAKABLE_SQUARE, 336, 429, 1, 0], [CommonVals.BREAKABLE_SQUARE, 578, 394, 1, 0], [CommonVals.SPINY_BALL, [[147, 601], [147, 707], [872, 707]], 1.8, 2], [CommonVals.TrashCan, 522, 159, 1, 90], [CommonVals.TrashCan, 564, 159, 1, 90], [CommonVals.TrashCan, 606, 159, 1, 90], [CommonVals.TrashCan, 648, 159, 1, 90], [CommonVals.CANNON, 27, 476, 1.5, -19, [65, 185], 250, 150], [CommonVals.WINDMILL_FAN, 1242, 180, 1, 0, 2], [CommonVals.KEY, 16, 18, true, [0]], [CommonVals.KEY, 511, 410, true, [1]], [CommonVals.DOOR, 495, 10, 1, 0, true, 1, 0], [CommonVals.COW, 152, 80, 1], [CommonVals.DOG, 238, 105, 1], [CommonVals.DOG, 343, 105, 1], [CommonVals.CAT, 430, 102, 1], [CommonVals.DOG, 1087, 959, 1], [CommonVals.DOG, 1037, 959, 1], [CommonVals.DOG, 1203, 959, 1], [CommonVals.DOG, 1253, 959, 1], [CommonVals.CAT, 1230, 959, 1], [CommonVals.CAT, 1064, 959, 1]]; allLevels.push(_local10); var _local11:LevelDataPrototype = new LevelDataPrototype(); _local11.levelWidth = 910; _local11.levelHeight = 871; _local11.bgLayerWidth = 780; _local11.bgLayerHeight = 568; _local11.initCameraPos = new Point(167, 0x0100); _local11.ufoPos = new Point(487, 496); _local11.sceneType = NIGHT_SCENE; _local11.ufoSpawnable = true; _local11.stillTerrain = [[[-30, 0], [0, 0], [0, 871], [-30, 871]], [[0, -30], [910, -30], [910, 0], [0, 0]], [[910, 0], [940, 0], [940, 871], [910, 871]], [[0, 826], [910, 826], [910, 871], [0, 871]], [[0, 0], [73, 0], [73, 626], [0, 626]], [[73, 554], [181, 554], [181, 626], [73, 626]], [[191, 128], [270, 128], [270, 177], [191, 177]], [[191, 177], [393, 177], [393, 415], [250, 415], [191, 382]], [[393, 344], [693, 344], [693, 387], [602, 415], [393, 415]], [[460, 0], [528, 0], [528, 154], [460, 154]], [[460, 154], [694, 154], [694, 198], [645, 228], [506, 228], [460, 198]], [[840, 0], [910, 0], [910, 427], [840, 427]], [[840, 427], [910, 427], [910, 561], [696, 561]], [[83, 718], [324, 718], [324, 772], [83, 772]], [[278, 561], [324, 561], [324, 718], [278, 718]], [[324, 561], [910, 561], [910, 618], [324, 618]], [[324, 618], [495, 618], [495, 685], [324, 685]], [[745, 618], [910, 618], [910, 826], [745, 826]]]; _local11.objects = [[CommonVals.LASER_PROJECTOR, 605, 198, 90, 2, true, 3], [CommonVals.LASER_PROJECTOR, 323, 208, -90, 4, true, 4], [CommonVals.LASER_PROJECTOR, 198, 237, 180, 1, true, 5], [CommonVals.STAR_TOKEN, 439, 703], [CommonVals.STAR_TOKEN, 393, 703], [CommonVals.STAR_TOKEN, 439, 808], [CommonVals.STAR_TOKEN, 393, 808], [CommonVals.STAR_TOKEN, 439, 0x0300], [CommonVals.STAR_TOKEN, 393, 0x0300], [CommonVals.STAR_TOKEN, 706, 652], [CommonVals.STAR_TOKEN, 706, 702], [CommonVals.STAR_TOKEN, 706, 752], [CommonVals.STAR_TOKEN, 706, 801], [CommonVals.STAR_TOKEN, 660, 652], [CommonVals.STAR_TOKEN, 660, 702], [CommonVals.STAR_TOKEN, 660, 752], [CommonVals.STAR_TOKEN, 660, 801], [CommonVals.STAR_TOKEN, 616, 652], [CommonVals.STAR_TOKEN, 616, 702], [CommonVals.STAR_TOKEN, 616, 752], [CommonVals.STAR_TOKEN, 616, 801], [CommonVals.STAR_TOKEN, 570, 652], [CommonVals.STAR_TOKEN, 570, 702], [CommonVals.STAR_TOKEN, 570, 752], [CommonVals.STAR_TOKEN, 570, 801], [CommonVals.STAR_TOKEN, 526, 652], [CommonVals.STAR_TOKEN, 526, 702], [CommonVals.STAR_TOKEN, 526, 752], [CommonVals.STAR_TOKEN, 526, 801], [CommonVals.FLOAT_BOMB, 247, 604, 1], [CommonVals.FLOAT_BOMB, 207, 604, 1], [CommonVals.FLOAT_BOMB, 50, 654, 1], [CommonVals.FLOAT_BOMB, 50, 687, 1], [CommonVals.HIDDEN_BLOCK_OBJECT, 0, 568, [[[0, 197], [753, 197], [753, 280], [0, 280]], [[313, 15], [755, 15], [755, 280], [313, 280]]], 1], [CommonVals.TELE_TRANSMISSION, 223, 720, 1, 0]]; _local11.actors = [[CommonVals.DOOR, 281, 413, 1.5, 0, false, -1, 0], [CommonVals.DOOR, 839, 344, 1.5, 90, false, -1, 1], [CommonVals.DOOR, 841, 155, 1.5, 90, false, -1, 2], [CommonVals.KEY, 579, 500, false, [1]], [CommonVals.KEY, 716, 248, false, [1, 3]], [CommonVals.KEY, 444, 306, false, [0, 2]], [CommonVals.KEY, 120, 276, false, [4]], [CommonVals.KEY, 414, 37, false, [5, 0]], [CommonVals.BREAKABLE_SQUARE, 376, 138, 1, 0], [CommonVals.BREAKABLE_SQUARE, 418, 138, 1, 0], [CommonVals.CANNON, 244, 169, 1, -45, 8, 30, 250], [CommonVals.COW, 572, 130, 1]]; allLevels.push(_local11); var _local12:LevelDataPrototype = new LevelDataPrototype(); _local12.levelWidth = 1856; _local12.levelHeight = 1090; _local12.bgLayerWidth = 1099; _local12.bgLayerHeight = 568; _local12.initCameraPos = new Point(0, 0); _local12.ufoPos = new Point(447, 296); _local12.sceneType = NIGHT_SCENE; _local12.ufoSpawnable = false; _local12.stillTerrain = [[[0, -30], [1856, -30], [1856, 0], [0, 0]], [[0, 0], [78, 0], [78, 1090], [0, 1090]], [[78, 0], [392, 0], [392, 212], [78, 212]], [[204, 310], [392, 310], [392, 437], [204, 437]], [[204, 437], [288, 437], [288, 536], [204, 536]], [[204, 536], [593, 536], [593, 858], [204, 858]], [[489, 310], [593, 310], [593, 536], [489, 536]], [[490, 136], [1856, 136], [1856, 212], [490, 212]], [[760, 0], [1856, 0], [1856, 136], [760, 136]], [[701, 212], [803, 212], [803, 632], [701, 632]], [[593, 746], [1026, 746], [1026, 858], [593, 858]], [[925, 322], [0x0404, 322], [0x0404, 746], [925, 746]], [[0x0404, 322], [1569, 575], [1569, 582], [0x0404, 582]], [[1098, 212], [1856, 212], [1856, 502], [1710, 502]], [[1710, 502], [1856, 502], [1856, 1090], [1710, 1090]], [[1154, 699], [1710, 699], [1710, 1090], [1154, 1090]], [[78, 980], [1154, 980], [1154, 1090], [78, 1090]]]; _local12.maliciousRegion = [[[78, 414], [95, 423], [91, 548], [78, 554]], [[803, 485], [820, 495], [818, 620], [803, 625]], [[909, 325], [923, 323], [923, 463], [910, 456]], [[1042, 327], [1064, 316], [1170, 365], [1167, 384]], [[1222, 283], [1227, 272], [1352, 331], [1333, 338]], [[1300, 448], [1317, 438], [1558, 549], [1559, 568]], [[1529, 415], [1653, 474], [1645, 484], [1523, 427]], [[775, 855], [1007, 859], [1007, 869], [787, 869]]]; _local12.objects = [[CommonVals.STAR_TOKEN, 251, 235], [CommonVals.STAR_TOKEN, 301, 235], [CommonVals.STAR_TOKEN, 678, 235], [CommonVals.STAR_TOKEN, 615, 355], [CommonVals.STAR_TOKEN, 615, 405], [CommonVals.STAR_TOKEN, 615, 455], [CommonVals.STAR_TOKEN, 675, 505], [CommonVals.STAR_TOKEN, 675, 555], [CommonVals.STAR_TOKEN, 675, 605], [CommonVals.STAR_TOKEN, 675, 655], [CommonVals.STAR_TOKEN, 847, 728], [CommonVals.STAR_TOKEN, 890, 728], [CommonVals.STAR_TOKEN, 906, 0x0202], [CommonVals.STAR_TOKEN, 906, 564], [CommonVals.STAR_TOKEN, 906, 614], [CommonVals.STAR_TOKEN, 825, 345], [CommonVals.STAR_TOKEN, 825, 395], [CommonVals.STAR_TOKEN, 825, 445], [CommonVals.STAR_TOKEN, 1110, 242], [CommonVals.STAR_TOKEN, 1170, 268], [CommonVals.STAR_TOKEN, 1284, 418], [CommonVals.STAR_TOKEN, 1364, 366], [CommonVals.STAR_TOKEN, 1407, 384], [CommonVals.STAR_TOKEN, 1688, 547], [CommonVals.STAR_TOKEN, 1688, 597], [CommonVals.STAR_TOKEN, 1688, 647], [CommonVals.STAR_TOKEN, 1480, 679], [CommonVals.STAR_TOKEN, 1430, 679], [CommonVals.STAR_TOKEN, 1420, 614], [CommonVals.STAR_TOKEN, 1370, 614], [CommonVals.STAR_TOKEN, 1320, 614], [CommonVals.STAR_TOKEN, 1270, 614], [CommonVals.STAR_TOKEN, 1110, 614], [CommonVals.STAR_TOKEN, 1067, 614], [CommonVals.STAR_TOKEN, 1050, 778], [CommonVals.STAR_TOKEN, 1140, 876], [CommonVals.STAR_TOKEN, 569, 879], [CommonVals.STAR_TOKEN, 523, 879], [CommonVals.STAR_TOKEN, 185, 679], [CommonVals.STAR_TOKEN, 185, 764], [CommonVals.STAR_TOKEN, 185, 809], [CommonVals.STAR_TOKEN, 129, 471], [CommonVals.STAR_TOKEN, 185, 399], [CommonVals.FLOAT_BOMB, 720, 654, 1], [CommonVals.FLOAT_BOMB, 803, 729, 1], [CommonVals.FLOAT_BOMB, 871, 235, 1], [CommonVals.FLOAT_BOMB, 1044, 235, 1], [CommonVals.FLOAT_BOMB, 1529, 619, 1], [CommonVals.FLOAT_BOMB, 1469, 619, 1], [CommonVals.FLOAT_BOMB, 1529, 619, 1], [CommonVals.FLOAT_BOMB, 1381, 681, 1], [CommonVals.FLOAT_BOMB, 1321, 681, 1], [CommonVals.FLOAT_BOMB, 1229, 619, 1], [CommonVals.FLOAT_BOMB, 1169, 619, 1], [CommonVals.FLOAT_BOMB, 1047, 735, 1], [CommonVals.BUMPER, 1231, 384, 1], [CommonVals.BUMPER, 1448, 409, 1], [CommonVals.TELE_TRANSMISSION, 699, 145, 1, 0]]; _local12.actors = [[CommonVals.DOOR, 489, 317, 1, 90, true, -1, 0], [CommonVals.DOOR, 493, 211, 1, 0, true, -1, 0], [CommonVals.KEY, 419, 217, true, [0]], [CommonVals.DOOR, 365, 212, 1, 0, true, -1, 1], [CommonVals.KEY, 274, 251, true, [1]], [CommonVals.DOOR, 489, 182, 1, 90, true, -1, 2], [CommonVals.KEY, 314, 495, true, [2]], [CommonVals.DOOR, 730, 859, 1.25, 0, true, -1, 3], [CommonVals.KEY, 881, 934, true, [3]], [CommonVals.TRIGGER, 89, 604, 4], [CommonVals.CANNON, 1275, 945, 1.5, 180, 45, 150, 150], [CommonVals.SPINY_BALL, [[445, 409], [445, 259], [647, 259], [647, 692], [863, 692], [863, 272], [1092, 272], [1637, 530], [1637, 637], [1096, 637], [1096, 918], [144, 918], [144, 268], [445, 268], [445, 487], [364, 487]], 1.5, 3], [CommonVals.SPINY_STICK, 81, 262, 0.766, 0, 1, true, 9], [CommonVals.WINDMILL_FAN, 226, 846, 1.15, 0, 2], [CommonVals.SPINY_STICK, 81, 429, 0.766, 0, 1, false, 4], [CommonVals.SPINY_STICK, 202, 632, 0.727, 0, 1, true, 9], [CommonVals.COW, 360, 506, 1], [CommonVals.DOG, 440, 160, 1]]; allLevels.push(_local12); var _local13:LevelDataPrototype = new LevelDataPrototype(); _local13.levelWidth = 2100; _local13.levelHeight = 904; _local13.bgLayerWidth = 666.67; _local13.bgLayerHeight = 500; _local13.initCameraPos = new Point(0, 0); _local13.ufoPos = new Point(118, 249); _local13.sceneType = SNOW_SCENE; _local13.ufoSpawnable = false; _local13.stillTerrain.push([[-30, 0], [0, 0], [0, 2000], [-30, 2000]]); _local13.stillTerrain.push([[0, -30], [2100, -30], [2100, 0], [0, 0]]); _local13.stillTerrain.push([[2100, 0], [2130, 0], [2130, 2000], [2100, 2000]]); _local13.stillTerrain.push([[0, 2000], [2100, 2000], [2100, 2030], [0, 2030]]); _local13.stillTerrain.push([[0, 0], [449, 0], [449, 49], [0, 49]]); _local13.stillTerrain.push([[449, 0], [729, 0], [729, 108], [449, 49]]); _local13.stillTerrain.push([[729, 0], [1230, 0], [1230, 108], [729, 108]]); _local13.stillTerrain.push([[1230, 0], [1451, 0], [1451, 60], [1230, 108]]); _local13.stillTerrain.push([[1451, 0], [2100, 0], [2100, 60], [1451, 60]]); _local13.stillTerrain.push([[0, 146], [449, 146], [449, 201], [0, 202]]); _local13.stillTerrain.push([[449, 146], [758, 208], [758, 259], [449, 201]]); _local13.stillTerrain.push([[758, 208], [1230, 208], [1230, 258], [758, 258]]); _local13.stillTerrain.push([[1230, 208], [1465, 148], [1465, 201], [1230, 258]]); _local13.stillTerrain.push([[1465, 148], [1772, 148], [1786, 175], [1772, 201], [1465, 201]]); _local13.stillTerrain.push([[0, 300], [449, 300], [449, 433], [0, 433]]); _local13.stillTerrain.push([[449, 300], [761, 348], [761, 433], [449, 433]]); _local13.stillTerrain.push([[761, 348], [1989, 348], [1989, 433], [761, 433]]); _local13.stillTerrain.push([[1950, 433], [1989, 433], [1989, 530], [1950, 530]]); _local13.stillTerrain.push([[1989, 530], [1989, 587], [1140, 587], [1140, 530]]); _local13.stillTerrain.push([[893, 603], [1140, 530], [1140, 587], [893, 657]]); _local13.stillTerrain.push([[417, 603], [893, 603], [893, 657], [417, 657]]); _local13.stillTerrain.push([[1132, 685], [2100, 685], [2100, 782], [1132, 782]]); _local13.stillTerrain.push([[1297, 782], [1344, 782], [1344, 839], [1297, 839]]); _local13.stillTerrain.push([[238, 838], [1344, 838], [1344, 904], [238, 904]]); _local13.stillTerrain.push([[0, 867], [238, 867], [238, 904], [0, 904]]); _local13.maliciousRegion.push([[0, 853], [238, 853], [238, 867], [0, 867]]); _local13.objects.push([CommonVals.STAR_TOKEN, 326, 228]); _local13.objects.push([CommonVals.STAR_TOKEN, 366, 228]); _local13.objects.push([CommonVals.STAR_TOKEN, 406, 228]); _local13.objects.push([CommonVals.STAR_TOKEN, 446, 228]); _local13.objects.push([CommonVals.STAR_TOKEN, 606, 302]); _local13.objects.push([CommonVals.STAR_TOKEN, 644, 312]); _local13.objects.push([CommonVals.STAR_TOKEN, 724, 328]); _local13.objects.push([CommonVals.STAR_TOKEN, 766, 334]); _local13.objects.push([CommonVals.STAR_TOKEN, 780, 280]); _local13.objects.push([CommonVals.STAR_TOKEN, 820, 280]); _local13.objects.push([CommonVals.STAR_TOKEN, 860, 280]); _local13.objects.push([CommonVals.STAR_TOKEN, 900, 280]); _local13.objects.push([CommonVals.STAR_TOKEN, 1040, 333]); _local13.objects.push([CommonVals.STAR_TOKEN, 1080, 333]); _local13.objects.push([CommonVals.STAR_TOKEN, 1120, 333]); _local13.objects.push([CommonVals.STAR_TOKEN, 1160, 333]); _local13.objects.push([CommonVals.STAR_TOKEN, 1474, 234]); _local13.objects.push([CommonVals.STAR_TOKEN, 1474, 314]); _local13.objects.push([CommonVals.STAR_TOKEN, 1514, 234]); _local13.objects.push([CommonVals.STAR_TOKEN, 1514, 275]); _local13.objects.push([CommonVals.STAR_TOKEN, 1514, 316]); _local13.objects.push([CommonVals.STAR_TOKEN, 1558, 275]); _local13.objects.push([CommonVals.STAR_TOKEN, 1598, 275]); _local13.objects.push([CommonVals.STAR_TOKEN, 1638, 275]); _local13.objects.push([CommonVals.STAR_TOKEN, 1678, 275]); _local13.objects.push([CommonVals.STAR_TOKEN, 1914, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1874, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1834, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1794, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1487, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1447, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1407, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1367, 610]); _local13.objects.push([CommonVals.STAR_TOKEN, 1747, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1707, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1667, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1627, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1539, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1499, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1459, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1419, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1193, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1153, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1113, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 1073, 666]); _local13.objects.push([CommonVals.STAR_TOKEN, 599, 679]); _local13.objects.push([CommonVals.STAR_TOKEN, 639, 679]); _local13.objects.push([CommonVals.STAR_TOKEN, 679, 679]); _local13.objects.push([CommonVals.STAR_TOKEN, 555, 751]); _local13.objects.push([CommonVals.STAR_TOKEN, 595, 751]); _local13.objects.push([CommonVals.STAR_TOKEN, 635, 751]); _local13.objects.push([CommonVals.STAR_TOKEN, 675, 751]); _local13.objects.push([CommonVals.STAR_TOKEN, 559, 818]); _local13.objects.push([CommonVals.STAR_TOKEN, 599, 818]); _local13.objects.push([CommonVals.STAR_TOKEN, 639, 818]); _local13.objects.push([CommonVals.BUMPER, 494, 228, 0.53]); _local13.objects.push([CommonVals.BUMPER, 686, 318, 0.53]); _local13.objects.push([CommonVals.BUMPER, 494, 228, 0.53]); _local13.objects.push([CommonVals.BUMPER, 942, 275, 0.53]); _local13.objects.push([CommonVals.BUMPER, 1197, 339, 0.53]); _local13.objects.push([CommonVals.BUMPER, 1477, 277, 0.53]); _local13.objects.push([CommonVals.BUMPER, 1563, 220, 0.53]); _local13.objects.push([CommonVals.BUMPER, 1563, 333, 0.53]); _local13.objects.push([CommonVals.BUMPER, 556, 676, 0.53]); _local13.objects.push([CommonVals.BUMPER, 680, 817, 0.53]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1882, 319, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1924, 319, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1966, 319, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1940, 659, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1892, 659, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1844, 659, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1796, 659, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1677, 606, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1629, 606, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1582, 606, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1534, 606, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1377, 662, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1329, 662, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1282, 662, 1]); _local13.objects.push([CommonVals.FLOAT_BOMB, 1234, 662, 1]); _local13.objects.push([CommonVals.LASER_PROJECTOR, 936, 651, 90, 2, true, 2]); _local13.objects.push([CommonVals.TELE_TRANSMISSION, 1703, 355, 1, 0]); _local13.objects.push([CommonVals.TELE_TRANSMISSION, 403, 845, 1, 0]); _local13.actors.push([CommonVals.KEY, 93, 0x0101, true, [0]]); _local13.actors.push([CommonVals.KEY, 2026, 622, true, [1]]); _local13.actors.push([CommonVals.KEY, 1135, 796, true, [2]]); _local13.actors.push([CommonVals.DOOR, 276, 49, 1, 0, true, -1, 0]); _local13.actors.push([CommonVals.DOOR, 170, 202, 1, 0, true, -1, 0]); _local13.actors.push([CommonVals.DOOR, 1960, 587, 1, 0, true, -1, 1]); _local13.actors.push([CommonVals.DOOR, 1644, 433, 1, 0, true, -1, 1]); _local13.actors.push([CommonVals.COW, 200, 110, 1]); _local13.actors.push([CommonVals.COW, 1723, 490, -1]); _local13.actors.push([CommonVals.CAR, 198, 144, 13]); _local13.actors.push([CommonVals.CAR, 1722, 516, -5]); _local13.actors.push([CommonVals.SPINY_BALL, [[766, 698], [500, 698], [500, 784], [766, 784], [766, 698]], 1, 3]); _local13.actors.push([CommonVals.SPINY_BALL, [[500, 784], [766, 784], [766, 698], [500, 698], [500, 784]], 1, 3]); allLevels.push(_local13); var _local14:LevelDataPrototype = new LevelDataPrototype(); _local14.levelWidth = 2799; _local14.levelHeight = 480; _local14.bgLayerWidth = 929; _local14.bgLayerHeight = 480; _local14.initCameraPos = new Point(0, 0); _local14.ufoPos = new Point(100, 83); _local14.sceneType = NIGHT_SCENE; _local14.ufoSpawnable = true; _local14.stillTerrain.push([[98, 159], [130, 159], [130, 212], [98, 212]]); _local14.stillTerrain.push([[0, 212], [130, 212], [130, 0xFF], [39, 311], [0, 311]]); _local14.stillTerrain.push([[0, 311], [39, 311], [39, 390], [0, 390]]); _local14.stillTerrain.push([[0, 390], [39, 390], [119, 442], [0, 442]]); _local14.stillTerrain.push([[0, 442], [2799, 442], [2799, 480], [0, 480]]); _local14.stillTerrain.push([[610, 212], [668, 212], [668, 0x0100], [610, 253]]); _local14.stillTerrain.push([[610, 253], [668, 0x0100], [701, 313]]); _local14.stillTerrain.push([[806, 212], [867, 212], [867, 0xFF], [806, 0x0100]]); _local14.stillTerrain.push([[806, 0x0100], [867, 0xFF], [776, 313]]); _local14.stillTerrain.push([[668, 0x0100], [806, 0x0100], [776, 313], [701, 313]]); _local14.stillTerrain.push([[701, 313], [776, 313], [776, 391], [701, 391]]); _local14.stillTerrain.push([[701, 391], [776, 391], [856, 442], [620, 442]]); _local14.stillTerrain.push([[1703, 212], [1836, 212], [1836, 0x0101], [1703, 0xFF]]); _local14.stillTerrain.push([[1703, 0xFF], [1836, 0x0101], [1794, 313]]); _local14.stillTerrain.push([[1836, 0x0101], [1955, 0x0101], [1869, 313], [1794, 313]]); _local14.stillTerrain.push([[1794, 313], [1869, 313], [1869, 390], [1794, 390]]); _local14.stillTerrain.push([[1794, 390], [1869, 390], [1951, 442], [1713, 442]]); _local14.stillTerrain.push([[2011, 292], [2799, 292], [2799, 358], [2011, 358]]); _local14.stillTerrain.push([[2718, 0], [2799, 0], [2799, 480], [2718, 480]]); _local14.stillTerrain.push([[0, -30], [2799, -30], [2799, 0], [0, 0]]); _local14.stillTerrain.push([[-30, 0], [0, 0], [0, 480], [-30, 480]]); _local14.stillTerrain.push([[2097, 0], [2799, 0], [2799, 150], [2097, 150]]); _local14.stillTerrain.push([[852, 0], [1706, 0], [1706, 38], [852, 38]]); _local14.stillTerrain.push([[1103, 301], [1198, 301], [1198, 320], [1103, 320]]); _local14.stillTerrain.push([[1405, 211], [1499, 211], [1499, 230], [1405, 230]]); _local14.maliciousRegion.push([[129, 254], [129, 281], [59, 326], [40, 311]]); _local14.maliciousRegion.push([[40, 311], [59, 326], [64, 382], [39, 389]]); _local14.maliciousRegion.push([[39, 389], [57, 377], [116, 420], [117, 439]]); _local14.maliciousRegion.push([[119, 421], [616, 421], [621, 442], [119, 442]]); _local14.maliciousRegion.push([[621, 442], [616, 421], [679, 377], [702, 391]]); _local14.maliciousRegion.push([[679, 377], [680, 324], [701, 313], [702, 391]]); _local14.maliciousRegion.push([[602, 273], [610, 253], [701, 313], [680, 324]]); _local14.maliciousRegion.push([[861, 258], [869, 278], [796, 321], [776, 312]]); _local14.maliciousRegion.push([[776, 321], [796, 321], [797, 378], [776, 390]]); _local14.maliciousRegion.push([[776, 390], [797, 378], [857, 421], [857, 442]]); _local14.maliciousRegion.push([[857, 442], [857, 421], [1713, 421], [1713, 442]]); _local14.maliciousRegion.push([[1713, 421], [1770, 380], [1794, 391], [1713, 442]]); _local14.maliciousRegion.push([[1770, 380], [1773, 324], [1793, 313], [1794, 391]]); _local14.maliciousRegion.push([[1700, 277], [1709, 259], [1793, 313], [1773, 324]]); _local14.maliciousRegion.push([[1705, 191], [1831, 191], [1835, 212], [1702, 212]]); _local14.objects.push([CommonVals.UFO_SPAWNER_INACTIVE, 1943, 100, false]); _local14.objects.push([CommonVals.STAR_TOKEN, 97, 328]); _local14.objects.push([CommonVals.STAR_TOKEN, 177, 376]); _local14.objects.push([CommonVals.STAR_TOKEN, 291, 383]); _local14.objects.push([CommonVals.STAR_TOKEN, 452, 383]); _local14.objects.push([CommonVals.STAR_TOKEN, 567, 383]); _local14.objects.push([CommonVals.STAR_TOKEN, 666, 335]); _local14.objects.push([CommonVals.STAR_TOKEN, 961, 79]); _local14.objects.push([CommonVals.STAR_TOKEN, 853, 369]); _local14.objects.push([CommonVals.STAR_TOKEN, 986, 323]); _local14.objects.push([CommonVals.STAR_TOKEN, 1109, 259]); _local14.objects.push([CommonVals.STAR_TOKEN, 1169, 389]); _local14.objects.push([CommonVals.STAR_TOKEN, 1161, 84]); _local14.objects.push([CommonVals.STAR_TOKEN, 1297, 87]); _local14.objects.push([CommonVals.STAR_TOKEN, 1433, 90]); _local14.objects.push([CommonVals.STAR_TOKEN, 1629, 90]); _local14.objects.push([CommonVals.STAR_TOKEN, 1302, 234]); _local14.objects.push([CommonVals.STAR_TOKEN, 1332, 406]); _local14.objects.push([CommonVals.STAR_TOKEN, 1517, 291]); _local14.objects.push([CommonVals.STAR_TOKEN, 1629, 366]); _local14.objects.push([CommonVals.STAR_TOKEN, 1967, 309]); _local14.objects.push([CommonVals.STAR_TOKEN, 1919, 350]); _local14.objects.push([CommonVals.STAR_TOKEN, 2027, 398]); _local14.objects.push([CommonVals.STAR_TOKEN, 2146, 399]); _local14.objects.push([CommonVals.STAR_TOKEN, 2302, 399]); _local14.objects.push([CommonVals.STAR_TOKEN, 2438, 399]); _local14.objects.push([CommonVals.TELE_TRANSMISSION, 2616, 300, 1, 0]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2069, 20, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2069, 74, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2069, 120, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2124, 185, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2124, 223, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2124, 260, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2086, 260, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 0x0800, 260, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 2010, 260, 1]); _local14.objects.push([CommonVals.FLOAT_BOMB, 1981, 233, 1]); _local14.objects.push([CommonVals.LASER_PROJECTOR, 2450, 324, -90, 2, true, 1]); _local14.actors.push([CommonVals.DOOR, 2268, 150, 1.45, 0, true, -1, 0]); _local14.actors.push([CommonVals.BREAKABLE_SQUARE, 1912, 214, 1, 0]); _local14.actors.push([CommonVals.CANNON, 1091, 22, 1, 111, 5, 90, 50]); _local14.actors.push([CommonVals.CANNON, 1223, 22, 1, 90, 5, 90, 30]); _local14.actors.push([CommonVals.CANNON, 1360, 22, 1, 90, 5, 90, 30]); _local14.actors.push([CommonVals.CANNON, 1492, 22, 1, 73.8, 5, 90, 250]); _local14.actors.push([CommonVals.CANNON, 2770, 394, 1, 180, [5, 20], 150, 150]); _local14.actors.push([CommonVals.WINDMILL_FAN, 373, 182, 1.1, 0, 2]); _local14.actors.push([CommonVals.KEY, 2220, 394, true, [0]]); _local14.actors.push([CommonVals.KEY, 2521, 394, true, [1]]); _local14.actors.push([CommonVals.COW, 43, 190, 1]); _local14.actors.push([CommonVals.SPINY_BALL, [[725, 222], [725, 147], [556, 147], [556, 377], [177, 377], [177, 32], [48, 32], [48, 166]], 1, 3]); allLevels.push(_local14); var _local15:LevelDataPrototype = new LevelDataPrototype(); _local15.levelWidth = 2500; _local15.levelHeight = 971; _local15.bgLayerWidth = 1099; _local15.bgLayerHeight = 568; _local15.initCameraPos = new Point(0, 0); _local15.ufoPos = new Point(297, 164); _local15.sceneType = NIGHT_SCENE; _local15.ufoSpawnable = true; _local15.stillTerrain = [[[0, -30], [2500, -30], [2500, 0], [0, 0]], [[2500, 0], [2530, 0], [2530, 971], [2500, 970]], [[0, 0], [763, 0], [763, 46], [0, 46]], [[159, 46], [600, 46], [452, 74], [297, 74]], [[0, 46], [28, 46], [28, 294], [0, 294]], [[28, 149], [160, 149], [160, 192], [28, 192]], [[0, 294], [308, 294], [308, 345], [0, 345]], [[731, 46], [763, 46], [763, 294], [731, 294]], [[600, 147], [731, 147], [731, 191], [600, 191]], [[450, 294], [763, 294], [763, 344], [450, 344]], [[0, 345], [162, 345], [162, 420], [0, 420]], [[0, 420], [162, 420], [239, 650], [239, 874], [0, 874]], [[0, 874], [754, 874], [754, 971], [0, 971]], [[600, 395], [763, 395], [763, 736], [522, 736], [522, 651]], [[754, 956], [950, 956], [950, 971], [754, 971]], [[950, 874], [1162, 696], [1278, 696], [1278, 971], [950, 971]], [[1278, 719], [2500, 719], [2500, 971], [1278, 971]], [[882, 679], [882, 563], [1045, 563], [917, 679]], [[882, 462], [1252, 462], [1045, 563], [882, 563]], [[882, 437], [1355, 437], [1252, 462], [882, 462]], [[882, 0], [2017, 0], [2017, 437], [882, 437]], [[2017, 386], [2270, 386], [2270, 437], [2017, 437]], [[1250, 545], [1665, 545], [1665, 567], [1499, 598], [1250, 598]], [[1758, 546], [2187, 546], [2246, 577], [2246, 598], [0x0707, 598]], [[1733, 694], [1734, 694], [1734, 696], [1733, 696]], [[1955, 694], [1956, 694], [1956, 696], [1955, 696]], [[2320, 694], [2321, 694], [2321, 696], [2320, 696]], [[1790, 528], [1839, 528], [1839, 546], [1790, 546]], [[2136, 528], [2185, 528], [2185, 546], [2139, 546]]]; _local15.maliciousRegion = [[[1278, 696], [2500, 696], [2500, 719], [1278, 719]], [[1263, 527], [1658, 527], [1662, 546], [1252, 546]], [[754, 938], [949, 938], [949, 955], [754, 955]]]; _local15.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 1040, 661, false], [CommonVals.STAR_TOKEN, 79, 272], [CommonVals.STAR_TOKEN, 679, 272], [CommonVals.STAR_TOKEN, 301, 668], [CommonVals.STAR_TOKEN, 371, 668], [CommonVals.STAR_TOKEN, 421, 668], [CommonVals.STAR_TOKEN, 491, 668], [CommonVals.STAR_TOKEN, 782, 914], [CommonVals.STAR_TOKEN, 832, 914], [CommonVals.STAR_TOKEN, 882, 914], [CommonVals.STAR_TOKEN, 1419, 662], [CommonVals.STAR_TOKEN, 1321, 632], [CommonVals.STAR_TOKEN, 1729, 650], [CommonVals.STAR_TOKEN, 2131, 507], [CommonVals.STAR_TOKEN, 2417, 590], [CommonVals.STAR_TOKEN, 2329, 654], [CommonVals.STAR_TOKEN, 2337, 78], [CommonVals.STAR_TOKEN, 2431, 197], [CommonVals.STAR_TOKEN, 2088, 183], [CommonVals.LASER_PROJECTOR, 263, 310, 0, 3, true, 0], [CommonVals.LASER_PROJECTOR, 84, 501, 0, 9, false, 0], [CommonVals.FLOAT_BOMB, 674, 760, 1], [CommonVals.FLOAT_BOMB, 674, 849, 1], [CommonVals.FLOAT_BOMB, 724, 760, 1], [CommonVals.FLOAT_BOMB, 724, 804, 1], [CommonVals.FLOAT_BOMB, 724, 847, 1], [CommonVals.FLOAT_BOMB, 864, 728, 1], [CommonVals.FLOAT_BOMB, 864, 772, 1], [CommonVals.FLOAT_BOMB, 864, 815, 1], [CommonVals.FLOAT_BOMB, 900, 840, 1], [CommonVals.FLOAT_BOMB, 940, 857, 1], [CommonVals.FLOAT_BOMB, 2473, 640, 1], [CommonVals.TELE_TRANSMISSION, 2074, 386, 1, 0]]; _local15.actors = [[CommonVals.DOOR, 129, 47, 1.04, 0, true, -1, 0], [CommonVals.DOOR, 601, 46, 1.04, 0, true, -1, 0], [CommonVals.DOOR, 882, 310, 1.21, 90, false, -1, 1], [CommonVals.DOOR, 594, 737, 1.41, 0, true, -1, 2], [CommonVals.DOOR, 1253, 597, 1.04, 0, true, 1, 3], [CommonVals.KEY, 363, 270, false, [0]], [CommonVals.KEY, 801, 555, false, [1]], [CommonVals.KEY, 651, 798, true, [2]], [CommonVals.KEY, 1261, 485, true, [3]], [CommonVals.WINDMILL_FAN, 305, 421, 0.55, 0, 2], [CommonVals.WINDMILL_FAN, 455, 421, 0.55, 0, -2], [CommonVals.WINDMILL_FAN, 2386, 279, 1, 0, 2], [CommonVals.SPINY_BALL, [[821, 183], [821, 804], [698, 804]], 1.8, 3], [CommonVals.COW, 71, 120, 1], [CommonVals.COW, 678, 120, 1], [CommonVals.CAT, 430, 850, 1], [CommonVals.DOG, 1986, 517, 1], [CommonVals.CAR, 1207, 691, 9]]; allLevels.push(_local15); var _local16:LevelDataPrototype = new LevelDataPrototype(); _local16.levelWidth = 640; _local16.levelHeight = 2800; _local16.bgLayerWidth = 1099; _local16.bgLayerHeight = 568; _local16.initCameraPos = new Point(0, 2320); _local16.ufoPos = new Point(376, 2638); _local16.sceneType = NIGHT_SCENE; _local16.ufoSpawnable = true; _local16.stillTerrain = [[[0, 0], [116, 0], [116, 480], [0, 480]], [[0, 480], [116, 480], [65, 590], [0, 590]], [[0, 590], [65, 590], [65, 703], [0, 703]], [[0, 703], [65, 703], [116, 830], [0, 830]], [[0, 830], [117, 830], [117, 2800], [0, 2800]], [[116, 934], [279, 934], [279, 969], [116, 969]], [[0, -50], [640, -50], [640, 0], [0, 0]], [[525, 0], [640, 0], [640, 468], [525, 468]], [[525, 468], [640, 468], [640, 577], [569, 577]], [[569, 577], [640, 577], [640, 736], [569, 736]], [[569, 736], [640, 736], [640, 854], [525, 854]], [[525, 854], [640, 854], [640, 2800], [525, 2800]], [[0, 2753], [640, 2753], [640, 2800], [0, 2800]], [[116, 2616], [239, 2616], [239, 2685], [116, 2685]], [[116, 2523], [190, 2523], [190, 2548], [116, 2548]], [[381, 2326], [525, 2326], [525, 2395], [381, 2395]], [[423, 2233], [525, 2233], [525, 2258], [423, 2258]], [[251, 1955], [274, 1955], [274, 1978], [251, 1978]], [[369, 1955], [392, 1955], [392, 1978], [369, 1978]], [[251, 1978], [392, 1978], [391, 2001], [251, 2001]], [[251, 1770], [392, 1770], [392, 1793], [251, 1793]], [[116, 1339], [289, 1339], [289, 1482], [116, 1544]], [[353, 1339], [525, 1339], [525, 1541], [353, 1478]], [[267, 361], [291, 361], [291, 383], [267, 383]], [[267, 383], [525, 383], [525, 406], [267, 406]]]; _local16.maliciousRegion = [[[116, 2733], [525, 2733], [525, 2753], [116, 2753]]]; _local16.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 320, 1356, false], [CommonVals.STAR_TOKEN, 305, 2705], [CommonVals.STAR_TOKEN, 436, 2585], [CommonVals.STAR_TOKEN, 156, 2377], [CommonVals.STAR_TOKEN, 156, 1802], [CommonVals.STAR_TOKEN, 143, 1926], [CommonVals.STAR_TOKEN, 233, 2175], [CommonVals.STAR_TOKEN, 149, 2043], [CommonVals.STAR_TOKEN, 475, 2207], [CommonVals.STAR_TOKEN, 490, 2029], [CommonVals.STAR_TOKEN, 500, 1885], [CommonVals.STAR_TOKEN, 484, 1763], [CommonVals.STAR_TOKEN, 347, 1629], [CommonVals.STAR_TOKEN, 204, 1609], [CommonVals.STAR_TOKEN, 197, 1303], [CommonVals.STAR_TOKEN, 436, 1287], [CommonVals.STAR_TOKEN, 468, 1217], [CommonVals.STAR_TOKEN, 229, 1188], [CommonVals.STAR_TOKEN, 370, 1100], [CommonVals.STAR_TOKEN, 371, 1022], [CommonVals.STAR_TOKEN, 200, 1089], [CommonVals.STAR_TOKEN, 176, 1021], [CommonVals.STAR_TOKEN, 387, 817], [CommonVals.STAR_TOKEN, 254, 823], [CommonVals.STAR_TOKEN, 475, 729], [CommonVals.STAR_TOKEN, 475, 599], [CommonVals.STAR_TOKEN, 167, 729], [CommonVals.STAR_TOKEN, 167, 599], [CommonVals.STAR_TOKEN, 388, 496], [CommonVals.STAR_TOKEN, 258, 496], [CommonVals.STAR_TOKEN, 475, 331], [CommonVals.STAR_TOKEN, 363, 335], [CommonVals.STAR_TOKEN, 172, 219], [CommonVals.STAR_TOKEN, 179, 99], [CommonVals.BUMPER, 476, 1565, 1], [CommonVals.BUMPER, 166, 1565, 1], [CommonVals.FLOAT_BOMB, 310, 2205, 1], [CommonVals.FLOAT_BOMB, 491, 2144, 1], [CommonVals.FLOAT_BOMB, 163, 2135, 1], [CommonVals.LASER_PROJECTOR, 173, 1491, 0, 4, false, 2], [CommonVals.TELE_TRANSMISSION, 109, 1697, 1, 90], [CommonVals.TELE_TRANSMISSION, 530, 1697, 1, -90], [CommonVals.TELE_TRANSMISSION, 447, 1346, 1, 0]]; _local16.actors = [[CommonVals.BREAKABLE_SQUARE, 274, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 315, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 358, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 399, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 440, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 481, 89, 1, 0], [CommonVals.BREAKABLE_SQUARE, 319, 130, 1, 0], [CommonVals.BREAKABLE_SQUARE, 319, 173, 1, 0], [CommonVals.BREAKABLE_SQUARE, 315, 216, 1, 0], [CommonVals.BREAKABLE_SQUARE, 358, 216, 1, 0], [CommonVals.BREAKABLE_SQUARE, 399, 216, 1, 0], [CommonVals.BREAKABLE_SQUARE, 440, 216, 1, 0], [CommonVals.BREAKABLE_SQUARE, 481, 216, 1, 0], [CommonVals.DOOR, 172, 2548, 0.7, 0, true, 1, 0], [CommonVals.DOOR, 423, 2258, 0.7, 0, true, 1, 1], [CommonVals.MOVABLE_STICK_BLOCK, 901, 1160, 1.04, 90, 370, 2, 230], [CommonVals.MOVABLE_STICK_BLOCK, -259, 1054, 1.04, -90, 370, 2, 230], [CommonVals.KEY, 197, 2591, true, [0]], [CommonVals.KEY, 374, 2290, true, [1]], [CommonVals.KEY, 301, 1405, false, [2]], [CommonVals.GEAR2, 321, 656, 1.1, 0, -1, 400], [CommonVals.CANNON, 577, 64, 1, 180, 10, 350, 450], [CommonVals.SPINY_BALL, [[185, 1684], [185, 2074], [454, 2074], [454, 1684], [185, 1684]], 1.5, 5], [CommonVals.SPINY_BALL, [[454, 2074], [454, 1684], [185, 1684], [185, 2074], [454, 2074]], 1.5, 5], [CommonVals.COW, 477, 2300, 1], [CommonVals.COW, 433, 195, 1], [CommonVals.DOG, 141, 2618, 1], [CommonVals.CAT, 328, 1976, 1], [CommonVals.CAT, 499, 351, 1]]; allLevels.push(_local16); var _local17:LevelDataPrototype = new LevelDataPrototype(); _local17.levelWidth = 1874; _local17.levelHeight = 1268; _local17.bgLayerWidth = 1099; _local17.bgLayerHeight = 568; _local17.initCameraPos = new Point(691, 200); _local17.ufoPos = new Point(1011, 440); _local17.sceneType = NIGHT_SCENE; _local17.ufoSpawnable = true; _local17.stillTerrain = [[[-30, 0], [0, 0], [0, 1268], [-30, 1268]], [[0, -30], [1874, -30], [1874, 0], [0, 0]], [[0, 0], [109, 0], [109, 593], [0, 593]], [[0, 503], [1247, 503], [1247, 593], [0, 593]], [[236, 503], [597, 478], [900, 503]], [[303, 352], [650, 352], [650, 407], [562, 434], [303, 434]], [[761, 364], [950, 364], [950, 415], [761, 415]], [[388, 0], [890, 0], [890, 35], [713, 84], [458, 84], [388, 42]], [[386, 135], [1162, 135], [1162, 218], [386, 218]], [[386, 217], [500, 217], [500, 352], [386, 352]], [[890, 0], [1007, 0], [1007, 35], [890, 35]], [[1162, 169], [0x0500, 169], [0x0500, 216], [1162, 216]], [[0x0500, 72], [1344, 72], [1344, 216], [0x0500, 216]], [[1344, 127], [1641, 127], [1641, 216], [1344, 216]], [[1076, 218], [1163, 218], [1163, 374], [1076, 374]], [[1163, 325], [1316, 325], [1316, 374], [1163, 374]], [[1249, 374], [1316, 374], [1316, 620], [1253, 668]], [[1316, 620], [1444, 620], [1444, 669], [1430, 704], [1292, 704], [1253, 668]], [[1385, 441], [1708, 441], [1708, 560], [1385, 560]], [[1708, 482], [1797, 482], [1797, 561], [1708, 561]], [[1797, 0], [1874, 0], [1874, 1268], [1797, 1268]], [[985, 764], [1874, 764], [1874, 811], [985, 811]], [[1171, 811], [1874, 811], [1874, 1160], [988, 1160]], [[0, 816], [321, 816], [321, 862], [0, 862]], [[0, 862], [321, 862], [521, 1160], [0, 1160]], [[0, 1160], [1874, 1160], [1874, 1268], [0, 1268]]]; _local17.maliciousRegion = [[[722, 82], [887, 36], [883, 58], [726, 95]], [[885, 36], [1007, 35], [1002, 56], [898, 56]], [[1346, 124], [1346, 110], [1509, 110], [1514, 124]], [[1713, 465], [1795, 464], [1794, 481], [1710, 481]]]; _local17.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 648, 108, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1181, 651, false], [CommonVals.STAR_TOKEN, 1203, 441], [CommonVals.STAR_TOKEN, 1164, 430], [CommonVals.STAR_TOKEN, 833, 323], [CommonVals.STAR_TOKEN, 720, 439], [CommonVals.STAR_TOKEN, 641, 263], [CommonVals.STAR_TOKEN, 543, 251], [CommonVals.STAR_TOKEN, 401, 470], [CommonVals.STAR_TOKEN, 197, 358], [CommonVals.STAR_TOKEN, 254, 312], [CommonVals.STAR_TOKEN, 254, 96], [CommonVals.STAR_TOKEN, 206, 40], [CommonVals.STAR_TOKEN, 164, 114], [CommonVals.STAR_TOKEN, 1644, 323], [CommonVals.STAR_TOKEN, 1412, 377], [CommonVals.STAR_TOKEN, 1385, 0x0101], [CommonVals.STAR_TOKEN, 1750, 425], [CommonVals.STAR_TOKEN, 1618, 591], [CommonVals.STAR_TOKEN, 1551, 634], [CommonVals.STAR_TOKEN, 1615, 686], [CommonVals.STAR_TOKEN, 1743, 688], [CommonVals.STAR_TOKEN, 1732, 624], [CommonVals.STAR_TOKEN, 0x0300, 671], [CommonVals.STAR_TOKEN, 597, 677], [CommonVals.STAR_TOKEN, 886, 798], [CommonVals.STAR_TOKEN, 1101, 849], [CommonVals.STAR_TOKEN, 1058, 878], [CommonVals.STAR_TOKEN, 890, 959], [CommonVals.STAR_TOKEN, 961, 1125], [CommonVals.STAR_TOKEN, 817, 1121], [CommonVals.STAR_TOKEN, 763, 1071], [CommonVals.STAR_TOKEN, 599, 1081], [CommonVals.STAR_TOKEN, 484, 959], [CommonVals.STAR_TOKEN, 478, 801], [CommonVals.STAR_TOKEN, 381, 681], [CommonVals.FLOAT_BOMB, 1693, 188, 1], [CommonVals.FLOAT_BOMB, 1764, 189, 1], [CommonVals.FLOAT_BOMB, 1225, 281, 1], [CommonVals.FLOAT_BOMB, 1614, 241, 1], [CommonVals.FLOAT_BOMB, 1728, 314, 1], [CommonVals.FLOAT_BOMB, 1646, 387, 1], [CommonVals.FLOAT_BOMB, 1515, 404, 1], [CommonVals.FLOAT_BOMB, 911, 639, 1], [CommonVals.FLOAT_BOMB, 962, 709, 1], [CommonVals.FLOAT_BOMB, 976, 942, 1], [CommonVals.FLOAT_BOMB, 1020, 995, 1], [CommonVals.FLOAT_BOMB, 952, 1051, 1], [CommonVals.FLOAT_BOMB, 879, 1102, 1], [CommonVals.FLOAT_BOMB, 549, 1129, 1], [CommonVals.FLOAT_BOMB, 406, 739, 1], [CommonVals.FLOAT_BOMB, 378, 839, 1], [CommonVals.FLOAT_BOMB, 208, 642, 1], [CommonVals.FLOAT_BOMB, 208, 709, 1], [CommonVals.FLOAT_BOMB, 208, 779, 1], [CommonVals.FLOAT_BOMB, 122, 680, 1], [CommonVals.FLOAT_BOMB, 122, 747, 1], [CommonVals.LASER_PROJECTOR, 858, 369, -90, 2, true, 0], [CommonVals.LASER_PROJECTOR, 464, 169, -90, 1, false, 2], [CommonVals.LASER_PROJECTOR, 1434, 643, 30, 3, false, 3], [CommonVals.TELE_TRANSMISSION, 1229, 329, 1, 0], [CommonVals.TELE_TRANSMISSION, 108, 819, 1, 0], [CommonVals.TELE_TRANSMISSION, 1179, 505, 1, 0]]; _local17.actors = [[CommonVals.KEY, 537, 454, true, [0]], [CommonVals.KEY, 499, 104, true, [2]], [CommonVals.KEY, 1343, 728, true, [3]], [CommonVals.WINDMILL_FAN, 1137, -13, 1, 0, -2], [CommonVals.SPINY_STICK, 741, 359, 0.746, 0, -0.5, false, 1], [CommonVals.TRIGGER, 951, 286, 1], [CommonVals.BREAKABLE_SQUARE, 1078, 373, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1078, 416, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1078, 459, 1, 0], [CommonVals.BREAKABLE_SQUARE, 907, 416, 1, 0], [CommonVals.BREAKABLE_SQUARE, 907, 459, 1, 0], [CommonVals.BREAKABLE_SQUARE, 178, 459, 1, 0], [CommonVals.BREAKABLE_SQUARE, 178, 419, 1, 0], [CommonVals.BREAKABLE_SQUARE, 138, 419, 1, 0], [CommonVals.MOVABLE_STICK_BLOCK, -253, 344, 1, -90, 163, 3, 0], [CommonVals.MOVABLE_STICK_BLOCK, -253, 264, 1, -90, 163, 3, 133], [CommonVals.MOVABLE_STICK_BLOCK, 307, -361, 1, 0, 311, 3, 301], [CommonVals.TrashCan, 1020, 748, 1, 90], [CommonVals.TrashCan, 1020, 718, 1, 90], [CommonVals.TrashCan, 1020, 688, 1, 90], [CommonVals.TrashCan, 1020, 658, 1, 90], [CommonVals.TrashCan, 1020, 628, 1, 90], [CommonVals.TrashCan, 1064, 688, 1, 90], [CommonVals.TrashCan, 1064, 718, 1, 90], [CommonVals.TrashCan, 1064, 688, 1, 90], [CommonVals.TrashCan, 1064, 658, 1, 90], [CommonVals.TrashCan, 1064, 628, 1, 90], [CommonVals.TrashCan, 1266, 168, 1, 0], [CommonVals.TrashCan, 1520, 127, 1, 0], [CommonVals.TrashCan, 1766, 762, 1, 0], [CommonVals.SPINY_BALL, [[1352, 519], [1352, 323], [1594, 323]], 1, 3], [CommonVals.CANNON, 468, 343, 1, -15, 40, 200, 350], [CommonVals.GEAR2, 679, 864, 1.274, 0, -1, 600], [CommonVals.COW, 1202, 145, 1], [CommonVals.COW, 1157, 738, 1], [CommonVals.DOG, 1175, 766, 1], [CommonVals.CAT, 1209, 761, 1], [CommonVals.DOG, 139, 503, 1]]; allLevels.push(_local17); var _local18:LevelDataPrototype = new LevelDataPrototype(); _local18.levelWidth = 764; _local18.levelHeight = 1010; _local18.bgLayerWidth = 700; _local18.bgLayerHeight = 568; _local18.initCameraPos = new Point(42, 0); _local18.ufoPos = new Point(362, 60); _local18.sceneType = NIGHT_SCENE; _local18.ufoSpawnable = true; _local18.stillTerrain = [[[-100, 0], [0, 0], [0, 1010], [-100, 1010]], [[0, -100], [764, -100], [764, 0], [0, 0]], [[764, 0], [864, 0], [864, 1010], [764, 1010]], [[0, 965], [764, 965], [764, 1065], [0, 1065]], [[0, 0x0100], [105, 0x0100], [105, 300], [0, 300]], [[0, 776], [105, 776], [105, 820], [0, 820]], [[658, 0x0100], [764, 0x0100], [764, 300], [658, 300]], [[658, 776], [764, 776], [764, 820], [658, 820]]]; _local18.maliciousRegion = [[[0, 949], [308, 949], [308, 965], [0, 965]], [[456, 949], [764, 949], [764, 965], [456, 965]]]; _local18.objects = [[CommonVals.LASER_PROJECTOR, -28, 920, 0, 13, true, 0], [CommonVals.TELE_TRANSMISSION, 381, 969, 1, 0]]; _local18.actors = [[CommonVals.BREAKABLE_SQUARE, 210, 111, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 151, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 231, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 274, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 314, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 394, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 437, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 477, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 561, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 604, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 644, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 724, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 767, 1, 0], [CommonVals.BREAKABLE_SQUARE, 210, 807, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 111, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 151, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 231, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 274, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 314, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 394, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 437, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 477, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 561, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 604, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 644, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 724, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 767, 1, 0], [CommonVals.BREAKABLE_SQUARE, 500, 807, 1, 0], [CommonVals.BREAKABLE_SQUARE, 250, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 292, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 332, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 375, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 417, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 457, 191, 1, 0], [CommonVals.BREAKABLE_SQUARE, 250, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 292, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 332, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 375, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 417, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 457, 354, 1, 0], [CommonVals.BREAKABLE_SQUARE, 250, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 292, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 332, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 375, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 417, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 457, 517, 1, 0], [CommonVals.BREAKABLE_SQUARE, 250, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 292, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 332, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 375, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 417, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 457, 684, 1, 0], [CommonVals.BREAKABLE_SQUARE, 250, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 292, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 332, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 375, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 417, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 457, 847, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 231, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 274, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 314, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 561, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 604, 1, 0], [CommonVals.BREAKABLE_SQUARE, 356, 644, 1, 0], [CommonVals.KEY, 326, 744, true, [0]], [CommonVals.CANNON, -69, 225, 1, 0, 10, 200, 250], [CommonVals.CANNON, -69, 745, 1, 0, 10, 230, 250], [CommonVals.CANNON, 827, 745, 1, 180, 10, 170, 250], [CommonVals.CANNON, 827, 225, 1, 180, 10, 190, 250], [CommonVals.TrashCan, 471, 520, 1, 0], [CommonVals.COW, 310, 168, 1], [CommonVals.COW, 375, 494, 1], [CommonVals.COW, 375, 824, 1], [CommonVals.CAT, 293, 357, 1], [CommonVals.CAT, 293, 687, 1], [CommonVals.DOG, 431, 356, 1], [CommonVals.DOG, 431, 686, 1]]; allLevels.push(_local18); var _local19:LevelDataPrototype = new LevelDataPrototype(); _local19.levelWidth = 2388; _local19.levelHeight = 1064; _local19.bgLayerWidth = 1099; _local19.bgLayerHeight = 568; _local19.initCameraPos = new Point(1589, 0); _local19.ufoPos = new Point(1909, 132); _local19.sceneType = NIGHT_SCENE; _local19.ufoSpawnable = true; _local19.stillTerrain = [[[-100, 0], [0, 0], [0, 1064], [-100, 1064]], [[0, -100], [2388, -100], [2388, 0], [0, 0]], [[2388, 0], [2488, 0], [2488, 1064], [2388, 1064]], [[0, 994], [2388, 994], [2388, 1094], [0, 1094]], [[0, 471], [167, 471], [167, 528], [0, 528]], [[199, 268], [266, 268], [266, 348], [199, 348]], [[266, 294], [350, 311], [350, 348], [266, 348]], [[350, 311], [517, 302], [517, 348], [350, 348]], [[517, 302], [554, 291], [554, 348], [517, 348]], [[554, 271], [624, 271], [624, 348], [554, 348]], [[624, 271], [657, 260], [756, 260], [756, 348], [624, 348]], [[0, 595], [99, 0x0300], [0, 885]], [[99, 0x0300], [232, 821], [232, 885], [0, 885]], [[232, 821], [864, 821], [864, 885], [232, 885]], [[403, 674], [492, 674], [492, 696], [403, 696]], [[576, 538], [671, 538], [671, 561], [576, 561]], [[1096, 0], [1308, 0], [1308, 170], [1247, 316], [1167, 316], [1096, 204]], [[836, 607], [1014, 607], [1005, 652], [836, 652]], [[1014, 607], [1150, 697], [1150, 830], [1037, 830], [1005, 652]], [[1037, 830], [1150, 830], [1150, 994], [1037, 994]], [[1402, 607], [1581, 607], [1581, 652], [1410, 652]], [[1402, 607], [1410, 652], [1380, 829], [1266, 829], [1266, 685]], [[1266, 829], [1380, 829], [1380, 994], [1266, 994]], [[1524, 822], [2388, 822], [2388, 884], [1524, 884]], [[2036, 884], [2388, 884], [2388, 994], [2036, 994]], [[2155, 822], [2289, 769], [2388, 822]], [[2289, 769], [2388, 595], [2388, 822]], [[1717, 539], [1812, 539], [1812, 561], [1717, 561]], [[1895, 674], [1985, 674], [1985, 696], [1895, 696]], [[2221, 472], [2388, 472], [2388, 528], [2221, 528]], [[1591, 260], [1730, 260], [1870, 303], [1870, 348], [1591, 348]], [[1870, 303], [2038, 310], [2038, 348], [1870, 348]], [[2038, 310], [2121, 295], [2188, 295], [2188, 348], [2038, 348]]]; _local19.maliciousRegion = [[[0, 975], [860, 975], [869, 994], [0, 994]], [[235, 885], [862, 885], [850, 902], [245, 902]], [[232, 821], [239, 804], [851, 804], [861, 820]], [[843, 606], [852, 590], [993, 590], [1000, 606]], [[1408, 606], [1417, 588], [1555, 588], [1564, 606]], [[1527, 821], [1537, 803], [2143, 803], [2155, 821]], [[1525, 886], [1834, 886], [1820, 903], [1534, 903]], [[1382, 994], [1391, 974], [1839, 974], [1852, 994]]]; _local19.objects = [[CommonVals.STAR_TOKEN, 96, 361], [CommonVals.STAR_TOKEN, 566, 81], [CommonVals.STAR_TOKEN, 1000, 147], [CommonVals.STAR_TOKEN, 435, 531], [CommonVals.STAR_TOKEN, 77, 617], [CommonVals.STAR_TOKEN, 615, 688], [CommonVals.STAR_TOKEN, 988, 933], [CommonVals.STAR_TOKEN, 1510, 457], [CommonVals.STAR_TOKEN, 1205, 850], [CommonVals.STAR_TOKEN, 1205, 958], [CommonVals.STAR_TOKEN, 1455, 859], [CommonVals.STAR_TOKEN, 1773, 688], [CommonVals.STAR_TOKEN, 1953, 531], [CommonVals.STAR_TOKEN, 2194, 725], [CommonVals.STAR_TOKEN, 2311, 617], [CommonVals.STAR_TOKEN, 2297, 393], [CommonVals.STAR_TOKEN, 2271, 147], [CommonVals.UFO_SPAWNER_INACTIVE, 1197, 553, false], [CommonVals.LASER_PROJECTOR, 1646, 272, -90, 4, true, 3], [CommonVals.LASER_PROJECTOR, 742, 272, -90, 4, true, 2], [CommonVals.TELE_TRANSMISSION, 1205, 1001, 1, 0], [CommonVals.FLOAT_BOMB, 1534, 950, 1], [CommonVals.FLOAT_BOMB, 1574, 950, 1], [CommonVals.FLOAT_BOMB, 1614, 950, 1], [CommonVals.FLOAT_BOMB, 1654, 950, 1], [CommonVals.BUMPER, 1462, 721, 1], [CommonVals.BUMPER, 966, 705, 1], [CommonVals.FLOAT_BOMB, 1694, 950, 1], [CommonVals.FLOAT_BOMB, 1734, 950, 1], [CommonVals.FLOAT_BOMB, 1774, 950, 1], [CommonVals.FLOAT_BOMB, 1814, 950, 1], [CommonVals.FLOAT_BOMB, 1854, 950, 1]]; _local19.actors = [[CommonVals.DOOR, 101, 884, 1.128, 0, true, 1, 0], [CommonVals.DOOR, 1267, 886, 1.19, 90, true, 1, 0], [CommonVals.DOOR, 1267, 780, 1.19, 90, true, 1, 1], [CommonVals.KEY, 170, 899, true, [0]], [CommonVals.KEY, 1971, 934, true, [1]], [CommonVals.KEY, 642, 142, true, [2]], [CommonVals.WINDMILL_FAN, 943, 363, 1.221, 0, -2], [CommonVals.WINDMILL_FAN, 1420, 363, 1.221, 0, 2], [CommonVals.TrashCan, 992, 969, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1874, 909, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1874, 949, 1, 0], [CommonVals.SPINY_BALL, [[826, 705], [904, 705], [924, 837], [924, 941], [192, 942]], 1, 3], [CommonVals.SPINY_BALL, [[709, 735], [709, 403]], 1, 3], [CommonVals.SPINY_BALL, [[530, 403], [530, 735]], 1, 3], [CommonVals.SPINY_BALL, [[349, 735], [349, 403]], 1, 3], [CommonVals.SPINY_BALL, [[1677, 735], [1677, 403]], 1, 3], [CommonVals.SPINY_BALL, [[1857, 403], [1857, 735]], 1, 3], [CommonVals.SPINY_BALL, [[2038, 735], [2038, 403]], 1, 3], [CommonVals.COW, 396, 277, 1], [CommonVals.COW, 2143, 262, -1], [CommonVals.DOG, 56, 949, 1], [CommonVals.DOG, 464, 306, 1], [CommonVals.DOG, 321, 303, 1], [CommonVals.CAR, 56, 965, 8]]; allLevels.push(_local19); var _local20:LevelDataPrototype = new LevelDataPrototype(); _local20.levelWidth = 1500; _local20.levelHeight = 731; _local20.bgLayerWidth = 666.67; _local20.bgLayerHeight = 500; _local20.initCameraPos = new Point(406, 0); _local20.ufoPos = new Point(726, 269); _local20.sceneType = SNOW_SCENE; _local20.ufoSpawnable = true; _local20.stillTerrain = [[[0, -100], [1500, -100], [1500, 0], [0, 0]], [[0, 800], [1500, 800], [1500, 900], [0, 900]], [[-164, 98], [297, 98], [584, 148], [584, 165], [-164, 165]], [[-163, 260], [305, 260], [591, 309], [591, 327], [-163, 327]], [[0, 327], [340, 327], [251, 430], [0, 430]], [[1138, 96], [1700, 96], [1700, 163], [850, 163], [850, 146]], [[1146, 261], [1700, 261], [1700, 327], [859, 327], [859, 310]], [[668, 481], [792, 481], [830, 529], [830, 730], [628, 730], [628, 527]], [[1162, 327], [1500, 327], [1500, 429], [1249, 429]], [[1500, 327], [1600, 327], [1600, 900], [1500, 900]], [[-100, 327], [0, 327], [0, 900], [-100, 900]]]; _local20.maliciousRegion = []; _local20.objects = [[CommonVals.STAR_TOKEN, 54, 61], [CommonVals.STAR_TOKEN, 124, 61], [CommonVals.STAR_TOKEN, 124, 231], [CommonVals.STAR_TOKEN, 54, 231], [CommonVals.STAR_TOKEN, 1464, 61], [CommonVals.STAR_TOKEN, 1394, 61], [CommonVals.STAR_TOKEN, 1464, 231], [CommonVals.STAR_TOKEN, 1394, 231], [CommonVals.UFO_BLOCK, [[1500, 0], [1600, 0], [1600, 261], [1500, 261]]], [CommonVals.UFO_BLOCK, [[-100, 0], [0, 0], [0, 261], [-100, 261]]], [CommonVals.LASER_PROJECTOR, 780, 507, 0, 14, true, 1], [CommonVals.LASER_PROJECTOR, 682, 507, 180, 12, true, 1], [CommonVals.TELE_TRANSMISSION, 729, 485, 1, 0]]; _local20.actors = [[CommonVals.KEY, 702, 83, true, [0]], [CommonVals.DOOR, 275, 0, 1, 0, true, -1, 0], [CommonVals.DOOR, 174, 164, 1, 0, true, 1, 0], [CommonVals.DOOR, 1136, 0, 1, 0, true, -1, 0], [CommonVals.DOOR, 1228, 164, 1, 0, true, 1, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -108, 67, CommonVals.COW, 0, 16, 0], [CommonVals.ANIMAL_CAR_SPAWNER, 1606, 67, CommonVals.DOG, 30, -8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -90, 208, CommonVals.COW, 130, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, 1606, 208, CommonVals.DOG, 220, -6, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -108, 67, CommonVals.COW, 390, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, 1606, 208, CommonVals.DOG, 450, -8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -90, 208, CommonVals.DOG, 530, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -90, 208, CommonVals.DOG, 730, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -90, 208, CommonVals.COW, 890, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -108, 67, CommonVals.CAT, 1090, 8, 0], [CommonVals.ANIMAL_CAR_SPAWNER, -108, 67, CommonVals.COW, 1250, 8, 0]]; allLevels.push(_local20); var _local21:LevelDataPrototype = new LevelDataPrototype(); _local21.levelWidth = 2743; _local21.levelHeight = 529; _local21.bgLayerWidth = 666.67; _local21.bgLayerHeight = 500; _local21.initCameraPos = new Point(0, 0); _local21.ufoPos = new Point(200, 48); _local21.sceneType = SNOW_SCENE; _local21.ufoSpawnable = false; _local21.stillTerrain = [[[0, -100], [2743, -100], [2743, 0], [0, 0]], [[2743, 0], [2785, 0], [2785, 529], [2743, 529]], [[-100, 174], [0, 174], [0, 529], [-100, 529]], [[0, 115], [542, 115], [542, 155], [473, 174], [0, 174]], [[542, 115], [811, 115], [811, 155], [542, 155]], [[811, 115], [1044, 115], [1044, 174], [877, 174], [811, 155]], [[1148, 0], [1231, 0], [1231, 162], [1148, 162]], [[1345, 0], [2743, 0], [2743, 162], [1345, 162]], [[0, 347], [222, 347], [222, 529], [0, 529]], [[222, 288], [0x0400, 288], [0x0400, 529], [222, 529]], [[0x0400, 288], [1346, 288], [1346, 353], [0x0400, 353]], [[1186, 0x0101], [1224, 0x0101], [1224, 288], [1186, 288]], [[0x0400, 500], [1200, 500], [1200, 529], [0x0400, 529]], [[1200, 469], [2743, 469], [2743, 529], [1200, 529]], [[1461, 288], [2472, 288], [2472, 345], [1461, 345]]]; _local21.maliciousRegion = [[[0, 99], [231, 99], [231, 115], [0, 115]], [[267, 97], [495, 97], [499, 115], [267, 115]], [[883, 174], [959, 174], [958, 194], [888, 192]], [[1592, 286], [1598, 269], [1819, 268], [1823, 286]], [[1819, 161], [2051, 161], [2049, 180], [1830, 180]], [[2065, 287], [2070, 270], [2293, 270], [2297, 287]]]; _local21.objects = [[CommonVals.STAR_TOKEN, 336, 31], [CommonVals.STAR_TOKEN, 476, 31], [CommonVals.STAR_TOKEN, 549, 93], [CommonVals.STAR_TOKEN, 659, 93], [CommonVals.STAR_TOKEN, 1121, 41], [CommonVals.STAR_TOKEN, 716, 180], [CommonVals.STAR_TOKEN, 606, 180], [CommonVals.STAR_TOKEN, 1062, 381], [CommonVals.STAR_TOKEN, 1122, 381], [CommonVals.STAR_TOKEN, 1182, 381], [CommonVals.STAR_TOKEN, 1242, 381], [CommonVals.STAR_TOKEN, 1062, 431], [CommonVals.STAR_TOKEN, 1122, 431], [CommonVals.STAR_TOKEN, 1767, 189], [CommonVals.STAR_TOKEN, 2095, 191], [CommonVals.STAR_TOKEN, 1867, 270], [CommonVals.STAR_TOKEN, 1565, 442], [CommonVals.STAR_TOKEN, 1698, 381], [CommonVals.STAR_TOKEN, 1831, 450], [CommonVals.STAR_TOKEN, 2107, 411], [CommonVals.STAR_TOKEN, 2538, 350], [CommonVals.STAR_TOKEN, 2642, 243], [CommonVals.STAR_TOKEN, 2632, 366], [CommonVals.FLOAT_BOMB, 951, 47, 1], [CommonVals.FLOAT_BOMB, 951, 96, 1], [CommonVals.FLOAT_BOMB, 1070, 144, 1], [CommonVals.FLOAT_BOMB, 1120, 144, 1], [CommonVals.FLOAT_BOMB, 2458, 218, 1], [CommonVals.FLOAT_BOMB, 2458, 267, 1], [CommonVals.BUMPER, 583, 25, 1], [CommonVals.BUMPER, 739, 94, 1], [CommonVals.BUMPER, 1686, 189, 1], [CommonVals.BUMPER, 1933, 266, 1], [CommonVals.BUMPER, 2155, 189, 1], [CommonVals.LASER_PROJECTOR, 1318, 310, 0, 2, false, 2], [CommonVals.UFO_BLOCK, [[-100, 0], [0, 0], [0, 115], [-100, 115]]], [CommonVals.HIDDEN_BLOCK_OBJECT, 1000, 300, [[[0, 41], [342, 41], [342, 230], [0, 230]]], 1], [CommonVals.TELE_TRANSMISSION, 2617, 476, 1, 0]]; _local21.actors = [[CommonVals.DOOR, -115, 0, 1.189, 0, true, -1, 0], [CommonVals.DOOR, 234, 0, 1.189, 0, true, -1, 0], [CommonVals.DOOR, 964, 174, 1.189, 0, true, 1, 1], [CommonVals.DOOR, 317, 174, 1.189, 0, true, 1, 1], [CommonVals.DOOR, 1558, 160, 1.32, 0, true, -1, 2], [CommonVals.DOOR, 1346, 131, 1.189, 90, true, -1, 2], [CommonVals.DOOR, 1459, 346, 1.272, 0, false, 1, 2], [CommonVals.DOOR, 2298, 160, 1.32, 0, true, -1, 3], [CommonVals.DOOR, 2315, 346, 1.272, 0, true, 1, 4], [CommonVals.KEY, 180, 67, true, [0]], [CommonVals.KEY, 1007, 260, true, [1]], [CommonVals.KEY, 1501, 195, true, [2]], [CommonVals.KEY, 2246, 181, true, [3]], [CommonVals.KEY, 2358, 359, true, [2, 4]], [CommonVals.TrashCan, 774, 100, 1, 90], [CommonVals.TrashCan, 2334, 272, 1, 90], [CommonVals.SPINY_BALL, [[-154, 57], [1094, 57], [1094, 230], [106, 230]], 1.5, 3], [CommonVals.SPINY_BALL, [[1289, 74], [1289, 224], [2408, 224]], 1.5, 3], [CommonVals.MOVABLE_STICK_BLOCK, 2491, -197, 1, 0, 247, 3, 130], [CommonVals.MOVABLE_STICK_BLOCK, 2602, -197, 1, 0, 247, 3, 240], [CommonVals.COW, 274, 248, 1], [CommonVals.DOG, 1122, 500, 1], [CommonVals.CAT, 1055, 500, 1], [CommonVals.CAR, 274, 286, 14], [CommonVals.CAR, 1415, 466, 14]]; allLevels.push(_local21); var _local22:LevelDataPrototype = new LevelDataPrototype(); _local22.levelWidth = 1887; _local22.levelHeight = 935; _local22.bgLayerWidth = 1099; _local22.bgLayerHeight = 568; _local22.initCameraPos = new Point(1405, 0); _local22.ufoPos = new Point(1725, 35); _local22.sceneType = NIGHT_SCENE; _local22.ufoSpawnable = true; _local22.stillTerrain = [[[-100, 0], [0, 0], [0, 935], [-100, 935]], [[0, -100], [1887, -100], [1887, 0], [0, 0]], [[1823, 0], [1887, 0], [1887, 935], [1823, 935]], [[0, 865], [1887, 865], [1887, 935], [0, 935]], [[189, 172], [359, 172], [359, 264], [189, 264]], [[129, 264], [607, 264], [607, 344], [129, 344]], [[607, 116], [664, 116], [776, 278], [776, 344], [607, 344]], [[678, 344], [776, 344], [776, 491], [678, 491]], [[130, 491], [982, 491], [982, 556], [130, 556]], [[1083, 491], [1561, 491], [1561, 556], [1083, 556]], [[338, 491], [369, 468], [506, 468], [506, 491]], [[1497, 396], [1561, 396], [1561, 556], [1497, 556]], [[857, 662], [1072, 662], [1072, 697], [857, 697]], [[857, 832], [885, 832], [885, 865], [857, 865]], [[1046, 832], [1073, 832], [1073, 865], [1046, 865]], [[1688, 201], [1716, 201], [1716, 270], [1688, 270]], [[1716, 233], [1822, 233], [1822, 270], [1716, 270]], [[0, 625], [372, 625], [372, 695], [0, 695]]]; _local22.maliciousRegion = [[[32, 608], [75, 608], [75, 625], [32, 625]], [[192, 608], [239, 608], [239, 625], [192, 625]], [[1176, 556], [1468, 556], [1468, 573], [1176, 573]]]; _local22.objects = [[CommonVals.STAR_TOKEN, 555, 391], [CommonVals.STAR_TOKEN, 625, 391], [CommonVals.STAR_TOKEN, 555, 442], [CommonVals.STAR_TOKEN, 625, 442], [CommonVals.STAR_TOKEN, 60, 728], [CommonVals.STAR_TOKEN, 130, 728], [CommonVals.STAR_TOKEN, 190, 728], [CommonVals.STAR_TOKEN, 260, 728], [CommonVals.STAR_TOKEN, 320, 728], [CommonVals.STAR_TOKEN, 60, 798], [CommonVals.STAR_TOKEN, 130, 798], [CommonVals.STAR_TOKEN, 190, 798], [CommonVals.STAR_TOKEN, 260, 798], [CommonVals.STAR_TOKEN, 320, 798], [CommonVals.STAR_TOKEN, 1555, 693], [CommonVals.STAR_TOKEN, 1598, 439], [CommonVals.STAR_TOKEN, 1408, 439], [CommonVals.STAR_TOKEN, 1288, 349], [CommonVals.STAR_TOKEN, 1358, 209], [CommonVals.STAR_TOKEN, 1564, 75], [CommonVals.STAR_TOKEN, 1192, 229], [CommonVals.STAR_TOKEN, 995, 476], [CommonVals.STAR_TOKEN, 1008, 349], [CommonVals.STAR_TOKEN, 848, 329], [CommonVals.STAR_TOKEN, 907, 171], [CommonVals.STAR_TOKEN, 1017, 70], [CommonVals.STAR_TOKEN, 751, 78], [CommonVals.FLOAT_BOMB, 886, 636, 1], [CommonVals.FLOAT_BOMB, 886, 591, 1], [CommonVals.FLOAT_BOMB, 956, 636, 1], [CommonVals.FLOAT_BOMB, 956, 591, 1], [CommonVals.FLOAT_BOMB, 1026, 636, 1], [CommonVals.FLOAT_BOMB, 1026, 591, 1], [CommonVals.FLOAT_BOMB, 1026, 546, 1], [CommonVals.UFO_SPAWNER_INACTIVE, 314, 591, false], [CommonVals.UFO_SPAWNER_INACTIVE, 202, 108, false], [CommonVals.LASER_PROJECTOR, 1528, 396, -90, 7, true, 0], [CommonVals.LASER_PROJECTOR, 1501, 458, 180, 11, true, 1], [CommonVals.LASER_PROJECTOR, 1357, 516, -129.9, 11, true, 2], [CommonVals.LASER_PROJECTOR, 951, 516, -50.1, 11, true, 3], [CommonVals.LASER_PROJECTOR, 786, 518, -90, 9, true, 4], [CommonVals.TELE_TRANSMISSION, 272, 178, 1, 0]]; _local22.actors = [[CommonVals.BREAKABLE_SQUARE, 1, 263, 1, 0], [CommonVals.BREAKABLE_SQUARE, 44, 263, 1, 0], [CommonVals.BREAKABLE_SQUARE, 87, 263, 1, 0], [CommonVals.BREAKABLE_SQUARE, 421, 345, 1, 0], [CommonVals.BREAKABLE_SQUARE, 421, 385, 1, 0], [CommonVals.BREAKABLE_SQUARE, 421, 425, 1, 0], [CommonVals.BREAKABLE_SQUARE, 464, 345, 1, 0], [CommonVals.BREAKABLE_SQUARE, 464, 385, 1, 0], [CommonVals.BREAKABLE_SQUARE, 464, 425, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1, 490, 1, 0], [CommonVals.BREAKABLE_SQUARE, 44, 490, 1, 0], [CommonVals.BREAKABLE_SQUARE, 87, 490, 1, 0], [CommonVals.DOOR, 629, -2, 1.23, 0, true, -1, 5], [CommonVals.KEY, 1602, 95, false, [0]], [CommonVals.KEY, 1357, 258, false, [0, 1, 2]], [CommonVals.KEY, 1118, 343, false, [2, 3, 4]], [CommonVals.KEY, 1155, 105, false, [1, 2, 3]], [CommonVals.KEY, 922, 259, false, [1, 4, 5]], [CommonVals.WINDMILL_FAN, 1694, 487, 1.231, 0, -2], [CommonVals.MOVABLE_STICK_BLOCK, 1155, 1225, 1, 180, 270, -1, 0], [CommonVals.MOVABLE_STICK_BLOCK, 1236, 1225, 1, 180, 270, -1, 70], [CommonVals.MOVABLE_STICK_BLOCK, 1316, 1225, 1, 180, 270, 2, 140], [CommonVals.MOVABLE_STICK_BLOCK, 1396, 1225, 1, 180, 270, 2, 210], [CommonVals.MOVABLE_STICK_BLOCK, 1478, 1225, 1, 180, 270, -2, 260], [CommonVals.MOVABLE_STICK_BLOCK, 857, 1225, 1, 180, 290, -3, 0], [CommonVals.MOVABLE_STICK_BLOCK, 777, 1225, 1, 180, 290, -3, 110], [CommonVals.MOVABLE_STICK_BLOCK, 696, 1225, 1, 180, 290, 3, 110], [CommonVals.MOVABLE_STICK_BLOCK, 616, 1225, 1, 180, 290, -3, 260], [CommonVals.MOVABLE_STICK_BLOCK, 535, 1225, 1, 180, 290, 3, 0], [CommonVals.MOVABLE_STICK_BLOCK, 454, 1225, 1, 180, 290, 3, 260], [CommonVals.CANNON, 489, 300, 1, -90, 50, 100, 350], [CommonVals.CANNON, 662, 259, 1, -45, 50, 110, 350], [CommonVals.CANNON, 1569, 905, 1, -90, 50, 250, 4], [CommonVals.CANNON, 1781, 905, 1, -90, 50, 200, 4], [CommonVals.TrashCan, 296, 864, 1, 0], [CommonVals.COW, 940, 841, 1], [CommonVals.COW, 553, 492, 1], [CommonVals.DOG, 174, 492, 1], [CommonVals.DOG, 1770, 231, 1]]; allLevels.push(_local22); var _local23:LevelDataPrototype = new LevelDataPrototype(); _local23.levelWidth = 2000; _local23.levelHeight = 1419; _local23.bgLayerWidth = 1099; _local23.bgLayerHeight = 568; _local23.initCameraPos = new Point(0, 903); _local23.ufoPos = new Point(80, 1143); _local23.sceneType = NIGHT_SCENE; _local23.ufoSpawnable = true; _local23.stillTerrain = [[[-100, 0], [0, 0], [0, 1419], [-100, 1419]], [[0, -100], [2000, -100], [2000, 0], [0, 0]], [[2000, 0], [2100, 0], [2100, 1419], [2000, 1419]], [[0, 1419], [2000, 1419], [2000, 1519], [0, 1519]], [[0, 0], [391, 0], [391, 68], [0, 68]], [[0, 0], [85, 0], [85, 822], [0, 822]], [[181, 68], [261, 68], [261, 630], [181, 630]], [[261, 542], [709, 542], [709, 630], [261, 630]], [[0, 822], [328, 822], [328, 852], [218, 968], [0, 968]], [[254, 727], [328, 727], [328, 822], [254, 822]], [[131, 1262], [183, 1262], [183, 1300], [131, 1300]], [[0, 1300], [218, 1300], [330, 1419], [0, 1419]], [[633, 1419], [748, 1303], [2000, 1303], [2000, 1419]], [[664, 229], [1232, 229], [1232, 333], [664, 333]], [[1116, 333], [1232, 333], [1232, 852], [1116, 852]], [[1232, 412], [1551, 412], [1441, 529], [1232, 529]], [[1538, 0], [1600, 0], [1600, 250], [1538, 250]], [[1600, 206], [1840, 206], [1840, 250], [1600, 250]], [[1789, 180], [1840, 180], [1840, 206], [1789, 206]], [[1855, 411], [2000, 411], [2000, 528], [1969, 528]], [[747, 966], [633, 851], [1439, 851], [1552, 966]], [[1366, 804], [1439, 804], [1439, 851], [1366, 851]], [[1148, 968], [1316, 968], [1316, 999], [1148, 999]], [[1151, 1258], [1321, 1258], [1321, 1301], [1151, 1301]], [[1970, 853], [2000, 853], [2000, 969], [1857, 969]]]; _local23.maliciousRegion = []; _local23.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 1307, 650, false], [CommonVals.STAR_TOKEN, 135, 171], [CommonVals.STAR_TOKEN, 300, 116], [CommonVals.STAR_TOKEN, 618, 235], [CommonVals.STAR_TOKEN, 749, 178], [CommonVals.STAR_TOKEN, 388, 920], [CommonVals.STAR_TOKEN, 576, 910], [CommonVals.STAR_TOKEN, 828, 1063], [CommonVals.STAR_TOKEN, 836, 1266], [CommonVals.STAR_TOKEN, 633, 813], [CommonVals.STAR_TOKEN, 843, 683], [CommonVals.STAR_TOKEN, 868, 817], [CommonVals.STAR_TOKEN, 662, 506], [CommonVals.STAR_TOKEN, 784, 377], [CommonVals.STAR_TOKEN, 1014, 461], [CommonVals.STAR_TOKEN, 1081, 450], [CommonVals.STAR_TOKEN, 711, 53], [CommonVals.STAR_TOKEN, 862, 51], [CommonVals.STAR_TOKEN, 1126, 59], [CommonVals.STAR_TOKEN, 1310, 59], [CommonVals.STAR_TOKEN, 1227, 183], [CommonVals.STAR_TOKEN, 1439, 340], [CommonVals.STAR_TOKEN, 1940, 336], [CommonVals.STAR_TOKEN, 1940, 336], [CommonVals.STAR_TOKEN, 1697, 373], [CommonVals.STAR_TOKEN, 1621, 474], [CommonVals.STAR_TOKEN, 1797, 480], [CommonVals.STAR_TOKEN, 1487, 596], [CommonVals.STAR_TOKEN, 1494, 776], [CommonVals.STAR_TOKEN, 1625, 903], [CommonVals.STAR_TOKEN, 1795, 906], [CommonVals.STAR_TOKEN, 1940, 781], [CommonVals.STAR_TOKEN, 1917, 605], [CommonVals.STAR_TOKEN, 1739, 1130], [CommonVals.STAR_TOKEN, 1885, 1035], [CommonVals.STAR_TOKEN, 1558, 1086], [CommonVals.STAR_TOKEN, 1577, 1253], [CommonVals.STAR_TOKEN, 1743, 1246], [CommonVals.STAR_TOKEN, 1854, 1213], [CommonVals.FLOAT_BOMB, 133, 289, 1], [CommonVals.FLOAT_BOMB, 133, 329, 1], [CommonVals.FLOAT_BOMB, 133, 369, 1], [CommonVals.FLOAT_BOMB, 133, 409, 1], [CommonVals.FLOAT_BOMB, 133, 449, 1], [CommonVals.FLOAT_BOMB, 133, 489, 1], [CommonVals.FLOAT_BOMB, 133, 529, 1], [CommonVals.FLOAT_BOMB, 133, 569, 1], [CommonVals.FLOAT_BOMB, 133, 609, 1], [CommonVals.FLOAT_BOMB, 133, 649, 1], [CommonVals.FLOAT_BOMB, 133, 689, 1], [CommonVals.FLOAT_BOMB, 173, 689, 1], [CommonVals.FLOAT_BOMB, 213, 689, 1], [CommonVals.FLOAT_BOMB, 703, 805, 1], [CommonVals.FLOAT_BOMB, 966, 809, 1], [CommonVals.FLOAT_BOMB, 1046, 649, 1], [CommonVals.FLOAT_BOMB, 1060, 383, 1], [CommonVals.FLOAT_BOMB, 1404, 1146, 1], [CommonVals.FLOAT_BOMB, 1408, 1230, 1], [CommonVals.FLOAT_BOMB, 1612, 1167, 1], [CommonVals.FLOAT_BOMB, 1597, 1042, 1], [CommonVals.FLOAT_BOMB, 1683, 1083, 1], [CommonVals.FLOAT_BOMB, 1730, 1187, 1], [CommonVals.FLOAT_BOMB, 1855, 1098, 1], [CommonVals.FLOAT_BOMB, 1367, 570, 1], [CommonVals.FLOAT_BOMB, 1286, 570, 1], [CommonVals.BUMPER, 416, 775, 1], [CommonVals.BUMPER, 516, 775, 1], [CommonVals.BUMPER, 1053, 541, 1], [CommonVals.BUMPER, 856, 541, 1], [CommonVals.BUMPER, 398, 318, 1], [CommonVals.BUMPER, 580, 285, 1], [CommonVals.LASER_PROJECTOR, 387, 56, 32, 5, true, 1], [CommonVals.LASER_PROJECTOR, 860, 963, 90, 5, true, 2], [CommonVals.LASER_PROJECTOR, 1040, 963, 90, 5, true, 3], [CommonVals.LASER_PROJECTOR, 1500, 963, 90, 5, true, 4], [CommonVals.TELE_TRANSMISSION, 945, 1305, 1, 0]]; _local23.actors = [[CommonVals.GEAR1, 485, 1132, 1.41, 0, 1.5, 0], [CommonVals.GEAR2, 1706, 686, 1.383, 0, -1.5, 0], [CommonVals.DOOR, 248, 630, 1, 0, true, 1, 0], [CommonVals.DOOR, 182, 232, 1, 90, true, 1, 0], [CommonVals.KEY, 278, 676, true, [0]], [CommonVals.KEY, 110, 91, true, [1]], [CommonVals.KEY, 925, 1085, true, [2]], [CommonVals.KEY, 1081, 1110, true, [3]], [CommonVals.KEY, 1834, 1247, true, [4]], [CommonVals.BREAKABLE_SQUARE, 85, 718, 1, 0], [CommonVals.BREAKABLE_SQUARE, 85, 718, 1, 0], [CommonVals.BREAKABLE_SQUARE, 127, 718, 1, 0], [CommonVals.BREAKABLE_SQUARE, 170, 718, 1, 0], [CommonVals.BREAKABLE_SQUARE, 212, 718, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 999, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 1042, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 1085, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 1128, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 1171, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1151, 1214, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 1214, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 1171, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 1128, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 1085, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 1042, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1193, 999, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 999, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 1042, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 1085, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 1128, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 1171, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1236, 1214, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 999, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 1042, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 1085, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 1128, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 1171, 1, 0], [CommonVals.BREAKABLE_SQUARE, 1278, 1214, 1, 0], [CommonVals.SPINY_BALL, [[133, 189], [133, 770], [134, 770]], 1.5, 3], [CommonVals.SPINY_BALL, [[319, 184], [319, 463], [788, 464], [788, 685], [401, 685]], 1.5, 5], [CommonVals.SPINY_BALL, [[938, 692], [938, 397], [480, 397], [480, 188]], 1.5, 5], [CommonVals.SPINY_STICK, 753, 427, 1, 0, 1.7, true, 9], [CommonVals.SPINY_STICK, 787, 108, 1, 0, 1.7, true, 9], [CommonVals.SPINY_STICK, 1231, 108, 1, 0, -1.7, true, 9], [CommonVals.CANNON, 1186, 314, 1, 0, 70, 100, 1], [CommonVals.CANNON, 1186, 384, 1, 0, 70, 150, 1], [CommonVals.CANNON, 2062, 1030, 1, 180, 30, 200, 70], [CommonVals.CANNON, 2062, 1150, 1, 180, 30, 300, 70], [CommonVals.COW, 132, 796, 1], [CommonVals.COW, 1284, 823, 1], [CommonVals.CAT, 1747, 209, 1], [CommonVals.DOG, 1684, 206, 1]]; allLevels.push(_local23); var _local24:LevelDataPrototype = new LevelDataPrototype(); _local24.levelWidth = 1582; _local24.levelHeight = 1290; _local24.bgLayerWidth = 1099; _local24.bgLayerHeight = 568; _local24.initCameraPos = new Point(0, 30); _local24.ufoPos = new Point(272, 350); _local24.sceneType = NIGHT_SCENE; _local24.ufoSpawnable = true; _local24.stillTerrain = [[[-100, 0], [0, 0], [0, 1290], [-100, 1290]], [[0, 0], [1582, 0], [1582, 68], [0, 68]], [[1463, 0], [1582, 0], [1582, 1290], [1463, 1290]], [[0, 1224], [1582, 1224], [1582, 1290], [0, 1290]], [[0, 200], [436, 200], [436, 268], [0, 268]], [[436, 200], [601, 132], [698, 132], [811, 213], [811, 268], [436, 268]], [[0, 268], [75, 268], [75, 890], [0, 890]], [[0, 890], [438, 890], [438, 1290], [0, 1290]], [[215, 448], [334, 479], [334, 736], [306, 792], [243, 792], [215, 737]], [[215, 448], [364, 407], [1320, 407], [1320, 479], [334, 479]], [[1002, 68], [1582, 68], [1582, 224], [1002, 224]], [[1002, 224], [1121, 224], [1121, 407], [1002, 407]], [[452, 576], [878, 576], [878, 642], [452, 642]], [[878, 479], [978, 479], [978, 858], [878, 858]], [[569, 828], [607, 828], [607, 858], [567, 858]], [[567, 858], [878, 858], [878, 973], [567, 973]], [[808, 973], [969, 919], [969, 1054], [939, 1054]], [[978, 780], [1106, 780], [1106, 788], [969, 919]], [[439, 1157], [1018, 1157], [1101, 1224], [439, 1224]], [[1255, 781], [1463, 781], [1389, 911], [1255, 788]], [[1463, 781], [1463, 1100], [1389, 1100], [1389, 911]], [[1389, 1100], [1582, 1100], [1582, 1224], [1260, 1224]]]; _local24.maliciousRegion = [[[232, 182], [422, 182], [422, 200], [232, 200]], [[981, 183], [1000, 182], [1000, 378], [981, 378]], [[711, 269], [807, 269], [807, 283], [711, 283]], [[0x0200, 389], [604, 389], [604, 407], [0x0200, 407]], [[193, 558], [213, 559], [213, 655], [193, 655]], [[74, 734], [93, 731], [87, 778], [74, 778]], [[74, 838], [92, 838], [88, 884], [74, 884]], [[471, 643], [566, 642], [564, 658], [471, 658]], [[1442, 472], [1461, 472], [1461, 665], [1442, 665]]]; _local24.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 474, 749, false], [CommonVals.STAR_TOKEN, 35, 99], [CommonVals.STAR_TOKEN, 593, 522], [CommonVals.STAR_TOKEN, 732, 532], [CommonVals.STAR_TOKEN, 593, 1114], [CommonVals.STAR_TOKEN, 510, 1047], [CommonVals.STAR_TOKEN, 1006, 940], [CommonVals.STAR_TOKEN, 1113, 856], [CommonVals.STAR_TOKEN, 1248, 866], [CommonVals.STAR_TOKEN, 1342, 963], [CommonVals.STAR_TOKEN, 1342, 1087], [CommonVals.STAR_TOKEN, 1254, 1170], [CommonVals.STAR_TOKEN, 1120, 1174], [CommonVals.STAR_TOKEN, 1012, 1105], [CommonVals.STAR_TOKEN, 1002, 683], [CommonVals.STAR_TOKEN, 1202, 586], [CommonVals.STAR_TOKEN, 1294, 629], [CommonVals.STAR_TOKEN, 1135, 647], [CommonVals.TELE_TRANSMISSION, 1254, 412, 1, 0]]; _local24.actors = [[CommonVals.DOOR, 179, 67, 1.395, 0, true, -1, 0], [CommonVals.DOOR, 214, 444, 1.437, 90, true, -1, 0], [CommonVals.DOOR, 521, 478, 1, 0, true, -1, 1], [CommonVals.KEY, 260, 114, true, [0]], [CommonVals.KEY, 807, 750, true, [1]], [CommonVals.SPINY_BALL, [[137, 533], [137, 300], [647, 300]], 1, 2], [CommonVals.SPINY_BALL, [[1032, 536], [1032, 723], [1395, 723], [1395, 536], [1032, 536]], 1, 4], [CommonVals.SPINY_STICK, 1181, 1014, 1.176, 90, 0.7, true, 4], [CommonVals.SPINY_STICK, 1181, 1014, 1.176, 0, 0.7, true, 4], [CommonVals.BREAKABLE_SQUARE, 439, 929, 1, 0], [CommonVals.BREAKABLE_SQUARE, 482, 929, 1, 0], [CommonVals.BREAKABLE_SQUARE, 525, 929, 1, 0], [CommonVals.MOVABLE_STICK_BLOCK, 77, 1156, 1, -90, 253, 3, 0], [CommonVals.CANNON, 679, 598, 1, 90, 10, 200, 350], [CommonVals.CANNON, 759, 598, 1, 90, 10, 100, 450], [CommonVals.COW, 56, 176, 1], [CommonVals.CAT, 712, 575, 1], [CommonVals.DOG, 829, 575, 1]]; allLevels.push(_local24); var _local25:LevelDataPrototype = new LevelDataPrototype(); _local25.levelWidth = 2220; _local25.levelHeight = 1629; _local25.bgLayerWidth = 1099; _local25.bgLayerHeight = 568; _local25.initCameraPos = new Point(206, 680); _local25.ufoPos = new Point(526, 920); _local25.sceneType = NIGHT_SCENE; _local25.ufoSpawnable = true; _local25.stillTerrain = [[[0, 0], [75, 0], [75, 1629], [0, 1629]], [[0, -100], [2220, -100], [2220, 0], [0, 0]], [[2146, 0], [2220, 0], [2220, 1629], [2146, 1629]], [[0, 1555], [2220, 1555], [2220, 1629], [0, 1629]], [[0, 941], [1430, 941], [1430, 1090], [0, 1090]], [[1573, 941], [2220, 941], [2220, 1090], [1573, 1090]], [[0, 1235], [807, 1235], [807, 1309], [0, 1309]], [[993, 1235], [2220, 1235], [2220, 1629], [993, 1629]], [[732, 725], [1100, 725], [1100, 799], [732, 799]], [[1242, 432], [1645, 432], [1645, 506], [1242, 506]], [[1789, 432], [2220, 432], [2220, 506], [1789, 506]], [[1026, 0], [1100, 0], [1100, 799], [1026, 799]], [[1571, 0], [1645, 0], [1645, 290], [1571, 290]], [[1571, 432], [1645, 432], [1645, 940], [1571, 940]], [[545, 1509], [644, 1509], [644, 1629], [545, 1629]]]; _local25.maliciousRegion = []; _local25.objects = [[CommonVals.UFO_SPAWNER_INACTIVE, 1173, 871, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1173, 871, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1136, 370, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1700, 348, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1676, 547, false], [CommonVals.UFO_SPAWNER_INACTIVE, 1504, 1013, false], [CommonVals.FLOAT_BOMB, 1711, 613, 1], [CommonVals.FLOAT_BOMB, 1852, 621, 1], [CommonVals.FLOAT_BOMB, 1891, 571, 1], [CommonVals.FLOAT_BOMB, 2031, 634, 1], [CommonVals.FLOAT_BOMB, 2086, 733, 1], [CommonVals.FLOAT_BOMB, 1793, 709, 1], [CommonVals.FLOAT_BOMB, 1683, 819, 1], [CommonVals.FLOAT_BOMB, 1737, 852, 1], [CommonVals.FLOAT_BOMB, 1770, 904, 1], [CommonVals.BUMPER, 1694, 724, 1], [CommonVals.BUMPER, 1859, 0x0303, 1], [CommonVals.BUMPER, 1928, 617, 1], [CommonVals.BUMPER, 2084, 571, 1], [CommonVals.BUMPER, 2019, 703, 1], [CommonVals.BUMPER, 2010, 811, 1], [CommonVals.BUMPER, 1216, 1206, 1], [CommonVals.BUMPER, 1091, 1127, 1], [CommonVals.BUMPER, 621, 1127, 1], [CommonVals.BUMPER, 495, 1206, 1], [CommonVals.LASER_PROJECTOR, 1108, 755, 0, 7, true, 4], [CommonVals.LASER_PROJECTOR, 1108, 615, 0, 7, true, 5], [CommonVals.LASER_PROJECTOR, 1274, 955, -90, 7, true, 6], [CommonVals.LASER_PROJECTOR, 1404, 955, -90, 7, true, 7], [CommonVals.LASER_PROJECTOR, 594, 1497, -90, 2, true, 13], [CommonVals.TELE_TRANSMISSION, 284, 1561, 1, 0]]; _local25.actors = [[CommonVals.TRIGGER, 526, 837, 0], [CommonVals.TRIGGER, 520, 113, 0], [CommonVals.CANNON, 517, -20, 1, 90, 10, 300, 550], [CommonVals.DOOR, 727, 798, 1.477, 0, true, 1, 1], [CommonVals.DOOR, 817, 798, 1.477, 0, true, 1, 2], [CommonVals.DOOR, 907, 798, 1.477, 0, true, 1, 3], [CommonVals.KEY, 134, 129, true, [1]], [CommonVals.KEY, 492, 363, true, [2]], [CommonVals.KEY, 855, 138, true, [3]], [CommonVals.BREAKABLE_SQUARE, 1030, 797, 1.663, 0], [CommonVals.BREAKABLE_SQUARE, 1030, 868, 1.663, 0], [CommonVals.KEY, 1127, 785, false, [5, 6]], [CommonVals.KEY, 1300, 875, false, [4, 6]], [CommonVals.KEY, 1306, 647, false, [5, 7]], [CommonVals.KEY, 1306, 528, false, [4, 7]], [CommonVals.KEY, 1475, 661, false, [5]], [CommonVals.KEY, 1127, 640, false, [7, 8]], [CommonVals.DOOR, 1243, 429, 1.477, 90, false, -1, 8], [CommonVals.SPINY_BALL, [[1168, 61], [1168, 364], [1496, 364], [1496, 61], [1168, 61]], 1, 4], [CommonVals.SPINY_BALL, [[1168, 364], [1496, 364], [1496, 61], [1168, 61], [1168, 364]], 1, 4], [CommonVals.SPINY_BALL, [[1496, 364], [1496, 61], [1168, 61], [1168, 364], [1496, 364]], 1, 4], [CommonVals.SPINY_BALL, [[1496, 61], [1168, 61], [1168, 364], [1496, 364], [1496, 61]], 1, 4], [CommonVals.SPINY_BALL, [[1246, 286], [1419, 286], [1419, 140], [1246, 140], [1246, 286]], 1, 3], [CommonVals.SPINY_BALL, [[1419, 140], [1246, 140], [1246, 286], [1419, 286], [1419, 140]], 1, 3], [CommonVals.KEY, 1315, 209, false, [9]], [CommonVals.DOOR, 1583, 290, 1.477, 0, true, -1, 9], [CommonVals.CANNON, 1605, 85, 1, 0, 70, 200, 2], [CommonVals.CANNON, 1605, 215, 1, 0, 70, 200, 2], [CommonVals.CANNON, 2190, 27, 1, 180, 70, 150, 2], [CommonVals.CANNON, 2190, 147, 1, 180, 70, 150, 2], [CommonVals.CANNON, 2190, 277, 1, 180, 70, 150, 2], [CommonVals.CANNON, 2190, 397, 1, 180, 70, 150, 2], [CommonVals.KEY, 2081, 73, true, [10]], [CommonVals.KEY, 1666, 890, true, [11]], [CommonVals.DOOR, 1789, 430, 1.477, 90, true, -1, 10], [CommonVals.DOOR, 1575, 937, 1.477, 90, true, -1, 11], [CommonVals.TrashCan, 2119, 940, 1, 0], [CommonVals.KEY, 1483, 1059, true, [12]], [CommonVals.DOOR, 1574, 1090, 1.487, 0, true, -1, 12], [CommonVals.DOOR, 1574, 1090, 1.487, 0, true, -1, 12], [CommonVals.DOOR, 0xFF, 1090, 1.487, 0, true, -1, 12], [CommonVals.KEY, 352, 1190, true, [13]], [CommonVals.SPINY_BALL, [[1510, 1164], [407, 1164], [1510, 1164]], 1.8, 3], [CommonVals.SPINY_BALL, [[0x0800, 1164], [147, 1164], [0x0800, 1164]], 1.8, 3], [CommonVals.SPINY_BALL, [[147, 1164], [0x0800, 1164], [147, 1164]], 1.8, 3], [CommonVals.COW, 783, 1527, 1], [CommonVals.SPINY_STICK, 523, 459, 1.826, 0, -0.7, false, 0], [CommonVals.SPINY_STICK, 523, 459, 1.826, 90, -0.7, false, 0], [CommonVals.SPINY_STICK, 0xFF, 695, 1.26, 90, 0.7, true, 15], [CommonVals.SPINY_STICK, 0xFF, 695, 1.26, 0, 0.7, true, 15], [CommonVals.SPINY_STICK, 795, 232, 1.26, 90, -0.7, true, 15], [CommonVals.SPINY_STICK, 795, 232, 1.26, 0, -0.7, true, 15], [CommonVals.SPINY_STICK, 252, 232, 1.26, 90, -0.7, true, 15], [CommonVals.SPINY_STICK, 252, 232, 1.26, 0, -0.7, true, 15]]; allLevels.push(_local25); } public static function getLevelData(_arg1:int):LevelDataPrototype{ return (allLevels[_arg1]); } } }//package com.tinime.levels
Section 158
//GameObject (com.tinime.objects.GameObject) package com.tinime.objects { import Box2D.Dynamics.*; import flash.display.*; public class GameObject { protected var _body:b2Body; protected var _costume:DisplayObjectContainer; public function destroy():void{ } public function get body():b2Body{ return (_body); } public function set body(_arg1:b2Body):void{ _body = _arg1; } public function get costume():DisplayObjectContainer{ return (_costume); } public function set costume(_arg1:DisplayObjectContainer):void{ _costume = _arg1; } } }//package com.tinime.objects
Section 159
//LaserProjector (com.tinime.objects.LaserProjector) package com.tinime.objects { import flash.display.*; import com.hexagonstar.display.bitmaps.*; import Box2D.Dynamics.*; import com.tinime.control.*; import flash.geom.*; import com.tinime.data.*; import com.tinime.view.*; import com.greensock.*; import com.tinime.interfaces.*; public class LaserProjector extends GameObject implements Triggered { private var _projectorStartCostume:Sprite; private var _projectorStartBody:b2Body; private var _projectorEndCostume:Sprite; private var _projectorEndBody:b2Body; private var _laserCostumeArr:Array; private var _laserAnimatedBitmapArr:Array; private var _laserBodyArr:Array; private var _isOn:Boolean; private var _isTweening:Boolean;// = false public function LaserProjector(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Number, _arg4:Number, _arg5:Boolean){ var _local9:Sprite; var _local10:AnimatedBitmap; var _local11:b2Body; super(); _isOn = true; _projectorStartCostume = Box2dObjSpawner.buildBitmapSprite(_arg1, new LaserProjectorSprLib(), _arg2, 1, new Point(69, 34), new Point(-38, -17), _arg3); _projectorStartBody = Box2dObjSpawner.buildBody([[-21, -16], [28, -2], [28, 2], [-21, 16], [-37, 0]], CommonVals.SCENE_BLOCK, _arg2, 0, 0.7, 0, 1, _arg3); _laserCostumeArr = new Array(); _laserBodyArr = new Array(); _laserAnimatedBitmapArr = new Array(); var _local6:Number = ((_arg3 * Math.PI) / 180); var _local7:Point = new Point((_arg2.x + (28 * Math.cos(_local6))), (_arg2.y + (28 * Math.sin(_local6)))); var _local8:int; while (_local8 < _arg4) { _local9 = new Sprite(); _local10 = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.LASER_BEAM); _local10.x = -1; _local10.y = -5; _local9.addChild(_local10); _local9.x = _local7.x; _local9.y = _local7.y; _local9.rotation = _arg3; _arg1.addChild(_local9); _local11 = Box2dObjSpawner.buildBody([[0, -3], [59, -3], [59, 3], [0, 3]], CommonVals.LASER_BEAM, _local7, 0, 0.7, 0, 1, _arg3); _local11.GetShapeList().m_isSensor = true; _laserCostumeArr.push(_local9); _laserBodyArr.push(_local11); _laserAnimatedBitmapArr.push(_local10); _local7 = new Point((_local7.x + (59 * Math.cos(_local6))), (_local7.y + (59 * Math.sin(_local6)))); _local8++; }; _local7 = new Point((_local7.x + (28 * Math.cos(_local6))), (_local7.y + (28 * Math.sin(_local6)))); _projectorEndCostume = Box2dObjSpawner.buildBitmapSprite(_arg1, new LaserProjectorSprLib(), _local7, 1, new Point(69, 34), new Point(-38, -17), (_arg3 + 180)); _projectorEndBody = Box2dObjSpawner.buildBody([[-21, -16], [28, -2], [28, 2], [-21, 16], [-37, 0]], CommonVals.SCENE_BLOCK, _local7, 0, 0.7, 0, 1, (_arg3 + 180)); if (!(_arg5)){ onTriggered(); }; } override public function destroy():void{ var _local2:Sprite; var _local3:AnimatedBitmap; var _local4:b2Body; _projectorStartCostume.parent.removeChild(_projectorStartCostume); PhysicsVals.world.DestroyBody(_projectorStartBody); _projectorEndCostume.parent.removeChild(_projectorEndCostume); PhysicsVals.world.DestroyBody(_projectorEndBody); _projectorStartCostume = null; _projectorEndCostume = null; var _local1:int; while (_local1 < _laserBodyArr.length) { _local2 = _laserCostumeArr[_local1]; _local3 = _laserAnimatedBitmapArr[_local1]; _local3.destroy(); _local4 = _laserBodyArr[_local1]; _local2.removeChild(_local3); _local2.parent.removeChild(_local2); PhysicsVals.world.DestroyBody(_local4); _local3 = null; _local2 = null; _local1++; }; _laserAnimatedBitmapArr = null; _laserBodyArr = null; _laserCostumeArr = null; } public function onTriggered():void{ var onTweenComplete:Function; var curBeamCostume:Sprite; var curBeamBody:b2Body; onTweenComplete = function ():void{ _isTweening = false; }; if (_isTweening){ return; }; _isOn = !(_isOn); var i:int; while (i < _laserBodyArr.length) { curBeamCostume = _laserCostumeArr[i]; curBeamBody = _laserBodyArr[i]; if (_isOn){ _isTweening = true; TweenLite.to(curBeamCostume, 1, {alpha:1, onComplete:onTweenComplete}); curBeamBody.GetShapeList().m_isSensor = false; curBeamBody.SetUserData(CommonVals.LASER_BEAM); } else { _isTweening = true; TweenLite.to(curBeamCostume, 1, {alpha:0, onComplete:onTweenComplete}); curBeamBody.GetShapeList().m_isSensor = true; curBeamBody.SetUserData(""); }; i = (i + 1); }; } } }//package com.tinime.objects
Section 160
//UfoBlock (com.tinime.objects.UfoBlock) package com.tinime.objects { import com.tinime.control.*; import flash.geom.*; import com.tinime.data.*; public class UfoBlock extends GameObject { public function UfoBlock(_arg1:Array){ _body = Box2dObjSpawner.buildBody(_arg1, null, new Point(0, 0)); _body.GetShapeList().m_filter.categoryBits = PhysicsVals.NPC_CATAGORY; _body.GetShapeList().m_filter.maskBits = PhysicsVals.UFO_CATEGORY; } override public function destroy():void{ PhysicsVals.world.DestroyBody(_body); } } }//package com.tinime.objects
Section 161
//UfoSpawner (com.tinime.objects.UfoSpawner) package com.tinime.objects { import Box2D.Collision.Shapes.*; import com.tinime.data.*; import Box2D.Dynamics.*; import flash.display.*; import flash.geom.*; import com.tinime.control.*; import com.tinime.view.*; import com.hexagonstar.display.bitmaps.*; public class UfoSpawner extends GameObject { private var _isActive:Boolean; private var _parent:DisplayObjectContainer; private var _location:Point; private var _animatedBitmap:AnimatedBitmap; public function UfoSpawner(_arg1:DisplayObjectContainer, _arg2:Point, _arg3:Boolean){ var _local4:b2CircleDef; super(); _parent = _arg1; _location = _arg2; updateDisplay(_arg3); _local4 = new b2CircleDef(); _local4.radius = (8 / PhysicsVals.RATIO); _local4.density = 0; _local4.isSensor = true; var _local5:b2BodyDef = new b2BodyDef(); _local5.position.Set((_arg2.x / PhysicsVals.RATIO), (_arg2.y / PhysicsVals.RATIO)); _body = PhysicsVals.world.CreateBody(_local5); _body.CreateShape(_local4); _body.SetUserData(this); } public function touch():void{ if (!(_isActive)){ _isActive = true; updateDisplay(true); UfoSpawnController.changeSpawner(this); }; } public function updateDisplay(_arg1:Boolean):void{ _isActive = _arg1; if (_costume != null){ if (_parent.contains(_costume)){ _parent.removeChild(_costume); }; }; if (_isActive){ _costume = new Sprite(); _costume.x = _location.x; _costume.y = _location.y; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.UFO_SPAWNER_ACTIVE); _animatedBitmap.x = -91; _animatedBitmap.y = -87; _costume.addChild(_animatedBitmap); _animatedBitmap.play(); } else { _costume = new Sprite(); _costume.x = _location.x; _costume.y = _location.y; _animatedBitmap = BitmapAnimManager.getInstance().getAnimatedBitmap(CommonVals.UFO_SPAWNER_INACTIVE); _animatedBitmap.x = -27; _animatedBitmap.y = -27; _costume.addChild(_animatedBitmap); _animatedBitmap.play(); }; _parent.addChildAt(_costume, 0); } public function getPosition():Point{ return (_location); } override public function destroy():void{ PhysicsVals.world.DestroyBody(_body); _parent.removeChild(_costume); _animatedBitmap.parent.removeChild(_animatedBitmap); _animatedBitmap.destroy(); _animatedBitmap = null; } public function get isActive():Boolean{ return (_isActive); } public function set isActive(_arg1:Boolean):void{ _isActive = _arg1; } } }//package com.tinime.objects
Section 162
//AllLevelCompleteScreen (com.tinime.view.AllLevelCompleteScreen) package com.tinime.view { import flash.events.*; import com.tinime.event.*; import flash.display.*; public class AllLevelCompleteScreen extends Sprite { private var allLevelCompleteMc:MovieClip; public function AllLevelCompleteScreen(){ allLevelCompleteMc = new AllPassAnimMcLib(); allLevelCompleteMc.x = 320; allLevelCompleteMc.y = 240; addChild(allLevelCompleteMc); mouseEnabled = true; useHandCursor = true; buttonMode = true; addEventListener(MouseEvent.CLICK, onClick); allLevelCompleteMc.gotoAndPlay(1); } private function onClick(_arg1:MouseEvent):void{ trace(allLevelCompleteMc.currentFrame); if (allLevelCompleteMc.currentFrame >= 231){ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); removeEventListener(MouseEvent.CLICK, onClick); }; } } }//package com.tinime.view
Section 163
//BitmapAnimManager (com.tinime.view.BitmapAnimManager) package com.tinime.view { import flash.display.*; import com.tinime.data.*; import com.hexagonstar.display.bitmaps.*; import com.tinime.event.*; import flash.geom.*; import flash.events.*; public class BitmapAnimManager { private var _cowArr:Array; private var _catArr:Array; private var _dogArr:Array; private var _ufoArr:Array; private var _teleTransmissionArr:Array; private var _starTokenArr:Array; private var _ufoSpawnerInactiveArr:Array; private var _ufoSpawnerActiveArr:Array; private var _floatBombArr:Array; private var _spinyBallArr:Array; private var _spinyBallScale150Arr:Array; private var _spinyBallScale180Arr:Array; private var _keyArr:Array; private var _triggerArr:Array; private var _laserBeamArr:Array; private var _cannonArr:Array; private var _cannonScale60Arr:Array; private var _cannonScale150Arr:Array; private var _bumperArr:Array; private var _bumperScale53Arr:Array; private var _cowDimension:Point; private var _catDimension:Point; private var _dogDimension:Point; private var _ufoDimension:Point; private var _teleTransmissionDimension:Point; private var _starTokenDimension:Point; private var _ufoSpawnerInactiveDimension:Point; private var _ufoSpawnerActiveDimension:Point; private var _floatBombDimension:Point; private var _spinyBallDimension:Point; private var _spinyBallScale150Dimension:Point; private var _spinyBallScale180Dimension:Point; private var _keyDimension:Point; private var _triggerDimension:Point; private var _laserBeamDimension:Point; private var _cannonDimension:Point; private var _cannonScale60Dimension:Point; private var _cannonScale150Dimension:Point; private var _bumperDimension:Point; private var _bumperScale53Dimension:Point; private var _totalGenNum:uint; private var _genCount:uint; private static var _instance:BitmapAnimManager; public function BitmapAnimManager(_arg1:SingletonEnforcer){ } public function initBitmapAnimData():void{ initTempData(); var _local1:DisplayObjectContainer = UIManager.stage; UIManager.setStageFrameRate(15); generateBitmapAnimBlockFromMc(new CowMcLib(), _local1); generateBitmapAnimBlockFromMc(new CatMcLib(), _local1); generateBitmapAnimBlockFromMc(new DogMcLib(), _local1); generateBitmapAnimBlockFromMc(new UfoMcLib(), _local1); generateBitmapAnimBlockFromMc(new TeleTransmissionMcLib(), _local1); generateBitmapAnimBlockFromMc(new StarTokenMcLib(), _local1); generateBitmapAnimBlockFromMc(new UfoSpawnerActiveMcLib(), _local1); generateBitmapAnimBlockFromMc(new UfoSpawnerInactiveMcLib(), _local1); generateBitmapAnimBlockFromMc(new FloatBombMcLib(), _local1); generateBitmapAnimBlockFromMc(new SpinyBallMcLib(), _local1); generateBitmapAnimBlockFromMc(new KeyMcLib(), _local1); generateBitmapAnimBlockFromMc(new TriggerMcLib(), _local1); generateBitmapAnimBlockFromMc(new LaserBeamMcLib(), _local1); generateBitmapAnimBlockFromMc(new CannonMcLib(), _local1); generateBitmapAnimBlockFromMc(new BumperMcLib(), _local1); } public function getAnimatedBitmap(_arg1:int):AnimatedBitmap{ var _local2:BitmapAnimDataBlock; switch (_arg1){ case CommonVals.COW: _local2 = BitmapAnimDataCollection.cowAnimPrototype; break; case CommonVals.CAT: _local2 = BitmapAnimDataCollection.catAnimPrototype; break; case CommonVals.DOG: _local2 = BitmapAnimDataCollection.dogAnimPrototype; break; case CommonVals.UFO: _local2 = BitmapAnimDataCollection.ufoAnimPrototype; break; case CommonVals.TELE_TRANSMISSION: _local2 = BitmapAnimDataCollection.teleTransmissionPrototype; break; case CommonVals.STAR_TOKEN: _local2 = BitmapAnimDataCollection.starTokenPrototype; break; case CommonVals.UFO_SPAWNER_INACTIVE: _local2 = BitmapAnimDataCollection.ufoSpawnerInactivePrototype; break; case CommonVals.UFO_SPAWNER_ACTIVE: _local2 = BitmapAnimDataCollection.ufoSpawnerActivePrototype; break; case CommonVals.FLOAT_BOMB: _local2 = BitmapAnimDataCollection.floatBombPrototype; break; case CommonVals.SPINY_BALL: _local2 = BitmapAnimDataCollection.spinyBallPrototype; break; case CommonVals.SPINY_BALL_150: _local2 = BitmapAnimDataCollection.spinyBallScale150Prototype; break; case CommonVals.SPINY_BALL_180: _local2 = BitmapAnimDataCollection.spinyBallScale180prototype; break; case CommonVals.KEY: _local2 = BitmapAnimDataCollection.keyPrototype; break; case CommonVals.TRIGGER: _local2 = BitmapAnimDataCollection.triggerPrototype; break; case CommonVals.LASER_BEAM: _local2 = BitmapAnimDataCollection.laserBeamPrototype; break; case CommonVals.CANNON: _local2 = BitmapAnimDataCollection.cannonPrototype; break; case CommonVals.CANNON_60: _local2 = BitmapAnimDataCollection.cannonScale60Prototype; break; case CommonVals.CANNON_150: _local2 = BitmapAnimDataCollection.cannonScale150Prototype; break; case CommonVals.BUMPER: _local2 = BitmapAnimDataCollection.bumperPrototype; break; case CommonVals.BUMPER_53: _local2 = BitmapAnimDataCollection.bumperScale53Prototype; break; default: break; }; return (new AnimatedBitmap(_local2.bitmapData, _local2.width, _local2.height, _local2.wCount, _local2.frameAmount, PhysicsVals.ANIMATED_BITMAP_TIMER, true, "auto", true)); } private function onBitmapDataReady():void{ setBitmapAnimDataBlock(_cowArr, _cowDimension, BitmapAnimDataCollection.cowAnimPrototype); setBitmapAnimDataBlock(_catArr, _catDimension, BitmapAnimDataCollection.catAnimPrototype); setBitmapAnimDataBlock(_dogArr, _dogDimension, BitmapAnimDataCollection.dogAnimPrototype); setBitmapAnimDataBlock(_ufoArr, _ufoDimension, BitmapAnimDataCollection.ufoAnimPrototype); setBitmapAnimDataBlock(_teleTransmissionArr, _teleTransmissionDimension, BitmapAnimDataCollection.teleTransmissionPrototype); setBitmapAnimDataBlock(_starTokenArr, _starTokenDimension, BitmapAnimDataCollection.starTokenPrototype); setBitmapAnimDataBlock(_ufoSpawnerActiveArr, _ufoSpawnerActiveDimension, BitmapAnimDataCollection.ufoSpawnerActivePrototype); setBitmapAnimDataBlock(_ufoSpawnerInactiveArr, _ufoSpawnerInactiveDimension, BitmapAnimDataCollection.ufoSpawnerInactivePrototype); setBitmapAnimDataBlock(_floatBombArr, _floatBombDimension, BitmapAnimDataCollection.floatBombPrototype); setBitmapAnimDataBlock(_spinyBallArr, _spinyBallDimension, BitmapAnimDataCollection.spinyBallPrototype); setBitmapAnimDataBlock(_spinyBallScale150Arr, _spinyBallScale150Dimension, BitmapAnimDataCollection.spinyBallScale150Prototype); setBitmapAnimDataBlock(_spinyBallScale180Arr, _spinyBallScale180Dimension, BitmapAnimDataCollection.spinyBallScale180prototype); setBitmapAnimDataBlock(_keyArr, _keyDimension, BitmapAnimDataCollection.keyPrototype); setBitmapAnimDataBlock(_triggerArr, _triggerDimension, BitmapAnimDataCollection.triggerPrototype); setBitmapAnimDataBlock(_laserBeamArr, _laserBeamDimension, BitmapAnimDataCollection.laserBeamPrototype); setBitmapAnimDataBlock(_cannonArr, _cannonDimension, BitmapAnimDataCollection.cannonPrototype); setBitmapAnimDataBlock(_cannonScale60Arr, _cannonScale60Dimension, BitmapAnimDataCollection.cannonScale60Prototype); setBitmapAnimDataBlock(_cannonScale150Arr, _cannonScale150Dimension, BitmapAnimDataCollection.cannonScale150Prototype); setBitmapAnimDataBlock(_bumperArr, _bumperDimension, BitmapAnimDataCollection.bumperPrototype); setBitmapAnimDataBlock(_bumperScale53Arr, _bumperScale53Dimension, BitmapAnimDataCollection.bumperScale53Prototype); removeTempData(); UIManager.setStageFrameRate(PhysicsVals.FRAME_RATE); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.ANIMATED_BITMAP_DATA_READY)); } private function removeTempData():void{ _cowDimension = null; _cowArr = null; _catDimension = null; _catArr = null; _dogDimension = null; _dogArr = null; _ufoDimension = null; _ufoArr = null; _teleTransmissionDimension = null; _teleTransmissionArr = null; _starTokenDimension = null; _starTokenArr = null; _ufoSpawnerActiveDimension = null; _ufoSpawnerActiveArr = null; _ufoSpawnerInactiveDimension = null; _ufoSpawnerInactiveArr = null; _floatBombDimension = null; _floatBombArr = null; _spinyBallDimension = null; _spinyBallArr = null; _spinyBallScale150Dimension = null; _spinyBallScale150Arr = null; _spinyBallScale180Dimension = null; _spinyBallScale180Arr = null; _keyDimension = null; _keyArr = null; _triggerDimension = null; _triggerArr = null; _laserBeamDimension = null; _laserBeamArr = null; _cannonDimension = null; _cannonArr = null; _cannonScale60Dimension = null; _cannonScale60Arr = null; _cannonScale150Dimension = null; _cannonScale150Arr = null; _bumperDimension = null; _bumperArr = null; _bumperScale53Dimension = null; _bumperScale53Arr = null; } private function setBitmapAnimDataBlock(_arg1:Array, _arg2:Point, _arg3:BitmapAnimDataBlock):void{ var _local12:int; var _local13:BitmapData; var _local14:Bitmap; var _local4:int = 2800; var _local5:int = 2800; var _local6:int = _arg1.length; var _local7:int = int((_local4 / _arg2.x)); var _local8:int = ((_local7 > _local6)) ? _local6 : _local7; var _local9:int = Math.ceil((_local6 / _local7)); if ((_local9 * _arg2.y) > _local5){ trace("exceed the max bitmap size"); }; var _local10:Sprite = new Sprite(); var _local11:int; while (_local11 < _local9) { _local12 = 0; while (_local12 < _local8) { if (_arg1.length == 0){ break; }; _local13 = _arg1.shift(); _local14 = new Bitmap(_local13); _local14.x = (_local12 * _arg2.x); _local14.y = (_local11 * _arg2.y); _local10.addChild(_local14); _local12++; }; _local11++; }; _arg3.bitmapData = new BitmapData((_local8 * _arg2.x), (_local9 * _arg2.y), true, 0xFF0000); _arg3.bitmapData.draw(_local10); _arg3.width = _arg2.x; _arg3.height = _arg2.y; _arg3.wCount = _local8; _arg3.frameAmount = _local6; } private function initTempData():void{ _totalGenNum = 0; _genCount = 0; _cowDimension = new Point(101, 65); _catDimension = new Point(38, 29); _dogDimension = new Point(60, 37); _ufoDimension = new Point(58, 37); _teleTransmissionDimension = new Point(139, 67); _starTokenDimension = new Point(103, 62); _ufoSpawnerActiveDimension = new Point(187, 183); _ufoSpawnerInactiveDimension = new Point(56, 56); _floatBombDimension = new Point(46, 46); _spinyBallDimension = new Point(90, 80); _spinyBallScale150Dimension = new Point((_spinyBallDimension.x * 1.5), (_spinyBallDimension.y * 1.5)); _spinyBallScale180Dimension = new Point((_spinyBallDimension.x * 1.8), (_spinyBallDimension.y * 1.8)); _keyDimension = new Point(54, 38); _triggerDimension = new Point(40, 40); _laserBeamDimension = new Point(62, 10); _cannonDimension = new Point(250, 206); _cannonScale60Dimension = new Point((_cannonDimension.x * 0.6), (_cannonDimension.y * 0.6)); _cannonScale150Dimension = new Point((_cannonDimension.x * 1.5), (_cannonDimension.y * 1.5)); _bumperDimension = new Point(68, 68); _bumperScale53Dimension = new Point((_bumperDimension.x * 0.53), (_bumperDimension.y * 0.53)); _cowArr = new Array(); _catArr = new Array(); _dogArr = new Array(); _ufoArr = new Array(); _teleTransmissionArr = new Array(); _starTokenArr = new Array(); _ufoSpawnerInactiveArr = new Array(); _ufoSpawnerActiveArr = new Array(); _floatBombArr = new Array(); _spinyBallArr = new Array(); _spinyBallScale150Arr = new Array(); _spinyBallScale180Arr = new Array(); _keyArr = new Array(); _triggerArr = new Array(); _laserBeamArr = new Array(); _cannonArr = new Array(); _cannonScale60Arr = new Array(); _cannonScale150Arr = new Array(); _bumperArr = new Array(); _bumperScale53Arr = new Array(); } private function generateBitmapAnimBlockFromMc(_arg1:MovieClip, _arg2:DisplayObjectContainer):void{ _totalGenNum++; _arg2.addChildAt(_arg1, 0); _arg1.addEventListener(Event.ENTER_FRAME, onMcEnterFrame); _arg1.gotoAndPlay(1); } private function onMcEnterFrame(_arg1:Event):void{ var _local2:MovieClip = MovieClip(_arg1.target); if ((_local2 is CowMcLib)){ getFrameBitmapData(_local2, _cowDimension, _cowArr); } else { if ((_local2 is CatMcLib)){ getFrameBitmapData(_local2, _catDimension, _catArr); } else { if ((_local2 is DogMcLib)){ getFrameBitmapData(_local2, _dogDimension, _dogArr); } else { if ((_local2 is UfoMcLib)){ getFrameBitmapData(_local2, _ufoDimension, _ufoArr); } else { if ((_local2 is TeleTransmissionMcLib)){ getFrameBitmapData(_local2, _teleTransmissionDimension, _teleTransmissionArr); } else { if ((_local2 is StarTokenMcLib)){ getFrameBitmapData(_local2, _starTokenDimension, _starTokenArr); } else { if ((_local2 is UfoSpawnerActiveMcLib)){ getFrameBitmapData(_local2, _ufoSpawnerActiveDimension, _ufoSpawnerActiveArr); getFrameBitmapData(_local2, _ufoSpawnerActiveDimension, _ufoSpawnerActiveArr); } else { if ((_local2 is UfoSpawnerInactiveMcLib)){ getFrameBitmapData(_local2, _ufoSpawnerInactiveDimension, _ufoSpawnerInactiveArr); getFrameBitmapData(_local2, _ufoSpawnerInactiveDimension, _ufoSpawnerInactiveArr); } else { if ((_local2 is FloatBombMcLib)){ getFrameBitmapData(_local2, _floatBombDimension, _floatBombArr); } else { if ((_local2 is SpinyBallMcLib)){ getFrameBitmapData(_local2, _spinyBallDimension, _spinyBallArr); getFrameBitmapData(_local2, _spinyBallScale150Dimension, _spinyBallScale150Arr, 1.5); getFrameBitmapData(_local2, _spinyBallScale180Dimension, _spinyBallScale180Arr, 1.8); } else { if ((_local2 is KeyMcLib)){ getFrameBitmapData(_local2, _keyDimension, _keyArr); } else { if ((_local2 is TriggerMcLib)){ getFrameBitmapData(_local2, _triggerDimension, _triggerArr); } else { if ((_local2 is LaserBeamMcLib)){ getFrameBitmapData(_local2, _laserBeamDimension, _laserBeamArr); } else { if ((_local2 is CannonMcLib)){ getFrameBitmapData(_local2, _cannonDimension, _cannonArr); getFrameBitmapData(_local2, _cannonScale60Dimension, _cannonScale60Arr, 0.6); getFrameBitmapData(_local2, _cannonScale150Dimension, _cannonScale150Arr, 1.5); } else { if ((_local2 is BumperMcLib)){ getFrameBitmapData(_local2, _bumperDimension, _bumperArr); getFrameBitmapData(_local2, _bumperDimension, _bumperArr); getFrameBitmapData(_local2, _bumperDimension, _bumperArr); getFrameBitmapData(_local2, _bumperScale53Dimension, _bumperScale53Arr, 0.53); getFrameBitmapData(_local2, _bumperScale53Dimension, _bumperScale53Arr, 0.53); getFrameBitmapData(_local2, _bumperScale53Dimension, _bumperScale53Arr, 0.53); }; }; }; }; }; }; }; }; }; }; }; }; }; }; }; if (_local2.currentFrame == _local2.totalFrames){ _local2.stop(); _local2.removeEventListener(Event.ENTER_FRAME, onMcEnterFrame); _local2.parent.removeChild(_local2); if (++_genCount == _totalGenNum){ onBitmapDataReady(); }; }; } private function getFrameBitmapData(_arg1:MovieClip, _arg2:Point, _arg3:Array, _arg4:Number=1):void{ var _local5:BitmapData = new BitmapData(_arg2.x, _arg2.y, true, 0xFF0000); var _local6:Matrix = new Matrix(); _local6.scale(_arg4, _arg4); _local5.draw(_arg1, _local6); _arg3.push(_local5); } public function get totalGenNum():uint{ return (_totalGenNum); } public function get genCount():uint{ return (_genCount); } public static function getInstance():BitmapAnimManager{ if (_instance == null){ _instance = new BitmapAnimManager(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.view class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 164
//Camera (com.tinime.view.Camera) package com.tinime.view { import com.tinime.data.*; import com.tinime.event.*; import flash.display.*; import com.tinime.control.*; import flash.text.*; import flash.filters.*; import flash.geom.*; import com.greensock.*; import com.tinime.levels.*; import com.greensock.easing.*; import flash.events.*; public class Camera extends Sprite { private var _topLayer:Sprite; private var _frontLayer:Sprite; private var _bglayer:Sprite; private var _uiLayer:Sprite; private var _lowerBound:Point; private var _upperBound:Point; private var _curSceneWidth:Number; private var _curSceneHeight:Number; private var _bgLayerWidth:Number; private var _bgLayerHeight:Number; private var _bgLayerMoveXRatio:Number; private var _bgLayerMoveYRatio:Number; private var _activeMovingBorderLen:int; private var _leftMoveBorder:int; private var _rightMoveBorder:int; private var _upMoveBorder:int; private var _downMoveBorder:int; private var _owner:Sprite; private var _energyText:TextField; private var _energyBar:Sprite; private var _energyDecoration:Sprite; private var _lifeNumSprite:NumberSprite; private var _scoreNumSprite:NumberSprite; private var _levelNumSprite:NumberSprite; private var _cowText:TextField; private var _lifeUpMask:Sprite; private var lifeUpSprite:Sprite; private var _lifeUpMaskInitialX:Number; private var _uiTextFmt:TextFormat; private var gamePausedPanel:GamePausePanel; private var controllerPanel:ControllerPanel; public var ufoX:Number; public var ufoY:Number; public var _cameraMask:MovieClip; public var _isCameraLocked:Boolean; private var _cameraModeStartPos:Point; public var frontLayerBitMap:Bitmap; private static var _originalBgWidth:Number = 513; private static var _originalBgHeight:Number = 265; private static var _stageWidth:Number = 640; private static var _stageHeight:Number = 480; private static var _stageHalfWidth:Number = 320; private static var _stageHalfHeight:Number = 240; private static var _cameraMoveSpeedX:int = 5; private static var _cameraMoveSpeedY:int = 5; private static var _blackScreen:Sprite; public static var stage:Sprite; private static var _gameEventDispatcher:GameEventDispatcher = GameEventDispatcher.getInstance(); private static var _instance:Camera; public function Camera(_arg1:SingletonEnforcer){ } public function initialize():void{ _isCameraLocked = false; _owner = this; _bglayer = new Sprite(); _frontLayer = new Sprite(); _topLayer = new Sprite(); _uiLayer = new Sprite(); addChild(_bglayer); addChild(_frontLayer); addChild(_topLayer); addChild(_uiLayer); initialUILayer(); } public function updateLives():void{ _lifeNumSprite.setNumber(LivesControl.curLives); } public function removeAllLayers():void{ if (_bglayer == null){ return; }; while (_bglayer.numChildren) { _bglayer.removeChildAt(0); }; while (_frontLayer.numChildren) { _frontLayer.removeChildAt(0); }; while (_topLayer.numChildren) { _topLayer.removeChildAt(0); }; while (_uiLayer.numChildren) { _uiLayer.removeChildAt(0); }; while (numChildren) { removeChildAt(0); }; _bglayer = null; _frontLayer = null; _topLayer = null; _uiLayer = null; } public function initialUILayer():void{ var _local1:Sprite = new StatisticTextSprLib(); _local1.x = 25; _local1.y = 8; _uiLayer.addChild(_local1); _local1.cacheAsBitmap = true; _uiTextFmt = new TextFormat("Verdana", 18, 0xFF9900, true, true); var _local2:TextFormat = new TextFormat("Verdana", 12, 0xFFFFFF, true); _lifeNumSprite = new NumberSprite(); _lifeNumSprite.x = 65; _lifeNumSprite.y = 5; _uiLayer.addChild(_lifeNumSprite); updateLives(); _scoreNumSprite = new NumberSprite(); _scoreNumSprite.x = 277; _scoreNumSprite.y = 5; _uiLayer.addChild(_scoreNumSprite); displayScore(); _levelNumSprite = new NumberSprite(); _levelNumSprite.x = 483; _levelNumSprite.y = 5; _uiLayer.addChild(_levelNumSprite); _levelNumSprite.setNumber(LevelController.curLevelNum); var _local3:Sprite = new cowIconSprite(); _local3.x = 558; _local3.y = 451; _uiLayer.addChild(_local3); _cowText = new TextField(); _cowText.x = 588; _cowText.y = 454; _cowText.selectable = false; _cowText.filters = new Array(new GlowFilter(51, 1, 3, 3, 15)); var _local4:TextFormat = new TextFormat("Verdana", 14, 0xFFFFFF, true); _cowText.setTextFormat(_local4); _uiLayer.addChild(_cowText); var _local5:Sprite = new LifeUpProgressSprLib(); _local5.x = 500; _local5.y = 454; lifeUpSprite = new LifeUpSprLib(); lifeUpSprite.x = 500; lifeUpSprite.y = 454; _lifeUpMask = new Sprite(); _lifeUpMask.graphics.beginFill(0, 1); _lifeUpMask.graphics.drawRect(0, 0, 55, 20); _lifeUpMask.graphics.endFill(); _lifeUpMask.x = 500; _lifeUpMaskInitialX = 500; _lifeUpMask.y = 454; _uiLayer.addChild(_local5); _uiLayer.addChild(lifeUpSprite); _uiLayer.addChild(_lifeUpMask); lifeUpSprite.mask = _lifeUpMask; } public function updateLifeUpDisplay(_arg1:Number):void{ _lifeUpMask.x = (_lifeUpMaskInitialX + ((_arg1 * 54) / LivesControl.starNeedToAddLife)); lifeUpSprite.mask = _lifeUpMask; } public function prepareEnergyDisplay():void{ _energyDecoration = new Sprite(); _energyDecoration.graphics.beginFill(0xFFCC00, 1); _energyDecoration.graphics.lineStyle(1, 0xFFCC00); _energyDecoration.graphics.drawRect(0, 0, 33, 4); _energyDecoration.graphics.endFill(); _frontLayer.addChild(_energyDecoration); _energyDecoration.alpha = 1; _energyBar = new Sprite(); _energyBar.graphics.beginFill(6195336, 1); _energyBar.graphics.lineStyle(1, 6195336); _energyBar.graphics.drawRect(1, 0, 31, 2); _energyBar.graphics.endFill(); _frontLayer.addChild(_energyBar); setVisualEnergy(false); _energyBar.scaleX = 0; } public function setVisualEnergy(_arg1:Boolean):void{ if (_arg1){ _energyBar.visible = true; _energyDecoration.visible = true; } else { _energyBar.visible = false; _energyDecoration.visible = false; }; } public function setEnergyPos(_arg1:Number, _arg2:Number):void{ _energyBar.x = (_arg1 - 15); _energyBar.y = (_arg2 - 44); _energyDecoration.x = (_arg1 - 16); _energyDecoration.y = (_arg2 - 45); } public function setEnergyDisplay(_arg1:Number):void{ if (_arg1 == 0){ _energyBar.transform.colorTransform = new ColorTransform(1, 1, 1); setVisualEnergy(false); } else { if (_arg1 == 1){ _energyBar.transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0xFF, -255, -255); }; }; _energyBar.scaleX = _arg1; } public function tweenWholeScene(_arg1:Number, _arg2:Number, _arg3:Point, _arg4:Number, _arg5:Number):void{ var times = _arg1; var tweenSpeed = _arg2; var endPos = _arg3; var startScale = _arg4; var endScale = _arg5; var tweenTheCamera:Function = function ():void{ var onTweenDownComplete:Function; var onTweenUpComplete:Function; onTweenDownComplete = function ():void{ times--; if (times > 0){ TweenLite.to(_frontLayer, tweenSpeed, {y:0, onComplete:onTweenUpComplete}); TweenLite.to(_bglayer, tweenSpeed, {y:0}); } else { tweenToEnd(); }; }; onTweenUpComplete = function ():void{ tweenTheCamera(); }; TweenLite.to(_frontLayer, tweenSpeed, {y:(-(_curSceneHeight) + (_stageHeight / scaleY)), onComplete:onTweenDownComplete}); TweenLite.to(_bglayer, tweenSpeed, {y:(-(_bgLayerHeight) + (_stageHeight / scaleY))}); }; var tweenToEnd:Function = function ():void{ var onTweenToEndComplete:Function; onTweenToEndComplete = function ():void{ _gameEventDispatcher.onCameraPrepared(); }; TweenLite.to(_frontLayer, 2, {x:-(endPos.x), y:-(endPos.y)}); TweenLite.to(_bglayer, 2, {x:(-(endPos.x) * _bgLayerMoveXRatio), y:(-(endPos.y) * _bgLayerMoveYRatio)}); TweenLite.to(_owner, 2, {scaleX:endScale, scaleY:endScale, onComplete:onTweenToEndComplete}); }; moveTo(new Point(0, 0)); scaleX = startScale; scaleY = startScale; tweenTheCamera(); } public function prepareNightBgLayer(_arg1:Number):void{ var _local2:Sprite; switch (_arg1){ case LevelsData.NIGHT_SCENE: _local2 = new NightBgSprLib(); _originalBgHeight = 265; break; case LevelsData.SNOW_SCENE: _local2 = new SnowBgSprLib(); _originalBgHeight = 480; break; }; var _local3:BitmapData = new BitmapData(_bgLayerWidth, _bgLayerHeight); var _local4:Matrix = new Matrix(); _local4.scale((_bgLayerHeight / _originalBgHeight), (_bgLayerHeight / _originalBgHeight)); _local3.draw(_local2, _local4); var _local5:Bitmap = new Bitmap(_local3); _bglayer.addChild(_local5); _local5.filters = new Array(new BlurFilter(2, 2)); } public function moveTo(_arg1:Point):void{ if (_isCameraLocked){ return; }; ufoX = (_arg1.x + 320); ufoY = (_arg1.y + 240); var _local2:Number = (_curSceneWidth - CommonVals.STAGE_WIDTH); if ((((_arg1.x > 0)) && ((_arg1.x < _local2)))){ _frontLayer.x = -(_arg1.x); _topLayer.x = -(_arg1.x); _bglayer.x = (-(_arg1.x) * _bgLayerMoveXRatio); } else { if (_arg1.x <= 0){ _frontLayer.x = 0; _topLayer.x = 0; _bglayer.x = 0; } else { if (_arg1.x >= _local2){ _frontLayer.x = -(_local2); _topLayer.x = -(_local2); _bglayer.x = (-(_local2) * _bgLayerMoveXRatio); }; }; }; var _local3:Number = (_curSceneHeight - CommonVals.STAGE_HEIGHT); if ((((_arg1.y > 0)) && ((_arg1.y < _local3)))){ _frontLayer.y = -(_arg1.y); _topLayer.y = -(_arg1.y); _bglayer.y = (-(_arg1.y) * _bgLayerMoveYRatio); }; if (_arg1.y <= 0){ _frontLayer.y = 0; _topLayer.y = 0; _bglayer.y = 0; }; if (_arg1.y >= _local3){ _frontLayer.y = -(_local3); _topLayer.y = -(_local3); _bglayer.y = (-(_local3) * _bgLayerMoveYRatio); }; } public function tweenTo(_arg1:Point, _arg2:Number, _arg3:Boolean=true):void{ var completeTween:Function; var pos = _arg1; var time = _arg2; var isAutoPaused = _arg3; completeTween = function ():void{ if (isAutoPaused){ CommonVals.gamePaused = false; }; _gameEventDispatcher.dispatchEvent(new GameEvent(GameEvent.TWEEN_COMPLETE)); }; if (isAutoPaused){ CommonVals.gamePaused = true; }; var frontLayerEndP:Point = new Point(0, 0); var topLayerEndP:Point = new Point(0, 0); var bgLayerEndP:Point = new Point(0, 0); var rightBorder:Number = (_curSceneWidth - CommonVals.STAGE_WIDTH); if ((((pos.x > 0)) && ((pos.x < rightBorder)))){ frontLayerEndP.x = -(pos.x); topLayerEndP.x = -(pos.x); bgLayerEndP.x = (-(pos.x) * _bgLayerMoveXRatio); } else { if (pos.x <= 0){ frontLayerEndP.x = 0; topLayerEndP.x = 0; bgLayerEndP.x = 0; } else { if (pos.x >= rightBorder){ frontLayerEndP.x = -(rightBorder); topLayerEndP.x = -(rightBorder); bgLayerEndP.x = (-(rightBorder) * _bgLayerMoveXRatio); }; }; }; var downBorder:Number = (_curSceneHeight - CommonVals.STAGE_HEIGHT); if ((((pos.y > 0)) && ((pos.y < downBorder)))){ frontLayerEndP.y = -(pos.y); topLayerEndP.y = -(pos.y); bgLayerEndP.y = (-(pos.y) * _bgLayerMoveYRatio); }; if (pos.y <= 0){ frontLayerEndP.y = 0; topLayerEndP.y = 0; bgLayerEndP.y = 0; }; if (pos.y >= downBorder){ frontLayerEndP.y = -(downBorder); topLayerEndP.y = -(downBorder); bgLayerEndP.y = (-(downBorder) * _bgLayerMoveYRatio); }; TweenLite.to(_frontLayer, time, {x:frontLayerEndP.x, y:frontLayerEndP.y}); TweenLite.to(_topLayer, time, {x:topLayerEndP.x, y:frontLayerEndP.y}); TweenLite.to(_bglayer, time, {x:bgLayerEndP.x, y:bgLayerEndP.y, onComplete:completeTween}); } public function setSceneBounds(_arg1:Number, _arg2:Number):void{ _curSceneWidth = _arg1; _curSceneHeight = _arg2; } public function setBglayerBounds(_arg1:Number, _arg2:Number):void{ _bgLayerWidth = _arg1; _bgLayerHeight = _arg2; _bgLayerMoveXRatio = ((_bgLayerWidth - CommonVals.STAGE_WIDTH) / (_curSceneWidth - CommonVals.STAGE_WIDTH)); if ((_curSceneWidth - CommonVals.STAGE_WIDTH) == 0){ _bgLayerMoveXRatio = 0; }; _bgLayerMoveYRatio = ((_bgLayerHeight - CommonVals.STAGE_HEIGHT) / (_curSceneHeight - CommonVals.STAGE_HEIGHT)); if ((_curSceneHeight - CommonVals.STAGE_HEIGHT) == 0){ _bgLayerMoveYRatio = 0; }; } public function displayOneUp(_arg1:Point):void{ var oneUp:Sprite; var onTweenFinish:Function; var location = _arg1; onTweenFinish = function ():void{ if (_frontLayer.contains(oneUp)){ _frontLayer.removeChild(oneUp); }; }; oneUp = new oneUpSprite(); oneUp.x = location.x; oneUp.y = location.y; _frontLayer.addChild(oneUp); TweenLite.to(oneUp, 1, {x:location.x, y:(location.y - 70), ease:Back.easeOut, onComplete:onTweenFinish}); } public function displayScore(_arg1:int=0, _arg2:Point=null):void{ var scoreSprite:Sprite; var onTweenFinish:Function; var scoreNum = _arg1; var location = _arg2; onTweenFinish = function ():void{ if (_frontLayer.contains(scoreSprite)){ _frontLayer.removeChild(scoreSprite); }; }; _scoreNumSprite.setNumber(ScoreManager.scoreNum); if (location == null){ return; }; switch (scoreNum){ case 20: scoreSprite = new score20(); break; case 10: scoreSprite = new score10(); break; case 50: scoreSprite = new score50(); break; case 100: scoreSprite = new score100(); break; }; scoreSprite.x = location.x; scoreSprite.y = (location.y - 10); _frontLayer.addChild(scoreSprite); TweenLite.to(scoreSprite, 1, {x:location.x, y:(location.y - 50), ease:Back.easeOut, onComplete:onTweenFinish}); } public function addCameraMask():void{ var addComplete:Function; addComplete = function ():void{ UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.CAMERA_MASK_ADDED)); }; _cameraModeStartPos = new Point(-(_frontLayer.x), -(_frontLayer.y)); _cameraMask = new cameraModeMask(); _cameraMask.alpha = 0; _uiLayer.addChild(_cameraMask); TweenLite.to(_cameraMask, 1, {alpha:1, onComplete:addComplete}); } public function removeCameraMask():void{ var removeComplete:Function; removeComplete = function ():void{ if (_uiLayer.contains(_cameraMask)){ _uiLayer.removeChild(_cameraMask); }; _cameraMask = null; UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.CAMERA_MASK_REMOVED)); }; TweenLite.to(_cameraMask, 0.5, {alpha:0, onComplete:removeComplete}); } public function updateCowNum(_arg1:Number, _arg2:Number):void{ _cowText.text = ((String((_arg2 - _arg1)) + "/") + String(_arg2)); var _local3:TextFormat = new TextFormat("Verdana", 14, 0xFFFFFF, true); _cowText.setTextFormat(_local3); } public function showGamePausedPanel():void{ gamePausedPanel = new GamePausePanel(); gamePausedPanel.filters = new Array(new DropShadowFilter()); gamePausedPanel.x = (_stageHalfWidth + 15); gamePausedPanel.y = -150; _uiLayer.addChild(gamePausedPanel); TweenLite.to(gamePausedPanel, 1, {y:_stageHalfHeight, ease:Back.easeOut}); } public function hideGamePausedPanel():void{ var onHide:Function; onHide = function ():void{ CommonVals.gamePaused = false; CommonVals.gameLocked = false; gamePausedPanel.parent.removeChild(gamePausedPanel); stage.stage.stageFocusRect = false; stage.stage.focus = stage; gamePausedPanel = null; }; if (gamePausedPanel != null){ TweenLite.to(gamePausedPanel, 1, {y:-150, ease:Back.easeIn, onComplete:onHide}); }; } public function showControllerPanel():void{ controllerPanel = new ControllerPanel(); controllerPanel.filters = new Array(new DropShadowFilter()); controllerPanel.x = (_stageHalfWidth + 15); controllerPanel.y = -150; _uiLayer.addChild(controllerPanel); TweenLite.to(controllerPanel, 1, {y:_stageHalfHeight, ease:Back.easeOut}); } public function hideControllerPanel():void{ var onMouseMove:Function; var onHide:Function; onMouseMove = function (_arg1:Event):void{ if (++moveCount > 60){ UIManager.stage.removeEventListener(Event.ENTER_FRAME, onMouseMove); CommonVals.ufoMouseLocked = false; }; }; onHide = function ():void{ if (controllerPanel != null){ controllerPanel.parent.removeChild(controllerPanel); controllerPanel = null; }; UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.QUIT_CONTROLLER_PANEL)); stage.stage.stageFocusRect = false; stage.stage.focus = stage; }; if (controllerPanel != null){ TweenLite.to(controllerPanel, 0.5, {y:-150, ease:Back.easeIn, onComplete:onHide}); }; CommonVals.ufoMouseLocked = true; UIManager.stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouseMove); var moveCount:int; } public function showGameOverPanel():void{ var _local1:GameOverPanel = new GameOverPanel(); _local1.filters = new Array(new DropShadowFilter()); _local1.x = (_stageHalfWidth + 15); _local1.y = -150; _uiLayer.addChild(_local1); TweenLite.to(_local1, 1, {y:_stageHalfHeight, ease:Back.easeOut}); } public function showLevelCompletePanel():void{ var _local1:LevelCompletePanel = new LevelCompletePanel(); _local1.filters = new Array(new DropShadowFilter()); _local1.x = (_stageHalfWidth + 15); _local1.y = -150; _uiLayer.addChild(_local1); TweenLite.to(_local1, 1, {y:_stageHalfHeight, ease:Back.easeOut}); } public function get frontLayer():Sprite{ return (_frontLayer); } public function set frontLayer(_arg1:Sprite):void{ _frontLayer = _arg1; } public function get lowerBound():Point{ return (_lowerBound); } public function set lowerBound(_arg1:Point):void{ _lowerBound = _arg1; } public function get upperBound():Point{ return (_upperBound); } public function set upperBound(_arg1:Point):void{ _upperBound = _arg1; } public function get bglayer():Sprite{ return (_bglayer); } public function set bglayer(_arg1:Sprite):void{ _bglayer = _arg1; } public function get topLayer():Sprite{ return (_topLayer); } public function set topLayer(_arg1:Sprite):void{ _topLayer = _arg1; } public function get isCameraLocked():Boolean{ return (_isCameraLocked); } public function set isCameraLocked(_arg1:Boolean):void{ _isCameraLocked = _arg1; } public function get uiLayer():Sprite{ return (_uiLayer); } public function set uiLayer(_arg1:Sprite):void{ _uiLayer = _arg1; } public function get cameraModeStartPos():Point{ return (_cameraModeStartPos); } public function set cameraModeStartPos(_arg1:Point):void{ _cameraModeStartPos = _arg1; } public static function getInstance():Camera{ if (_instance == null){ _instance = new Camera(new SingletonEnforcer()); }; return (_instance); } } }//package com.tinime.view class SingletonEnforcer { private function SingletonEnforcer(){ } }
Section 165
//CircleTransition (com.tinime.view.CircleTransition) package com.tinime.view { import flash.display.*; import com.tinime.data.*; import flash.events.*; import com.tinime.event.*; public class CircleTransition { private static var isScreenCoveredEventSent:Boolean; private static var waitCount:int = 0; public static function transitionIn():void{ var _local1:Sprite; _local1 = prepareSprites(); _local1.scaleX = 1; _local1.scaleY = 1; var _local2:Number = 0.01; var _local3:int = 20; waitCount = 0; var _local4:int = 100; var _local5:int = (_local4 + (Math.random() * (CommonVals.STAGE_WIDTH - (2 * _local4)))); var _local6:int = (_local4 + (Math.random() * (CommonVals.STAGE_HEIGHT - (2 * _local4)))); _local1.x = _local5; _local1.y = _local6; var _local7:Number = 0.05; _local1.addEventListener(Event.ENTER_FRAME, onTransitionIn); isScreenCoveredEventSent = false; } public static function transitionOut():void{ var _local1:Sprite = prepareSprites(); _local1.scaleX = 0.01; _local1.scaleY = 0.01; var _local2:int = 100; var _local3:int = (_local2 + (Math.random() * (CommonVals.STAGE_WIDTH - (2 * _local2)))); var _local4:int = (_local2 + (Math.random() * (CommonVals.STAGE_HEIGHT - (2 * _local2)))); _local1.x = _local3; _local1.y = _local4; _local1.addEventListener(Event.ENTER_FRAME, onTransitionOut); } private static function onTransitionIn(_arg1:Event):void{ var _local2:Sprite = Sprite(_arg1.target); _local2.scaleX = (_local2.scaleX - 0.05); _local2.scaleY = (_local2.scaleY - 0.05); if (_local2.scaleX <= 0.05){ if (!(isScreenCoveredEventSent)){ isScreenCoveredEventSent = true; UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.SCREEN_COVERED)); }; _local2.scaleX = 0; _local2.scaleY = 0; waitCount++; if (waitCount > 20){ _local2.removeEventListener(Event.ENTER_FRAME, onTransitionIn); UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.CIRCLE_TRANSITION_COMPLETE)); }; }; } private static function onTransitionOut(_arg1:Event):void{ var _local2:Sprite = Sprite(_arg1.target); _local2.scaleX = (_local2.scaleX + 0.06); _local2.scaleY = (_local2.scaleY + 0.06); if (_local2.scaleX >= 0.99){ _local2.removeEventListener(Event.ENTER_FRAME, onTransitionOut); UIManager.stage.mask = null; UIManager.stage.stage.removeChild(_local2); _local2 = null; UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.CIRCLE_TRANSITION_COMPLETE)); }; } private static function prepareSprites():Sprite{ var _local1:Sprite = new Sprite(); _local1.graphics.beginFill(0); _local1.graphics.drawCircle(0, 0, CommonVals.STAGE_WIDTH); _local1.graphics.endFill(); UIManager.stage.stage.addChild(_local1); UIManager.stage.mask = _local1; _local1.cacheAsBitmap = true; _local1.mouseEnabled = false; return (_local1); } } }//package com.tinime.view
Section 166
//ControllerPanel (com.tinime.view.ControllerPanel) package com.tinime.view { import flash.events.*; import com.tinime.control.*; import com.tinime.data.*; import com.tinime.event.*; import flash.display.*; public class ControllerPanel extends Sprite { private var mouseButton:SimpleButton; private var keyboardButton:SimpleButton; public function ControllerPanel(){ var _local1:ControllerPanelSprLib = new ControllerPanelSprLib(); mouseButton = _local1.mouseBtn; keyboardButton = _local1.keyboardBtn; addChild(_local1); mouseButton.addEventListener(MouseEvent.CLICK, onClickMouse); keyboardButton.addEventListener(MouseEvent.CLICK, onClickKeyBoard); } private function onClickKeyBoard(_arg1:MouseEvent):void{ mouseButton.removeEventListener(MouseEvent.CLICK, onClickMouse); keyboardButton.removeEventListener(MouseEvent.CLICK, onClickKeyBoard); keyboardButton.mouseEnabled = false; keyboardButton.upState = keyboardButton.overState; LevelController.getInstance().isConntrolledByMouse = false; CommonVals.controllerSetted = true; Camera.getInstance().hideControllerPanel(); } private function onClickMouse(_arg1:MouseEvent):void{ mouseButton.removeEventListener(MouseEvent.CLICK, onClickMouse); keyboardButton.removeEventListener(MouseEvent.CLICK, onClickKeyBoard); mouseButton.mouseEnabled = false; mouseButton.upState = mouseButton.overState; LevelController.getInstance().isConntrolledByMouse = true; CommonVals.controllerSetted = true; UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.QUIT_CONTROLLER_PANEL)); Camera.getInstance().hideControllerPanel(); } } }//package com.tinime.view
Section 167
//CreditsScreen (com.tinime.view.CreditsScreen) package com.tinime.view { import flash.display.*; import flash.events.*; import com.tinime.control.*; import com.tinime.event.*; import com.tinime.interfaces.*; public class CreditsScreen extends Sprite implements ClickEventWaitable { private var backButton:SimpleButton; private var isClickable:Boolean; public function CreditsScreen(){ var _local1:Sprite = new CreditsScreenSprite(); addChild(_local1); backButton = new BackBtn(); backButton.x = 526; backButton.y = 438; isClickable = false; addChild(backButton); backButton.addEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); } public function setClickable(_arg1:Boolean):void{ isClickable = _arg1; } private function onBackMenuBtnClicked(_arg1:MouseEvent=null):void{ if (!(isClickable)){ return; }; backButton.mouseEnabled = false; backButton.upState = backButton.overState; backButton.removeEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_MENU_SCREEN)); } } }//package com.tinime.view
Section 168
//GameOverPanel (com.tinime.view.GameOverPanel) package com.tinime.view { import flash.text.*; import com.tinime.control.*; import flash.events.*; import flash.utils.*; import com.tinime.event.*; import com.greensock.*; import com.greensock.easing.*; import com.tinime.data.*; import flash.display.*; public class GameOverPanel extends Sprite { private var tryAgainButton:SimpleButton; private var submitScoreButton:SimpleButton; private var quitButton:SimpleButton; private var timer:Timer; private var isWaiting:Boolean; private var submitScorePanel:SubmitScorePanel; private var originalSubmitUpState:DisplayObject; public function GameOverPanel(){ var _local1:GameOverPanelSprite = new GameOverPanelSprite(); tryAgainButton = _local1.tryAgainBtn; submitScoreButton = _local1.submitScoreBtn; quitButton = _local1.quitBtn; var _local2:TextField = new TextField(); _local2.text = String(ScoreManager.scoreNum); _local2.x = -62.7; _local2.y = -90.7; _local2.selectable = false; _local2.autoSize = TextFieldAutoSize.LEFT; var _local3:TextFormat = new TextFormat("Verdana", 18, 0xFFFFFF, true); _local2.setTextFormat(_local3); _local1.addChild(_local2); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); tryAgainButton.addEventListener(MouseEvent.CLICK, onTryAgain); submitScoreButton.addEventListener(MouseEvent.CLICK, onSubmitScore); quitButton.addEventListener(MouseEvent.CLICK, onQuit); addChild(_local1); if (ScoreManager.scoreNum == 0){ submitScoreButton.visible = false; }; isWaiting = true; timer = new Timer(1000, 1); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); } private function onTimer(_arg1:TimerEvent):void{ if (isWaiting){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); timer = new Timer(100, 10000000); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); isWaiting = false; } else { if (Input.spaceHold){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); onTryAgain(); }; }; } private function onQuit(_arg1:MouseEvent):void{ tryAgainButton.mouseEnabled = false; submitScoreButton.mouseEnabled = false; quitButton.mouseEnabled = false; quitButton.upState = quitButton.overState; SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); tryAgainButton.removeEventListener(MouseEvent.CLICK, onTryAgain); submitScoreButton.removeEventListener(MouseEvent.CLICK, onSubmitScore); quitButton.removeEventListener(MouseEvent.CLICK, onQuit); } private function onSubmitScore(_arg1:MouseEvent):void{ tryAgainButton.mouseEnabled = false; submitScoreButton.mouseEnabled = false; quitButton.mouseEnabled = false; originalSubmitUpState = submitScoreButton.upState; submitScoreButton.upState = submitScoreButton.overState; SoundManager.playButtonClick(); TweenLite.to(this, 1, {y:-150, ease:Back.easeIn, onComplete:onHideGameOverPanel}); submitScorePanel = new SubmitScorePanel(); submitScorePanel.x = this.x; submitScorePanel.y = -150; } private function onHideGameOverPanel():void{ parent.addChild(submitScorePanel); TweenLite.to(submitScorePanel, 1, {y:(CommonVals.STAGE_HEIGHT * 0.5), ease:Back.easeOut}); UIEventDispatcher.getInstance().addEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onHideScorePanel():void{ submitScorePanel.parent.removeChild(submitScorePanel); submitScorePanel = null; TweenLite.to(this, 1, {y:(CommonVals.STAGE_HEIGHT * 0.5), ease:Back.easeOut}); } private function onQuitScoreSubmitPanel(_arg1:UIEvent):void{ tryAgainButton.mouseEnabled = true; submitScoreButton.mouseEnabled = true; quitButton.mouseEnabled = true; submitScoreButton.upState = originalSubmitUpState; UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); TweenLite.to(submitScorePanel, 1, {y:-150, ease:Back.easeIn, onComplete:onHideScorePanel}); } private function onTryAgain(_arg1:MouseEvent=null):void{ tryAgainButton.mouseEnabled = false; submitScoreButton.mouseEnabled = false; quitButton.mouseEnabled = false; tryAgainButton.upState = tryAgainButton.overState; SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.RESTART_LEVEL)); tryAgainButton.removeEventListener(MouseEvent.CLICK, onTryAgain); submitScoreButton.removeEventListener(MouseEvent.CLICK, onSubmitScore); quitButton.removeEventListener(MouseEvent.CLICK, onQuit); } private function onRemovedFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); timer.removeEventListener(TimerEvent.TIMER, onTimer); UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } } }//package com.tinime.view
Section 169
//GamePausePanel (com.tinime.view.GamePausePanel) package com.tinime.view { import flash.events.*; import com.tinime.control.*; import flash.utils.*; import com.tinime.event.*; import com.greensock.*; import com.greensock.easing.*; import com.tinime.data.*; import flash.display.*; public class GamePausePanel extends Sprite { private var resumeButton:SimpleButton; private var restartButton:SimpleButton; private var quitButton:SimpleButton; private var submitScorePanel:SubmitScorePanel; private var timer:Timer; private var isWaiting:Boolean; private var keyBoardButton:SimpleButton; private var mouseButton:SimpleButton; private var keyBoardOrigUpStatus:DisplayObject; private var mouseOrigUpStatus:DisplayObject; public function GamePausePanel(){ var _local1:GamePausePanelSprite = new GamePausePanelSprite(); addEventListener(Event.ADDED_TO_STAGE, onAddToStage); addChild(_local1); resumeButton = _local1.resumeBtn; restartButton = _local1.restartBtn; quitButton = _local1.quitBtn; keyBoardButton = _local1.keyboardBtn; mouseButton = _local1.mouseBtn; keyBoardOrigUpStatus = keyBoardButton.upState; mouseOrigUpStatus = mouseButton.upState; if (LevelController.getInstance().isConntrolledByMouse){ mouseButton.mouseEnabled = false; mouseButton.upState = mouseButton.overState; } else { keyBoardButton.mouseEnabled = false; keyBoardButton.upState = keyBoardButton.overState; }; resumeButton.addEventListener(MouseEvent.CLICK, onResumeClick); restartButton.addEventListener(MouseEvent.CLICK, onRestartClick); quitButton.addEventListener(MouseEvent.CLICK, onQuitClick); keyBoardButton.addEventListener(MouseEvent.CLICK, onClickKeyboard); mouseButton.addEventListener(MouseEvent.CLICK, onClickMouse); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); isWaiting = true; timer = new Timer(1000, 1); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); } private function onClickMouse(_arg1:MouseEvent):void{ if (LevelController.getInstance().isConntrolledByMouse){ return; }; mouseButton.mouseEnabled = false; mouseButton.upState = mouseButton.overState; keyBoardButton.mouseEnabled = true; keyBoardButton.upState = keyBoardOrigUpStatus; LevelController.getInstance().isConntrolledByMouse = true; } private function onClickKeyboard(_arg1:MouseEvent):void{ if (!(LevelController.getInstance().isConntrolledByMouse)){ return; }; keyBoardButton.mouseEnabled = false; keyBoardButton.upState = keyBoardButton.overState; mouseButton.mouseEnabled = true; mouseButton.upState = mouseOrigUpStatus; LevelController.getInstance().isConntrolledByMouse = false; } private function onAddToStage(_arg1:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAddToStage); } private function onTimer(_arg1:TimerEvent):void{ if (isWaiting){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); timer = new Timer(100, 10000000); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); isWaiting = false; } else { if (Input.spaceHold){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.GAME_RESUMED)); }; }; } private function onRemovedFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); resumeButton.removeEventListener(MouseEvent.CLICK, onResumeClick); restartButton.removeEventListener(MouseEvent.CLICK, onRestartClick); keyBoardButton.removeEventListener(MouseEvent.CLICK, onClickKeyboard); mouseButton.removeEventListener(MouseEvent.CLICK, onClickMouse); quitButton.removeEventListener(MouseEvent.CLICK, onQuitClick); timer.removeEventListener(TimerEvent.TIMER, onTimer); UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onQuitClick(_arg1:MouseEvent):void{ quitButton.mouseEnabled = false; resumeButton.mouseEnabled = false; restartButton.mouseEnabled = false; quitButton.upState = quitButton.overState; resumeButton.removeEventListener(MouseEvent.CLICK, onResumeClick); restartButton.removeEventListener(MouseEvent.CLICK, onRestartClick); quitButton.removeEventListener(MouseEvent.CLICK, onQuitClick); SoundManager.playButtonClick(); if (ScoreManager.scoreNum != 0){ submitScorePanel = new SubmitScorePanel(true); TweenLite.to(this, 1, {y:-150, ease:Back.easeIn, onComplete:onHideGamePausePanel}); submitScorePanel.x = this.x; submitScorePanel.y = -150; } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); }; } private function onHideGamePausePanel():void{ parent.addChild(submitScorePanel); TweenLite.to(submitScorePanel, 1, {y:(CommonVals.STAGE_HEIGHT * 0.5), ease:Back.easeOut}); UIEventDispatcher.getInstance().addEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onQuitScoreSubmitPanel(_arg1:UIEvent):void{ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onRestartClick(_arg1:MouseEvent):void{ quitButton.mouseEnabled = false; resumeButton.mouseEnabled = false; restartButton.mouseEnabled = false; restartButton.upState = restartButton.overState; resumeButton.removeEventListener(MouseEvent.CLICK, onResumeClick); restartButton.removeEventListener(MouseEvent.CLICK, onRestartClick); quitButton.removeEventListener(MouseEvent.CLICK, onQuitClick); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.RESTART_LEVEL)); } private function onResumeClick(_arg1:MouseEvent):void{ quitButton.mouseEnabled = false; resumeButton.mouseEnabled = false; restartButton.mouseEnabled = false; resumeButton.upState = resumeButton.overState; resumeButton.removeEventListener(MouseEvent.CLICK, onResumeClick); restartButton.removeEventListener(MouseEvent.CLICK, onRestartClick); quitButton.removeEventListener(MouseEvent.CLICK, onQuitClick); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.GAME_RESUMED)); } } }//package com.tinime.view
Section 170
//LevelCompletePanel (com.tinime.view.LevelCompletePanel) package com.tinime.view { import flash.text.*; import com.tinime.control.*; import flash.events.*; import flash.utils.*; import com.tinime.data.*; import com.tinime.event.*; import com.greensock.*; import com.greensock.easing.*; import flash.display.*; public class LevelCompletePanel extends Sprite { private var continueButton:SimpleButton; private var quitButton:SimpleButton; private var submitScorePanel:SubmitScorePanel; private var timer:Timer; private var isWaiting:Boolean; public function LevelCompletePanel(){ var _local2:TextFormat; var _local3:TextField; super(); var _local1:LevelCompletePanelSprite = new LevelCompletePanelSprite(); addChild(_local1); _local2 = new TextFormat("Verdana", 14, 0xFFFFFF, true); _local3 = new TextField(); _local3.x = -80; _local3.y = -73; _local3.selectable = false; _local3.text = String(ScoreManager.levelScoreNum); _local3.setTextFormat(_local2); _local3.autoSize = TextFieldAutoSize.LEFT; var _local4:TextField = new TextField(); _local4.x = -80; _local4.y = -42; _local4.selectable = false; _local4.text = String(ScoreManager.scoreNum); _local4.autoSize = TextFieldAutoSize.LEFT; _local4.setTextFormat(_local2); _local1.addChild(_local3); _local1.addChild(_local4); continueButton = _local1.continueBtn; quitButton = _local1.quitBtn; continueButton.addEventListener(MouseEvent.CLICK, onContinue); quitButton.addEventListener(MouseEvent.CLICK, onQuit); var _local5:LevelController = LevelController.getInstance(); var _local6:NumberSprite = new NumberSprite(_local5.totalCowNum); var _local7:NumberSprite = new NumberSprite(_local5.dogSavedNum); var _local8:NumberSprite = new NumberSprite(_local5.catSavedNum); var _local9:NumberSprite = new NumberSprite(_local5.starSavedNum); _local6.x = -145; _local6.y = -7; _local8.x = -55; _local8.y = -7; _local7.x = 34; _local7.y = -7; _local9.x = 115; _local9.y = -7; _local1.addChild(_local6); _local1.addChild(_local7); _local1.addChild(_local8); _local1.addChild(_local9); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); isWaiting = true; timer = new Timer(1000, 1); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); if (LevelController.curLevelNum == 25){ CommonVals.allLevelComplete = true; }; } private function onTimer(_arg1:TimerEvent):void{ if (isWaiting){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); timer = new Timer(100, 10000000); timer.addEventListener(TimerEvent.TIMER, onTimer); timer.start(); isWaiting = false; } else { if (Input.spaceHold){ timer.removeEventListener(TimerEvent.TIMER, onTimer); timer.stop(); if (CommonVals.allLevelComplete){ onQuit(); } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.START_NEXT_LEVEL)); }; }; }; } private function onRemovedFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); continueButton.removeEventListener(MouseEvent.CLICK, onContinue); quitButton.removeEventListener(MouseEvent.CLICK, onQuit); timer.removeEventListener(TimerEvent.TIMER, onTimer); UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onQuit(_arg1:MouseEvent=null):void{ continueButton.mouseEnabled = false; quitButton.mouseEnabled = false; if (_arg1 != null){ quitButton.upState = quitButton.overState; }; continueButton.removeEventListener(MouseEvent.CLICK, onContinue); quitButton.removeEventListener(MouseEvent.CLICK, onQuit); SoundManager.playButtonClick(); if (ScoreManager.scoreNum != 0){ TweenLite.to(this, 1, {y:-150, ease:Back.easeIn, onComplete:onHideLevelCompletePanel}); submitScorePanel = new SubmitScorePanel(true); submitScorePanel.x = this.x; submitScorePanel.y = -150; } else { if (!(CommonVals.allLevelComplete)){ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.ALL_LEVELS_COMPLETE)); }; }; } private function onHideLevelCompletePanel():void{ parent.addChild(submitScorePanel); TweenLite.to(submitScorePanel, 1, {y:(CommonVals.STAGE_HEIGHT * 0.5), ease:Back.easeOut}); UIEventDispatcher.getInstance().addEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); } private function onQuitScoreSubmitPanel(_arg1:UIEvent):void{ UIEventDispatcher.getInstance().removeEventListener(UIEvent.QUIT_SCORE_SUBMIT_PANEL, onQuitScoreSubmitPanel); if (CommonVals.allLevelComplete){ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.ALL_LEVELS_COMPLETE)); } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); }; } private function onContinue(_arg1:MouseEvent):void{ continueButton.mouseEnabled = false; quitButton.mouseEnabled = false; continueButton.upState = continueButton.overState; if (CommonVals.allLevelComplete){ onQuit(); return; }; continueButton.removeEventListener(MouseEvent.CLICK, onContinue); quitButton.removeEventListener(MouseEvent.CLICK, onQuit); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.START_NEXT_LEVEL)); } } }//package com.tinime.view
Section 171
//MedalScreen (com.tinime.view.MedalScreen) package com.tinime.view { import flash.display.*; import flash.events.*; import com.tinime.control.*; import spill.localisation.*; import com.tinime.event.*; import com.tinime.interfaces.*; public class MedalScreen extends Sprite implements ClickEventWaitable { private var backButton:SimpleButton; private var _medalArr:Array; private var _rollOverSprite:Sprite; private var isClickable:Boolean; public function MedalScreen(){ var _local1:Sprite = new MedalScreenSprite(); addChild(_local1); backButton = new BackBtn(); backButton.x = 526; backButton.y = 438; addChild(backButton); isClickable = false; addMedals(); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); backButton.addEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); } private function onRemovedFromStage(_arg1:Event):void{ var _local3:Sprite; removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); var _local2:int; while (_local2 < _medalArr.length) { _local3 = _medalArr[_local2]; _local3.removeEventListener(MouseEvent.ROLL_OVER, onRolloverMedal); _local3.removeEventListener(MouseEvent.ROLL_OUT, onRollOutMedal); _local2++; }; } private function addMedals():void{ var _local7:Sprite; _medalArr = new Array(); var _local1:Number = MedalsManager.totalMedalsNum; var _local2:Number = 113; var _local3:Number = 140; var _local4:Number = 3; var _local5:Number = 10; var _local6:Number = 0; while (_local6 < _local1) { if (MedalsManager.earnedMedals == null){ _local7 = new MedalUncoveredSprLib(); } else { if (MedalsManager.earnedMedals.indexOf(_local6) == -1){ _local7 = new MedalUncoveredSprLib(); } else { _local7 = MedalsManager.getMedalSprite(_local6); _local7.addEventListener(MouseEvent.ROLL_OVER, onRolloverMedal); _local7.addEventListener(MouseEvent.ROLL_OUT, onRollOutMedal); }; }; _local7.x = (_local2 + ((80 + _local4) * (_local6 % 5))); _local7.y = (_local3 + ((80 + _local5) * Math.floor((_local6 / 5)))); addChild(_local7); _medalArr.push(_local7); _local6++; }; } private function onRolloverMedal(_arg1:MouseEvent):void{ _rollOverSprite = new Sprite(); _rollOverSprite.x = (Sprite(_arg1.currentTarget).x + 20); _rollOverSprite.y = (Sprite(_arg1.currentTarget).y + 20); _rollOverSprite.mouseEnabled = false; var _local2:int = _medalArr.indexOf(_arg1.currentTarget); var _local3:LocalizedTextField = new LocalizedTextField(); _local3.text = MedalsManager.medalsText[_local2].title; var _local4:LocalizedTextField = new LocalizedTextField(); _local4.text = MedalsManager.medalsText[_local2].depict; _local3.textColor = 0xFFFFFF; _local4.textColor = 0xFFFFFF; _local3.mouseEnabled = false; _local4.mouseEnabled = false; _local3.useGlowFilter = true; _local4.useGlowFilter = true; _local3.x = 0; _local3.y = 0; _local4.x = 0; _local4.y = 15; _rollOverSprite.addChild(_local3); _rollOverSprite.addChild(_local4); addChild(_rollOverSprite); } private function onRollOutMedal(_arg1:MouseEvent):void{ if (_rollOverSprite != null){ removeChild(_rollOverSprite); _rollOverSprite = null; }; } public function setClickable(_arg1:Boolean):void{ isClickable = _arg1; } private function onBackMenuBtnClicked(_arg1:MouseEvent):void{ if (!(isClickable)){ return; }; backButton.mouseEnabled = false; backButton.upState = backButton.overState; backButton.removeEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_MENU_SCREEN)); } } }//package com.tinime.view
Section 172
//NumberSprite (com.tinime.view.NumberSprite) package com.tinime.view { import flash.display.*; import flash.utils.*; public class NumberSprite extends Sprite { public function NumberSprite(_arg1:int=0){ setNumber(_arg1); } public function setNumber(_arg1:int):void{ var _local5:int; var _local6:Class; var _local7:Sprite; while (numChildren) { removeChildAt(0); }; var _local2:int = String(_arg1).length; var _local3:Number = Math.pow(10, (_local2 - 1)); var _local4:int; while (_local3 >= 1) { _local5 = Math.floor((_arg1 / int(_local3))); _local6 = (getDefinitionByName((("Num" + _local5) + "SprLib")) as Class); _local7 = new (_local6); _local7.x = (18 * _local4); _local4++; addChild(_local7); _local7.cacheAsBitmap = true; _arg1 = (_arg1 - (_local5 * _local3)); _local3 = (_local3 / 10); }; } } }//package com.tinime.view
Section 173
//ScoresScreen (com.tinime.view.ScoresScreen) package com.tinime.view { import flash.display.*; import flash.events.*; import com.tinime.control.*; import com.tinime.event.*; import com.tinime.interfaces.*; public class ScoresScreen extends Sprite implements ClickEventWaitable { private var backButton:SimpleButton; private var isClickable:Boolean; public function ScoresScreen(){ var _local1:Sprite = new ScoresScreenSprite(); addChild(_local1); backButton = new BackBtn(); backButton.x = 526; backButton.y = 438; addChild(backButton); backButton.addEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); isClickable = false; } public function setClickable(_arg1:Boolean):void{ isClickable = _arg1; } private function onBackMenuBtnClicked(_arg1:MouseEvent):void{ if (!(isClickable)){ return; }; backButton.mouseEnabled = false; backButton.upState = backButton.overState; backButton.removeEventListener(MouseEvent.CLICK, onBackMenuBtnClicked); SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_MENU_SCREEN)); } } }//package com.tinime.view
Section 174
//SelectLevelScreen (com.tinime.view.SelectLevelScreen) package com.tinime.view { import flash.display.*; import com.tinime.control.*; import flash.events.*; import com.tinime.levels.*; import flash.text.*; import flash.utils.*; import spill.localisation.*; import com.tinime.event.*; import com.tinime.interfaces.*; public class SelectLevelScreen extends Sprite implements ClickEventWaitable { private var backButton:SimpleButton; private var preButton:SimpleButton; private var nextButton:SimpleButton; private var preTextMc:LocalizedTextField; private var nextTextMc:LocalizedTextField; private var maxLevel:int; private var levelButtonsContainer:Sprite; private var levelUnleashed:int; private var curStartLevel:int; private var isClickable:Boolean; public function SelectLevelScreen(){ var _local1:LevelScreenSprLib = new LevelScreenSprLib(); backButton = _local1.backBtn; preButton = _local1.preBtn; nextButton = _local1.nextBtn; preTextMc = _local1.prevTextMc; nextTextMc = _local1.nextTextMc; addChild(_local1); isClickable = false; levelButtonsContainer = new Sprite(); levelButtonsContainer.x = 42; levelButtonsContainer.y = 104; addChild(levelButtonsContainer); levelUnleashed = LevelController.levelUnleashed; if (levelUnleashed == 0){ levelUnleashed = 1; }; isClickable = false; backButton.addEventListener(MouseEvent.CLICK, onBackClicked); preButton.addEventListener(MouseEvent.CLICK, onPreClicked); nextButton.addEventListener(MouseEvent.CLICK, onNextClicked); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); maxLevel = LevelsData.allLevels.length; curStartLevel = 1; setLevelButtons(curStartLevel); } private function setLevelButtons(_arg1:int):void{ var _local8:Class; var _local9:MovieClip; var _local10:TextField; while (levelButtonsContainer.numChildren != 0) { levelButtonsContainer.removeChildAt(0); }; if (_arg1 == 1){ preButton.visible = false; preTextMc.visible = false; nextButton.visible = true; nextTextMc.visible = true; } else { if (_arg1 == 21){ preButton.visible = true; preTextMc.visible = true; nextButton.visible = false; nextTextMc.visible = false; } else { preButton.visible = true; preTextMc.visible = true; nextButton.visible = true; nextTextMc.visible = true; }; }; var _local2:int; var _local3:int; var _local4:int = 114; var _local5:int = 110; var _local6:Boolean; var _local7:int = _arg1; while (_local7 <= (_arg1 + 9)) { if (_local7 > maxLevel){ break; }; _local8 = (getDefinitionByName((("LevelSel" + _local7) + "McLib")) as Class); _local9 = new (_local8); if ((((_local7 > (_arg1 + 4))) && (!(_local6)))){ _local2 = 0; _local3 = (_local3 + _local5); _local6 = true; }; _local9.x = _local2; _local9.y = _local3; _local2 = (_local2 + _local4); levelButtonsContainer.addChild(_local9); if (_local7 <= levelUnleashed){ _local9.gotoAndStop(10); _local9.mouseEnabled = true; _local9.useHandCursor = true; _local9.buttonMode = true; _local10 = new TextField(); _local10.text = String(_local7); _local10.selectable = false; _local10.visible = false; _local9.addChildAt(_local10, 0); _local9.addEventListener(MouseEvent.ROLL_OUT, onRollOutButton); _local9.addEventListener(MouseEvent.ROLL_OVER, onRollOverButton); _local9.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedButtonFromStage); _local9.addEventListener(MouseEvent.CLICK, onClickButton); } else { _local9.gotoAndStop(1); }; _local7++; }; } private function onRemovedButtonFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedButtonFromStage); _arg1.target.removeEventListener(MouseEvent.ROLL_OUT, onRollOutButton); _arg1.target.removeEventListener(MouseEvent.ROLL_OVER, onRollOverButton); _arg1.target.removeEventListener(MouseEvent.CLICK, onClickButton); } private function onClickButton(_arg1:MouseEvent):void{ if (!(isClickable)){ return; }; MovieClip(_arg1.target).mouseEnabled = false; isClickable = false; SoundManager.playButtonClick(); var _local2:int = int(TextField(MovieClip(_arg1.target).getChildAt(0)).text); LevelController.curLevelNum = _local2; GameLoopControl.getInstance().gameTracker.beginLevel(_local2, 0); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_GAME_PLAY_SCREEN)); } private function onRollOverButton(_arg1:MouseEvent):void{ MovieClip(_arg1.target).gotoAndStop(20); } private function onRollOutButton(_arg1:MouseEvent):void{ MovieClip(_arg1.target).gotoAndStop(10); } private function onRemovedFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); backButton.removeEventListener(MouseEvent.CLICK, onBackClicked); preButton.removeEventListener(MouseEvent.CLICK, onPreClicked); nextButton.removeEventListener(MouseEvent.CLICK, onNextClicked); } private function onNextClicked(_arg1:MouseEvent):void{ if (!(isClickable)){ return; }; SoundManager.playButtonClick(); var _local2:int = (curStartLevel + 10); if (_local2 < maxLevel){ curStartLevel = _local2; setLevelButtons(curStartLevel); }; } private function onPreClicked(_arg1:MouseEvent):void{ if (!(isClickable)){ return; }; SoundManager.playButtonClick(); var _local2:int = (curStartLevel - 10); if (_local2 > 0){ curStartLevel = _local2; setLevelButtons(curStartLevel); }; } private function onBackClicked(_arg1:MouseEvent):void{ backButton.mouseEnabled = false; backButton.upState = backButton.overState; if (!(isClickable)){ return; }; isClickable = false; SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_MENU_SCREEN)); } public function setClickable(_arg1:Boolean):void{ isClickable = _arg1; } } }//package com.tinime.view
Section 175
//SubmitScorePanel (com.tinime.view.SubmitScorePanel) package com.tinime.view { import flash.text.*; import com.tinime.control.*; import flash.events.*; import com.tinime.event.*; import com.tinime.data.*; import com.spilgames.api.*; import flash.display.*; public class SubmitScorePanel extends Sprite { private var _submitButton:SimpleButton; private var _cancelButton:SimpleButton; private var _quitBtn:SimpleButton; public function SubmitScorePanel(_arg1:Boolean=false){ var _local2:ScoreSubmitPanelSprLib; super(); _local2 = new ScoreSubmitPanelSprLib(); addChild(_local2); _submitButton = _local2.submitBtn; _cancelButton = _local2.cancelBtn; _quitBtn = _local2.quitBtn; var _local3:TextField = new TextField(); _local3.text = String(ScoreManager.scoreNum); _local3.selectable = false; _local3.setTextFormat(new TextFormat("Arial", 18, 0xFFFFFF, true)); _local3.x = -88; _local3.y = -45; _local3.multiline = false; _local3.mouseEnabled = false; _local2.addChild(_local3); if (_arg1){ _cancelButton.visible = false; _quitBtn.addEventListener(MouseEvent.CLICK, canclAction); } else { _quitBtn.visible = false; _cancelButton.addEventListener(MouseEvent.CLICK, canclAction); }; _submitButton.addEventListener(MouseEvent.CLICK, submitScore); addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } private function onRemovedFromStage(_arg1:Event):void{ removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); _submitButton.removeEventListener(MouseEvent.CLICK, submitScore); _cancelButton.removeEventListener(MouseEvent.CLICK, canclAction); } private function canclAction(_arg1:MouseEvent):void{ _submitButton.mouseEnabled = false; _cancelButton.mouseEnabled = false; _quitBtn.mouseEnabled = false; SoundManager.playButtonClick(); _submitButton.removeEventListener(MouseEvent.CLICK, submitScore); _cancelButton.removeEventListener(MouseEvent.CLICK, canclAction); _quitBtn.removeEventListener(MouseEvent.CLICK, canclAction); UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.QUIT_SCORE_SUBMIT_PANEL)); } private function submitScore(_arg1:MouseEvent):void{ var e = _arg1; var onCloseSubmitScore:Function = function ():void{ if (CommonVals.allLevelComplete){ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.ALL_LEVELS_COMPLETE)); } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); }; }; _submitButton.mouseEnabled = false; _cancelButton.mouseEnabled = false; _quitBtn.mouseEnabled = false; SoundManager.playButtonClick(); _submitButton.removeEventListener(MouseEvent.CLICK, submitScore); _cancelButton.removeEventListener(MouseEvent.CLICK, canclAction); _quitBtn.removeEventListener(MouseEvent.CLICK, canclAction); ScoreService.submitScore(ScoreManager.scoreNum); if (CommonVals.allLevelComplete){ GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.ALL_LEVELS_COMPLETE)); } else { GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.QUIT_GAME)); }; } } }//package com.tinime.view
Section 176
//TutorialDialog (com.tinime.view.TutorialDialog) package com.tinime.view { import com.tinime.event.*; import flash.utils.*; import flash.geom.*; import flash.events.*; import com.greensock.*; import flash.display.*; public class TutorialDialog extends EventDispatcher { private var _camera:Camera; private var _gameEventDispatcher:GameEventDispatcher; private var _dialogSprite:Sprite; public function TutorialDialog(_arg1:Point, _arg2:int, _arg3:Point=null){ _camera = Camera.getInstance(); _gameEventDispatcher = GameEventDispatcher.getInstance(); super(); var _local4:Class = (getDefinitionByName((("Tutorial" + String(_arg2)) + "SprLib")) as Class); _dialogSprite = new (_local4); _dialogSprite.x = _arg1.x; _dialogSprite.y = _arg1.y; _dialogSprite.alpha = 0.1; _dialogSprite.alpha = 0.1; if (_arg3 != null){ _gameEventDispatcher.addEventListener(GameEvent.TWEEN_COMPLETE, popUpTutorial); _camera.tweenTo(_arg3, 0.5, false); } else { popUpTutorial(); }; } private function popUpTutorial(_arg1:GameEvent=null):void{ var onDialogDisplayed:Function; var onAnyKey:Function; var onClose:Function; var e = _arg1; onDialogDisplayed = function ():void{ _dialogSprite.stage.addEventListener(KeyboardEvent.KEY_DOWN, onAnyKey); _dialogSprite.stage.addEventListener(MouseEvent.CLICK, onAnyKey); }; onAnyKey = function (_arg1:Event):void{ _dialogSprite.stage.removeEventListener(KeyboardEvent.KEY_DOWN, onAnyKey); _dialogSprite.stage.removeEventListener(MouseEvent.CLICK, onAnyKey); TweenLite.to(_dialogSprite, 0.3, {alpha:0.1, onComplete:onClose}); }; onClose = function ():void{ _camera.uiLayer.removeChild(_dialogSprite); dispatchEvent(new Event(Event.CLOSE)); }; if (e != null){ _gameEventDispatcher.removeEventListener(GameEvent.TWEEN_COMPLETE, popUpTutorial); }; _camera.uiLayer.addChild(_dialogSprite); TweenLite.to(_dialogSprite, 0.3, {alpha:1, onComplete:onDialogDisplayed}); } } }//package com.tinime.view
Section 177
//UIManager (com.tinime.view.UIManager) package com.tinime.view { import flash.events.*; import com.tinime.event.*; import flash.display.*; import com.tinime.control.*; import spill.localisation.*; import flash.net.*; import SWFStats.*; import com.tinime.data.*; import com.tinime.interfaces.*; import mochi.as3.*; import flash.filters.*; import com.greensock.*; import flash.utils.*; public class UIManager { public static var stage:Sprite; private static var musicBlock:Sprite; private static var soundBlock:Sprite; public static function showLogoScreen():void{ var logoMc:MovieClip; var onEnterFrame:Function; var onClickLogo:Function; var onRemovedFromStage:Function; onEnterFrame = function (_arg1:Event):void{ if (logoMc.currentFrame == logoMc.totalFrames){ logoMc.removeEventListener(Event.ENTER_FRAME, onEnterFrame); logoMc.stop(); UIEventDispatcher.getInstance().dispatchEvent(new UIEvent(UIEvent.LOGO_SCREEN_READY)); }; }; onClickLogo = function (_arg1:Event):void{ }; onRemovedFromStage = function (_arg1:Event):void{ logoMc.removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); }; logoMc = new LogoMcLib(); stage.addChild(logoMc); logoMc.addEventListener(Event.ENTER_FRAME, onEnterFrame); logoMc.gotoAndPlay(1); logoMc.addEventListener(MouseEvent.CLICK, onClickLogo); logoMc.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } public static function showMenuScreen(_arg1:Boolean):void{ var uiEventListener:UIEventDispatcher; var gameEventListener:GameEventDispatcher; var menuSprite:Sprite; var playBtn:SimpleButton; var medalsBtn:SimpleButton; var scoresBtn:SimpleButton; var creditsBtn:SimpleButton; var moreGamesBtn:SimpleButton; var curBtnTarget:SimpleButton; var onTransitionIn:Function; var handleBrandingLogoClicked:Function; var handleSpilGamesButtonClicked:Function; var onTransitionOut:Function; var onClickMenuBtn:Function; var ifNeedplayMenuMusic = _arg1; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); addSoundButtons(); if (ifNeedplayMenuMusic){ SoundManager.playMenuLoop(); }; stage.addChildAt(menuSprite, 0); playBtn.x = 45.5; playBtn.y = 390; menuSprite.addChild(playBtn); medalsBtn.x = 194.2; medalsBtn.y = 390; menuSprite.addChild(medalsBtn); scoresBtn.x = 263.3; scoresBtn.y = 390; creditsBtn.x = 333.1; creditsBtn.y = 390; menuSprite.addChild(creditsBtn); moreGamesBtn.x = 481.4; moreGamesBtn.y = 390; menuSprite.addChild(moreGamesBtn); var _local2:Sprite = new menuGrass(); _local2.x = -30.9; _local2.y = 444.4; menuSprite.addChild(_local2); menuSprite.mouseEnabled = false; menuSprite.useHandCursor = false; var _local3:BrandingLogo = new BrandingLogo(); _local3.x = 287; _local3.y = 463; _local3.mouseEnabled = (_local3.buttonMode = (_local3.useHandCursor = true)); _local3.addEventListener(MouseEvent.CLICK, handleBrandingLogoClicked); stage.addChild(_local3); var _local4:SpilGamesLink = new SpilGamesLink(); _local4.y = 454; _local4.addEventListener(MouseEvent.CLICK, handleSpilGamesButtonClicked); stage.addChild(_local4); var _local5:LanguageSelectBox = new LanguageSelectBox(); _local5.y = 450; _local5.x = (640 - _local5.width); stage.addChild(_local5); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; handleBrandingLogoClicked = function (_arg1:MouseEvent):void{ navigateToURL(new URLRequest(SpilGame.getMoreGamesLink("Mainscreen")), "_blank"); }; handleSpilGamesButtonClicked = function (_arg1:MouseEvent):void{ navigateToURL(new URLRequest(SpilGame.getSpilCompanyLink())); }; onTransitionOut = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); playBtn.addEventListener(MouseEvent.CLICK, onClickMenuBtn); medalsBtn.addEventListener(MouseEvent.CLICK, onClickMenuBtn); scoresBtn.addEventListener(MouseEvent.CLICK, onClickMenuBtn); creditsBtn.addEventListener(MouseEvent.CLICK, onClickMenuBtn); moreGamesBtn.addEventListener(MouseEvent.CLICK, onClickMenuBtn); }; onClickMenuBtn = function (_arg1:MouseEvent):void{ SoundManager.playButtonClick(); curBtnTarget = SimpleButton(_arg1.target); curBtnTarget.mouseEnabled = false; switch (curBtnTarget){ case playBtn: gameEventListener.dispatchEvent(new GameEvent(GameEvent.SHOW_LEVEL_SCREEN)); Log.Play(); break; case medalsBtn: gameEventListener.dispatchEvent(new GameEvent(GameEvent.SHOW_MEDAL_SCREEN)); break; case scoresBtn: gameEventListener.dispatchEvent(new GameEvent(GameEvent.SHOW_SCORE_SCREEN)); break; case creditsBtn: gameEventListener.dispatchEvent(new GameEvent(GameEvent.SHOW_CREDITS_SCREEN)); break; case moreGamesBtn: navigateToURL(new URLRequest(SpilGame.getMoreGamesLink("Mainscreen")), "_blank"); break; default: break; }; if (curBtnTarget != moreGamesBtn){ playBtn.removeEventListener(MouseEvent.CLICK, onClickMenuBtn); medalsBtn.removeEventListener(MouseEvent.CLICK, onClickMenuBtn); scoresBtn.removeEventListener(MouseEvent.CLICK, onClickMenuBtn); creditsBtn.removeEventListener(MouseEvent.CLICK, onClickMenuBtn); moreGamesBtn.removeEventListener(MouseEvent.CLICK, onClickMenuBtn); }; }; uiEventListener = UIEventDispatcher.getInstance(); gameEventListener = GameEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); var menuSpriteCopy:Sprite = new MenuSprite(); var menuBitmapData:BitmapData = new BitmapData(CommonVals.STAGE_WIDTH, CommonVals.STAGE_HEIGHT, false); menuBitmapData.draw(menuSpriteCopy); var menuBitmap:Bitmap = new Bitmap(menuBitmapData); menuSprite = new Sprite(); menuSprite.addChild(menuBitmap); menuSprite.mouseEnabled = false; playBtn = new PlayBtn(); medalsBtn = new MedalsBtn(); scoresBtn = new ScoresBtn(); creditsBtn = new CreditsBtn(); moreGamesBtn = new MoreGamesBtn(); CircleTransition.transitionIn(); } private static function showScreen(_arg1:Sprite):void{ var uiEventListener:UIEventDispatcher; var onTransitionIn:Function; var onTransitionOut:Function; var screenSprite = _arg1; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); addSoundButtons(); stage.addChildAt(screenSprite, 0); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; onTransitionOut = function (_arg1:UIEvent):void{ ClickEventWaitable(screenSprite).setClickable(true); uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); }; uiEventListener = UIEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); CircleTransition.transitionIn(); } public static function showLevelScreen():void{ showScreen(new SelectLevelScreen()); } public static function showMedalScreen():void{ var uiEventListener:UIEventDispatcher; var medalScreen:MedalScreen; var onTransitionIn:Function; var onTransitionOut:Function; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); addSoundButtons(); stage.addChildAt(medalScreen, 0); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; onTransitionOut = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); medalScreen.setClickable(true); }; uiEventListener = UIEventDispatcher.getInstance(); var gameEventListener:GameEventDispatcher = GameEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); medalScreen = new MedalScreen(); CircleTransition.transitionIn(); } public static function showScoresScreen():void{ var uiEventListener:UIEventDispatcher; var scoresScreen:ScoresScreen; var onTransitionIn:Function; var onCloseLeaderboard:Function; var onTransitionOut:Function; onTransitionIn = function (_arg1:UIEvent):void{ var o:Object; var boardID:String; var e = _arg1; uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); addSoundButtons(); if (((MochiServices.connected) && (!((CommonVals.currentDomain == "localhost"))))){ o = {n:[10, 10, 11, 9, 12, 13, 15, 12, 15, 13, 0, 11, 2, 13, 15, 9], f:function (_arg1:Number, _arg2:String):String{ if (_arg2.length == 16){ return (_arg2); }; return (this.f((_arg1 + 1), (_arg2 + this.n[_arg1].toString(16)))); }}; boardID = o.f(0, ""); MochiScores.showLeaderboard({boardID:boardID, onClose:onCloseLeaderboard}); }; stage.addChildAt(scoresScreen, 0); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; onCloseLeaderboard = function ():void{ SoundManager.playButtonClick(); GameEventDispatcher.getInstance().dispatchEvent(new GameEvent(GameEvent.SHOW_MENU_SCREEN)); }; onTransitionOut = function (_arg1:UIEvent):void{ scoresScreen.setClickable(true); uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); }; uiEventListener = UIEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); scoresScreen = new ScoresScreen(); CircleTransition.transitionIn(); } public static function showCreditsScreen():void{ var uiEventListener:UIEventDispatcher; var creditsScreen:CreditsScreen; var onTransitionIn:Function; var onTransitionOut:Function; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); addSoundButtons(); stage.addChildAt(creditsScreen, 0); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; onTransitionOut = function (_arg1:UIEvent):void{ creditsScreen.setClickable(true); uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); }; uiEventListener = UIEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); creditsScreen = new CreditsScreen(); CircleTransition.transitionIn(); } public static function showAllLevelComplete():void{ var uiEventListener:UIEventDispatcher; var onTransitionIn:Function; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); clearPreviousScreen(); var _local2:AllLevelCompleteScreen = new AllLevelCompleteScreen(); stage.addChild(_local2); CircleTransition.transitionOut(); }; uiEventListener = UIEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); CircleTransition.transitionIn(); } public static function showGamePlayScreen():void{ var uiEventListener:UIEventDispatcher; var onTransitionIn:Function; var onTransitionOut:Function; onTransitionIn = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); LevelController.getInstance().removeData(); LevelController.getInstance().initialize(); Camera.getInstance().removeAllLayers(); clearPreviousScreen(); PhysicsWorldControl.setupPhysicsWorld(); Camera.getInstance().initialize(); LevelController.getInstance().buildLevel(); Camera.getInstance().updateLifeUpDisplay(LivesControl.starCount); addSoundButtons(); addPauseButton(); addCameraButton(); stage.addChildAt(Camera.getInstance(), 0); stage.stage.stageFocusRect = false; stage.stage.focus = stage; uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); CircleTransition.transitionOut(); }; onTransitionOut = function (_arg1:UIEvent):void{ uiEventListener.removeEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionOut); uiEventListener.dispatchEvent(new UIEvent(UIEvent.PLAY_SCREEN_READY)); }; uiEventListener = UIEventDispatcher.getInstance(); uiEventListener.addEventListener(UIEvent.CIRCLE_TRANSITION_COMPLETE, onTransitionIn); CircleTransition.transitionIn(); } public static function showAnimBitmapInitStatus():void{ var statusDisplayBar:Sprite; var statusText:LocalizedTextField; var statusTimeCount:int; var statusTimeNum:int; var bitmapAnimManager:BitmapAnimManager; var onStatusTextEnterFrame:Function; var onRemoveFromStage:Function; onStatusTextEnterFrame = function (_arg1:Event):void{ if (statusTimeNum >= statusTimeCount){ statusText.visible = (statusText.visible) ? false : true; statusTimeNum = 0; } else { statusTimeNum++; }; statusDisplayBar.scaleX = (bitmapAnimManager.genCount / bitmapAnimManager.totalGenNum); }; onRemoveFromStage = function (_arg1:Event):void{ statusText.removeEventListener(Event.ENTER_FRAME, onStatusTextEnterFrame); statusText.removeEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage); }; var statusDisplayFrame:Sprite = new Sprite(); statusDisplayFrame.graphics.lineStyle(1, 0, 1); statusDisplayFrame.graphics.beginFill(0xFFFFFF, 1); statusDisplayFrame.graphics.drawRect(0, 0, 160, 18); statusDisplayFrame.graphics.endFill(); statusDisplayFrame.y = 450; statusDisplayFrame.x = ((CommonVals.STAGE_WIDTH - statusDisplayFrame.width) * 0.5); statusDisplayFrame.filters = new Array(new DropShadowFilter(4, 45, 0, 0.5, 4, 4, 1, 1, true)); stage.addChild(statusDisplayFrame); statusDisplayBar = new Sprite(); statusDisplayBar.graphics.lineStyle(1, 0, 1); statusDisplayBar.graphics.beginFill(16724889, 1); statusDisplayBar.graphics.drawRect(0, 0, 160, 18); statusDisplayBar.graphics.endFill(); statusDisplayBar.y = 450; statusDisplayBar.x = ((CommonVals.STAGE_WIDTH - statusDisplayBar.width) * 0.5); statusDisplayBar.scaleX = 0; stage.addChild(statusDisplayBar); statusText = new LocalizedTextField(); statusText.text = "{initializing}"; statusText.y = 450; statusText.x = (((CommonVals.STAGE_WIDTH - statusText.width) * 0.5) + 15); stage.addChild(statusText); statusTimeCount = 1; statusTimeNum = 0; bitmapAnimManager = BitmapAnimManager.getInstance(); statusText.addEventListener(Event.ENTER_FRAME, onStatusTextEnterFrame); statusText.addEventListener(Event.REMOVED_FROM_STAGE, onRemoveFromStage); } public static function showMedalEarned(_arg1:Sprite, _arg2:String, _arg3:String):void{ var medalAwardBg:Sprite; var timer:Timer; var onShowUpComplete:Function; var onTimerComplete:Function; var removeMedalBg:Function; var medalSprite = _arg1; var title = _arg2; var depict = _arg3; onShowUpComplete = function ():void{ timer.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); timer.start(); }; onTimerComplete = function (_arg1:TimerEvent):void{ timer.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete); TweenLite.to(medalAwardBg, 1.5, {x:medalAwardBg.x, y:CommonVals.STAGE_HEIGHT, onComplete:removeMedalBg}); }; removeMedalBg = function ():void{ if (stage.stage.contains(medalAwardBg)){ stage.stage.removeChild(medalAwardBg); }; medalAwardBg = null; }; medalAwardBg = new medalAwardBgSprite(); medalAwardBg.x = ((CommonVals.STAGE_WIDTH - medalAwardBg.width) * 0.5); medalAwardBg.y = CommonVals.STAGE_HEIGHT; medalSprite.x = -10; medalSprite.y = 8; medalAwardBg.addChild(medalSprite); var titleText:LocalizedTextField = new LocalizedTextField(); titleText.text = title; titleText.x = 83; titleText.y = 30; titleText.bold = true; titleText.textSize = 22; titleText.textColor = 0xFFFFFF; titleText.width = 217; titleText.height = 24; medalAwardBg.addChild(titleText); var depictText:LocalizedTextField = new LocalizedTextField(); depictText.text = depict; depictText.x = 83; depictText.y = 53; depictText.multiline = true; depictText.textSize = 14; depictText.textColor = 0xFFFFFF; medalAwardBg.addChild(depictText); stage.stage.addChild(medalAwardBg); timer = new Timer(3000, 1); TweenLite.to(medalAwardBg, 1.5, {x:medalAwardBg.x, y:(CommonVals.STAGE_HEIGHT - 88), onComplete:onShowUpComplete}); } private static function addSoundButtons():void{ var musicButton:SimpleButton; var soundButton:SimpleButton; var onRemovedFromStage:Function; var onClickSound:Function; var onClickMusic:Function; onRemovedFromStage = function (_arg1:Event):void{ musicButton.removeEventListener(MouseEvent.CLICK, onClickMusic); soundButton.removeEventListener(MouseEvent.CLICK, onClickSound); musicButton.removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); musicButton = null; }; onClickSound = function (_arg1:MouseEvent):void{ if (soundBlock == null){ soundBlock = new invalidSprite(); soundBlock.x = soundButton.x; soundBlock.y = soundButton.y; soundBlock.mouseEnabled = false; stage.addChild(soundBlock); SoundManager.isSoundMute = true; } else { stage.removeChild(soundBlock); soundBlock = null; SoundManager.isSoundMute = false; }; }; onClickMusic = function (_arg1:MouseEvent):void{ if (musicBlock == null){ musicBlock = new invalidSprite(); musicBlock.x = musicButton.x; musicBlock.y = musicButton.y; musicBlock.mouseEnabled = false; stage.addChild(musicBlock); SoundManager.isMusicMute = true; } else { stage.removeChild(musicBlock); musicBlock = null; SoundManager.isMusicMute = false; }; }; musicButton = new musicBtn(); musicButton.x = 564; musicButton.y = 6; soundButton = new soundBtn(); soundButton.x = 591; soundButton.y = 6; stage.addChild(musicButton); stage.addChild(soundButton); if (soundBlock != null){ stage.addChild(soundBlock); }; if (musicBlock != null){ stage.addChild(musicBlock); }; musicButton.addEventListener(MouseEvent.CLICK, onClickMusic); soundButton.addEventListener(MouseEvent.CLICK, onClickSound); musicButton.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } private static function addPauseButton():void{ var pauseButton:SimpleButton; var onRemovedFromStage:Function; var onClickPause:Function; onRemovedFromStage = function (_arg1:Event):void{ pauseButton.removeEventListener(MouseEvent.CLICK, onClickPause); pauseButton.removeEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); pauseButton = null; }; onClickPause = function (_arg1:MouseEvent):void{ if (CommonVals.gameLocked){ return; }; GameEventDispatcher.getInstance().onGamePaused(); }; pauseButton = new pauseBtn(); pauseButton.x = 615; pauseButton.y = 6; stage.addChild(pauseButton); pauseButton.addEventListener(MouseEvent.CLICK, onClickPause); pauseButton.addEventListener(Event.REMOVED_FROM_STAGE, onRemovedFromStage); } private static function addCameraButton():void{ CameraModeControl.getInstance().addCameraButton(); } public static function setStageFrameRate(_arg1:int):void{ stage.stage.frameRate = _arg1; } private static function clearPreviousScreen():void{ while (stage.numChildren) { stage.removeChildAt(0); }; } } }//package com.tinime.view
Section 178
//GameTracker (FGL.GameTracker.GameTracker) package FGL.GameTracker { import flash.net.*; import flash.utils.*; import flash.external.*; import flash.events.*; public class GameTracker extends EventDispatcher { protected var _timer:Timer;// = null protected var _currentGame:int;// = 0 protected var _currentLevel:int;// = 0 protected var _inGame:Boolean;// = false protected var _inLevel:Boolean;// = false protected var _msg_queue:Array; protected var _conn:NetConnection;// = null protected var _responder:Responder;// = null protected var _sessionID:uint; protected var _isEnabled:Boolean;// = false protected var _serverVersionMajor:int;// = 0 protected var _serverVersionMinor:int;// = 0 protected var _hostUrl:String;// = "" protected var _serviceName:String;// = "" protected var _passphrase:String;// = "" public static const GAMETRACKER_SERVER_ERROR:String = "gametracker_server_error"; public static const GAMETRACKER_CODING_ERROR:String = "gametracker_coding_error"; private static const TIMER_DELAY:int = 15000; public function GameTracker(){ _msg_queue = new Array(); super(); setGlobalConfig(); if (_isEnabled){ _responder = new Responder(onSuccess, onNetworkingError); _conn = new NetConnection(); _conn.connect(_hostUrl); _timer = new Timer(TIMER_DELAY); _timer.addEventListener("timer", onTimer); _timer.start(); _sessionID = Math.floor((new Date().getTime() / 1000)); addToMsgQueue("begin_app", null, 0, null, null); }; } public function isEnabled():Boolean{ return (_isEnabled); } public function beginGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{ if (_inGame){ endGame(_arg1, _arg2, "AUTO:(this game automatically ended when new game was started)"); }; _currentGame++; _inGame = true; addToMsgQueue("begin_game", null, _arg1, _arg2, _arg3); } public function endGame(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{ if (!(_inGame)){ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endGame() called before beginGame() was called!")); } else { if (_inLevel){ endLevel(_arg1, _arg2, "AUTO:(this level automatically ended when game ended)"); }; addToMsgQueue("end_game", null, _arg1, _arg2, _arg3); _inGame = false; submitMsgQueue(); }; } public function beginLevel(_arg1:int, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{ if (!(_inGame)){ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "beginLevel() called before beginGame() was called!")); } else { if (_inLevel){ endLevel(_arg2, _arg3, "AUTO:(this level automatically ended when new level was started)"); }; _currentLevel = _arg1; _inLevel = true; addToMsgQueue("begin_level", null, _arg2, _arg3, _arg4); }; } public function endLevel(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{ if (!(_inLevel)){ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "endLevel() called before beginLevel() was called!")); } else { _inLevel = false; addToMsgQueue("end_level", null, _arg1, _arg2, _arg3); }; } public function checkpoint(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{ if (!(_inGame)){ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_CODING_ERROR, "checkpoint() called before startGame() was called!")); } else { addToMsgQueue("checkpoint", null, _arg1, _arg2, _arg3); }; } public function alert(_arg1:Number=0, _arg2:String=null, _arg3:String=null):void{ addToMsgQueue("alert", null, _arg1, _arg2, _arg3); submitMsgQueue(); } public function customMsg(_arg1:String, _arg2:Number=0, _arg3:String=null, _arg4:String=null):void{ addToMsgQueue("custom", _arg1, _arg2, _arg3, _arg4); } protected function addToMsgQueue(_arg1:String, _arg2:String, _arg3:Number, _arg4:String, _arg5:String):void{ var _local6:Object; if (_isEnabled){ _local6 = new Object(); _local6["action"] = _arg1; _local6["custom_action"] = _arg2; _local6["session_id"] = _sessionID; _local6["game_idx"] = _currentGame; _local6["level"] = _currentLevel; _local6["score"] = _arg3; _local6["game_state"] = _arg4; _local6["time"] = Math.floor((new Date().getTime() / 1000)); _local6["msg"] = _arg5; _msg_queue.push(_local6); }; } protected function submitMsgQueue():void{ var _local1:Object; if (((_isEnabled) && ((_msg_queue.length > 0)))){ _local1 = new Object(); _local1["actions"] = _msg_queue; _local1["identifier"] = _passphrase; _conn.call(_serviceName, _responder, _local1); _msg_queue = new Array(); }; } protected function setGlobalConfig():void{ var ret:Array; _isEnabled = false; _serverVersionMajor = 0; _serverVersionMinor = 0; _hostUrl = ""; _serviceName = ""; _passphrase = ""; try { if (ExternalInterface.available){ ret = ExternalInterface.call("get_gametracker_info"); _serverVersionMajor = ret[0]; _serverVersionMinor = ret[1]; _hostUrl = ret[2]; _serviceName = ret[3]; _passphrase = ret[4]; _isEnabled = (_serverVersionMajor == 1); }; } catch(e) { }; } protected function onSuccess(_arg1):void{ if (_arg1.toString() != ""){ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, _arg1.toString())); }; } protected function onNetworkingError(_arg1):void{ dispatchEvent(new GameTrackerErrorEvent(GAMETRACKER_SERVER_ERROR, "Networking error")); } protected function onTimer(_arg1:TimerEvent):void{ submitMsgQueue(); } } }//package FGL.GameTracker
Section 179
//GameTrackerErrorEvent (FGL.GameTracker.GameTrackerErrorEvent) package FGL.GameTracker { import flash.events.*; public class GameTrackerErrorEvent extends Event { public var _msg:String; public function GameTrackerErrorEvent(_arg1:String, _arg2:String){ _msg = _arg2; super(_arg1, false, false); } public function get msg():String{ return (_msg); } } }//package FGL.GameTracker
Section 180
//MochiCoins (mochi.as3.MochiCoins) package mochi.as3 { public class MochiCoins { public static const STORE_SHOW:String = "StoreShow"; public static const STORE_HIDE:String = "StoreHide"; public static const ITEM_OWNED:String = "ItemOwned"; public static const ITEM_NEW:String = "ItemNew"; public static const STORE_ITEMS:String = "StoreItems"; public static const ERROR:String = "Error"; public static const IO_ERROR:String = "IOError"; public static const NO_USER:String = "NoUser"; public static var _inventory:MochiInventory; public static function get inventory():MochiInventory{ return (_inventory); } public static function getVersion():String{ return (MochiServices.getVersion()); } public static function showStore(_arg1:Object=null):void{ MochiServices.bringToTop(); MochiServices.send("coins_showStore", {options:_arg1}, null, null); } public static function showItem(_arg1:Object=null):void{ if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){ trace("ERROR: showItem call must pass an Object with an item key"); return; }; MochiServices.bringToTop(); MochiServices.send("coins_showItem", {options:_arg1}, null, null); } public static function showVideo(_arg1:Object=null):void{ if (((!(_arg1)) || (!((typeof(_arg1.item) == "string"))))){ trace("ERROR: showVideo call must pass an Object with an item key"); return; }; MochiServices.bringToTop(); MochiServices.send("coins_showVideo", {options:_arg1}, null, null); } public static function getStoreItems():void{ MochiServices.send("coins_getStoreItems"); } public static function addEventListener(_arg1:String, _arg2:Function):void{ MochiSocial.addEventListener(_arg1, _arg2); } public static function triggerEvent(_arg1:String, _arg2:Object):void{ MochiSocial.triggerEvent(_arg1, _arg2); } public static function removeEventListener(_arg1:String, _arg2:Function):void{ MochiSocial.removeEventListener(_arg1, _arg2); } MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{ _inventory = new MochiInventory(); }); MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{ _inventory = null; }); } }//package mochi.as3
Section 181
//MochiDigits (mochi.as3.MochiDigits) package mochi.as3 { public final class MochiDigits { private var Fragment:Number; private var Sibling:MochiDigits; private var Encoder:Number; public function MochiDigits(_arg1:Number=0, _arg2:uint=0):void{ Encoder = 0; setValue(_arg1, _arg2); } public function get value():Number{ return (Number(this.toString())); } public function set value(_arg1:Number):void{ setValue(_arg1); } public function addValue(_arg1:Number):void{ value = (value + _arg1); } public function setValue(_arg1:Number=0, _arg2:uint=0):void{ var _local3:String = _arg1.toString(); var _temp1 = _arg2; _arg2 = (_arg2 + 1); Fragment = (_local3.charCodeAt(_temp1) ^ Encoder); if (_arg2 < _local3.length){ Sibling = new MochiDigits(_arg1, _arg2); } else { Sibling = null; }; reencode(); } public function reencode():void{ var _local1:uint = int((2147483647 * Math.random())); Fragment = (Fragment ^ (_local1 ^ Encoder)); Encoder = _local1; } public function toString():String{ var _local1:String = String.fromCharCode((Fragment ^ Encoder)); if (Sibling != null){ _local1 = (_local1 + Sibling.toString()); }; return (_local1); } } }//package mochi.as3
Section 182
//MochiEventDispatcher (mochi.as3.MochiEventDispatcher) package mochi.as3 { public class MochiEventDispatcher { private var eventTable:Object; public function MochiEventDispatcher():void{ eventTable = {}; } public function addEventListener(_arg1:String, _arg2:Function):void{ removeEventListener(_arg1, _arg2); eventTable[_arg1].push(_arg2); } public function removeEventListener(_arg1:String, _arg2:Function):void{ var _local3:Object; if (eventTable[_arg1] == undefined){ eventTable[_arg1] = []; return; }; for (_local3 in eventTable[_arg1]) { if (eventTable[_arg1][_local3] != _arg2){ } else { eventTable[_arg1].splice(Number(_local3), 1); }; }; } public function triggerEvent(_arg1:String, _arg2:Object):void{ var _local3:Object; if (eventTable[_arg1] == undefined){ return; }; for (_local3 in eventTable[_arg1]) { var _local6 = eventTable[_arg1]; _local6[_local3](_arg2); }; } } }//package mochi.as3
Section 183
//MochiEvents (mochi.as3.MochiEvents) package mochi.as3 { import flash.display.*; public class MochiEvents { public static const ACHIEVEMENT_RECEIVED:String = "AchievementReceived"; public static const ALIGN_TOP_LEFT:String = "ALIGN_TL"; public static const ALIGN_TOP:String = "ALIGN_T"; public static const ALIGN_TOP_RIGHT:String = "ALIGN_TR"; public static const ALIGN_LEFT:String = "ALIGN_L"; public static const ALIGN_CENTER:String = "ALIGN_C"; public static const ALIGN_RIGHT:String = "ALIGN_R"; public static const ALIGN_BOTTOM_LEFT:String = "ALIGN_BL"; public static const ALIGN_BOTTOM:String = "ALIGN_B"; public static const ALIGN_BOTTOM_RIGHT:String = "ALIGN_BR"; public static const FORMAT_SHORT:String = "ShortForm"; public static const FORMAT_LONG:String = "LongForm"; private static var gameStart:Number; private static var levelStart:Number; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public static function getVersion():String{ return (MochiServices.getVersion()); } public static function startSession(_arg1:String):void{ MochiServices.send("events_beginSession", {achievementID:_arg1}, null, null); } public static function setNotifications(_arg1:MovieClip, _arg2:Object):void{ var _local4:Object; var _local3:Object = {}; for (_local4 in _arg2) { _local3[_local4] = _arg2[_local4]; }; _local3.clip = _arg1; MochiServices.send("events_setNotifications", _local3, null, null); } public static function addEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.addEventListener(_arg1, _arg2); } public static function triggerEvent(_arg1:String, _arg2:Object):void{ _dispatcher.triggerEvent(_arg1, _arg2); } public static function removeEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.removeEventListener(_arg1, _arg2); } public static function startPlay(_arg1:String="gameplay"):void{ MochiServices.send("events_setRoundID", {tag:String(_arg1)}, null, null); } public static function endPlay():void{ MochiServices.send("events_clearRoundID", null, null, null); } public static function trackEvent(_arg1:String, _arg2=null):void{ MochiServices.send("events_trackEvent", {tag:_arg1, value:_arg2}, null, null); } } }//package mochi.as3
Section 184
//MochiInventory (mochi.as3.MochiInventory) package mochi.as3 { import flash.utils.*; import flash.events.*; public dynamic class MochiInventory extends Proxy { private var _timer:Timer; private var _consumableProperties:Object; private var _syncPending:Boolean; private var _outstandingID:Number; private var _syncID:Number; private var _names:Array; private var _storeSync:Object; private static const CONSUMER_KEY:String = "MochiConsumables"; private static const KEY_SALT:String = " syncMaint"; public static const READY:String = "InvReady"; public static const WRITTEN:String = "InvWritten"; public static const ERROR:String = "Error"; public static const IO_ERROR:String = "IoError"; public static const VALUE_ERROR:String = "InvValueError"; public static const NOT_READY:String = "InvNotReady"; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public function MochiInventory():void{ MochiCoins.addEventListener(MochiCoins.ITEM_OWNED, itemOwned); MochiCoins.addEventListener(MochiCoins.ITEM_NEW, newItems); MochiSocial.addEventListener(MochiSocial.LOGGED_IN, loggedIn); MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, loggedOut); _storeSync = new Object(); _syncPending = false; _outstandingID = 0; _syncID = 0; _timer = new Timer(1000); _timer.addEventListener(TimerEvent.TIMER, sync); _timer.start(); if (MochiSocial.loggedIn){ loggedIn(); } else { loggedOut(); }; } public function release():void{ MochiCoins.removeEventListener(MochiCoins.ITEM_NEW, newItems); MochiSocial.removeEventListener(MochiSocial.LOGGED_IN, loggedIn); MochiSocial.removeEventListener(MochiSocial.LOGGED_OUT, loggedOut); } private function loggedOut(_arg1:Object=null):void{ _consumableProperties = null; } private function loggedIn(_arg1:Object=null):void{ MochiUserData.get(CONSUMER_KEY, getConsumableBag); } private function newItems(_arg1:Object):void{ if (!(this[(_arg1.id + KEY_SALT)])){ this[(_arg1.id + KEY_SALT)] = 0; }; if (!(this[_arg1.id])){ this[_arg1.id] = 0; }; this[(_arg1.id + KEY_SALT)] = (this[(_arg1.id + KEY_SALT)] + _arg1.count); this[_arg1.id] = (this[_arg1.id] + _arg1.count); if (_arg1.privateProperties.consumable){ if (!(this[_arg1.privateProperties.tag])){ this[_arg1.privateProperties.tag] = 0; }; this[_arg1.privateProperties.tag] = (this[_arg1.privateProperties.tag] + (_arg1.privateProperties.inc * _arg1.count)); }; } private function itemOwned(_arg1:Object):void{ _storeSync[_arg1.id] = {properties:_arg1.properties, count:_arg1.count}; } private function getConsumableBag(_arg1:MochiUserData):void{ var _local2:String; var _local3:Number; if (_arg1.error){ triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error}); return; }; _consumableProperties = {}; _names = new Array(); if (_arg1.data){ for (_local2 in _arg1.data) { _names.push(_local2); _consumableProperties[_local2] = new MochiDigits(_arg1.data[_local2]); }; }; for (_local2 in _storeSync) { _local3 = _storeSync[_local2].count; if (_consumableProperties[(_local2 + KEY_SALT)]){ _local3 = (_local3 - _consumableProperties[_local2]); }; if (_local3 == 0){ } else { newItems({id:_local2, count:_local3, properties:_storeSync[_local2].properties}); }; }; triggerEvent(READY, {}); } private function putConsumableBag(_arg1:MochiUserData):void{ _syncPending = false; if (_arg1.error){ triggerEvent(ERROR, {type:IO_ERROR, error:_arg1.error}); _outstandingID = -1; }; triggerEvent(WRITTEN, {}); } private function sync(_arg1:Event=null):void{ var _local3:String; if (((_syncPending) || ((_syncID == _outstandingID)))){ return; }; _outstandingID = _syncID; var _local2:Object = {}; for (_local3 in _consumableProperties) { _local2[_local3] = MochiDigits(_consumableProperties[_local3]).value; }; MochiUserData.put(CONSUMER_KEY, _local2, putConsumableBag); _syncPending = true; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){ if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return (-1); }; if (_consumableProperties[_arg1]){ return (MochiDigits(_consumableProperties[_arg1]).value); }; return (undefined); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function deleteProperty(_arg1):Boolean{ if (!(_consumableProperties[_arg1])){ return (false); }; _names.splice(_names.indexOf(_arg1), 1); delete _consumableProperties[_arg1]; return (true); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function hasProperty(_arg1):Boolean{ if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return (false); }; if (_consumableProperties[_arg1] == undefined){ return (false); }; return (true); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{ var _local3:MochiDigits; if (_consumableProperties == null){ triggerEvent(ERROR, {type:NOT_READY}); return; }; if (!((_arg2 is Number))){ triggerEvent(ERROR, {type:VALUE_ERROR, error:"Invalid type", arg:_arg2}); return; }; if (_consumableProperties[_arg1]){ _local3 = MochiDigits(_consumableProperties[_arg1]); if (_local3.value == _arg2){ return; }; _local3.value = _arg2; } else { _names.push(_arg1); _consumableProperties[_arg1] = new MochiDigits(_arg2); }; _syncID++; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextNameIndex(_arg1:int):int{ return (((_arg1)>=_names.length) ? 0 : (_arg1 + 1)); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function nextName(_arg1:int):String{ return (_names[(_arg1 - 1)]); } public static function addEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.addEventListener(_arg1, _arg2); } public static function triggerEvent(_arg1:String, _arg2:Object):void{ _dispatcher.triggerEvent(_arg1, _arg2); } public static function removeEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.removeEventListener(_arg1, _arg2); } } }//package mochi.as3
Section 185
//MochiScores (mochi.as3.MochiScores) package mochi.as3 { import flash.display.*; import flash.text.*; public class MochiScores { public static var onCloseHandler:Object; public static var onErrorHandler:Object; private static var boardID:String; public static function onClose(_arg1:Object=null):void{ if (((((_arg1) && ((_arg1.error == true)))) && (onErrorHandler))){ if (_arg1.errorCode == null){ _arg1.errorCode = "IOError"; }; onErrorHandler(_arg1.errorCode); MochiServices.doClose(); return; }; onCloseHandler(); MochiServices.doClose(); } public static function setBoardID(_arg1:String):void{ MochiServices.warnID(_arg1, true); MochiScores.boardID = _arg1; MochiServices.send("scores_setBoardID", {boardID:_arg1}); } public static function showLeaderboard(_arg1:Object=null):void{ var n:Number; var options = _arg1; if (options != null){ delete options.clip; MochiServices.setContainer(); MochiServices.bringToTop(); if (options.name != null){ if ((options.name is TextField)){ if (options.name.text.length > 0){ options.name = options.name.text; }; }; }; if (options.score != null){ if ((options.score is TextField)){ if (options.score.text.length > 0){ options.score = options.score.text; }; } else { if ((options.score is MochiDigits)){ options.score = options.score.value; }; }; n = Number(options.score); if (isNaN(n)){ trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is 'Not a Number'")); } else { if ((((n == Number.NEGATIVE_INFINITY)) || ((n == Number.POSITIVE_INFINITY)))){ trace((("ERROR: Submitted score '" + options.score) + "' will be rejected, score is an infinite")); } else { if (Math.floor(n) != n){ trace((("WARNING: Submitted score '" + options.score) + "' will be truncated")); }; options.score = n; }; }; }; if (options.onDisplay != null){ options.onDisplay(); } else { if (MochiServices.clip != null){ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; }; } else { options = {}; if ((MochiServices.clip is MovieClip)){ MochiServices.clip.stop(); } else { trace("Warning: Container is not a MovieClip, cannot call default onDisplay."); }; }; if (options.onClose != null){ onCloseHandler = options.onClose; } else { onCloseHandler = function ():void{ if ((MochiServices.clip is MovieClip)){ MochiServices.clip.play(); } else { trace("Warning: Container is not a MovieClip, cannot call default onClose."); }; }; }; if (options.onError != null){ onErrorHandler = options.onError; } else { onErrorHandler = null; }; if (options.boardID == null){ if (MochiScores.boardID != null){ options.boardID = MochiScores.boardID; }; }; MochiServices.warnID(options.boardID, true); trace("[MochiScores] NOTE: Security Sandbox Violation errors below are normal"); MochiServices.send("scores_showLeaderboard", {options:options}, null, onClose); } public static function closeLeaderboard():void{ MochiServices.send("scores_closeLeaderboard"); } public static function getPlayerInfo(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_getPlayerInfo", null, _arg1, _arg2); } public static function submit(_arg1:Number, _arg2:String, _arg3:Object=null, _arg4:Object=null):void{ _arg1 = Number(_arg1); if (isNaN(_arg1)){ trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is 'Not a Number'")); } else { if ((((_arg1 == Number.NEGATIVE_INFINITY)) || ((_arg1 == Number.POSITIVE_INFINITY)))){ trace((("ERROR: Submitted score '" + String(_arg1)) + "' will be rejected, score is an infinite")); } else { if (Math.floor(_arg1) != _arg1){ trace((("WARNING: Submitted score '" + String(_arg1)) + "' will be truncated")); }; _arg1 = Number(_arg1); }; }; MochiServices.send("scores_submit", {score:_arg1, name:_arg2}, _arg3, _arg4); } public static function requestList(_arg1:Object, _arg2:Object=null):void{ MochiServices.send("scores_requestList", null, _arg1, _arg2); } public static function scoresArrayToObjects(_arg1:Object):Object{ var _local3:Number; var _local4:Number; var _local5:Object; var _local6:Object; var _local7:String; var _local8:String; var _local2:Object = {}; for (_local7 in _arg1) { if (typeof(_arg1[_local7]) == "object"){ if (((!((_arg1[_local7].cols == null))) && (!((_arg1[_local7].rows == null))))){ _local2[_local7] = []; _local5 = _arg1[_local7]; _local4 = 0; while (_local4 < _local5.rows.length) { _local6 = {}; _local3 = 0; while (_local3 < _local5.cols.length) { _local6[_local5.cols[_local3]] = _local5.rows[_local4][_local3]; _local3++; }; _local2[_local7].push(_local6); _local4++; }; } else { _local2[_local7] = {}; for (_local8 in _arg1[_local7]) { _local2[_local7][_local8] = _arg1[_local7][_local8]; }; }; } else { _local2[_local7] = _arg1[_local7]; }; }; return (_local2); } } }//package mochi.as3
Section 186
//MochiServices (mochi.as3.MochiServices) package mochi.as3 { import flash.system.*; import flash.display.*; import flash.events.*; import flash.net.*; import flash.utils.*; import flash.geom.*; public class MochiServices { private static var _id:String; private static var _container:Object; private static var _clip:MovieClip; private static var _loader:Loader; private static var _timer:Timer; private static var _preserved:Object; private static var _servURL:String = "http://www.mochiads.com/static/lib/services/"; private static var _services:String = "services.swf"; private static var _mochiLC:String = "MochiLC.swf"; private static var _swfVersion:String; private static var _listenChannelName:String = "__ms_"; private static var _sendChannel:LocalConnection; private static var _sendChannelName:String; private static var _connecting:Boolean = false; private static var _connected:Boolean = false; public static var netup:Boolean = true; public static var netupAttempted:Boolean = false; public static var onError:Object; public static var widget:Boolean = false; public static var servicesSync:MochiSync = new MochiSync(); private static var _mochiLocalConnection:MovieClip; private static var _queue:Array; private static var _nextCallbackID:Number; private static var _callbacks:Object; public static function get id():String{ return (_id); } public static function get clip():Object{ return (_container); } public static function get childClip():Object{ return (_clip); } public static function getVersion():String{ return ("3.8 as3"); } public static function allowDomains(_arg1:String):String{ var _local2:String; if (Security.sandboxType != "application"){ Security.allowDomain("*"); Security.allowInsecureDomain("*"); }; if (_arg1.indexOf("http://") != -1){ _local2 = _arg1.split("/")[2].split(":")[0]; if (Security.sandboxType != "application"){ Security.allowDomain(_local2); Security.allowInsecureDomain(_local2); }; }; return (_local2); } public static function isNetworkAvailable():Boolean{ return (!((Security.sandboxType == "localWithFile"))); } public static function set comChannelName(_arg1:String):void{ if (_arg1 != null){ if (_arg1.length > 3){ _sendChannelName = (_arg1 + "_fromgame"); initComChannels(); }; }; } public static function get connected():Boolean{ return (_connected); } public static function warnID(_arg1:String, _arg2:Boolean):void{ _arg1 = _arg1.toLowerCase(); if (_arg1.length != 16){ trace((("WARNING: " + (_arg2) ? "board" : "game") + " ID is not the appropriate length")); return; } else { if (_arg1 == "1e113c7239048b3f"){ if (_arg2){ trace("WARNING: Using testing board ID"); } else { trace("WARNING: Using testing board ID as game ID"); }; return; } else { if (_arg1 == "84993a1de4031cd8"){ if (_arg2){ trace("WARNING: Using testing game ID as board ID"); } else { trace("WARNING: Using testing game ID"); }; return; }; }; }; var _local3:Number = 0; while (_local3 < _arg1.length) { switch (_arg1.charAt(_local3)){ case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": case "a": case "b": case "c": case "d": case "e": case "f": break; default: trace(("WARNING: Board ID contains illegal characters: " + _arg1)); return; }; _local3++; }; } public static function connect(_arg1:String, _arg2:Object, _arg3:Object=null):void{ var id = _arg1; var clip = _arg2; var onError = _arg3; warnID(id, false); if ((clip is DisplayObject)){ if (clip.stage == null){ trace("MochiServices connect requires the containing clip be attached to the stage"); }; if (((!(_connected)) && ((_clip == null)))){ trace("MochiServices Connecting..."); _connecting = true; init(id, clip); }; } else { trace("Error, MochiServices requires a Sprite, Movieclip or instance of the stage."); }; if (onError != null){ MochiServices.onError = onError; } else { if (MochiServices.onError == null){ MochiServices.onError = function (_arg1:String):void{ trace(_arg1); }; }; }; } public static function disconnect():void{ if (((_connected) || (_connecting))){ if (_clip != null){ if (_clip.parent != null){ if ((_clip.parent is Sprite)){ Sprite(_clip.parent).removeChild(_clip); _clip = null; }; }; }; _connecting = (_connected = false); flush(true); try { _mochiLocalConnection.close(); } catch(error:Error) { }; }; if (_timer != null){ try { _timer.stop(); } catch(error:Error) { }; }; } public static function stayOnTop():void{ _container.addEventListener(Event.ENTER_FRAME, MochiServices.bringToTop, false, 0, true); if (_clip != null){ _clip.visible = true; }; } public static function doClose():void{ _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); } public static function bringToTop(_arg1:Event=null):void{ var e = _arg1; if (((!((MochiServices.clip == null))) && (!((MochiServices.childClip == null))))){ try { if (MochiServices.clip.numChildren > 1){ MochiServices.clip.setChildIndex(MochiServices.childClip, (MochiServices.clip.numChildren - 1)); }; } catch(errorObject:Error) { trace("Warning: Depth sort error."); _container.removeEventListener(Event.ENTER_FRAME, MochiServices.bringToTop); }; }; } private static function init(_arg1:String, _arg2:Object):void{ _id = _arg1; if (_arg2 != null){ _container = _arg2; loadCommunicator(_arg1, _container); }; } public static function setContainer(_arg1:Object=null, _arg2:Boolean=true):void{ if (_clip.parent){ _clip.parent.removeChild(_clip); }; if (_arg1 != null){ if ((_arg1 is DisplayObjectContainer)){ _container = _arg1; }; }; if (_arg2){ if ((_container is DisplayObjectContainer)){ DisplayObjectContainer(_container).addChild(_clip); }; }; } private static function loadCommunicator(_arg1:String, _arg2:Object):MovieClip{ if (_clip != null){ return (_clip); }; if (!(MochiServices.isNetworkAvailable())){ return (null); }; if (urlOptions(_arg2).servURL){ _servURL = urlOptions(_arg2).servURL; }; var _local3:String = (_servURL + _services); if (urlOptions(_arg2).servicesURL){ _local3 = urlOptions(_arg2).servicesURL; }; _listenChannelName = (_listenChannelName + ((Math.floor(new Date().time) + "_") + Math.floor((Math.random() * 99999)))); MochiServices.allowDomains(_local3); _clip = new MovieClip(); loadLCBridge(_clip); _loader = new Loader(); _loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); var _local4:URLRequest = new URLRequest(_local3); var _local5:URLVariables = new URLVariables(); _local5.listenLC = _listenChannelName; _local5.mochiad_options = _arg2.loaderInfo.parameters.mochiad_options; _local5.api_version = getVersion(); if (widget){ _local5.widget = true; }; _local4.data = _local5; _loader.load(_local4); _clip.addChild(_loader); _sendChannel = new LocalConnection(); _queue = []; _nextCallbackID = 0; _callbacks = {}; _timer = new Timer(10000, 1); _timer.addEventListener(TimerEvent.TIMER, connectWait); _timer.start(); return (_clip); } private static function loadLCBridge(_arg1:Object):void{ var loader:Loader; var clip = _arg1; loader = new Loader(); var mochiLCURL:String = (_servURL + _mochiLC); var req:URLRequest = new URLRequest(mochiLCURL); var complete:Function = function (_arg1:Object):void{ _mochiLocalConnection = MovieClip(loader.content); listen(); }; loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, loadError); loader.load(req); clip.addChild(loader); } private static function loadError(_arg1:Object):void{ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load."); MochiServices.disconnect(); MochiServices.onError("IOError"); } public static function connectWait(_arg1:TimerEvent):void{ if (!(_connected)){ _clip._mochiad_ctr_failed = true; trace("MochiServices could not load. (timeout)"); MochiServices.disconnect(); MochiServices.onError("IOError"); }; } private static function listen():void{ _mochiLocalConnection.connect(_listenChannelName); _clip.handshake = function (_arg1:Object):void{ MochiServices.comChannelName = _arg1.newChannel; }; trace("Waiting for MochiAds services to connect..."); } private static function initComChannels():void{ if (!(_connected)){ trace("[SERVICES_API] connected!"); _connecting = false; _connected = true; _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:"registerGame", preserved:_preserved, id:_id, version:getVersion(), parentURL:_container.loaderInfo.loaderURL}); _clip.onReceive = onReceive; _clip.onEvent = onEvent; _clip.onError = function ():void{ MochiServices.onError("IOError"); }; while (_queue.length > 0) { _mochiLocalConnection.send(_sendChannelName, "onReceive", _queue.shift()); }; }; } private static function onReceive(_arg1:Object):void{ var methodName:String; var pkg = _arg1; var cb:String = pkg.callbackID; var cblst:Object = _callbacks[cb]; if (!(cblst)){ return; }; var method:* = cblst.callbackMethod; methodName = ""; var obj:Object = cblst.callbackObject; if (((obj) && ((typeof(method) == "string")))){ methodName = method; if (obj[method] != null){ method = obj[method]; } else { trace((("Error: Method " + method) + " does not exist.")); }; }; if (method != undefined){ try { method.apply(obj, pkg.args); } catch(error:Error) { trace(((("Error invoking callback method '" + methodName) + "': ") + error.toString())); }; } else { if (obj != null){ try { obj(pkg.args); } catch(error:Error) { trace(("Error invoking method on object: " + error.toString())); }; }; }; delete _callbacks[cb]; } private static function onEvent(_arg1:Object):void{ var _local2:String = _arg1.target; var _local3:String = _arg1.event; switch (_local2){ case "events": MochiEvents.triggerEvent(_arg1.event, _arg1.args); break; case "coins": MochiCoins.triggerEvent(_arg1.event, _arg1.args); break; case "sync": servicesSync.triggerEvent(_arg1.event, _arg1.args); break; }; } public static function updateCopy(_arg1:Object):void{ MochiServices.send("coins_updateCopy", _arg1, null, null); } private static function flush(_arg1:Boolean):void{ var _local2:Object; var _local3:Object; if (((_clip) && (_queue))){ while (_queue.length > 0) { _local2 = _queue.shift(); _local3 = null; if (_local2 != null){ if (_local2.callbackID != null){ _local3 = _callbacks[_local2.callbackID]; }; delete _callbacks[_local2.callbackID]; if (((_arg1) && (!((_local3 == null))))){ handleError(_local2.args, _local3.callbackObject, _local3.callbackMethod); }; }; }; }; } private static function handleError(_arg1:Object, _arg2:Object, _arg3:Object):void{ var args = _arg1; var callbackObject = _arg2; var callbackMethod = _arg3; if (args != null){ if (args.onError != null){ args.onError.apply(null, ["NotConnected"]); }; if (((!((args.options == null))) && (!((args.options.onError == null))))){ args.options.onError.apply(null, ["NotConnected"]); }; }; if (callbackMethod != null){ args = {}; args.error = true; args.errorCode = "NotConnected"; if (((!((callbackObject == null))) && ((callbackMethod is String)))){ try { var _local5 = callbackObject; _local5[callbackMethod](args); } catch(error:Error) { }; } else { if (callbackMethod != null){ try { callbackMethod.apply(args); } catch(error:Error) { }; }; }; }; } public static function send(_arg1:String, _arg2:Object=null, _arg3:Object=null, _arg4:Object=null):void{ if (_connected){ _mochiLocalConnection.send(_sendChannelName, "onReceive", {methodName:_arg1, args:_arg2, callbackID:_nextCallbackID}); } else { if ((((_clip == null)) || (!(_connecting)))){ trace(("Error: MochiServices not connected. Please call MochiServices.connect(). Function: " + _arg1)); handleError(_arg2, _arg3, _arg4); flush(true); return; }; _queue.push({methodName:_arg1, args:_arg2, callbackID:_nextCallbackID}); }; if (_clip != null){ if (_callbacks != null){ _callbacks[_nextCallbackID] = {callbackObject:_arg3, callbackMethod:_arg4}; _nextCallbackID++; }; }; } private static function urlOptions(_arg1:Object):Object{ var _local3:String; var _local4:Array; var _local5:Number; var _local6:Array; var _local2:Object = {}; if (_arg1.stage){ _local3 = _arg1.stage.loaderInfo.parameters.mochiad_options; } else { _local3 = _arg1.loaderInfo.parameters.mochiad_options; }; if (_local3){ _local4 = _local3.split("&"); _local5 = 0; while (_local5 < _local4.length) { _local6 = _local4[_local5].split("="); _local2[unescape(_local6[0])] = unescape(_local6[1]); _local5++; }; }; return (_local2); } public static function addLinkEvent(_arg1:String, _arg2:String, _arg3:DisplayObjectContainer, _arg4:Function=null):void{ var avm1Click:DisplayObject; var x:String; var req:URLRequest; var loader:Loader; var setURL:Function; var err:Function; var complete:Function; var url = _arg1; var burl = _arg2; var btn = _arg3; var onClick = _arg4; var vars:Object = new Object(); vars["mav"] = getVersion(); vars["swfv"] = "9"; vars["swfurl"] = btn.loaderInfo.loaderURL; vars["fv"] = Capabilities.version; vars["os"] = Capabilities.os; vars["lang"] = Capabilities.language; vars["scres"] = ((Capabilities.screenResolutionX + "x") + Capabilities.screenResolutionY); var s:String = "?"; var i:Number = 0; for (x in vars) { if (i != 0){ s = (s + "&"); }; i = (i + 1); s = (((s + x) + "=") + escape(vars[x])); }; req = new URLRequest("http://x.mochiads.com/linkping.swf"); loader = new Loader(); setURL = function (_arg1:String):void{ if (avm1Click){ btn.removeChild(avm1Click); }; avm1Click = clickMovie(_arg1, onClick); var _local2:Rectangle = btn.getBounds(btn); btn.addChild(avm1Click); avm1Click.x = _local2.x; avm1Click.y = _local2.y; avm1Click.scaleX = (0.01 * _local2.width); avm1Click.scaleY = (0.01 * _local2.height); }; err = function (_arg1:Object):void{ netup = false; _arg1.target.removeEventListener(_arg1.type, arguments.callee); setURL(burl); }; complete = function (_arg1:Object):void{ _arg1.target.removeEventListener(_arg1.type, arguments.callee); }; if (netup){ setURL((url + s)); } else { setURL(burl); }; if (!(((netupAttempted) || (_connected)))){ netupAttempted = true; loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, err); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, complete); loader.load(req); }; } private static function clickMovie(_arg1:String, _arg2:Function):MovieClip{ var _local4:int; var _local14:Loader; var _local3:Array = [150, 21, 0, 7, 1, 0, 0, 0, 0, 98, 116, 110, 0, 7, 2, 0, 0, 0, 0, 116, 104, 105, 115, 0, 28, 150, 22, 0, 0, 99, 114, 101, 97, 116, 101, 69, 109, 112, 116, 121, 77, 111, 118, 105, 101, 67, 108, 105, 112, 0, 82, 135, 1, 0, 0, 23, 150, 13, 0, 4, 0, 0, 111, 110, 82, 101, 108, 101, 97, 115, 101, 0, 142, 8, 0, 0, 0, 0, 2, 42, 0, 114, 0, 150, 17, 0, 0, 32, 0, 7, 1, 0, 0, 0, 8, 0, 0, 115, 112, 108, 105, 116, 0, 82, 135, 1, 0, 1, 23, 150, 7, 0, 4, 1, 7, 0, 0, 0, 0, 78, 150, 8, 0, 0, 95, 98, 108, 97, 110, 107, 0, 154, 1, 0, 0, 150, 7, 0, 0, 99, 108, 105, 99, 107, 0, 150, 7, 0, 4, 1, 7, 1, 0, 0, 0, 78, 150, 27, 0, 7, 2, 0, 0, 0, 7, 0, 0, 0, 0, 0, 76, 111, 99, 97, 108, 67, 111, 110, 110, 101, 99, 116, 105, 111, 110, 0, 64, 150, 6, 0, 0, 115, 101, 110, 100, 0, 82, 79, 150, 15, 0, 4, 0, 0, 95, 97, 108, 112, 104, 97, 0, 7, 0, 0, 0, 0, 79, 150, 23, 0, 7, 0xFF, 0, 0xFF, 0, 7, 1, 0, 0, 0, 4, 0, 0, 98, 101, 103, 105, 110, 70, 105, 108, 108, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 109, 111, 118, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 100, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 100, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 25, 0, 7, 0, 0, 0, 0, 7, 0, 0, 0, 0, 7, 2, 0, 0, 0, 4, 0, 0, 108, 105, 110, 101, 84, 111, 0, 82, 23, 150, 16, 0, 7, 0, 0, 0, 0, 4, 0, 0, 101, 110, 100, 70, 105, 108, 108, 0, 82, 23]; var _local5:Array = [104, 0, 31, 64, 0, 7, 208, 0, 0, 12, 1, 0, 67, 2, 0xFF, 0xFF, 0xFF, 63, 3]; var _local6:Array = [0, 64, 0, 0, 0]; var _local7:MovieClip = new MovieClip(); var _local8:LocalConnection = new LocalConnection(); var _local9:String = ((("_click_" + Math.floor((Math.random() * 999999))) + "_") + Math.floor(new Date().time)); _local8 = new LocalConnection(); _local7.lc = _local8; _local7.click = _arg2; _local8.client = _local7; _local8.connect(_local9); var _local10:ByteArray = new ByteArray(); var _local11:ByteArray = new ByteArray(); _local11.endian = Endian.LITTLE_ENDIAN; _local11.writeShort(1); _local11.writeUTFBytes(((_arg1 + " ") + _local9)); _local11.writeByte(0); var _local12:uint = ((_local3.length + _local11.length) + 4); var _local13:uint = (_local12 + 35); _local10.endian = Endian.LITTLE_ENDIAN; _local10.writeUTFBytes("FWS"); _local10.writeByte(8); _local10.writeUnsignedInt(_local13); for each (_local4 in _local5) { _local10.writeByte(_local4); }; _local10.writeUnsignedInt(_local12); _local10.writeByte(136); _local10.writeShort(_local11.length); _local10.writeBytes(_local11); for each (_local4 in _local3) { _local10.writeByte(_local4); }; for each (_local4 in _local6) { _local10.writeByte(_local4); }; _local14 = new Loader(); _local14.loadBytes(_local10); _local7.addChild(_local14); return (_local7); } } }//package mochi.as3
Section 187
//MochiSocial (mochi.as3.MochiSocial) package mochi.as3 { public class MochiSocial { public static const LOGGED_IN:String = "LoggedIn"; public static const LOGGED_OUT:String = "LoggedOut"; public static const LOGIN_SHOW:String = "LoginShow"; public static const LOGIN_HIDE:String = "LoginHide"; public static const LOGIN_SHOWN:String = "LoginShown"; public static const PROFILE_SHOW:String = "ProfileShow"; public static const PROFILE_HIDE:String = "ProfileHide"; public static const PROPERTIES_SAVED:String = "PropertySaved"; public static const WIDGET_LOADED:String = "WidgetLoaded"; public static const USER_INFO:String = "UserInfo"; public static const ERROR:String = "Error"; public static const IO_ERROR:String = "IOError"; public static const NO_USER:String = "NoUser"; public static const PROPERTIES_SIZE:String = "PropertiesSize"; private static var _dispatcher:MochiEventDispatcher = new MochiEventDispatcher(); public static var _user_info:Object = null; public static function getVersion():String{ return (MochiServices.getVersion()); } public static function getAPIURL():String{ if (!(_user_info)){ return (null); }; return (_user_info.api_url); } public static function getAPIToken():String{ if (!(_user_info)){ return (null); }; return (_user_info.api_token); } public static function showLoginWidget(_arg1:Object=null):void{ MochiServices.setContainer(); MochiServices.bringToTop(); MochiServices.send("coins_showLoginWidget", {options:_arg1}); } public static function hideLoginWidget():void{ MochiServices.send("coins_hideLoginWidget"); } public static function requestLogin():void{ MochiServices.send("coins_requestLogin"); } public static function getUserInfo():void{ MochiServices.send("coins_getUserInfo"); } public static function saveUserProperties(_arg1:Object):void{ MochiServices.send("coins_saveUserProperties", _arg1); } public static function addEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.addEventListener(_arg1, _arg2); } public static function get loggedIn():Boolean{ return (!((_user_info == null))); } public static function triggerEvent(_arg1:String, _arg2:Object):void{ _dispatcher.triggerEvent(_arg1, _arg2); } public static function removeEventListener(_arg1:String, _arg2:Function):void{ _dispatcher.removeEventListener(_arg1, _arg2); } MochiSocial.addEventListener(MochiSocial.LOGGED_IN, function (_arg1:Object):void{ _user_info = _arg1; }); MochiSocial.addEventListener(MochiSocial.LOGGED_OUT, function (_arg1:Object):void{ _user_info = null; }); } }//package mochi.as3
Section 188
//MochiSync (mochi.as3.MochiSync) package mochi.as3 { import flash.utils.*; public dynamic class MochiSync extends Proxy { private var _syncContainer:Object; public static var SYNC_REQUEST:String = "SyncRequest"; public static var SYNC_PROPERTY:String = "UpdateProperty"; public function MochiSync():void{ _syncContainer = {}; } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){ return (_syncContainer[_arg1]); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function setProperty(_arg1, _arg2):void{ if (_syncContainer[_arg1] == _arg2){ return; }; var _local3:String = _arg1.toString(); _syncContainer[_local3] = _arg2; MochiServices.send("sync_propUpdate", {name:_local3, value:_arg2}); } public function triggerEvent(_arg1:String, _arg2:Object):void{ switch (_arg1){ case SYNC_REQUEST: MochiServices.send("sync_syncronize", _syncContainer); break; case SYNC_PROPERTY: _syncContainer[_arg2.name] = _arg2.value; break; }; } } }//package mochi.as3
Section 189
//MochiUserData (mochi.as3.MochiUserData) package mochi.as3 { import flash.utils.*; import flash.net.*; import flash.events.*; public class MochiUserData extends EventDispatcher { public var _loader:URLLoader; public var key:String;// = null public var data;// = null public var error:Event;// = null public var operation:String;// = null public var callback:Function;// = null public function MochiUserData(_arg1:String="", _arg2:Function=null){ this.key = _arg1; this.callback = _arg2; } public function serialize(_arg1):ByteArray{ var _local2:ByteArray = new ByteArray(); _local2.objectEncoding = ObjectEncoding.AMF3; _local2.writeObject(_arg1); _local2.compress(); return (_local2); } public function deserialize(_arg1:ByteArray){ _arg1.objectEncoding = ObjectEncoding.AMF3; _arg1.uncompress(); return (_arg1.readObject()); } public function request(_arg1:String, _arg2:ByteArray):void{ var _operation = _arg1; var _data = _arg2; operation = _operation; var api_url:String = MochiSocial.getAPIURL(); var api_token:String = MochiSocial.getAPIToken(); if ((((api_url == null)) || ((api_token == null)))){ errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, "not logged in")); return; }; _loader = new URLLoader(); var args:URLVariables = new URLVariables(); args.op = _operation; args.key = key; var req:URLRequest = new URLRequest((((MochiSocial.getAPIURL() + "/") + "MochiUserData?") + args.toString())); req.method = URLRequestMethod.POST; req.contentType = "application/x-mochi-userdata"; req.requestHeaders = [new URLRequestHeader("x-mochi-services-version", MochiServices.getVersion()), new URLRequestHeader("x-mochi-api-token", api_token)]; req.data = _data; _loader.dataFormat = URLLoaderDataFormat.BINARY; _loader.addEventListener(Event.COMPLETE, completeHandler); _loader.addEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); try { _loader.load(req); } catch(e:SecurityError) { errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + e.toString()))); }; } public function completeHandler(_arg1:Event):void{ var event = _arg1; try { if (_loader.data.length){ data = deserialize(_loader.data); } else { data = null; }; } catch(e:Error) { errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("deserialize error: " + e.toString()))); return; }; if (callback != null){ performCallback(); } else { dispatchEvent(event); }; close(); } public function errorHandler(_arg1:IOErrorEvent):void{ data = null; error = _arg1; if (callback != null){ performCallback(); } else { dispatchEvent(_arg1); }; close(); } public function securityErrorHandler(_arg1:SecurityErrorEvent):void{ errorHandler(new IOErrorEvent(IOErrorEvent.IO_ERROR, false, false, ("security error: " + _arg1.toString()))); } public function performCallback():void{ try { callback(this); } catch(e:Error) { trace(("[MochiUserData] exception during callback: " + e)); }; } public function close():void{ if (_loader){ _loader.removeEventListener(Event.COMPLETE, completeHandler); _loader.removeEventListener(IOErrorEvent.IO_ERROR, errorHandler); _loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler); _loader.close(); _loader = null; }; error = null; callback = null; } public function getEvent():void{ request("get", serialize(null)); } public function putEvent(_arg1):void{ request("put", serialize(_arg1)); } override public function toString():String{ return ((((((((("[MochiUserData operation=" + operation) + " key=\"") + key) + "\" data=") + data) + " error=\"") + error) + "\"]")); } public static function get(_arg1:String, _arg2:Function):void{ var _local3:MochiUserData = new MochiUserData(_arg1, _arg2); _local3.getEvent(); } public static function put(_arg1:String, _arg2, _arg3:Function):void{ var _local4:MochiUserData = new MochiUserData(_arg1, _arg3); _local4.putEvent(_arg2); } } }//package mochi.as3
Section 190
//Brand (spill.localisation.Brand) package spill.localisation { import flash.xml.*; public class Brand { public var domain:String; public var site_id:uint; public var moreLink:String;// = "" public var emailLink:String;// = "game" public var emailPage:String; public var id:Number; public var name:String; public var portalGroup:uint; public var useGoogleAnalitics:Boolean;// = true public var hasSendToFriendLink:Boolean;// = true public var preferedLanguage:String;// = "" public var isExternal:Boolean;// = false public var hostingDomain:String;// = "" private static const topLevelDoubles:String = ((((((((((((((("ac.cn,ac.jp,ac.uk,ad.jp,adm.br,adv.br,agr.br," + "ah.cn,am.br,arq.br,art.br,asn.au,ato.br,av.tr,bel.tr,bio.br,biz.tr,bj.cn,bmd.br,") + "cim.br,cng.br,cnt.br,co.at,co.jp,co.uk,com.au,com.br,com.cn,com.eg,com.hk,com.mx,") + "com.ru,com.tr,com.tw,conf.au,cq.cn,csiro.au,dr.tr,ecn.br,edu.au,edu.br,edu.tr,") + "emu.id.au,eng.br,esp.br,etc.br,eti.br,eun.eg,far.br,fj.cn,fm.br,fnd.br,fot.br,") + "fst.br,g12.br,gb.com,gb.net,gd.cn,gen.tr,ggf.br,gob.mx,gov.au,gov.br,gov.cn,") + "gov.hk,gov.tr,gr.jp,gs.cn,gx.cn,gz.cn,ha.cn,hb.cn,he.cn,hi.cn,hk.cn,hl.cn,hn.cn,") + "id.au,idv.tw,imb.br,ind.br,inf.br,info.au,info.tr,jl.cn,jor.br,js.cn,jx.cn,k12.tr,") + "lel.br,ln.cn,ltd.uk,mat.br,me.uk,med.br,mil.br,mil.tr,mo.cn,mus.br,name.tr,ne.jp,") + "net.au,net.br,net.cn,net.eg,net.hk,net.lu,net.mx,net.ru,net.tr,net.tw,net.uk,") + "nm.cn,no.com,nom.br,not.br,ntr.br,nx.cn,odo.br,oop.br,or.at,or.jp,org.au,org.br,") + "org.cn,org.hk,org.lu,org.ru,org.tr,org.tw,org.uk,plc.uk,pol.tr,pp.ru,ppg.br,pro.br,") + "psc.br,psi.br,qh.cn,qsl.br,rec.br,sc.cn,sd.cn,se.com,se.net,sh.cn,slg.br,sn.cn,") + "srv.br,sx.cn,tel.tr,tj.cn,tmp.br,trd.br,tur.br,tv.br,tw.cn,uk.com,uk.net,vet.br,") + "wattle.id.au,web.tr,xj.cn,xz.cn,yn.cn,zj.cn,zlg.br,co.nr,co.nz,com.fr,com.ph,com.ar,") + "com.id,com.in"); public function getMoreGamesLink(_arg1:String, _arg2:Boolean, _arg3:String="", _arg4:String=""):String{ var _local5:String = ("http://" + domain); _local5 = (_local5 + ("/" + moreLink)); if (useGoogleAnalitics){ _local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg2) ? "external" : "internal")); _local5 = (_local5 + ("&utm_campaign=" + _arg1)); _arg3 = stripSubDomain(_arg3); if (_arg3 == "localhost"){ _arg3 = "offline_play"; }; _local5 = (_local5 + ("&utm_source=" + _arg3)); if (((!((_arg4 == ""))) && (!((_arg4 == null))))){ _local5 = (_local5 + ("&utm_content=" + _arg4)); }; }; return (_local5); } public function getSendToFriendLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String=""):String{ if (!(hasSendToFriendLink)){ return (getMoreGamesLink(_arg1, _arg3)); }; var _local5:String = ("http://" + domain); _local5 = (_local5 + ((("/" + emailLink) + "/") + _arg2)); if (useGoogleAnalitics){ _local5 = (_local5 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal")); _local5 = (_local5 + ("&utm_campaign=" + _arg1)); _arg4 = stripSubDomain(_arg4); if (_arg4 == "localhost"){ _arg4 = "offline_play"; }; _local5 = (_local5 + ("&utm_source=" + _arg4)); _local5 = (_local5 + "&utm_content=send_to_friend"); }; return (_local5); } public function getPromotionLink(_arg1:String, _arg2:String, _arg3:Boolean, _arg4:String="", _arg5:String=""):String{ var _local6:String = ("http://" + domain); _local6 = (_local6 + ((("/" + emailLink) + "/") + _arg2)); if (useGoogleAnalitics){ _local6 = (_local6 + ("?utm_medium=brandedgames_" + (_arg3) ? "external" : "internal")); _local6 = (_local6 + ("&utm_campaign=" + _arg1)); _arg4 = stripSubDomain(_arg4); trace(_arg4); if (_arg4 == "localhost"){ _arg4 = "offline_play"; }; _local6 = (_local6 + ("&utm_source=" + _arg4)); if (((!((_arg5 == ""))) && (!((_arg5 == null))))){ _local6 = (_local6 + ("&utm_content=" + _arg5)); }; }; return (_local6); } public function get backgroundColor():uint{ return (PortalGroup.backgroundColors[portalGroup]); } public function exportXML():XML{ var _local3:XML; var _local1:XML = <portal/> ; _local1.@id = site_id; _local1.@language = preferedLanguage; _local1.@channel = portalGroup; var _local2:XML = <domain/> ; _local2.appendChild(new XMLNode(3, domain)); _local1.appendChild(_local2); if (moreLink){ _local3 = <more_games_path/> ; _local3.appendChild(new XMLNode(3, moreLink)); _local1.appendChild(_local3); }; _local2 = <game_path/> ; _local2.appendChild(new XMLNode(3, emailLink)); _local1.appendChild(_local2); if (!(useGoogleAnalitics)){ _local1.attributes.noGoogleAnalitics = true; }; if (!(hasSendToFriendLink)){ _local1.attributes.noSendToFriendLink = true; }; return (_local1); } public function importXML(_arg1:XMLNode):void{ } private function get utm_source():String{ return (("utm_source=brandedgames_" + (isExternal) ? "external" : "internal")); } private function get utm_term():String{ return ("utm_term="); } private function get utm_campaign():String{ if (isExternal){ return (("utm_campaign=" + hostingDomain)); }; return (""); } public static function stripSubDomain(_arg1:String):String{ if (!(_arg1)){ return (""); }; var _local2:Array = _arg1.split("."); if (_local2.length <= 2){ return (_arg1); }; _local2 = _local2.reverse(); if (topLevelDoubles.indexOf((((_local2[1] + ".") + _local2[0]) + ",")) > 0){ return (((((_local2[2] + ".") + _local2[1]) + ".") + _local2[0])); }; return (((_local2[1] + ".") + _local2[0])); } } }//package spill.localisation
Section 191
//BrandingLogo (spill.localisation.BrandingLogo) package spill.localisation { import flash.events.*; import flash.display.*; public class BrandingLogo extends MovieClip { public function BrandingLogo(){ addFrameScript(0, frame1); super(); stop(); mouseEnabled = false; mouseChildren = false; addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true); if (stage){ added(); }; brandingChanged(); } private function added(_arg1:Event=null):void{ SpilGame.addEventListener("brandingChanged", brandingChanged, false, 0, true); brandingChanged(); } private function removed(_arg1:Event):void{ SpilGame.removeEventListener("brandingChanged", brandingChanged); } private function brandingChanged(_arg1:Event=null):void{ if (SpilGame.currentBranding){ gotoAndStop(SpilGame.currentBranding.domain); }; } function frame1(){ stop(); } } }//package spill.localisation
Section 192
//Brandings (spill.localisation.Brandings) package spill.localisation { public class Brandings { private static var brands_by_id:Object = new Object(); private static var brands_by_domain:Object = new Object(); public static function initialize():void{ var _local1:Brand; _local1 = new Brand(); _local1.site_id = 79; _local1.domain = "www.agame.com"; _local1.preferedLanguage = "en_us"; _local1.portalGroup = PortalGroup.TEENS; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 88; _local1.domain = "www.gamesgames.com"; _local1.preferedLanguage = "en_us"; _local1.portalGroup = PortalGroup.FAMILY; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 90; _local1.domain = "www.girlsgogames.com"; _local1.preferedLanguage = "en_us"; _local1.portalGroup = PortalGroup.GIRL; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 45; _local1.domain = "www.a10.com"; _local1.preferedLanguage = "en_us"; _local1.portalGroup = PortalGroup.YOUNG_ADULTS; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 92; _local1.domain = "www.games.co.uk"; _local1.preferedLanguage = "en_uk"; _local1.portalGroup = PortalGroup.FAMILY; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 107; _local1.domain = "www.agame.co.uk"; _local1.preferedLanguage = "en_uk"; _local1.portalGroup = PortalGroup.TEENS; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 102; _local1.domain = "www.girlsgogames.co.uk"; _local1.preferedLanguage = "en_uk"; _local1.portalGroup = PortalGroup.GIRL; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 2; _local1.domain = "www.game.com.cn"; _local1.moreLink = "moregames/"; _local1.preferedLanguage = "cn"; _local1.portalGroup = PortalGroup.NONE; _local1.useGoogleAnalitics = false; _local1.hasSendToFriendLink = false; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 25; _local1.domain = "www.spel.nl"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "nl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 1; _local1.domain = "www.spelletjes.nl"; _local1.emailLink = "spel"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "nl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 93; _local1.domain = "www.girlsgogames.nl"; _local1.emailLink = "spel"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "nl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 12; _local1.domain = "www.jeu.fr"; _local1.emailLink = "jeu"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "fr"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 95; _local1.domain = "www.girlsgogames.fr"; _local1.emailLink = "jeu"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "fr"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 11; _local1.domain = "www.jeux.fr"; _local1.emailLink = "jeu"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "fr"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 26; _local1.domain = "www.spielen.com"; _local1.emailLink = "spiel"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "de"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 94; _local1.domain = "www.girlsgogames.de"; _local1.emailLink = "spiel"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "de"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 5; _local1.domain = "www.jetztspielen.de"; _local1.emailLink = "spiel"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "de"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 109; _local1.domain = "www.minigry.pl"; _local1.emailLink = "gra"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "pl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 16; _local1.domain = "www.gry.pl"; _local1.emailLink = "gra"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "pl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 98; _local1.domain = "www.girlsgogames.pl"; _local1.emailLink = "gra"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "pl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 108; _local1.domain = "www.spel.se"; _local1.emailLink = "spel_"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "se"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 100; _local1.domain = "www.girlsgogames.se"; _local1.emailLink = "spel_"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "se"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 44; _local1.domain = "www.spela.se"; _local1.emailLink = "spel_"; _local1.preferedLanguage = "se"; _local1.portalGroup = PortalGroup.FAMILY; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 106; _local1.domain = "www.giocaregratis.it"; _local1.emailLink = "gioco"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "it"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 15; _local1.domain = "www.gioco.it"; _local1.emailLink = "gioco"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "it"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 99; _local1.domain = "www.girlsgogames.it"; _local1.emailLink = "gioco"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "it"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 97; _local1.domain = "www.zapjuegos.com"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 86; _local1.domain = "www.juegos.com"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 96; _local1.domain = "www.juegosdechicas.com"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 122; _local1.domain = "www.girlsgogames.es"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 125; _local1.domain = "www.juegos.mx"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 126; _local1.domain = "www.juegosdechicas.mx"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 127; _local1.domain = "www.juegos.com.ar"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 128; _local1.domain = "www.juegosdechicas.com.ar"; _local1.emailLink = "juego"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "es"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 91; _local1.domain = "www.clickjogos.com"; _local1.emailLink = "jogo"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "br"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 101; _local1.domain = "www.girlsgogames.com.br"; _local1.emailLink = "jogo"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "br"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 50; _local1.domain = "www.ojogos.com.br"; _local1.emailLink = "jogo"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "br"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 55; _local1.domain = "www.games.co.id"; _local1.emailLink = "permainanme"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "id"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 105; _local1.domain = "www.flashgames.ru"; _local1.emailLink = "igra"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "ru"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 104; _local1.domain = "www.girlsgogames.ru"; _local1.emailLink = "igra"; _local1.portalGroup = PortalGroup.GIRL; _local1.preferedLanguage = "ru"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 103; _local1.domain = "www.ourgames.ru"; _local1.emailLink = "igra"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "ru"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 24; _local1.domain = "www.game.co.in"; _local1.emailLink = "game"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "in"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 87; _local1.domain = "www.ojogos.pt"; _local1.emailLink = "jogo"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "pt"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 120; _local1.domain = "www.egames.jp"; _local1.emailLink = "game"; _local1.portalGroup = PortalGroup.TEENS; _local1.preferedLanguage = "jp"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 121; _local1.domain = "www.dailygame.com"; _local1.emailLink = "/game/"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "en_us"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 123; _local1.domain = "www.zapapa.com"; _local1.emailLink = "game"; _local1.portalGroup = PortalGroup.ZAPAPA; _local1.preferedLanguage = "en_us"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 124; _local1.domain = "www.zapapa.nl"; _local1.emailLink = "game"; _local1.portalGroup = PortalGroup.HYVES; _local1.preferedLanguage = "nl"; addBrand(_local1); _local1 = new Brand(); _local1.site_id = 0; _local1.domain = "gamedev.dev.spilgames.com"; _local1.portalGroup = PortalGroup.FAMILY; _local1.preferedLanguage = "en_us"; addBrand(_local1); } public static function hasDomain(_arg1:String):Boolean{ return (!((brands_by_domain[_arg1] == null))); } public static function getBrandByDomain(_arg1:String):Brand{ return (brands_by_domain[_arg1]); } public static function getBrandByID(_arg1:Number):Brand{ return (brands_by_id[_arg1]); } private static function addBrand(_arg1:Brand):Brand{ if (brands_by_domain[_arg1.domain]){ trace(("ERROR: Attempting to add duplicate brand by domain: " + _arg1.domain)); } else { brands_by_domain[_arg1.domain] = _arg1; }; if (brands_by_id[_arg1.site_id]){ trace(("ERROR: Attempting to add duplicate brand by id: " + _arg1.site_id)); } else { brands_by_id[_arg1.site_id] = _arg1; }; return (_arg1); } public static function getBrandsArray():Array{ var _local2:Brand; var _local1:Array = new Array(); for each (_local2 in brands_by_domain) { _local1.push(_local2); }; return (_local1); } public static function exportXML():XML{ var _local2:Brand; var _local1:XML = <portals/> ; for each (_local2 in brands_by_domain) { _local1.appendChild(_local2.exportXML()); }; return (_local1); } } }//package spill.localisation
Section 193
//Language (spill.localisation.Language) package spill.localisation { import flash.xml.*; public class Language { public var name:String; public var dname:String; public var id:uint; public var portal_groups:Array; public var textLanguage:String; public var embedFonts:Boolean;// = true public var embedInputFonts:Boolean;// = true public var forceFont:String;// = null public var bwcId:int; public var references:Array; public var displayName:String;// = "" public function Language(_arg1:String, _arg2:String=null){ references = []; super(); name = _arg1; dname = _arg2; portal_groups = new Array(); } public function get displayAcronim():String{ return ((dname) ? dname : name); } public function set p_family(_arg1:String):void{ portal_groups[PortalGroup.FAMILY] = _arg1; } public function get p_family():String{ return (portal_groups[PortalGroup.FAMILY]); } public function set p_tween(_arg1:String):void{ portal_groups[PortalGroup.TEENS] = _arg1; } public function get p_tween():String{ return (portal_groups[PortalGroup.TEENS]); } public function set p_girl(_arg1:String):void{ portal_groups[PortalGroup.GIRL] = _arg1; } public function get p_girl():String{ trace("Language", portal_groups[PortalGroup.GIRL]); return (portal_groups[PortalGroup.GIRL]); } public function set p_teen(_arg1:String):void{ portal_groups[PortalGroup.YOUNG_ADULTS] = _arg1; } public function get p_teen():String{ return (portal_groups[PortalGroup.YOUNG_ADULTS]); } public function set p_zapapa(_arg1:String):void{ portal_groups[PortalGroup.ZAPAPA] = _arg1; } public function get p_zapapa():String{ return (portal_groups[PortalGroup.ZAPAPA]); } public function set p_hyves(_arg1:String):void{ portal_groups[PortalGroup.HYVES] = _arg1; } public function get p_hyves():String{ return (portal_groups[PortalGroup.HYVES]); } public function exportXML():XMLNode{ var _local1:XMLNode = new XMLNode(1, "language"); _local1.attributes.name = name; if (textLanguage != null){ _local1.attributes.textLanguage = textLanguage; }; if (references.length){ _local1.attributes.references = references.toString(); }; _local1.attributes.id = bwcId; var _local2:XMLNode = new XMLNode(1, "display_name"); _local2.firstChild = new XMLNode(3, displayName); _local1.appendChild(_local2); var _local3:Array = []; var _local4:Array = PortalGroup.channelNames; var _local5:int; while (_local5 < _local4.length) { _local3.push(Brandings.getBrandByDomain(portal_groups[_local5]).site_id); _local5++; }; _local1.attributes.channels = _local3.join(","); return (_local1); } } }//package spill.localisation
Section 194
//Languages (spill.localisation.Languages) package spill.localisation { import flash.xml.*; public class Languages { public static var languages:Object = new Object(); private static var _init:Boolean = false; public static function initialize():void{ var _local1:Language; if (_init){ return; }; _init = true; _local1 = new Language("nl"); _local1.displayName = "Nederlands"; _local1.p_family = "www.spelletjes.nl"; _local1.p_tween = "www.spel.nl"; _local1.p_girl = "www.girlsgogames.nl"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.p_hyves = "www.zapapa.nl"; _local1.bwcId = 3; addLanguage(_local1); _local1 = new Language("es"); _local1.displayName = "Español"; _local1.p_family = "www.juegos.com"; _local1.p_tween = "www.zapjuegos.com"; _local1.p_girl = "www.girlsgogames.es"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 9; addLanguage(_local1); _local1 = new Language("pl"); _local1.displayName = "Polski"; _local1.p_family = "www.gry.pl"; _local1.p_tween = "www.gry.pl"; _local1.p_girl = "www.girlsgogames.pl"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 6; addLanguage(_local1); _local1 = new Language("fr"); _local1.displayName = "Français"; _local1.p_family = "www.jeux.fr"; _local1.p_tween = "www.jeu.fr"; _local1.p_girl = "www.girlsgogames.fr"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 4; addLanguage(_local1); _local1 = new Language("en_us", "us"); _local1.displayName = "English"; _local1.p_family = "www.gamesgames.com"; _local1.p_tween = "www.agame.com"; _local1.p_girl = "www.girlsgogames.com"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 1; addLanguage(_local1); addReference(_local1, "en"); _local1 = new Language("id"); _local1.displayName = "Bahasa Ind."; _local1.p_family = "www.games.co.id"; _local1.p_tween = "www.games.co.id"; _local1.p_girl = "www.games.co.id"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 11; addLanguage(_local1); _local1 = new Language("ru"); _local1.displayName = "Русский"; _local1.p_family = "www.ourgames.ru"; _local1.p_tween = "www.flashgames.ru"; _local1.p_girl = "www.girlsgogames.ru"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 12; addLanguage(_local1); _local1 = new Language("se"); _local1.displayName = "Svenska"; _local1.p_family = "www.spela.se"; _local1.p_tween = "www.spel.se"; _local1.p_girl = "www.girlsgogames.se"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 7; addLanguage(_local1); addReference(_local1, "sv"); _local1 = new Language("it"); _local1.displayName = "Italiano"; _local1.p_family = "www.gioco.it"; _local1.p_tween = "www.gioco.it"; _local1.p_girl = "www.girlsgogames.it"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 8; addLanguage(_local1); _local1 = new Language("en_uk", "uk"); _local1.displayName = "English"; _local1.p_family = "www.games.co.uk"; _local1.p_tween = "www.agame.com"; _local1.p_girl = "www.girlsgogames.co.uk"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 13; addLanguage(_local1); _local1 = new Language("cn"); _local1.displayName = "中文"; _local1.p_family = "www.game.com.cn"; _local1.p_tween = "www.game.com.cn"; _local1.p_girl = "www.game.com.cn"; _local1.p_teen = "www.game.com.cn"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 2; _local1.embedInputFonts = false; addLanguage(_local1); addReference(_local1, "zh-CN"); addReference(_local1, "zh-TW"); _local1 = new Language("pt"); _local1.displayName = "Português"; _local1.p_family = "www.ojogos.pt"; _local1.p_tween = "www.ojogos.pt"; _local1.p_girl = "www.ojogos.pt"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 17; addLanguage(_local1); _local1 = new Language("in"); _local1.displayName = "English"; _local1.p_family = "www.game.co.in"; _local1.p_tween = "www.game.co.in"; _local1.p_girl = "www.game.co.in"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.textLanguage = "en_uk"; _local1.bwcId = 14; addLanguage(_local1); _local1 = new Language("de"); _local1.displayName = "Deutsch"; _local1.p_family = "www.jetztspielen.de"; _local1.p_tween = "www.spielen.com"; _local1.p_girl = "www.girlsgogames.de"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 5; addLanguage(_local1); _local1 = new Language("br"); _local1.displayName = "Português (BR)"; _local1.p_family = "www.ojogos.com.br"; _local1.p_tween = "www.clickjogos.com"; _local1.p_girl = "www.girlsgogames.com.br"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 10; addLanguage(_local1); _local1 = new Language("jp"); _local1.displayName = "日本語"; _local1.p_family = "www.egames.jp"; _local1.p_tween = "www.egames.jp"; _local1.p_girl = "www.egames.jp"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.embedInputFonts = false; _local1.bwcId = 19; addLanguage(_local1); addReference(_local1, "ja"); _local1 = new Language("ar"); _local1.displayName = "English"; _local1.p_family = "www.dailygame.com"; _local1.p_tween = "www.dailygame.com"; _local1.p_girl = "www.dailygame.com"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; _local1.bwcId = 20; addLanguage(_local1); addReference(_local1, "ar"); _local1 = new Language("es_mx", "mx"); _local1.displayName = "Español (mx)"; _local1.p_family = "www.juegos.mx"; _local1.p_tween = "www.juegos.mx"; _local1.p_girl = "www.juegosdechicas.mx"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; addLanguage(_local1); addReference(_local1, "mx"); _local1 = new Language("es_ar", "arg"); _local1.displayName = "Español (ar)"; _local1.p_family = "www.juegos.com.ar"; _local1.p_tween = "www.juegos.com.ar"; _local1.p_girl = "www.juegosdechicas.com.ar"; _local1.p_teen = "www.a10.com"; _local1.p_zapapa = "www.zapapa.com"; addLanguage(_local1); addReference(_local1, "arg"); } private static function addReference(_arg1:Language, _arg2:String):void{ languages[_arg2] = _arg1; _arg1.references.push(_arg2); } private static function addLanguage(_arg1:Language):void{ languages[_arg1.name] = _arg1; } public static function getLanguage(_arg1:String):Language{ return (languages[_arg1]); } public static function getLanguageByOldID(_arg1:int):Language{ var _local2:Language; for each (_local2 in languages) { if (_local2.bwcId == _arg1){ return (_local2); }; }; return (null); } public static function getLanguagesArray():Array{ var _local3:Language; var _local1:Array = new Array(); var _local2:Object = new Object(); for each (_local3 in languages) { if (!(_local2[_local3.name])){ _local1.push(_local3); _local2[_local3.name] = true; }; }; return (_local1); } public static function exportXML():XMLNode{ var _local3:Language; var _local1:Array = getLanguagesArray(); var _local2:XMLNode = new XMLNode(1, "languages"); for each (_local3 in _local1) { _local2.appendChild(_local3.exportXML()); }; return (_local2); } } }//package spill.localisation
Section 195
//LanguageSelectBox (spill.localisation.LanguageSelectBox) package spill.localisation { import flash.events.*; import flash.display.*; import flash.text.*; public class LanguageSelectBox extends MovieClip { private var popup:MovieClip; private var flag:MovieClip; private var languageName_text:TextField; private var mc:MovieClip; public function LanguageSelectBox(){ trace("new langselecbox"); super(); if (numChildren > 0){ removeChildAt(0); }; addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true); addEventListener(MouseEvent.MOUSE_OVER, mouseOver, false, 0, true); addEventListener(MouseEvent.MOUSE_OUT, mouseOut, false, 0, true); Languages.initialize(); popup = new LanguageSelectPopup_mc(); x = Math.round(x); y = Math.round(y); popup.y = (-(Math.floor(popup.height)) + 1); popup.visible = false; addChild(popup); mc = new LanguageSelectBox_mc(); addChild(mc); flag = mc.flag; languageName_text = mc.languageName_text; if (stage){ added(); }; init(); languageChanged(); } public function init():void{ var _local3:MovieClip; var _local4:Language; trace("initselectbox"); var _local1:Array = new Array(popup.l_br, popup.l_de, popup.l_en_us, popup.l_fr, popup.l_in, popup.l_jp, popup.l_pt, popup.l_ru, popup.l_ar, popup.l_cn, popup.l_en_uk, popup.l_es, popup.l_id, popup.l_it, popup.l_nl, popup.l_pl, popup.l_se, popup.l_es_mx, popup.l_es_ar); var _local2:int; while (_local2 < _local1.length) { _local3 = MovieClip(_local1[_local2]); if (_local3){ _local3.addEventListener(MouseEvent.CLICK, itemClicked, true, 0, true); _local3.flag.gotoAndStop(_local3.name.substr(2)); _local3.flag.mouseEnabled = false; _local3.text.mouseEnabled = false; _local4 = Languages.getLanguage(_local3.name.substr(2)); if (_local4){ _local3.text.text = _local4.displayAcronim; } else { trace((("Error, '" + _local3.name.substr(2)) + "' language not found")); }; } else { trace((((("Error, btn number '" + _local2) + "' is not a MovieClip or there is no button '") + _local1[_local2]) + "'")); }; _local2++; }; } private function itemClicked(_arg1:MouseEvent):void{ SpilGame.changeLanguage(_arg1.currentTarget.name.substr(2)); popup.visible = false; } private function mouseOver(_arg1:MouseEvent):void{ popup.visible = true; } private function mouseOut(_arg1:MouseEvent):void{ popup.visible = false; } private function added(_arg1:Event=null):void{ trace("addedselebnox"); SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true); } private function removed(_arg1:Event):void{ SpilGame.removeEventListener("languageChanged", languageChanged); } private function languageChanged(_arg1:Event=null):void{ if (SpilGame.currentLanguage){ if ((((SpilGame.portalGroup == PortalGroup.HYVES)) && ((SpilGame.currentLanguage.name == "nl")))){ this.visible = false; return; }; this.visible = true; flag.gotoAndStop(SpilGame.currentLanguage.name); languageName_text.text = SpilGame.currentLanguage.displayName; languageName_text.embedFonts = SpilGame.currentLanguage.embedInputFonts; }; } public function set popupLocation(_arg1:String):void{ trace(("popupLocation = " + _arg1)); if (_arg1 == "bottom"){ popup.y = Math.floor(mc.height); } else { popup.y = (-(Math.floor(mc.height)) + 1); }; } } }//package spill.localisation
Section 196
//LanguageSelectBox_mc (spill.localisation.LanguageSelectBox_mc) package spill.localisation { import flash.text.*; import flash.display.*; public dynamic class LanguageSelectBox_mc extends MovieClip { public var languageName_text:TextField; public var flag:MovieClip; } }//package spill.localisation
Section 197
//LanguageSelectPopup_mc (spill.localisation.LanguageSelectPopup_mc) package spill.localisation { import flash.display.*; public dynamic class LanguageSelectPopup_mc extends MovieClip { public var l_ar:MovieClip; public var l_pt:MovieClip; public var l_en_uk:MovieClip; public var l_br:MovieClip; public var l_ru:MovieClip; public var l_se:MovieClip; public var l_in:MovieClip; public var l_es:MovieClip; public var l_fr:MovieClip; public var l_de:MovieClip; public var l_jp:MovieClip; public var l_nl:MovieClip; public var l_pl:MovieClip; public var l_es_ar:MovieClip; public var l_id:MovieClip; public var l_en_us:MovieClip; public var l_it:MovieClip; public var l_es_mx:MovieClip; public var l_cn:MovieClip; } }//package spill.localisation
Section 198
//LocalizedTextField (spill.localisation.LocalizedTextField) package spill.localisation { import flash.events.*; public class LocalizedTextField extends TextFieldFit { private var originalText:String; private var regex:RegExp; public function LocalizedTextField(){ regex = /{([^{}]*)}/g; super(); addEventListener(Event.ADDED_TO_STAGE, added, false, 0, true); addEventListener(Event.REMOVED_FROM_STAGE, removed, false, 0, true); added(); } private function added(_arg1:Event=null):void{ SpilGame.addEventListener("languageChanged", languageChanged, false, 0, true); text = originalText; } private function removed(_arg1:Event):void{ SpilGame.removeEventListener("languageChanged", languageChanged); } private function languageChanged(_arg1:Event):void{ text = originalText; updateProperties(); } override public function set text(_arg1:String):void{ originalText = _arg1; if ((_arg1 is String)){ super.text = _arg1.replace(regex, replaceFn); } else { super.text = ""; }; trace(super.text); } private function replaceFn():String{ var _local2:String = SpilGame.getString(arguments[1]); if (((!(_local2)) || ((_local2 == "")))){ return ((("{" + arguments[1]) + "}")); }; return (_local2); } } }//package spill.localisation
Section 199
//PortalGroup (spill.localisation.PortalGroup) package spill.localisation { import flash.xml.*; public class PortalGroup { public static const FAMILY:uint = 0; public static const TEENS:uint = 1; public static const GIRL:uint = 2; public static const YOUNG_ADULTS:uint = 3; public static const ZAPAPA:uint = 4; public static const HYVES:uint = 5; public static const NONE:uint = 6; public static const channelNames:Array = ["family", "tween", "girl", "teen", "zapapa", "hyves"]; public static const backgroundColors:Array = [0xFFFFFF, 0xFFFFFF, 16742331, 0xFFFFFF, 0xFFFFFF, 0xFFFFFF]; public static function getName(_arg1:int):String{ return (channelNames[_arg1]); } public static function exportXML():XMLNode{ var _local3:XMLNode; var _local1:XMLNode = new XMLNode(1, "channels"); var _local2:int; while (_local2 < 5) { _local3 = new XMLNode(1, "channel"); _local3.attributes.name = channelNames[_local2]; _local3.attributes.id = _local2; _local1.appendChild(_local3); _local2++; }; return (_local1); } } }//package spill.localisation
Section 200
//spil_internal (spill.localisation.spil_internal) package spill.localisation { public namespace spil_internal = "spill.localisation"; }//package spill.localisation
Section 201
//SpilGame (spill.localisation.SpilGame) package spill.localisation { import flash.display.*; import flash.text.*; import flash.ui.*; import flash.events.*; import flash.net.*; import flash.system.*; import flash.external.*; public class SpilGame { private static const cookiePath:String = "/"; private static const cookieName:String = "spilgames_language_v100"; private static const cookieLanguageVar:String = "savedLang"; public static const LANGUAGE_CHANGED:String = "languageChanged"; public static const BRANDING_CHANGED:String = "brandingChanged"; spil_internal static var gameName:String; public static var currentBranding:Brand; public static var currentLanguage:Language; spil_internal static var emailPage:String; spil_internal static var portalGroup:uint; private static var channelLock:Boolean = false; private static var _init:Boolean = false; private static var eventDispatcher:EventDispatcher; private static var localDomains:Object = new Object(); private static var strings:Object = new Object(); private static var contexMenuItem:ContextMenuItem; private static var stage:Sprite; spil_internal static var debugHostDomain:String = ""; spil_internal static var debugEmbedDomain:String = ""; public static function initialize(_arg1:String, _arg2:int, _arg3:String, _arg4:Sprite, _arg5:Boolean=false):void{ stage = _arg4; if (_init){ trace("ERROR: LocalisationManager already initialised"); return; }; _init = true; localDomains["localhost"] = true; localDomains["www8.agame.com"] = true; localDomains["gamedev.dev.spilgames.com"] = true; localDomains["stg.spel.nl"] = true; localDomains["stg.girlsgogames.nl"] = true; localDomains["stg.pl.spel.nl"] = true; localDomains["stg.pl.girlsgogames.nl"] = true; trace(localDomains["stg.girlsgogames.nl"]); Brandings.initialize(); Languages.initialize(); initContexMenu(_arg4); channelLock = _arg5; gameName = _arg1.replace(" ", "_"); portalGroup = _arg2; emailPage = _arg3; chooseLanguage(); chooseBranding(); if (portalGroup == PortalGroup.HYVES){ changeLanguage("nl"); }; } public static function initTextField(_arg1:TextField):void{ var _local2:TextFormat; trace(_arg1.text); _arg1.text = _arg1.text.replace(/{([^{}]*)}/g, replaceFn); trace(_arg1.text); _arg1.embedFonts = currentLanguage.embedFonts; if (currentLanguage.forceFont != ""){ _local2 = new TextFormat(); _local2.font = currentLanguage.forceFont; _arg1.setTextFormat(_local2); }; } private static function replaceFn():String{ var _local2:String = SpilGame.getString(arguments[1]); if (((!(_local2)) || ((_local2 == "")))){ return ((("{" + arguments[1]) + "}")); }; return (_local2); } public static function outputAllBrands():String{ var _local3:Brand; var _local1:Array = Brandings.getBrandsArray(); var _local2:String = ""; for each (_local3 in _local1) { _local2 = (_local2 + (_local3.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain) + "\n")); }; return (_local2); } public static function traceAllBrands():void{ trace(outputAllBrands()); } public static function getMoreGamesLink(_arg1:String=""):String{ var _local2:String = (embedDomain) ? embedDomain : hostingDomain; return (currentBranding.getMoreGamesLink(gameName, isExternal, _local2, _arg1)); } public static function getSendToFriendLink():String{ return (currentBranding.getSendToFriendLink(gameName, emailPage, isExternal, embedDomain)); } public static function getPromotionLink(_arg1:String="feature_promotion"):String{ var _local2:String = (embedDomain) ? embedDomain : hostingDomain; return (currentBranding.getPromotionLink(gameName, emailPage, isExternal, _local2, _arg1)); } public static function getSpilCompanyLink():String{ var _local1:String = "http://www.gameportal.net/"; _local1 = (_local1 + ("?utm_medium=brandedgames_" + (isExternal) ? "external" : "internal")); _local1 = (_local1 + ("&utm_campaign=" + gameName)); _local1 = (_local1 + ("&utm_source=" + Brand.stripSubDomain((embedDomain) ? embedDomain : hostingDomain))); _local1 = (_local1 + "&utm_content=Branding_Link"); return (_local1); } public static function importXML(_arg1:XML):void{ var _local2:XML; var _local3:Object; var _local4:XML; for each (_local2 in _arg1.children()) { _local3 = (strings[_local2.identifier] = new Object()); for each (_local4 in _local2.children()) { _local3[_local4.name()] = _local4.children()[0].toString(); }; }; } public static function importXMLv2(_arg1:XML):void{ var _local2:XML; var _local3:Object; var _local4:XML; for each (_local2 in _arg1.children()) { _local3 = (strings[_local2.attribute("identifier")] = new Object()); for each (_local4 in _local2.children()) { if (_local4.children().length() > 0){ _local3[_local4.name()] = _local4.children()[0].toString(); } else { _local3[_local4.name()] = ""; }; }; }; } public static function getString(_arg1:String):String{ var _local2:Object = strings[_arg1]; if (_local2){ if (currentLanguage.textLanguage){ return (_local2[currentLanguage.textLanguage]); }; if (_local2[currentLanguage.name]){ return (_local2[currentLanguage.name]); }; return (_local2["en_us"]); //unresolved jump }; return (""); } private static function initContexMenu(_arg1:Sprite):void{ contexMenuItem = new ContextMenuItem(""); _arg1.contextMenu = new ContextMenu(); _arg1.contextMenu.customItems.push(contexMenuItem); contexMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contexMenuClicked); } private static function contexMenuClicked(_arg1:ContextMenuEvent):void{ navigateToURL(new URLRequest(getMoreGamesLink("Contex_Menu"))); } spil_internal static function chooseLanguage():void{ if (cookieLanguage != null){ currentLanguage = cookieLanguage; } else { if (isExternal){ currentLanguage = systemLanguage; } else { currentLanguage = portalLanguage; if (!(currentLanguage)){ currentLanguage = systemLanguage; }; }; }; if (!(currentLanguage)){ trace("Unable to determine language, using 'English US'"); currentLanguage = Languages.getLanguage("en_us"); }; TextFieldFit.embedFonts = currentLanguage.embedFonts; TextFieldFit.forceFont = currentLanguage.forceFont; dispatchEvent(new Event(LANGUAGE_CHANGED)); } spil_internal static function chooseBranding():void{ currentBranding = Brandings.getBrandByDomain(currentLanguage.portal_groups[portalGroup]); if (!((currentBranding is Brand))){ currentBranding = Brandings.getBrandByDomain("www.agame.com"); }; contexMenuItem.caption = ("More Games: " + currentBranding.domain); dispatchEvent(new Event(BRANDING_CHANGED)); } spil_internal static function changeLanguage(_arg1:String):void{ var _local2:Language = Languages.getLanguage(_arg1); if (!(_local2)){ trace("ERROR: Supplied language string does not have a matching language"); } else { cookieLanguage = _local2; currentLanguage = _local2; }; TextFieldFit.embedFonts = currentLanguage.embedFonts; TextFieldFit.forceFont = currentLanguage.forceFont; chooseBranding(); dispatchEvent(new Event(LANGUAGE_CHANGED)); } private static function get portalLanguage():Language{ var _local1:Brand; var _local2:String; var _local3:Language; if (isExternal){ return (null); }; if (!(embedDomain)){ return (null); }; _local1 = Brandings.getBrandByDomain(embedDomain); if (!(_local1)){ return (null); }; _local2 = _local1.preferedLanguage; if (!(_local2)){ return (null); }; _local3 = Languages.getLanguage(_local2); if (!(_local3)){ return (null); }; return (_local3); } spil_internal static function get systemLanguage():Language{ return (Languages.getLanguage(Capabilities.language)); } spil_internal static function get cookieLanguage():Language{ var _local1:SharedObject = SharedObject.getLocal(cookieName, cookiePath); var _local2:String = String(_local1.data[cookieLanguageVar]); return (Languages.getLanguage(_local2)); } spil_internal static function set cookieLanguage(_arg1:Language):void{ var _local2:SharedObject = SharedObject.getLocal(cookieName, cookiePath); if (_arg1 == null){ _local2.data[cookieLanguageVar] = null; } else { _local2.data[cookieLanguageVar] = _arg1.name; }; _local2.flush(); } public static function get isExternal():Boolean{ return (((((!(Brandings.hasDomain(embedDomain))) && (!(localDomains[embedDomain])))) && (!(isStagingDomain)))); } public static function get isStagingDomain():Boolean{ var _local1:String = ("http://" + embedDomain); return ((_local1.indexOf("http://stg.") >= 0)); } spil_internal static function get hostingDomain():String{ var _local1:LocalConnection; if (debugHostDomain != ""){ return (debugHostDomain); }; _local1 = new LocalConnection(); return (_local1.domain); } spil_internal static function get embedDomain():String{ var loc:String; if (debugEmbedDomain != ""){ return (debugEmbedDomain); }; if (ExternalInterface.available){ try { loc = ExternalInterface.call("window.location.href.toString"); if (((!((loc == ""))) && (!((loc == null))))){ trace(("embed domain = " + getDomain(loc))); return (getDomain(loc)); }; } catch(e:SecurityError) { trace(("Security Error connecting to external interface, error = " + e)); } catch(e:Error) { trace(("Error connecting to external interface, error = " + e)); }; }; return (null); } public static function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{ if (!(eventDispatcher)){ eventDispatcher = new EventDispatcher(); }; eventDispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5); } public static function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{ if (!(eventDispatcher)){ eventDispatcher = new EventDispatcher(); }; eventDispatcher.removeEventListener(_arg1, _arg2, _arg3); } spil_internal static function dispatchEvent(_arg1:Event):void{ if (!(eventDispatcher)){ eventDispatcher = new EventDispatcher(); }; eventDispatcher.dispatchEvent(_arg1); } public static function exportXML():XML{ var _local1:XML = <spil_games/> ; _local1.appendChild(Brandings.exportXML()); _local1.appendChild(Languages.exportXML()); _local1.appendChild(PortalGroup.exportXML()); return (_local1); } private static function getDomain(_arg1:String):String{ var _local2:String; var _local3:uint; if (_arg1.indexOf("file") == 0){ return ("offline_play"); }; _local2 = new String(); _local3 = 7; while (_local3 < _arg1.length) { if (_arg1.charAt(_local3) == "/"){ break; }; _local2 = (_local2 + _arg1.charAt(_local3)); _local3++; }; if (_local2 == "localhost"){ _local2 = "offline_play"; }; return (_local2); } } }//package spill.localisation
Section 202
//SpilGamesLink (spill.localisation.SpilGamesLink) package spill.localisation { import flash.events.*; import flash.net.*; import flash.display.*; public class SpilGamesLink extends SimpleButton { public function SpilGamesLink(){ addEventListener(MouseEvent.CLICK, buttonClicked); } private function buttonClicked(_arg1:MouseEvent):void{ navigateToURL(new URLRequest(SpilGame.getSpilCompanyLink()), "_blank"); } } }//package spill.localisation
Section 203
//TextFieldFit (spill.localisation.TextFieldFit) package spill.localisation { import flash.text.*; import flash.utils.*; import flash.events.*; import flash.filters.*; import flash.display.*; public class TextFieldFit extends MovieClip { private var field:TextField; private var w:Number; private var h:Number; private var format:TextFormat; private var embeddedFonts:Array; private var sizeChanged:Boolean;// = true private var debugBounding:Sprite; private var valid:Boolean;// = true protected var _text:String;// = "default" protected var _textColor:uint;// = 0 protected var _textSize:Number;// = 12 protected var _multiline:Boolean;// = false protected var _disableWordwrap:Boolean;// = false protected var _hAlign:String;// = "left" protected var _vAlign:String;// = "top" protected var _bold:Boolean;// = false protected var _underline:Boolean;// = false protected var _italic:Boolean;// = false protected var _selectable:Boolean;// = false protected var _font:String;// = "" protected var _embedFonts:Boolean;// = true protected var _antiAliasType:String;// = "advanced" protected var _gridFitType:String;// = "pixel" protected var _useGlowFilter:Boolean;// = false protected var _glowBlur:Number;// = 3 protected var _glowColor:uint;// = 0 protected var _glowStrength:Number;// = 5 protected var _glowQuality:Number;// = 1 private static const gutter:Number = 2; spil_internal static var embedFonts:Boolean = true; spil_internal static var forceFont:String = null; spil_internal static var forceAAType:String = null; public static var alwaysCheckWidth:Boolean = false; public function TextFieldFit(){ var _local1:Boolean = ((!((parent == null))) && ((getQualifiedClassName(parent) == "fl.livepreview::LivePreviewParent"))); var _local2:Number = width; var _local3:Number = height; if (numChildren > 0){ removeChildAt(0); }; if (!(field)){ field = new TextField(); addChild(field); }; field.border = false; field.background = false; field.type = TextFieldType.DYNAMIC; mouseEnabled = false; mouseChildren = false; format = new TextFormat(); embeddedFonts = Font.enumerateFonts(false); setSize(_local2, _local3); validate(); if (stage){ addEventListener(Event.RENDER, init); stage.invalidate(); }; init(); } public function get textField():TextField{ return (field); } private function init(_arg1:Event=null):void{ removeEventListener(Event.RENDER, init); updateProperties(); layoutText(); } protected function updateProperties():void{ var _local1:Boolean; var _local2:Font; field.text = _text; field.multiline = ((((_text.indexOf(" ") < 0)) && ((_text.length < 14)))) ? false : _multiline; field.wordWrap = ((field.multiline) && (!(_disableWordwrap))); field.selectable = _selectable; field.antiAliasType = (forceAAType) ? forceAAType : _antiAliasType; field.gridFitType = _gridFitType; embeddedFonts = Font.enumerateFonts(false); if (((((_embedFonts) && (!((_font == ""))))) && (TextFieldFit.embedFonts))){ _local1 = false; for each (_local2 in embeddedFonts) { if (_font == _local2.fontName){ _local1 = true; break; }; }; field.embedFonts = _local1; if (!(_local1)){ trace(((("WARNING: Embedded font '" + _font) + "' not found, disabling embedding of fonts, text = ") + _text)); } else { trace((("Found Embedded font '" + _font) + "' using font")); }; } else { field.embedFonts = false; }; if (TextFieldFit.forceFont){ format.font = TextFieldFit.forceFont; } else { format.font = _font; }; if (sizeChanged){ format.size = _textSize; }; format.color = _textColor; format.align = _hAlign; format.bold = _bold; format.italic = _italic; format.underline = _underline; format.leftMargin = 0; format.rightMargin = 0; field.setTextFormat(format); if (_useGlowFilter){ filters = [new GlowFilter(_glowColor, 1, _glowBlur, _glowBlur, _glowStrength, _glowQuality)]; } else { filters = []; }; } public function setSize(_arg1:Number, _arg2:Number):void{ w = _arg1; h = _arg2; scaleX = (scaleY = 1); field.width = w; field.height = h; invalidate(); } private function layoutText():void{ resizeText(); field.height = (field.textHeight + (gutter * 2)); if (vAlign == "top"){ field.y = 0; } else { if (vAlign == "middle"){ field.y = ((h - field.height) / 2); } else { if (vAlign == "bottom"){ field.y = (h - field.height); }; }; }; } private function resizeText(_arg1:Boolean=false):void{ if (!(doesTextFit())){ format.size = Object((Number(format.size) - 1)); if (format.size <= 3){ trace("WARNING: Text resised to 3px, either an error occured or the text just wont fit"); return; }; field.setTextFormat(format); resizeText(true); } else { if (_arg1 == false){ while (doesTextFit()) { if (format.size <= textSize){ format.size = Object((Number(format.size) + 1)); field.setTextFormat(format); if (!(doesTextFit())){ format.size = Object((Number(format.size) - 1)); field.setTextFormat(format); break; }; } else { break; }; }; }; }; } private function doesTextFit():Boolean{ if (((((field.textHeight + (gutter * 2)) > h)) || (((((field.textWidth + (gutter * 2)) > w)) && (((!(field.multiline)) || (alwaysCheckWidth))))))){ return (false); }; return (true); } private function invalidate():void{ if (valid){ addEventListener(Event.ENTER_FRAME, validate); if (stage){ stage.invalidate(); }; valid = false; }; } private function validate(_arg1:Event=null):void{ updateProperties(); layoutText(); removeEventListener(Event.ENTER_FRAME, validate); valid = true; } public function set text(_arg1:String):void{ _text = _arg1; invalidate(); } public function get text():String{ return (_text); } public function set textColor(_arg1:uint):void{ _textColor = _arg1; invalidate(); } public function get textColor():uint{ return (_textColor); } public function set textSize(_arg1:Number):void{ _textSize = _arg1; sizeChanged = true; invalidate(); } public function get textSize():Number{ return (_textSize); } public function set multiline(_arg1:Boolean):void{ _multiline = _arg1; invalidate(); } public function get multiline():Boolean{ return (_multiline); } public function set disableWordwrap(_arg1:Boolean):void{ _disableWordwrap = _arg1; invalidate(); } public function get disableWordwrap():Boolean{ return (_disableWordwrap); } public function set hAlign(_arg1:String):void{ _hAlign = _arg1; invalidate(); } public function get hAlign():String{ return (_hAlign); } public function set vAlign(_arg1:String):void{ _vAlign = _arg1; invalidate(); } public function get vAlign():String{ return (_vAlign); } public function set bold(_arg1:Boolean):void{ _bold = _arg1; invalidate(); } public function get bold():Boolean{ return (_bold); } public function set underline(_arg1:Boolean):void{ _underline = _arg1; invalidate(); } public function get underline():Boolean{ return (_underline); } public function set italic(_arg1:Boolean):void{ _italic = _arg1; invalidate(); } public function get italic():Boolean{ return (_italic); } public function set selectable(_arg1:Boolean):void{ _selectable = _arg1; invalidate(); } public function get selectable():Boolean{ return (_selectable); } public function set font(_arg1:String):void{ _font = _arg1; invalidate(); } public function get font():String{ return (_font); } public function set embedFonts(_arg1:Boolean):void{ _embedFonts = _arg1; invalidate(); } public function get embedFonts():Boolean{ return (_embedFonts); } public function set antiAliasType(_arg1:String):void{ _antiAliasType = _arg1; invalidate(); } public function get antiAliasType():String{ return (_antiAliasType); } public function set gridFitType(_arg1:String):void{ _gridFitType = _arg1; invalidate(); } public function get gridFitType():String{ return (_gridFitType); } public function set useGlowFilter(_arg1:Boolean):void{ _useGlowFilter = _arg1; invalidate(); } public function get useGlowFilter():Boolean{ return (_useGlowFilter); } public function set glowBlur(_arg1:Number):void{ _glowBlur = _arg1; invalidate(); } public function get glowBlur():Number{ return (_glowBlur); } public function set glowColor(_arg1:uint):void{ _glowColor = _arg1; invalidate(); } public function get glowColor():uint{ return (_glowColor); } public function set glowStrength(_arg1:Number):void{ _glowStrength = _arg1; invalidate(); } public function get glowStrength():Number{ return (_glowStrength); } public function set glowQuality(_arg1:Number):void{ _glowQuality = _arg1; invalidate(); } public function get glowQuality():Number{ return (_glowQuality); } } }//package spill.localisation
Section 204
//Log (SWFStats.Log) package SWFStats { import flash.utils.*; import flash.system.*; import flash.events.*; import flash.net.*; import flash.external.*; public final class Log { private static const PingF:Timer = new Timer(60000); private static const PingR:Timer = new Timer(30000); public static var Enabled:Boolean = false; public static var Queue:Boolean = true; public static var SWFID:int = 0; public static var GUID:String = ""; public static var SourceUrl:String; private static var Request:LogRequest = new LogRequest(); private static var FirstPing:Boolean = true; private static var Pings:int = 0; private static var Plays:int = 0; private static var HighestGoal:int = 0; public static function View(_arg1:int=0, _arg2:String="", _arg3:String=""):void{ if (SWFID > 0){ return; }; SWFID = _arg1; GUID = _arg2; Enabled = true; if ((((SWFID == 0)) || ((GUID == "")))){ Enabled = false; return; }; if (((((!((_arg3.indexOf("http://") == 0))) && (!((Security.sandboxType == "localWithNetwork"))))) && (!((Security.sandboxType == "localTrusted"))))){ Enabled = false; return; }; SourceUrl = GetUrl(_arg3); if ((((SourceUrl == null)) || ((SourceUrl == "")))){ Enabled = false; return; }; Security.allowDomain("http://tracker.swfstats.com/"); Security.allowInsecureDomain("http://tracker.swfstats.com/"); Security.loadPolicyFile("http://tracker.swfstats.com/crossdomain.xml"); Security.allowDomain("http://utils.swfstats.com/"); Security.allowInsecureDomain("http://utils.swfstats.com/"); Security.loadPolicyFile("http://utils.swfstats.com/crossdomain.xml"); var _local4:int = GetCookie("views"); _local4++; SaveCookie("views", _local4); Send(("v/" + _local4), true); PingF.addEventListener(TimerEvent.TIMER, PingServer); PingF.start(); } public static function Play():void{ if (!(Enabled)){ return; }; Plays++; Send(("p/" + Plays)); } public static function Goal(_arg1:int, _arg2:String):void{ } private static function PingServer(... _args):void{ if (!(Enabled)){ return; }; Pings++; Send(((("t/" + (FirstPing) ? "y" : "n") + "/") + Pings), true); if (FirstPing){ PingF.stop(); PingR.addEventListener(TimerEvent.TIMER, PingServer); PingR.start(); FirstPing = false; }; } public static function CustomMetric(_arg1:String, _arg2:String=null):void{ if (!(Enabled)){ return; }; if (_arg2 == null){ _arg2 = ""; }; Send(((("c/" + Clean(_arg1)) + "/") + Clean(_arg2))); } public static function LevelCounterMetric(_arg1:String, _arg2):void{ if (!(Enabled)){ return; }; Send(((("lc/" + Clean(_arg1)) + "/") + Clean(_arg2))); } public static function LevelRangedMetric(_arg1:String, _arg2, _arg3:int):void{ if (!(Enabled)){ return; }; Send(((((("lr/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3)); } public static function LevelAverageMetric(_arg1:String, _arg2, _arg3:int):void{ if (!(Enabled)){ return; }; Send(((((("la/" + Clean(_arg1)) + "/") + Clean(_arg2)) + "/") + _arg3)); } private static function Send(_arg1:String, _arg2:Boolean=false):void{ Request.Queue(_arg1); if (((((Request.Ready) || (_arg2))) || (!(Queue)))){ Request.Send(); Request = new LogRequest(); }; } private static function Clean(_arg1:String):String{ return (escape(_arg1.replace("/", "\\").replace("~", "-"))); } private static function GetCookie(_arg1:String):int{ var _local2:SharedObject = SharedObject.getLocal("swfstats"); if (_local2.data[_arg1] == undefined){ return (0); }; return (int(_local2.data[_arg1])); } private static function SaveCookie(_arg1:String, _arg2:int):void{ var _local3:SharedObject = SharedObject.getLocal("swfstats"); _local3.data[_arg1] = _arg2.toString(); _local3.flush(); } private static function GetUrl(_arg1:String):String{ var url:String; var defaulturl = _arg1; if (ExternalInterface.available){ try { url = String(ExternalInterface.call("window.location.href.toString")); } catch(s:Error) { url = defaulturl; }; } else { if (defaulturl.indexOf("http://") == 0){ url = defaulturl; }; }; if ((((((url == null)) || ((url == "")))) || ((url == "null")))){ if ((((Security.sandboxType == "localWithNetwork")) || ((Security.sandboxType == "localTrusted")))){ url = "http://local-testing/"; } else { url = null; }; }; return (url); } } }//package SWFStats
Section 205
//LogRequest (SWFStats.LogRequest) package SWFStats { import flash.net.*; import flash.events.*; public final class LogRequest { private var Data:String;// = "" private var Pieces:int; public var Ready:Boolean;// = false private static var Failed:int = 0; public function Queue(_arg1:String):void{ if (Failed > 3){ return; }; this.Pieces++; this.Data = (this.Data + (((this.Data == "")) ? "" : "~" + _arg1)); if ((((this.Pieces == 8)) || ((this.Data.length > 300)))){ this.Ready = true; }; } public function Send():void{ var _local1:URLLoader = new URLLoader(); _local1.addEventListener(IOErrorEvent.IO_ERROR, this.IOErrorHandler); _local1.addEventListener(HTTPStatusEvent.HTTP_STATUS, this.StatusChange); _local1.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.SecurityErrorHandler); _local1.load(new URLRequest((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z"))); trace((((((((((("http://tracker.swfstats.com/Games/q.aspx?guid=" + Log.GUID) + "&swfid=") + Log.SWFID) + "&q=") + this.Data) + "&url=") + Log.SourceUrl) + "&") + Math.random()) + "z")); } private function IOErrorHandler(_arg1:IOErrorEvent):void{ Failed++; } private function SecurityErrorHandler(_arg1:SecurityErrorEvent):void{ } private function StatusChange(_arg1:HTTPStatusEvent):void{ } } }//package SWFStats
Section 206
//AlienThief (AlienThief) package { import flash.events.*; import flash.net.*; import com.tinime.data.*; import SWFStats.*; import com.spilgames.api.*; import spill.localisation.*; import com.tinime.control.*; import flash.display.*; public class AlienThief extends MovieClip { public function AlienThief(){ addEventListener(Event.ADDED_TO_STAGE, onAddToStage); var _local1:LocalConnection = new LocalConnection(); CommonVals.currentDomain = _local1.domain; Log.View(824, "53996223-42d4-4537-9857-d5ab2f3e2b72", root.loaderInfo.loaderURL); } private function onServicesReady(_arg1:Event):void{ trace("SpilGamesServices are ready\n"); } private function onServicesFailed(_arg1:ErrorEvent):void{ trace((("SpilGamesServices failed: " + _arg1.text) + "\n")); } private function selectTinimeLink(_arg1:ContextMenuEvent):void{ navigateToURL(new URLRequest("http://www.tinime.com"), "_blank"); } private function onAddToStage(_arg1:Event):void{ var _local2:XML; var _local5:SpilGamesServices; SpilGame.initialize("Alien_Thief", PortalGroup.TEENS, "Alien-Thief.html", this, true); _local2 = <LocalisedText><textItem identifier="initializing"><en_us>Initializing…</en_us><en_uk>Initializing…</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>初使化…</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="playBtn"><en_us>PLAY</en_us><en_uk>PLAY</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>开始</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="medalsBtn"><en_us>MEDALS</en_us><en_uk>MEDALS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>奖章</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="scoresBtn"><en_us>SCORES</en_us><en_uk>SCORES</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>分数</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="creditsBtn"><en_us>CREDITS</en_us><en_uk>CREDITS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>信息</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="moreGamesBtn"><en_us>MORE GAMES</en_us><en_uk>MORE GAMES</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>更多游戏</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelNum"><en_us>LEVEL</en_us><en_uk>LEVEL</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>关卡</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="selectLevel"><en_us>SELECT LEVEL</en_us><en_uk>SELECT LEVEL</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>选择关卡</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="prevBtn"><en_us>PREV</en_us><en_uk>PREV</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>上页</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="nextBtn"><en_us>NEXT</en_us><en_uk>NEXT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>下页</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="backBtn"><en_us>BACK</en_us><en_uk>BACK</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="chooseYourController"><en_us>CHOOSE YOUR CONTROLLER</en_us><en_uk>CHOOSE YOUR CONTROLLER</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="keyboard"><en_us>KEYBOARD</en_us><en_uk>KEYBOARD</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="mouse"><en_us>MOUSE</en_us><en_uk>MOUSE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="life"><en_us>LIFE:</en_us><en_uk>LIFE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="score"><en_us>SCORES:</en_us><en_uk>SCORES:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="level"><en_us>LEVEL:</en_us><en_uk>LEVEL:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="gamePaused"><en_us>GAME PAUSED</en_us><en_uk>GAME PAUSED</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="spacePress"><en_us>Press 'Space' key to continue</en_us><en_uk>Press 'Space' key to continue</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="resumeBtn"><en_us>RESUME</en_us><en_uk>RESUME</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="restartBtn"><en_us>RESTART</en_us><en_uk>RESTART</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="quitBtn"><en_us>QUIT</en_us><en_uk>QUIT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="gameOver"><en_us>GAME OVER</en_us><en_uk>GAME OVER</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tryAgainBtn"><en_us>TRY AGAIN</en_us><en_uk>TRY AGAIN</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="totalScore"><en_us>TOTAL SCORE:</en_us><en_uk>TOTAL SCORE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelComplete"><en_us>LEVEL COMPLETE:</en_us><en_uk>LEVEL COMPLETE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelScore"><en_us>Level Score:</en_us><en_uk>Level Score:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="continueBtn"><en_us>CONTINUE</en_us><en_uk>CONTINUE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="yourMedals"><en_us>YOUR MEDALS</en_us><en_uk>YOUR MEDALS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="designAndProgramming"><en_us>GAME DESIGN&PROGRAMMING</en_us><en_uk>GAME DESIGN&PROGRAMMING</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="art"><en_us>ART</en_us><en_uk>ART</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="music"><en_us>MUSIC</en_us><en_uk>MUSIC</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial1"><en_us>You can choose either to use arrow keys or w,s,a,d to fly around.</en_us><en_uk>You can choose either to use arrow keys or w,s,a,d to fly around.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial2"><en_us>Press space key to lift animals and other things like trash can and cannon ball.</en_us><en_uk>Press space key to lift animals and other things like trash can and cannon ball.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="spaceKey"><en_us>SPACE</en_us><en_uk>SPACE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial3"><en_us>Pick and drop the cow here. Our babies like milk greatly!</en_us><en_uk>Pick and drop the cow here. Our babies like milk greatly!</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial4"><en_us>The ship will follow your mouse position, click and hold the mouse to lift things.</en_us><en_uk>The ship will follow your mouse position, click and hold the mouse to lift things.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial5"><en_us>By pressing 'Enter'key or click the icon below, you will enter into the camera mode,Then you can use arrow keys to scroll the whole scene.</en_us><en_uk>By pressing 'Enter'key or click the icon below, you will enter into the camera mode,Then you can use arrow keys to scroll the whole scene.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="submitScore"><en_us>SUBMIT SCORE</en_us><en_uk>SUBMIT SCORE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="submitBtn"><en_us>SUBMIT</en_us><en_uk>SUBMIT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="medalAwarded"><en_us>MEDAL AWARDED</en_us><en_uk>MEDAL AWARDED</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="rookie"><en_us>Rookie</en_us><en_uk>Rookie</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="pilot"><en_us>Pilot</en_us><en_uk>Pilot</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="cowSavior"><en_us>Cow Savior</en_us><en_uk>Cow Savior</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="explorer"><en_us>Explorer</en_us><en_uk>Explorer</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="richAlien"><en_us>Rich Alien</en_us><en_uk>Rich Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="wealthyAlien"><en_us>Wealthy Alien</en_us><en_uk>Wealthy Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tormentedAlien"><en_us>Tormented Alien</en_us><en_uk>Tormented Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="butcher"><en_us>Butcher</en_us><en_uk>Butcher</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="superStar"><en_us>SuperStar</en_us><en_uk>SuperStar</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="masterPilot"><en_us>Master Pilot</en_us><en_uk>Master Pilot</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="rookieDes"><en_us>First level Complete</en_us><en_uk>First level Complete</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="pilotDes"><en_us>Complete level 12</en_us><en_uk>Complete level 12</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="cowSaviorDes"><en_us>Complete level 15</en_us><en_uk>Complete level 15</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="explorerDes"><en_us>Find a hidden place</en_us><en_uk>Find a hidden place</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="richAlienDes"><en_us>Gather 50 stars</en_us><en_uk>Gather 50 stars</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="wealthyAlienDes"><en_us>Gather 200 stars</en_us><en_uk>Gather 200 stars</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tormentedAlienDes"><en_us>Die 20 times</en_us><en_uk>Die 20 times</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="butcherDes"><en_us>Have 20 cows killed</en_us><en_uk>Have 20 cows killed</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="superStarDes"><en_us>Win over 20000 score points</en_us><en_uk>Win over 20000 score points</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="masterPilotDes"><en_us>Complete all levels</en_us><en_uk>Complete all levels</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem></LocalisedText> ; SpilGame.importXMLv2(_local2); trace("Language Data Succesfully included"); Languages.initialize(); removeEventListener(Event.ADDED_TO_STAGE, onAddToStage); var _local3:String = this.root.loaderInfo.url.split("/")[2]; var _local4:Array = ["www.tinime.com", "www8.agame.com", "3.xiaoyouxi.cn", "swf.xiaoyouxi.cn", "files.game.com.cn", "files.game.asia", "swf.xiaoyouxi.cn", "files2.game.com.cn", "gamedev.dev.spilgames.com"]; if (CommonVals.currentDomain != "localhost"){ _local5 = SpilGamesServices.getInstance(); _local5.addEventListener("servicesReady", onServicesReady); _local5.addEventListener("servicesFailed", onServicesFailed); _local5.connect(this); if (_local4.indexOf(_local3) == -1){ return; }; }; SpilGame.initialize("Alien_Thief", PortalGroup.TEENS, "Alien-Thief.html", this, true); _local2 = <LocalisedText><textItem identifier="initializing"><en_us>Initializing…</en_us><en_uk>Initializing…</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>初使化…</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="playBtn"><en_us>PLAY</en_us><en_uk>PLAY</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>开始</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="medalsBtn"><en_us>MEDALS</en_us><en_uk>MEDALS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>奖章</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="scoresBtn"><en_us>SCORES</en_us><en_uk>SCORES</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>分数</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="creditsBtn"><en_us>CREDITS</en_us><en_uk>CREDITS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>信息</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="moreGamesBtn"><en_us>MORE GAMES</en_us><en_uk>MORE GAMES</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>更多游戏</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelNum"><en_us>LEVEL</en_us><en_uk>LEVEL</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>关卡</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="selectLevel"><en_us>SELECT LEVEL</en_us><en_uk>SELECT LEVEL</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>选择关卡</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="prevBtn"><en_us>PREV</en_us><en_uk>PREV</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>上页</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="nextBtn"><en_us>NEXT</en_us><en_uk>NEXT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn>下页</cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="backBtn"><en_us>BACK</en_us><en_uk>BACK</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="chooseYourController"><en_us>CHOOSE YOUR CONTROLLER</en_us><en_uk>CHOOSE YOUR CONTROLLER</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="keyboard"><en_us>KEYBOARD</en_us><en_uk>KEYBOARD</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="mouse"><en_us>MOUSE</en_us><en_uk>MOUSE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="life"><en_us>LIFE:</en_us><en_uk>LIFE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="score"><en_us>SCORES:</en_us><en_uk>SCORES:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="level"><en_us>LEVEL:</en_us><en_uk>LEVEL:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="gamePaused"><en_us>GAME PAUSED</en_us><en_uk>GAME PAUSED</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="spacePress"><en_us>Press 'Space' key to continue</en_us><en_uk>Press 'Space' key to continue</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="resumeBtn"><en_us>RESUME</en_us><en_uk>RESUME</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="restartBtn"><en_us>RESTART</en_us><en_uk>RESTART</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="quitBtn"><en_us>QUIT</en_us><en_uk>QUIT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="gameOver"><en_us>GAME OVER</en_us><en_uk>GAME OVER</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tryAgainBtn"><en_us>TRY AGAIN</en_us><en_uk>TRY AGAIN</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="totalScore"><en_us>TOTAL SCORE:</en_us><en_uk>TOTAL SCORE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelComplete"><en_us>LEVEL COMPLETE:</en_us><en_uk>LEVEL COMPLETE:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="levelScore"><en_us>Level Score:</en_us><en_uk>Level Score:</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="continueBtn"><en_us>CONTINUE</en_us><en_uk>CONTINUE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="yourMedals"><en_us>YOUR MEDALS</en_us><en_uk>YOUR MEDALS</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="designAndProgramming"><en_us>GAME DESIGN&PROGRAMMING</en_us><en_uk>GAME DESIGN&PROGRAMMING</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="art"><en_us>ART</en_us><en_uk>ART</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="music"><en_us>MUSIC</en_us><en_uk>MUSIC</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial1"><en_us>You can choose either to use arrow keys or w,s,a,d to fly around.</en_us><en_uk>You can choose either to use arrow keys or w,s,a,d to fly around.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial2"><en_us>Press space key to lift animals and other things like trash can and cannon ball.</en_us><en_uk>Press space key to lift animals and other things like trash can and cannon ball.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="spaceKey"><en_us>SPACE</en_us><en_uk>SPACE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial3"><en_us>Pick and drop the cow here. Our babies like milk greatly!</en_us><en_uk>Pick and drop the cow here. Our babies like milk greatly!</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial4"><en_us>The ship will follow your mouse position, click and hold the mouse to lift things.</en_us><en_uk>The ship will follow your mouse position, click and hold the mouse to lift things.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tutorial5"><en_us>By pressing 'Enter'key or click the icon below, you will enter into the camera mode,Then you can use arrow keys to scroll the whole scene.</en_us><en_uk>By pressing 'Enter'key or click the icon below, you will enter into the camera mode,Then you can use arrow keys to scroll the whole scene.</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="submitScore"><en_us>SUBMIT SCORE</en_us><en_uk>SUBMIT SCORE</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="submitBtn"><en_us>SUBMIT</en_us><en_uk>SUBMIT</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="medalAwarded"><en_us>MEDAL AWARDED</en_us><en_uk>MEDAL AWARDED</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="rookie"><en_us>Rookie</en_us><en_uk>Rookie</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="pilot"><en_us>Pilot</en_us><en_uk>Pilot</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="cowSavior"><en_us>Cow Savior</en_us><en_uk>Cow Savior</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="explorer"><en_us>Explorer</en_us><en_uk>Explorer</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="richAlien"><en_us>Rich Alien</en_us><en_uk>Rich Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="wealthyAlien"><en_us>Wealthy Alien</en_us><en_uk>Wealthy Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="tormentedAlien"><en_us>Tormented Alien</en_us><en_uk>Tormented Alien</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="butcher"><en_us>Butcher</en_us><en_uk>Butcher</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="superStar"><en_us>SuperStar</en_us><en_uk>SuperStar</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="masterPilot"><en_us>Master Pilot</en_us><en_uk>Master Pilot</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="rookieDes"><en_us>First level Complete</en_us><en_uk>First level Complete</en_uk><nl></nl><fr></fr><de></de><es></es><br></br><pt></pt><it></it><se></se><pl></pl><ru></ru><id></id><ar></ar><jp></jp><cn></cn><es_mx></es_mx><es_ar></es_ar></textItem><textItem identifier="pilotDes"><en_us>Complete level 12</en_us><en_uk>Complete level 12<