Section 1
//5_369 (_fla.5_369)
package _fla {
import flash.display.*;
public dynamic class 5_369 extends MovieClip {
public var bit_1:MovieClip;
public var bit_5:MovieClip;
public var bit_6:MovieClip;
public var bit_2:MovieClip;
public var bit_3:MovieClip;
public var bit_4:MovieClip;
}
}//package _fla
Section 2
//aw_273 (_fla.aw_273)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class aw_273 extends MovieClip {
public function aw_273(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 3
//bonus2_290 (_fla.bonus2_290)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class bonus2_290 extends MovieClip {
public function bonus2_290(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 4
//fackbook_mc_95 (_fla.fackbook_mc_95)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class fackbook_mc_95 extends MovieClip {
public var logo_btn:SimpleButton;
public function fackbook_mc_95(){
addFrameScript(0, frame1);
}
function frame1(){
logo_btn.addEventListener(MouseEvent.CLICK, linkHandler);
}
public function linkHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/igirlsgamesfans"), "_blank");
}
}
}//package _fla
Section 5
//helptxt_109 (_fla.helptxt_109)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class helptxt_109 extends MovieClip {
public var 新建符号_5:MovieClip;
public function helptxt_109(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 6
//igirlsgames_loading_4 (_fla.igirlsgames_loading_4)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class igirlsgames_loading_4 extends MovieClip {
public function igirlsgames_loading_4(){
addFrameScript(99, frame100);
}
function frame100(){
stop();
}
}
}//package _fla
Section 7
//igirlsgames_loading_6 (_fla.igirlsgames_loading_6)
package _fla {
import flash.display.*;
public dynamic class igirlsgames_loading_6 extends MovieClip {
public var k28:MovieClip;
public var k23:MovieClip;
public var k30:MovieClip;
public var k31:MovieClip;
public var k33:MovieClip;
public var k22:MovieClip;
public var k36:MovieClip;
public var k35:MovieClip;
public var k32:MovieClip;
public var k4:MovieClip;
public var k6:MovieClip;
public var k7:MovieClip;
public var k8:MovieClip;
public var k2:MovieClip;
public var k5:MovieClip;
public var k9:MovieClip;
public var k1:MovieClip;
public var k34:MovieClip;
public var k3:MovieClip;
public var k10:MovieClip;
public var k12:MovieClip;
public var k13:MovieClip;
public var k14:MovieClip;
public var k15:MovieClip;
public var k16:MovieClip;
public var k17:MovieClip;
public var k19:MovieClip;
public var k18:MovieClip;
public var k11:MovieClip;
public var k20:MovieClip;
public var k24:MovieClip;
public var k25:MovieClip;
public var k26:MovieClip;
public var k21:MovieClip;
public var k29:MovieClip;
public var k27:MovieClip;
}
}//package _fla
Section 8
//igirlsgames_loadingyj6_2 (_fla.igirlsgames_loadingyj6_2)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class igirlsgames_loadingyj6_2 extends MovieClip {
public var logo_btn:SimpleButton;
public function igirlsgames_loadingyj6_2(){
addFrameScript(0, frame1);
}
function frame1(){
logo_btn.addEventListener(MouseEvent.CLICK, linkHandler);
}
public function linkHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.igirlsgames.com"), "_blank");
}
}
}//package _fla
Section 9
//igirlsgamesload_mc_1 (_fla.igirlsgamesload_mc_1)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class igirlsgamesload_mc_1 extends MovieClip {
public var loading:MovieClip;
public var a;
public var percent_mc:MovieClip;
public var play_btn:SimpleButton;
public function igirlsgamesload_mc_1(){
addFrameScript(0, frame1, 1, frame2);
}
public function enterFrameHandler(_arg1:Event):void{
var _local2:Number;
var _local3:*;
_local2 = int(((root.loaderInfo.bytesLoaded / root.loaderInfo.bytesTotal) * 100));
if (percent_mc.currentFrame < _local2){
percent_mc.play();
} else {
percent_mc.stop();
};
_local3 = 1;
while (_local3 <= 36) {
if (_local3 <= Math.ceil(((percent_mc.currentFrame * 36) / 100))){
loading[("k" + _local3)].visible = true;
};
_local3++;
};
if (((loading.k36.visible) && ((percent_mc.currentFrame >= 100)))){
this.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
goNext();
};
}
function frame1(){
stop();
a = 1;
while (a <= 36) {
loading[("k" + a)].gotoAndStop(a);
loading[("k" + a)].visible = false;
a++;
};
this.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
}
public function playHandler(_arg1:MouseEvent):void{
play_btn.removeEventListener(MouseEvent.CLICK, playHandler);
MovieClip(root).play();
}
function frame2(){
stop();
play_btn.addEventListener(MouseEvent.CLICK, playHandler);
}
public function goNext():void{
this.play();
}
}
}//package _fla
Section 10
//igirsl_98 (_fla.igirsl_98)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class igirsl_98 extends MovieClip {
public var logo_btn:SimpleButton;
public function igirsl_98(){
addFrameScript(0, frame1);
}
function frame1(){
logo_btn.addEventListener(MouseEvent.CLICK, linkHandler);
}
public function linkHandler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.igirlsgames.com/seaside-wedding-photoshoots.html"), "_blank");
}
}
}//package _fla
Section 11
//levelcom_298 (_fla.levelcom_298)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class levelcom_298 extends MovieClip {
public function levelcom_298(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 12
//levelzi_365 (_fla.levelzi_365)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class levelzi_365 extends MovieClip {
public function levelzi_365(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 13
//lifezi_367 (_fla.lifezi_367)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class lifezi_367 extends MovieClip {
public function lifezi_367(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 14
//lostmc_317 (_fla.lostmc_317)
package _fla {
import flash.display.*;
public dynamic class lostmc_317 extends MovieClip {
public var retry_btn:SimpleButton;
public var score_mc:MovieClip;
public var bonus_mc:MovieClip;
public var lvscore_mc:MovieClip;
}
}//package _fla
Section 15
//MainTimeline (_fla.MainTimeline)
package _fla {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import flash.filters.*;
import flash.media.*;
import gs.easing.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class MainTimeline extends MovieClip {
public const WORLD_HALFHEIGHT_PIX:int = 5000;
public const GRAVITY_IN_METERS:Number = 9.8;
public var _gamespeed:int;
public var mkCount:int;
public var centerPoint:Point;
public var isPassed:Boolean;
public var setting:Object;
public var d2:MovieClip;
public var GameProgress:gameProgressInfo;
public var help_btn:SimpleButton;
public var d3:MovieClip;
public var mkData:Array;
public var d1:MovieClip;
public var pause_mc:MovieClip;
public var pass_mc:MovieClip;
public var go_btn:SimpleButton;
public var lost_mc:MovieClip;
public var score:int;
public var 新符号_1:MovieClip;
public var play_btn:SimpleButton;
public var win_mc:MovieClip;
public var gp:gameplay;
public var isPaused:Boolean;
public var life:int;
public var moreGameURI:String;
public var TPL_DATA:Array;
public var config:Array;
public var levelScore:int;
public var isLost:Boolean;
public var level:int;
public var load_mc:MovieClip;
public var player_mc:MovieClip;
public var SoundManager:soundManager;
public var lang:String;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
public function initPlayer(_arg1:MovieClip, _arg2:Array, _arg3:String):void{
var _local4:MovieClip;
var _local5:int;
var _local6:Boolean;
var _local7:int;
var _local8:int;
_local5 = 1;
_local6 = true;
while (true) {
_local7 = int(_arg2[_local5]);
_local6 = true;
_local4 = _arg1[(_arg3 + _local5)];
if (!_local4){
_local8 = 1;
while ((_local4 = _arg1[(((_arg3 + _local5) + "_") + _local8)])) {
_local6 = false;
init_item(_local4, _local7);
_local8++;
};
} else {
_local6 = false;
init_item(_local4, _local7);
};
if (_local6){
break;
};
_local5++;
};
}
public function init_ui():void{
var _local1:int;
_local1 = 1;
while (_local1 <= 3) {
this[("d" + _local1)].visible = false;
this[("d" + _local1)].stop();
_local1++;
};
win_mc.replay_btn.addEventListener(MouseEvent.CLICK, replay_handler);
pass_mc.next_btn.addEventListener(MouseEvent.CLICK, next_handler);
lost_mc.retry_btn.addEventListener(MouseEvent.CLICK, retry_handler);
}
public function $(_arg1:MovieClip, _arg2:Function, _arg3:String, _arg4:String="", _arg5:int=1, _arg6:int=-1):void{
var _local7:InteractiveObject;
var _local8:int;
if (_arg6 != -1){
_local8 = _arg5;
while (_local8 <= _arg6) {
_local7 = _arg1[((_arg3 + _local8) + _arg4)];
_arg2.apply(null, [_local7, _local8]);
_local8++;
};
} else {
_local8 = _arg5;
while ((_local7 = _arg1[((_arg3 + _local8) + _arg4)])) {
_arg2.apply(null, [_local7, _local8]);
_local8++;
};
};
}
public function pass():void{
level++;
if (level < 6){
set_score(pass_mc);
TweenLite.to(pass_mc, 0.5, {y:centerPoint.y, ease:Back.easeOut});
} else {
set_score(win_mc);
TweenLite.to(win_mc, 0.5, {y:centerPoint.y, ease:Back.easeOut});
};
}
public function gameLost():void{
}
public function help_handler(_arg1:MouseEvent):void{
clear_start();
this.gotoAndStop("help");
}
public function more_handler(_arg1:MouseEvent):void{
navigateToURL(new URLRequest(moreGameURI), "_blank");
}
function frame3(){
stop();
init_help();
}
function frame1(){
lang = "en";
moreGameURI = "http://www.igirlsgames.com/make-up-girl.html";
config = [];
_gamespeed = 40;
SoundManager = new soundManager();
GameProgress = new gameProgressInfo();
mkData = [];
TPL_DATA = [undefined, 6, 6, 6, 1];
stop();
}
function frame4(){
stop();
scoreAchievementsController.scores = 0;
scoreAchievementsController.levelScore = 0;
centerPoint = new Point(426, 170);
init_game();
}
public function init_start():void{
play_btn.addEventListener(MouseEvent.CLICK, play_handler);
help_btn.addEventListener(MouseEvent.CLICK, help_handler);
}
public function set_score(_arg1:MovieClip):void{
UtilDigital.set_digital(_arg1.lvscore_mc, scoreAchievementsController.levelScore);
UtilDigital.set_digital(_arg1.bonus_mc, scoreAchievementsController.bonus);
UtilDigital.set_digital(_arg1.score_mc, scoreAchievementsController.scores);
}
function frame2(){
stop();
init_start();
}
public function get_id(_arg1:String, _arg2:int=1):int{
var _local3:Array;
_local3 = _arg1.split("_");
return (int(_local3[_arg2]));
}
public function clear_game():void{
if (gp){
removeChild(gp);
gp = null;
};
}
public function retry_handler(_arg1:MouseEvent):void{
TweenLite.to(lost_mc, 0.5, {y:-200, onComplete:start_level});
}
public function init_item(_arg1:MovieClip, _arg2:int){
if (_arg2){
_arg1.gotoAndStop(_arg2);
_arg1.visible = true;
} else {
_arg1.gotoAndStop(1);
_arg1.visible = false;
};
}
public function go_handler(_arg1:MouseEvent):void{
go_btn.removeEventListener(MouseEvent.CLICK, go_handler);
this.gotoAndStop("game");
}
public function replay_handler(_arg1:MouseEvent):void{
clear_game();
this.gotoAndStop("start");
}
public function init_help():void{
go_btn.addEventListener(MouseEvent.CLICK, go_handler);
}
public function gamePass():void{
gp.cleanup(false);
gp.showLevelFinishedStats(true);
}
public function lost():void{
set_score(lost_mc);
TweenLite.to(lost_mc, 0.5, {y:centerPoint.y, ease:Back.easeOut});
}
public function makeup(_arg1:MovieClip):void{
var _local2:Point;
_local2 = new Point(_arg1.x, _arg1.y);
_local2 = _arg1.parent.localToGlobal(_local2);
_arg1.x = _local2.x;
_arg1.y = _local2.y;
addChild(_arg1);
TweenLite.to(_arg1, 0.5, {x:149, y:300, onComplete:real_mk, onCompleteParams:[_arg1]});
}
public function play_handler(_arg1:MouseEvent):void{
clear_start();
this.gotoAndStop("game");
}
public function top(_arg1:DisplayObject):void{
_arg1.parent.setChildIndex(_arg1, (_arg1.parent.numChildren - 1));
}
public function start_level():void{
if (gp){
removeChild(gp);
gp = null;
};
mkCount = 0;
mkData = TPL_DATA.concat();
initPlayer(player_mc, mkData, "o_");
gp = new gameplay(level, SoundManager, this);
gp.x = 242;
gp.y = 22;
addChildAt(gp, getChildIndex(player_mc));
}
public function updatePerson(_arg1:int):void{
if ((((_arg1 < 1)) || ((_arg1 > 3)))){
return;
};
mkData[_arg1] = level;
if (player_mc[("o_" + _arg1)]){
player_mc[("o_" + _arg1)].gotoAndStop(level);
};
mkCount++;
if (mkCount >= 3){
gamePass();
};
}
public function init_game():void{
level = 1;
start_level();
init_ui();
}
public function real_mk(_arg1:MovieClip):void{
var _local2:String;
var _local3:int;
_local2 = _arg1.name;
_local3 = get_id(_local2);
removeChild(_arg1);
this[("d" + _local3)].gotoAndPlay(1);
this[("d" + _local3)].visible = true;
if (mkCount == 2){
gp.pre_win();
};
}
public function clear_start():void{
play_btn.removeEventListener(MouseEvent.CLICK, play_handler);
help_btn.removeEventListener(MouseEvent.CLICK, help_handler);
}
public function next_handler(_arg1:MouseEvent):void{
TweenLite.to(pass_mc, 0.5, {y:-200, onComplete:start_level});
}
}
}//package _fla
Section 16
//more_27 (_fla.more_27)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class more_27 extends MovieClip {
public function more_27(){
addFrameScript(0, frame1);
}
function frame1(){
this.addEventListener(MouseEvent.CLICK, MovieClip(root).more_handler);
}
}
}//package _fla
Section 17
//passmc_296 (_fla.passmc_296)
package _fla {
import flash.display.*;
public dynamic class passmc_296 extends MovieClip {
public var next_btn:SimpleButton;
public var score_mc:MovieClip;
public var bonus_mc:MovieClip;
public var lvscore_mc:MovieClip;
}
}//package _fla
Section 18
//pauseMc_354 (_fla.pauseMc_354)
package _fla {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class pauseMc_354 extends MovieClip {
public var mc1:MovieClip;
public var mc2:MovieClip;
public var main:MovieClip;
public var isPaused:Boolean;
public function pauseMc_354(){
addFrameScript(0, frame1);
}
public function active(_arg1=null):void{
main.gp.togglePause();
}
function frame1(){
this.visible = false;
isPaused = false;
mc1.y = -373;
mc2.y = 344;
this.visible = true;
main = MovieClip(root);
stage.addEventListener(Event.DEACTIVATE, onDeactive);
}
public function onDeactive(_arg1:Event):void{
if (((MovieClip(root).isPassed) || (MovieClip(root).isFailed))){
return;
};
showPause(true);
}
public function showPause(_arg1:Boolean):void{
if (_arg1 == isPaused){
return;
};
isPaused = _arg1;
MovieClip(root).isPaused = _arg1;
if (_arg1){
this.addEventListener(MouseEvent.MOUSE_DOWN, active);
this.stage.addEventListener(KeyboardEvent.KEY_DOWN, active);
TweenLite.to(mc1, 0.5, {y:-84});
TweenLite.to(mc2, 0.5, {y:111.3});
} else {
this.removeEventListener(MouseEvent.MOUSE_DOWN, active);
this.stage.removeEventListener(KeyboardEvent.KEY_DOWN, active);
TweenLite.to(mc1, 0.5, {y:-373});
TweenLite.to(mc2, 0.5, {y:344});
};
}
}
}//package _fla
Section 19
//pauseshang_357 (_fla.pauseshang_357)
package _fla {
import flash.display.*;
public dynamic class pauseshang_357 extends MovieClip {
public var 新建符号_13:MovieClip;
}
}//package _fla
Section 20
//pausexia_355 (_fla.pausexia_355)
package _fla {
import flash.display.*;
public dynamic class pausexia_355 extends MovieClip {
public var 新建符号_13:MovieClip;
}
}//package _fla
Section 21
//renwu_144 (_fla.renwu_144)
package _fla {
import flash.display.*;
public dynamic class renwu_144 extends MovieClip {
public var o_3:MovieClip;
public var o_2:MovieClip;
public var o_4:MovieClip;
public var o_1:MovieClip;
public var 新符号_1:MovieClip;
}
}//package _fla
Section 22
//score2_289 (_fla.score2_289)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class score2_289 extends MovieClip {
public function score2_289(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 23
//scoreza2_294 (_fla.scoreza2_294)
package _fla {
import flash.display.*;
public dynamic class scoreza2_294 extends MovieClip {
public var bit_1:MovieClip;
public var bit_5:MovieClip;
public var bit_6:MovieClip;
public var bit_2:MovieClip;
public var bit_3:MovieClip;
public var bit_4:MovieClip;
public var bit_8:MovieClip;
public var bit_7:MovieClip;
public var bit_9:MovieClip;
}
}//package _fla
Section 24
//scorezi_366 (_fla.scorezi_366)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class scorezi_366 extends MovieClip {
public function scorezi_366(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 25
//Timeline_106 (_fla.Timeline_106)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_106 extends MovieClip {
public function Timeline_106(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 26
//Timeline_108 (_fla.Timeline_108)
package _fla {
import flash.display.*;
public dynamic class Timeline_108 extends MovieClip {
public var main_mc:MovieClip;
}
}//package _fla
Section 27
//Timeline_177 (_fla.Timeline_177)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_177 extends MovieClip {
public function Timeline_177(){
addFrameScript(16, frame17);
}
function frame17(){
stop();
MovieClip(parent).updatePerson(3);
}
}
}//package _fla
Section 28
//Timeline_179 (_fla.Timeline_179)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_179 extends MovieClip {
public function Timeline_179(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package _fla
Section 29
//Timeline_180 (_fla.Timeline_180)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_180 extends MovieClip {
public function Timeline_180(){
addFrameScript(32, frame33);
}
function frame33(){
stop();
MovieClip(parent).updatePerson(1);
}
}
}//package _fla
Section 30
//Timeline_182 (_fla.Timeline_182)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_182 extends MovieClip {
public function Timeline_182(){
addFrameScript(17, frame18);
}
function frame18(){
stop();
}
}
}//package _fla
Section 31
//Timeline_183 (_fla.Timeline_183)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_183 extends MovieClip {
public function Timeline_183(){
addFrameScript(21, frame22);
}
function frame22(){
stop();
MovieClip(parent).updatePerson(2);
}
}
}//package _fla
Section 32
//Timeline_19 (_fla.Timeline_19)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_19 extends MovieClip {
public function Timeline_19(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 33
//Timeline_24 (_fla.Timeline_24)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_24 extends MovieClip {
public function Timeline_24(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 34
//Timeline_30 (_fla.Timeline_30)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_30 extends MovieClip {
public function Timeline_30(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 35
//Timeline_315 (_fla.Timeline_315)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_315 extends MovieClip {
public function Timeline_315(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 36
//Timeline_352 (_fla.Timeline_352)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_352 extends MovieClip {
public function Timeline_352(){
addFrameScript(8, frame9);
}
function frame9(){
stop();
}
}
}//package _fla
Section 37
//Timeline_371 (_fla.Timeline_371)
package _fla {
import flash.display.*;
public dynamic class Timeline_371 extends MovieClip {
public var bit_1:MovieClip;
public var bit_2:MovieClip;
}
}//package _fla
Section 38
//Timeline_46 (_fla.Timeline_46)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class Timeline_46 extends MovieClip {
public function Timeline_46(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
}
}
}//package _fla
Section 39
//timezi_368 (_fla.timezi_368)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class timezi_368 extends MovieClip {
public function timezi_368(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 40
//title_48 (_fla.title_48)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class title_48 extends MovieClip {
public function title_48(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 41
//totalscore2_291 (_fla.totalscore2_291)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class totalscore2_291 extends MovieClip {
public function totalscore2_291(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 42
//whatapity_319 (_fla.whatapity_319)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class whatapity_319 extends MovieClip {
public function whatapity_319(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 43
//winmc_271 (_fla.winmc_271)
package _fla {
import flash.display.*;
public dynamic class winmc_271 extends MovieClip {
public var replay_btn:SimpleButton;
public var score_mc:MovieClip;
public var bonus_mc:MovieClip;
public var lvscore_mc:MovieClip;
}
}//package _fla
Section 44
//youaretury_288 (_fla.youaretury_288)
package _fla {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.media.*;
import flash.utils.*;
import flash.text.*;
import flash.net.*;
import flash.errors.*;
import flash.external.*;
import flash.accessibility.*;
import flash.system.*;
import flash.ui.*;
public dynamic class youaretury_288 extends MovieClip {
public function youaretury_288(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.gotoAndStop(MovieClip(root).lang);
}
}
}//package _fla
Section 45
//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 46
//b2CircleShape (Box2D.Collision.Shapes.b2CircleShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
public class b2CircleShape extends b2Shape {
public var m_radius:Number;
public var m_localPosition:b2Vec2;
public function b2CircleShape(_arg1:b2ShapeDef){
var _local2:b2CircleDef;
m_localPosition = new b2Vec2();
super(_arg1);
_local2 = (_arg1 as b2CircleDef);
m_type = e_circleShape;
m_localPosition.SetV(_local2.localPosition);
m_radius = _local2.radius;
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg1.R;
_local4 = (_arg1.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg1.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_local4 = (_arg2.x - _local4);
_local5 = (_arg2.y - _local5);
return ((((_local4 * _local4) + (_local5 * _local5)) <= (m_radius * m_radius)));
}
public function GetLocalPosition():b2Vec2{
return (m_localPosition);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg1.R;
_local7 = (_arg1.position.x + ((_local6.col1.x * m_localPosition.x) + (_local6.col2.x * m_localPosition.y)));
_local8 = (_arg1.position.x + ((_local6.col1.y * m_localPosition.x) + (_local6.col2.y * m_localPosition.y)));
_local9 = (_arg4.p1.x - _local7);
_local10 = (_arg4.p1.y - _local8);
_local11 = (((_local9 * _local9) + (_local10 * _local10)) - (m_radius * m_radius));
if (_local11 < 0){
return (false);
};
_local12 = (_arg4.p2.x - _arg4.p1.x);
_local13 = (_arg4.p2.y - _arg4.p1.y);
_local14 = ((_local9 * _local12) + (_local10 * _local13));
_local15 = ((_local12 * _local12) + (_local13 * _local13));
_local16 = ((_local14 * _local14) - (_local15 * _local11));
if ((((_local16 < 0)) || ((_local15 < Number.MIN_VALUE)))){
return (false);
};
_local17 = -((_local14 + Math.sqrt(_local16)));
if ((((0 <= _local17)) && ((_local17 <= (_arg5 * _local15))))){
_local17 = (_local17 / _local15);
_arg2[0] = _local17;
_arg3.x = (_local9 + (_local17 * _local12));
_arg3.y = (_local10 + (_local17 * _local13));
_arg3.Normalize();
return (true);
};
return (false);
}
override public function ComputeMass(_arg1:b2MassData):void{
_arg1.mass = (((m_density * b2Settings.b2_pi) * m_radius) * m_radius);
_arg1.center.SetV(m_localPosition);
_arg1.I = (_arg1.mass * (((0.5 * m_radius) * m_radius) + ((m_localPosition.x * m_localPosition.x) + (m_localPosition.y * m_localPosition.y))));
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = _arg2.R;
_local5 = (_arg2.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local6 = (_arg2.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_local4 = _arg3.R;
_local7 = (_arg3.position.x + ((_local4.col1.x * m_localPosition.x) + (_local4.col2.x * m_localPosition.y)));
_local8 = (_arg3.position.y + ((_local4.col1.y * m_localPosition.x) + (_local4.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((((_local5 < _local7)) ? _local5 : _local7 - m_radius), (((_local6 < _local8)) ? _local6 : _local8 - m_radius));
_arg1.upperBound.Set((((_local5 > _local7)) ? _local5 : _local7 + m_radius), (((_local6 > _local8)) ? _local6 : _local8 + m_radius));
}
public function GetRadius():Number{
return (m_radius);
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:Number;
var _local3:Number;
_local2 = (m_localPosition.x - _arg1.x);
_local3 = (m_localPosition.y - _arg1.y);
_local2 = Math.sqrt(((_local2 * _local2) + (_local3 * _local3)));
m_sweepRadius = ((_local2 + m_radius) - b2Settings.b2_toiSlop);
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
_local3 = _arg2.R;
_local4 = (_arg2.position.x + ((_local3.col1.x * m_localPosition.x) + (_local3.col2.x * m_localPosition.y)));
_local5 = (_arg2.position.y + ((_local3.col1.y * m_localPosition.x) + (_local3.col2.y * m_localPosition.y)));
_arg1.lowerBound.Set((_local4 - m_radius), (_local5 - m_radius));
_arg1.upperBound.Set((_local4 + m_radius), (_local5 + m_radius));
}
}
}//package Box2D.Collision.Shapes
Section 47
//b2FilterData (Box2D.Collision.Shapes.b2FilterData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2FilterData {
public var maskBits:uint;// = 0xFFFF
public var groupIndex:int;// = 0
public var categoryBits:uint;// = 1
public function b2FilterData(){
categoryBits = 1;
maskBits = 0xFFFF;
groupIndex = 0;
super();
}
public function Copy():b2FilterData{
var _local1:b2FilterData;
_local1 = new b2FilterData();
_local1.categoryBits = categoryBits;
_local1.maskBits = maskBits;
_local1.groupIndex = groupIndex;
return (_local1);
}
}
}//package Box2D.Collision.Shapes
Section 48
//b2MassData (Box2D.Collision.Shapes.b2MassData)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
public class b2MassData {
public var mass:Number;// = 0
public var center:b2Vec2;
public var I:Number;// = 0
public function b2MassData(){
mass = 0;
center = new b2Vec2(0, 0);
I = 0;
super();
}
}
}//package Box2D.Collision.Shapes
Section 49
//b2PolygonDef (Box2D.Collision.Shapes.b2PolygonDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PolygonDef extends b2ShapeDef {
public var vertexCount:int;
public var vertices:Array;
private static var s_mat:b2Mat22 = new b2Mat22();
public function b2PolygonDef(){
var _local1:int;
vertices = new Array(b2Settings.b2_maxPolygonVertices);
super();
type = b2Shape.e_polygonShape;
vertexCount = 0;
_local1 = 0;
while (_local1 < b2Settings.b2_maxPolygonVertices) {
vertices[_local1] = new b2Vec2();
_local1++;
};
}
public function SetAsOrientedBox(_arg1:Number, _arg2:Number, _arg3:b2Vec2=null, _arg4:Number=0):void{
var _local5:b2Vec2;
var _local6:b2Mat22;
var _local7:int;
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
if (_arg3){
_local5 = _arg3;
_local6 = s_mat;
_local6.Set(_arg4);
_local7 = 0;
while (_local7 < vertexCount) {
_arg3 = vertices[_local7];
_arg1 = (_local5.x + ((_local6.col1.x * _arg3.x) + (_local6.col2.x * _arg3.y)));
_arg3.y = (_local5.y + ((_local6.col1.y * _arg3.x) + (_local6.col2.y * _arg3.y)));
_arg3.x = _arg1;
_local7++;
};
};
}
public function SetAsBox(_arg1:Number, _arg2:Number):void{
vertexCount = 4;
vertices[0].Set(-(_arg1), -(_arg2));
vertices[1].Set(_arg1, -(_arg2));
vertices[2].Set(_arg1, _arg2);
vertices[3].Set(-(_arg1), _arg2);
}
}
}//package Box2D.Collision.Shapes
Section 50
//b2PolygonShape (Box2D.Collision.Shapes.b2PolygonShape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
public class b2PolygonShape extends b2Shape {
public var m_vertices:Array;
public var m_normals:Array;
private var s_supportVec:b2Vec2;
public var m_obb:b2OBB;
public var m_coreVertices:Array;
public var m_centroid:b2Vec2;
public var m_vertexCount:int;
private static var s_computeMat:b2Mat22 = new b2Mat22();
private static var s_sweptAABB1:b2AABB = new b2AABB();
private static var s_sweptAABB2:b2AABB = new b2AABB();
public function b2PolygonShape(_arg1:b2ShapeDef){
var _local2:b2PolygonDef;
var _local3:int;
var _local4:int;
var _local5:int;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
s_supportVec = new b2Vec2();
m_obb = new b2OBB();
m_vertices = new Array(b2Settings.b2_maxPolygonVertices);
m_normals = new Array(b2Settings.b2_maxPolygonVertices);
m_coreVertices = new Array(b2Settings.b2_maxPolygonVertices);
super(_arg1);
m_type = e_polygonShape;
_local2 = (_arg1 as b2PolygonDef);
m_vertexCount = _local2.vertexCount;
_local4 = _local3;
_local5 = _local3;
_local3 = 0;
while (_local3 < m_vertexCount) {
m_vertices[_local3] = _local2.vertices[_local3].Copy();
_local3++;
};
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = _local3;
_local5 = (((_local3 + 1) < m_vertexCount)) ? (_local3 + 1) : 0;
_local6 = (m_vertices[_local5].x - m_vertices[_local4].x);
_local7 = (m_vertices[_local5].y - m_vertices[_local4].y);
_local8 = Math.sqrt(((_local6 * _local6) + (_local7 * _local7)));
m_normals[_local3] = new b2Vec2((_local7 / _local8), (-(_local6) / _local8));
_local3++;
};
m_centroid = ComputeCentroid(_local2.vertices, _local2.vertexCount);
ComputeOBB(m_obb, m_vertices, m_vertexCount);
_local3 = 0;
while (_local3 < m_vertexCount) {
_local4 = (((_local3 - 1) >= 0)) ? (_local3 - 1) : (m_vertexCount - 1);
_local5 = _local3;
_local9 = m_normals[_local4].x;
_local10 = m_normals[_local4].y;
_local11 = m_normals[_local5].x;
_local12 = m_normals[_local5].y;
_local13 = (m_vertices[_local3].x - m_centroid.x);
_local14 = (m_vertices[_local3].y - m_centroid.y);
_local15 = (((_local9 * _local13) + (_local10 * _local14)) - b2Settings.b2_toiSlop);
_local16 = (((_local11 * _local13) + (_local12 * _local14)) - b2Settings.b2_toiSlop);
_local17 = (1 / ((_local9 * _local12) - (_local10 * _local11)));
m_coreVertices[_local3] = new b2Vec2(((_local17 * ((_local12 * _local15) - (_local10 * _local16))) + m_centroid.x), ((_local17 * ((_local9 * _local16) - (_local11 * _local15))) + m_centroid.y));
_local3++;
};
}
override public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:Number;
_local4 = _arg1.R;
_local5 = (_arg2.x - _arg1.position.x);
_local6 = (_arg2.y - _arg1.position.y);
_local7 = ((_local5 * _local4.col1.x) + (_local6 * _local4.col1.y));
_local8 = ((_local5 * _local4.col2.x) + (_local6 * _local4.col2.y));
_local9 = 0;
while (_local9 < m_vertexCount) {
_local3 = m_vertices[_local9];
_local5 = (_local7 - _local3.x);
_local6 = (_local8 - _local3.y);
_local3 = m_normals[_local9];
_local10 = ((_local3.x * _local5) + (_local3.y * _local6));
if (_local10 > 0){
return (false);
};
_local9++;
};
return (true);
}
public function GetCoreVertices():Array{
return (m_coreVertices);
}
override public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:Number;
var _local21:Number;
_local6 = 0;
_local7 = _arg5;
_local8 = (_arg4.p1.x - _arg1.position.x);
_local9 = (_arg4.p1.y - _arg1.position.y);
_local10 = _arg1.R;
_local12 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local13 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local8 = (_arg4.p2.x - _arg1.position.x);
_local9 = (_arg4.p2.y - _arg1.position.y);
_local10 = _arg1.R;
_local14 = ((_local8 * _local10.col1.x) + (_local9 * _local10.col1.y));
_local15 = ((_local8 * _local10.col2.x) + (_local9 * _local10.col2.y));
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local18 = -1;
_local19 = 0;
while (_local19 < m_vertexCount) {
_local11 = m_vertices[_local19];
_local8 = (_local11.x - _local12);
_local9 = (_local11.y - _local13);
_local11 = m_normals[_local19];
_local20 = ((_local11.x * _local8) + (_local11.y * _local9));
_local21 = ((_local11.x * _local16) + (_local11.y * _local17));
if ((((_local21 < 0)) && ((_local20 < (_local6 * _local21))))){
_local6 = (_local20 / _local21);
_local18 = _local19;
} else {
if ((((_local21 > 0)) && ((_local20 < (_local7 * _local21))))){
_local7 = (_local20 / _local21);
};
};
if (_local7 < _local6){
return (false);
};
_local19++;
};
if (_local18 >= 0){
_arg2[0] = _local6;
_local10 = _arg1.R;
_local11 = m_normals[_local18];
_arg3.x = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_arg3.y = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
return (true);
};
return (false);
}
public function GetCentroid():b2Vec2{
return (m_centroid);
}
override public function ComputeMass(_arg1:b2MassData):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:int;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local2 = 0;
_local3 = 0;
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = 0;
_local8 = (1 / 3);
_local9 = 0;
while (_local9 < m_vertexCount) {
_local10 = m_vertices[_local9];
_local11 = (((_local9 + 1) < m_vertexCount)) ? m_vertices[int((_local9 + 1))] : m_vertices[0];
_local12 = (_local10.x - _local6);
_local13 = (_local10.y - _local7);
_local14 = (_local11.x - _local6);
_local15 = (_local11.y - _local7);
_local16 = ((_local12 * _local15) - (_local13 * _local14));
_local17 = (0.5 * _local16);
_local4 = (_local4 + _local17);
_local2 = (_local2 + ((_local17 * _local8) * ((_local6 + _local10.x) + _local11.x)));
_local3 = (_local3 + ((_local17 * _local8) * ((_local7 + _local10.y) + _local11.y)));
_local18 = _local6;
_local19 = _local7;
_local20 = _local12;
_local21 = _local13;
_local22 = _local14;
_local23 = _local15;
_local24 = ((_local8 * ((0.25 * (((_local20 * _local20) + (_local22 * _local20)) + (_local22 * _local22))) + ((_local18 * _local20) + (_local18 * _local22)))) + ((0.5 * _local18) * _local18));
_local25 = ((_local8 * ((0.25 * (((_local21 * _local21) + (_local23 * _local21)) + (_local23 * _local23))) + ((_local19 * _local21) + (_local19 * _local23)))) + ((0.5 * _local19) * _local19));
_local5 = (_local5 + (_local16 * (_local24 + _local25)));
_local9++;
};
_arg1.mass = (m_density * _local4);
_local2 = (_local2 * (1 / _local4));
_local3 = (_local3 * (1 / _local4));
_arg1.center.Set(_local2, _local3);
_arg1.I = (m_density * _local5);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:Number;
var _local10:int;
var _local11:Number;
_local5 = _arg1.R;
_local6 = ((_arg2 * _local5.col1.x) + (_arg3 * _local5.col1.y));
_local7 = ((_arg2 * _local5.col2.x) + (_arg3 * _local5.col2.y));
_local8 = 0;
_local4 = m_coreVertices[0];
_local9 = ((_local4.x * _local6) + (_local4.y * _local7));
_local10 = 1;
while (_local10 < m_vertexCount) {
_local4 = m_coreVertices[_local10];
_local11 = ((_local4.x * _local6) + (_local4.y * _local7));
if (_local11 > _local9){
_local8 = _local10;
_local9 = _local11;
};
_local10++;
};
_local5 = _arg1.R;
_local4 = m_coreVertices[_local8];
s_supportVec.x = (_arg1.position.x + ((_local5.col1.x * _local4.x) + (_local5.col2.x * _local4.y)));
s_supportVec.y = (_arg1.position.y + ((_local5.col1.y * _local4.x) + (_local5.col2.y * _local4.y)));
return (s_supportVec);
}
public function GetVertexCount():int{
return (m_vertexCount);
}
override public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
var _local4:b2AABB;
var _local5:b2AABB;
_local4 = s_sweptAABB1;
_local5 = s_sweptAABB2;
ComputeAABB(_local4, _arg2);
ComputeAABB(_local5, _arg3);
_arg1.lowerBound.Set(((_local4.lowerBound.x < _local5.lowerBound.x)) ? _local4.lowerBound.x : _local5.lowerBound.x, ((_local4.lowerBound.y < _local5.lowerBound.y)) ? _local4.lowerBound.y : _local5.lowerBound.y);
_arg1.upperBound.Set(((_local4.upperBound.x > _local5.upperBound.x)) ? _local4.upperBound.x : _local5.upperBound.x, ((_local4.upperBound.y > _local5.upperBound.y)) ? _local4.upperBound.y : _local5.upperBound.y);
}
public function GetVertices():Array{
return (m_vertices);
}
public function GetNormals():Array{
return (m_normals);
}
public function GetOBB():b2OBB{
return (m_obb);
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_coreVertices[0]));
}
public function Centroid(_arg1:b2XForm):b2Vec2{
return (b2Math.b2MulX(_arg1, m_centroid));
}
override public function UpdateSweepRadius(_arg1:b2Vec2):void{
var _local2:b2Vec2;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_sweepRadius = 0;
_local3 = 0;
while (_local3 < m_vertexCount) {
_local2 = m_coreVertices[_local3];
_local4 = (_local2.x - _arg1.x);
_local5 = (_local2.y - _arg1.y);
_local4 = Math.sqrt(((_local4 * _local4) + (_local5 * _local5)));
if (_local4 > m_sweepRadius){
m_sweepRadius = _local4;
};
_local3++;
};
}
override public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Mat22;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local5 = s_computeMat;
_local3 = _arg2.R;
_local4 = m_obb.R.col1;
_local5.col1.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col1.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local4 = m_obb.R.col2;
_local5.col2.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
_local5.col2.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
_local5.Abs();
_local6 = _local5;
_local4 = m_obb.extents;
_local7 = ((_local6.col1.x * _local4.x) + (_local6.col2.x * _local4.y));
_local8 = ((_local6.col1.y * _local4.x) + (_local6.col2.y * _local4.y));
_local3 = _arg2.R;
_local4 = m_obb.center;
_local9 = (_arg2.position.x + ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y)));
_local10 = (_arg2.position.y + ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y)));
_arg1.lowerBound.Set((_local9 - _local7), (_local10 - _local8));
_arg1.upperBound.Set((_local9 + _local7), (_local10 + _local8));
}
public static function ComputeCentroid(_arg1:Array, _arg2:int):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local3 = new b2Vec2();
_local4 = 0;
_local5 = 0;
_local6 = 0;
_local7 = (1 / 3);
_local8 = 0;
while (_local8 < _arg2) {
_local9 = _arg1[_local8];
_local10 = (((_local8 + 1) < _arg2)) ? _arg1[int((_local8 + 1))] : _arg1[0];
_local11 = (_local9.x - _local5);
_local12 = (_local9.y - _local6);
_local13 = (_local10.x - _local5);
_local14 = (_local10.y - _local6);
_local15 = ((_local11 * _local14) - (_local12 * _local13));
_local16 = (0.5 * _local15);
_local4 = (_local4 + _local16);
_local3.x = (_local3.x + ((_local16 * _local7) * ((_local5 + _local9.x) + _local10.x)));
_local3.y = (_local3.y + ((_local16 * _local7) * ((_local6 + _local9.y) + _local10.y)));
_local8++;
};
_local3.x = (_local3.x * (1 / _local4));
_local3.y = (_local3.y * (1 / _local4));
return (_local3);
}
public static function ComputeOBB(_arg1:b2OBB, _arg2:Array, _arg3:int):void{
var _local4:int;
var _local5:Array;
var _local6:Number;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:b2Mat22;
_local5 = new Array((b2Settings.b2_maxPolygonVertices + 1));
_local4 = 0;
while (_local4 < _arg3) {
_local5[_local4] = _arg2[_local4];
_local4++;
};
_local5[_arg3] = _local5[0];
_local6 = Number.MAX_VALUE;
_local4 = 1;
while (_local4 <= _arg3) {
_local7 = _local5[int((_local4 - 1))];
_local8 = (_local5[_local4].x - _local7.x);
_local9 = (_local5[_local4].y - _local7.y);
_local10 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local8 = (_local8 / _local10);
_local9 = (_local9 / _local10);
_local11 = -(_local9);
_local12 = _local8;
_local13 = Number.MAX_VALUE;
_local14 = Number.MAX_VALUE;
_local15 = -(Number.MAX_VALUE);
_local16 = -(Number.MAX_VALUE);
_local17 = 0;
while (_local17 < _arg3) {
_local19 = (_local5[_local17].x - _local7.x);
_local20 = (_local5[_local17].y - _local7.y);
_local21 = ((_local8 * _local19) + (_local9 * _local20));
_local22 = ((_local11 * _local19) + (_local12 * _local20));
if (_local21 < _local13){
_local13 = _local21;
};
if (_local22 < _local14){
_local14 = _local22;
};
if (_local21 > _local15){
_local15 = _local21;
};
if (_local22 > _local16){
_local16 = _local22;
};
_local17++;
};
_local18 = ((_local15 - _local13) * (_local16 - _local14));
if (_local18 < (0.95 * _local6)){
_local6 = _local18;
_arg1.R.col1.x = _local8;
_arg1.R.col1.y = _local9;
_arg1.R.col2.x = _local11;
_arg1.R.col2.y = _local12;
_local23 = (0.5 * (_local13 + _local15));
_local24 = (0.5 * (_local14 + _local16));
_local25 = _arg1.R;
_arg1.center.x = (_local7.x + ((_local25.col1.x * _local23) + (_local25.col2.x * _local24)));
_arg1.center.y = (_local7.y + ((_local25.col1.y * _local23) + (_local25.col2.y * _local24)));
_arg1.extents.x = (0.5 * (_local15 - _local13));
_arg1.extents.y = (0.5 * (_local16 - _local14));
};
_local4++;
};
}
}
}//package Box2D.Collision.Shapes
Section 51
//b2Shape (Box2D.Collision.Shapes.b2Shape)
package Box2D.Collision.Shapes {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
public class b2Shape {
public var m_type:int;
public var m_sweepRadius:Number;
public var m_density:Number;
public var m_filter:b2FilterData;
public var m_friction:Number;
public var m_next:b2Shape;
public var m_restitution:Number;
public var m_userData;
public var m_isSensor:Boolean;
public var m_proxyId:uint;
public var m_body:b2Body;
public static const e_polygonShape:int = 1;
public static const e_unknownShape:int = -1;
public static const e_circleShape:int = 0;
public static const e_shapeTypeCount:int = 2;
private static var s_resetAABB:b2AABB = new b2AABB();
private static var s_syncAABB:b2AABB = new b2AABB();
private static var s_proxyAABB:b2AABB = new b2AABB();
public function b2Shape(_arg1:b2ShapeDef){
m_userData = _arg1.userData;
m_friction = _arg1.friction;
m_restitution = _arg1.restitution;
m_density = _arg1.density;
m_body = null;
m_sweepRadius = 0;
m_next = null;
m_proxyId = b2Pair.b2_nullProxy;
m_filter = _arg1.filter.Copy();
m_isSensor = _arg1.isSensor;
}
public function TestPoint(_arg1:b2XForm, _arg2:b2Vec2):Boolean{
return (false);
}
public function GetSweepRadius():Number{
return (m_sweepRadius);
}
public function GetNext():b2Shape{
return (m_next);
}
public function ComputeSweptAABB(_arg1:b2AABB, _arg2:b2XForm, _arg3:b2XForm):void{
}
public function GetType():int{
return (m_type);
}
public function GetRestitution():Number{
return (m_restitution);
}
public function GetFriction():Number{
return (m_friction);
}
public function GetFilterData():b2FilterData{
return (m_filter.Copy());
}
public function TestSegment(_arg1:b2XForm, _arg2:Array, _arg3:b2Vec2, _arg4:b2Segment, _arg5:Number):Boolean{
return (false);
}
public function RefilterProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
if (m_proxyId == b2Pair.b2_nullProxy){
return;
};
_arg1.DestroyProxy(m_proxyId);
_local3 = s_resetAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetFilterData(_arg1:b2FilterData):void{
m_filter = _arg1.Copy();
}
public function GetUserData(){
return (m_userData);
}
public function Synchronize(_arg1:b2BroadPhase, _arg2:b2XForm, _arg3:b2XForm):Boolean{
var _local4:b2AABB;
if (m_proxyId == b2Pair.b2_nullProxy){
return (false);
};
_local4 = s_syncAABB;
ComputeSweptAABB(_local4, _arg2, _arg3);
if (_arg1.InRange(_local4)){
_arg1.MoveProxy(m_proxyId, _local4);
return (true);
};
return (false);
}
public function ComputeMass(_arg1:b2MassData):void{
}
public function IsSensor():Boolean{
return (m_isSensor);
}
public function DestroyProxy(_arg1:b2BroadPhase):void{
if (m_proxyId != b2Pair.b2_nullProxy){
_arg1.DestroyProxy(m_proxyId);
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function UpdateSweepRadius(_arg1:b2Vec2):void{
}
public function ComputeAABB(_arg1:b2AABB, _arg2:b2XForm):void{
}
public function GetBody():b2Body{
return (m_body);
}
public function CreateProxy(_arg1:b2BroadPhase, _arg2:b2XForm):void{
var _local3:b2AABB;
var _local4:Boolean;
_local3 = s_proxyAABB;
ComputeAABB(_local3, _arg2);
_local4 = _arg1.InRange(_local3);
if (_local4){
m_proxyId = _arg1.CreateProxy(_local3, this);
} else {
m_proxyId = b2Pair.b2_nullProxy;
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public static function Destroy(_arg1:b2Shape, _arg2):void{
}
public static function Create(_arg1:b2ShapeDef, _arg2):b2Shape{
switch (_arg1.type){
case e_circleShape:
return (new b2CircleShape(_arg1));
case e_polygonShape:
return (new b2PolygonShape(_arg1));
default:
return (null);
};
}
}
}//package Box2D.Collision.Shapes
Section 52
//b2ShapeDef (Box2D.Collision.Shapes.b2ShapeDef)
package Box2D.Collision.Shapes {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2ShapeDef {
public var isSensor:Boolean;// = false
public var density:Number;// = 0
public var type:int;// = -1
public var restitution:Number;// = 0
public var userData;// = null
public var filter:b2FilterData;
public var friction:Number;// = 0.2
public function b2ShapeDef(){
type = b2Shape.e_unknownShape;
userData = null;
friction = 0.2;
restitution = 0;
density = 0;
isSensor = false;
filter = new b2FilterData();
super();
}
}
}//package Box2D.Collision.Shapes
Section 53
//b2AABB (Box2D.Collision.b2AABB)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2AABB {
public var upperBound:b2Vec2;
public var lowerBound:b2Vec2;
public function b2AABB(){
lowerBound = new b2Vec2();
upperBound = new b2Vec2();
super();
}
public function IsValid():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Boolean;
_local1 = (upperBound.x - lowerBound.x);
_local2 = (upperBound.y - lowerBound.y);
_local3 = (((_local1 >= 0)) && ((_local2 >= 0)));
_local3 = ((((_local3) && (lowerBound.IsValid()))) && (upperBound.IsValid()));
return (_local3);
}
}
}//package Box2D.Collision
Section 54
//b2Bound (Box2D.Collision.b2Bound)
package Box2D.Collision {
public class b2Bound {
public var proxyId:uint;
public var stabbingCount:uint;
public var value:uint;
public function Swap(_arg1:b2Bound):void{
var _local2:uint;
var _local3:uint;
var _local4:uint;
_local2 = value;
_local3 = proxyId;
_local4 = stabbingCount;
value = _arg1.value;
proxyId = _arg1.proxyId;
stabbingCount = _arg1.stabbingCount;
_arg1.value = _local2;
_arg1.proxyId = _local3;
_arg1.stabbingCount = _local4;
}
public function IsLower():Boolean{
return (((value & 1) == 0));
}
public function IsUpper():Boolean{
return (((value & 1) == 1));
}
}
}//package Box2D.Collision
Section 55
//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 56
//b2BroadPhase (Box2D.Collision.b2BroadPhase)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2BroadPhase {
public var m_quantizationFactor:b2Vec2;
public var m_worldAABB:b2AABB;
public var m_bounds:Array;
public var m_freeProxy:uint;
public var m_proxyCount:int;
public var m_proxyPool:Array;
public var m_queryResultCount:int;
public var m_pairManager:b2PairManager;
public var m_timeStamp:uint;
public var m_queryResults:Array;
public static const b2_nullEdge:uint = b2Settings.USHRT_MAX;
public static const b2_invalid:uint = b2Settings.USHRT_MAX;
public static var s_validate:Boolean = false;
public function b2BroadPhase(_arg1:b2AABB, _arg2:b2PairCallback){
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:b2Proxy;
var _local7:int;
m_pairManager = new b2PairManager();
m_proxyPool = new Array(b2Settings.b2_maxPairs);
m_bounds = new Array((2 * b2Settings.b2_maxProxies));
m_queryResults = new Array(b2Settings.b2_maxProxies);
m_quantizationFactor = new b2Vec2();
super();
m_pairManager.Initialize(this, _arg2);
m_worldAABB = _arg1;
m_proxyCount = 0;
_local3 = 0;
while (_local3 < b2Settings.b2_maxProxies) {
m_queryResults[_local3] = 0;
_local3++;
};
m_bounds = new Array(2);
_local3 = 0;
while (_local3 < 2) {
m_bounds[_local3] = new Array((2 * b2Settings.b2_maxProxies));
_local7 = 0;
while (_local7 < (2 * b2Settings.b2_maxProxies)) {
m_bounds[_local3][_local7] = new b2Bound();
_local7++;
};
_local3++;
};
_local4 = (_arg1.upperBound.x - _arg1.lowerBound.x);
_local5 = (_arg1.upperBound.y - _arg1.lowerBound.y);
m_quantizationFactor.x = (b2Settings.USHRT_MAX / _local4);
m_quantizationFactor.y = (b2Settings.USHRT_MAX / _local5);
_local3 = 0;
while (_local3 < (b2Settings.b2_maxProxies - 1)) {
_local6 = new b2Proxy();
m_proxyPool[_local3] = _local6;
_local6.SetNext((_local3 + 1));
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
_local3++;
};
_local6 = new b2Proxy();
m_proxyPool[int((b2Settings.b2_maxProxies - 1))] = _local6;
_local6.SetNext(b2Pair.b2_nullProxy);
_local6.timeStamp = 0;
_local6.overlapCount = b2_invalid;
_local6.userData = null;
m_freeProxy = 0;
m_timeStamp = 1;
m_queryResultCount = 0;
}
public function QueryAABB(_arg1:b2AABB, _arg2, _arg3:int):int{
var _local4:Array;
var _local5:Array;
var _local6:uint;
var _local7:uint;
var _local8:Array;
var _local9:Array;
var _local10:int;
var _local11:int;
var _local12:b2Proxy;
_local4 = new Array();
_local5 = new Array();
ComputeBounds(_local4, _local5, _arg1);
_local8 = [_local6];
_local9 = [_local7];
Query(_local8, _local9, _local4[0], _local5[0], m_bounds[0], (2 * m_proxyCount), 0);
Query(_local8, _local9, _local4[1], _local5[1], m_bounds[1], (2 * m_proxyCount), 1);
_local10 = 0;
_local11 = 0;
while ((((_local11 < m_queryResultCount)) && ((_local10 < _arg3)))) {
_local12 = m_proxyPool[m_queryResults[_local11]];
_arg2[_local11] = _local12.userData;
_local11++;
_local10++;
};
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local10);
}
public function Commit():void{
m_pairManager.Commit();
}
public function GetProxy(_arg1:int):b2Proxy{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((_local2.IsValid() == false)))){
return (null);
};
return (_local2);
}
private function IncrementTimeStamp():void{
var _local1:uint;
if (m_timeStamp == b2Settings.USHRT_MAX){
_local1 = 0;
while (_local1 < b2Settings.b2_maxProxies) {
(m_proxyPool[_local1] as b2Proxy).timeStamp = 0;
_local1++;
};
m_timeStamp = 1;
} else {
m_timeStamp++;
};
}
private function Query(_arg1:Array, _arg2:Array, _arg3:uint, _arg4:uint, _arg5:Array, _arg6:uint, _arg7:int):void{
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
var _local11:uint;
var _local12:int;
var _local13:int;
var _local14:b2Proxy;
_local8 = BinarySearch(_arg5, _arg6, _arg3);
_local9 = BinarySearch(_arg5, _arg6, _arg4);
_local11 = _local8;
while (_local11 < _local9) {
_local10 = _arg5[_local11];
if (_local10.IsLower()){
IncrementOverlapCount(_local10.proxyId);
};
_local11++;
};
if (_local8 > 0){
_local12 = (_local8 - 1);
_local10 = _arg5[_local12];
_local13 = _local10.stabbingCount;
while (_local13) {
_local10 = _arg5[_local12];
if (_local10.IsLower()){
_local14 = m_proxyPool[_local10.proxyId];
if (_local8 <= _local14.upperBounds[_arg7]){
IncrementOverlapCount(_local10.proxyId);
_local13--;
};
};
_local12--;
};
};
_arg1[0] = _local8;
_arg2[0] = _local9;
}
private function TestOverlapValidate(_arg1:b2Proxy, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
var _local6:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg1.lowerBounds[_local3]];
_local6 = _local4[_arg2.upperBounds[_local3]];
if (_local5.value > _local6.value){
return (false);
};
_local5 = _local4[_arg1.upperBounds[_local3]];
_local6 = _local4[_arg2.lowerBounds[_local3]];
if (_local5.value < _local6.value){
return (false);
};
_local3++;
};
return (true);
}
private function ComputeBounds(_arg1:Array, _arg2:Array, _arg3:b2AABB):void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local4 = _arg3.lowerBound.x;
_local5 = _arg3.lowerBound.y;
_local4 = b2Math.b2Min(_local4, m_worldAABB.upperBound.x);
_local5 = b2Math.b2Min(_local5, m_worldAABB.upperBound.y);
_local4 = b2Math.b2Max(_local4, m_worldAABB.lowerBound.x);
_local5 = b2Math.b2Max(_local5, m_worldAABB.lowerBound.y);
_local6 = _arg3.upperBound.x;
_local7 = _arg3.upperBound.y;
_local6 = b2Math.b2Min(_local6, m_worldAABB.upperBound.x);
_local7 = b2Math.b2Min(_local7, m_worldAABB.upperBound.y);
_local6 = b2Math.b2Max(_local6, m_worldAABB.lowerBound.x);
_local7 = b2Math.b2Max(_local7, m_worldAABB.lowerBound.y);
_arg1[0] = (uint((m_quantizationFactor.x * (_local4 - m_worldAABB.lowerBound.x))) & (b2Settings.USHRT_MAX - 1));
_arg2[0] = ((uint((m_quantizationFactor.x * (_local6 - m_worldAABB.lowerBound.x))) & 0xFFFF) | 1);
_arg1[1] = (uint((m_quantizationFactor.y * (_local5 - m_worldAABB.lowerBound.y))) & (b2Settings.USHRT_MAX - 1));
_arg2[1] = ((uint((m_quantizationFactor.y * (_local7 - m_worldAABB.lowerBound.y))) & 0xFFFF) | 1);
}
public function CreateProxy(_arg1:b2AABB, _arg2):uint{
var _local3:uint;
var _local4:b2Proxy;
var _local5:uint;
var _local6:uint;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:int;
var _local11:Array;
var _local12:uint;
var _local13:uint;
var _local14:Array;
var _local15:Array;
var _local16:Array;
var _local17:int;
var _local18:int;
var _local19:b2Bound;
var _local20:b2Bound;
var _local21:b2Bound;
var _local22:int;
var _local23:b2Proxy;
_local5 = m_freeProxy;
_local4 = m_proxyPool[_local5];
m_freeProxy = _local4.GetNext();
_local4.overlapCount = 0;
_local4.userData = _arg2;
_local6 = (2 * m_proxyCount);
_local7 = new Array();
_local8 = new Array();
ComputeBounds(_local7, _local8, _arg1);
_local9 = 0;
while (_local9 < 2) {
_local11 = m_bounds[_local9];
_local14 = [_local12];
_local15 = [_local13];
Query(_local14, _local15, _local7[_local9], _local8[_local9], _local11, _local6, _local9);
_local12 = _local14[0];
_local13 = _local15[0];
_local16 = new Array();
_local18 = (_local6 - _local13);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local13 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local13 + 2);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local16 = new Array();
_local18 = (_local13 - _local12);
_local17 = 0;
while (_local17 < _local18) {
_local16[_local17] = new b2Bound();
_local19 = _local16[_local17];
_local20 = _local11[int((_local12 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local18 = _local16.length;
_local22 = (_local12 + 1);
_local17 = 0;
while (_local17 < _local18) {
_local20 = _local16[_local17];
_local19 = _local11[int((_local22 + _local17))];
_local19.value = _local20.value;
_local19.proxyId = _local20.proxyId;
_local19.stabbingCount = _local20.stabbingCount;
_local17++;
};
_local13++;
_local19 = _local11[_local12];
_local20 = _local11[_local13];
_local19.value = _local7[_local9];
_local19.proxyId = _local5;
_local20.value = _local8[_local9];
_local20.proxyId = _local5;
_local21 = _local11[int((_local12 - 1))];
_local19.stabbingCount = ((_local12 == 0)) ? 0 : _local21.stabbingCount;
_local21 = _local11[int((_local13 - 1))];
_local20.stabbingCount = _local21.stabbingCount;
_local3 = _local12;
while (_local3 < _local13) {
_local21 = _local11[_local3];
_local21.stabbingCount++;
_local3++;
};
_local3 = _local12;
while (_local3 < (_local6 + 2)) {
_local19 = _local11[_local3];
_local23 = m_proxyPool[_local19.proxyId];
if (_local19.IsLower()){
_local23.lowerBounds[_local9] = _local3;
} else {
_local23.upperBounds[_local9] = _local3;
};
_local3++;
};
_local9++;
};
m_proxyCount++;
_local10 = 0;
while (_local10 < m_queryResultCount) {
m_pairManager.AddBufferedPair(_local5, m_queryResults[_local10]);
_local10++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
return (_local5);
}
public function DestroyProxy(_arg1:uint):void{
var _local2:b2Bound;
var _local3:b2Bound;
var _local4:b2Proxy;
var _local5:int;
var _local6:int;
var _local7:int;
var _local8:Array;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:Array;
var _local14:int;
var _local15:int;
var _local16:int;
var _local17:uint;
var _local18:int;
var _local19:b2Proxy;
_local4 = m_proxyPool[_arg1];
_local5 = (2 * m_proxyCount);
_local6 = 0;
while (_local6 < 2) {
_local8 = m_bounds[_local6];
_local9 = _local4.lowerBounds[_local6];
_local10 = _local4.upperBounds[_local6];
_local2 = _local8[_local9];
_local11 = _local2.value;
_local3 = _local8[_local10];
_local12 = _local3.value;
_local13 = new Array();
_local15 = ((_local10 - _local9) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local9 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = _local9;
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local13 = new Array();
_local15 = ((_local5 - _local10) - 1);
_local14 = 0;
while (_local14 < _local15) {
_local13[_local14] = new b2Bound();
_local2 = _local13[_local14];
_local3 = _local8[int(((_local10 + 1) + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = _local13.length;
_local16 = (_local10 - 1);
_local14 = 0;
while (_local14 < _local15) {
_local3 = _local13[_local14];
_local2 = _local8[int((_local16 + _local14))];
_local2.value = _local3.value;
_local2.proxyId = _local3.proxyId;
_local2.stabbingCount = _local3.stabbingCount;
_local14++;
};
_local15 = (_local5 - 2);
_local17 = _local9;
while (_local17 < _local15) {
_local2 = _local8[_local17];
_local19 = m_proxyPool[_local2.proxyId];
if (_local2.IsLower()){
_local19.lowerBounds[_local6] = _local17;
} else {
_local19.upperBounds[_local6] = _local17;
};
_local17++;
};
_local15 = (_local10 - 1);
_local18 = _local9;
while (_local18 < _local15) {
_local2 = _local8[_local18];
_local2.stabbingCount--;
_local18++;
};
Query([0], [0], _local11, _local12, _local8, (_local5 - 2), _local6);
_local6++;
};
_local7 = 0;
while (_local7 < m_queryResultCount) {
m_pairManager.RemoveBufferedPair(_arg1, m_queryResults[_local7]);
_local7++;
};
m_pairManager.Commit();
m_queryResultCount = 0;
IncrementTimeStamp();
_local4.userData = null;
_local4.overlapCount = b2_invalid;
_local4.lowerBounds[0] = b2_invalid;
_local4.lowerBounds[1] = b2_invalid;
_local4.upperBounds[0] = b2_invalid;
_local4.upperBounds[1] = b2_invalid;
_local4.SetNext(m_freeProxy);
m_freeProxy = _arg1;
m_proxyCount--;
}
public function TestOverlap(_arg1:b2BoundValues, _arg2:b2Proxy):Boolean{
var _local3:int;
var _local4:Array;
var _local5:b2Bound;
_local3 = 0;
while (_local3 < 2) {
_local4 = m_bounds[_local3];
_local5 = _local4[_arg2.upperBounds[_local3]];
if (_arg1.lowerValues[_local3] > _local5.value){
return (false);
};
_local5 = _local4[_arg2.lowerBounds[_local3]];
if (_arg1.upperValues[_local3] < _local5.value){
return (false);
};
_local3++;
};
return (true);
}
public function Validate():void{
var _local1:b2Pair;
var _local2:b2Proxy;
var _local3:b2Proxy;
var _local4:Boolean;
var _local5:int;
var _local6:b2Bound;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:b2Bound;
_local5 = 0;
while (_local5 < 2) {
_local6 = m_bounds[_local5];
_local7 = (2 * m_proxyCount);
_local8 = 0;
_local9 = 0;
while (_local9 < _local7) {
_local10 = _local6[_local9];
if (_local10.IsLower() == true){
_local8++;
} else {
_local8--;
};
_local9++;
};
_local5++;
};
}
private function IncrementOverlapCount(_arg1:uint):void{
var _local2:b2Proxy;
_local2 = m_proxyPool[_arg1];
if (_local2.timeStamp < m_timeStamp){
_local2.timeStamp = m_timeStamp;
_local2.overlapCount = 1;
} else {
_local2.overlapCount = 2;
m_queryResults[m_queryResultCount] = _arg1;
m_queryResultCount++;
};
}
public function InRange(_arg1:b2AABB):Boolean{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local2 = _arg1.lowerBound.x;
_local3 = _arg1.lowerBound.y;
_local2 = (_local2 - m_worldAABB.upperBound.x);
_local3 = (_local3 - m_worldAABB.upperBound.y);
_local4 = m_worldAABB.lowerBound.x;
_local5 = m_worldAABB.lowerBound.y;
_local4 = (_local4 - _arg1.upperBound.x);
_local5 = (_local5 - _arg1.upperBound.y);
_local2 = b2Math.b2Max(_local2, _local4);
_local3 = b2Math.b2Max(_local3, _local5);
return ((b2Math.b2Max(_local2, _local3) < 0));
}
public function MoveProxy(_arg1:uint, _arg2:b2AABB):void{
var _local3:Array;
var _local4:int;
var _local5:uint;
var _local6:uint;
var _local7:b2Bound;
var _local8:b2Bound;
var _local9:b2Bound;
var _local10:uint;
var _local11:b2Proxy;
var _local12:uint;
var _local13:b2Proxy;
var _local14:b2BoundValues;
var _local15:b2BoundValues;
var _local16:Array;
var _local17:uint;
var _local18:uint;
var _local19:uint;
var _local20:uint;
var _local21:int;
var _local22:int;
var _local23:uint;
var _local24:b2Proxy;
if ((((_arg1 == b2Pair.b2_nullProxy)) || ((b2Settings.b2_maxProxies <= _arg1)))){
return;
};
if (_arg2.IsValid() == false){
return;
};
_local12 = (2 * m_proxyCount);
_local13 = m_proxyPool[_arg1];
_local14 = new b2BoundValues();
ComputeBounds(_local14.lowerValues, _local14.upperValues, _arg2);
_local15 = new b2BoundValues();
_local5 = 0;
while (_local5 < 2) {
_local7 = m_bounds[_local5][_local13.lowerBounds[_local5]];
_local15.lowerValues[_local5] = _local7.value;
_local7 = m_bounds[_local5][_local13.upperBounds[_local5]];
_local15.upperValues[_local5] = _local7.value;
_local5++;
};
_local5 = 0;
while (_local5 < 2) {
_local16 = m_bounds[_local5];
_local17 = _local13.lowerBounds[_local5];
_local18 = _local13.upperBounds[_local5];
_local19 = _local14.lowerValues[_local5];
_local20 = _local14.upperValues[_local5];
_local7 = _local16[_local17];
_local21 = (_local19 - _local7.value);
_local7.value = _local19;
_local7 = _local16[_local18];
_local22 = (_local20 - _local7.value);
_local7.value = _local20;
if (_local21 < 0){
_local6 = _local17;
while ((((_local6 > 0)) && ((_local19 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local8.proxyId];
_local8.stabbingCount++;
if (_local8.IsUpper() == true){
if (TestOverlap(_local14, _local24)){
m_pairManager.AddBufferedPair(_arg1, _local23);
};
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
if (_local22 > 0){
_local6 = _local18;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local20)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount++;
if (_local9.IsLower() == true){
if (TestOverlap(_local14, _local11)){
m_pairManager.AddBufferedPair(_arg1, _local10);
};
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
} else {
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local21 > 0){
_local6 = _local17;
while ((((_local6 < (_local12 - 1))) && (((_local16[int((_local6 + 1))] as b2Bound).value <= _local19)))) {
_local7 = _local16[_local6];
_local9 = _local16[int((_local6 + 1))];
_local10 = _local9.proxyId;
_local11 = m_proxyPool[_local10];
_local9.stabbingCount--;
if (_local9.IsUpper()){
if (TestOverlap(_local15, _local11)){
m_pairManager.RemoveBufferedPair(_arg1, _local10);
};
_local3 = _local11.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local11.lowerBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.Swap(_local9);
_local6++;
};
};
if (_local22 < 0){
_local6 = _local18;
while ((((_local6 > 0)) && ((_local20 < (_local16[int((_local6 - 1))] as b2Bound).value)))) {
_local7 = _local16[_local6];
_local8 = _local16[int((_local6 - 1))];
_local23 = _local8.proxyId;
_local24 = m_proxyPool[_local23];
_local8.stabbingCount--;
if (_local8.IsLower() == true){
if (TestOverlap(_local15, _local24)){
m_pairManager.RemoveBufferedPair(_arg1, _local23);
};
_local3 = _local24.lowerBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount--;
} else {
_local3 = _local24.upperBounds;
_local4 = _local3[_local5];
_local4++;
_local3[_local5] = _local4;
_local7.stabbingCount++;
};
_local3 = _local13.upperBounds;
_local4 = _local3[_local5];
_local4--;
_local3[_local5] = _local4;
_local7.Swap(_local8);
_local6--;
};
};
_local5++;
};
}
public static function BinarySearch(_arg1:Array, _arg2:int, _arg3:uint):uint{
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:b2Bound;
_local4 = 0;
_local5 = (_arg2 - 1);
while (_local4 <= _local5) {
_local6 = ((_local4 + _local5) / 2);
_local7 = _arg1[_local6];
if (_local7.value > _arg3){
_local5 = (_local6 - 1);
} else {
if (_local7.value < _arg3){
_local4 = (_local6 + 1);
} else {
return (uint(_local6));
};
};
};
return (uint(_local4));
}
}
}//package Box2D.Collision
Section 57
//b2BufferedPair (Box2D.Collision.b2BufferedPair)
package Box2D.Collision {
public class b2BufferedPair {
public var proxyId1:uint;
public var proxyId2:uint;
}
}//package Box2D.Collision
Section 58
//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 EdgeSeparation(_arg1:b2PolygonShape, _arg2:b2XForm, _arg3:int, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:b2Mat22;
var _local12:b2Vec2;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_local6 = _arg1.m_vertexCount;
_local7 = _arg1.m_vertices;
_local8 = _arg1.m_normals;
_local9 = _arg4.m_vertexCount;
_local10 = _arg4.m_vertices;
_local11 = _arg2.R;
_local12 = _local8[_arg3];
_local13 = ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y));
_local14 = ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y));
_local11 = _arg5.R;
_local15 = ((_local11.col1.x * _local13) + (_local11.col1.y * _local14));
_local16 = ((_local11.col2.x * _local13) + (_local11.col2.y * _local14));
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local12 = _local10[_local19];
_local25 = ((_local12.x * _local15) + (_local12.y * _local16));
if (_local25 < _local18){
_local18 = _local25;
_local17 = _local19;
};
_local19++;
};
_local12 = _local7[_arg3];
_local11 = _arg2.R;
_local20 = (_arg2.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local21 = (_arg2.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local12 = _local10[_local17];
_local11 = _arg5.R;
_local22 = (_arg5.position.x + ((_local11.col1.x * _local12.x) + (_local11.col2.x * _local12.y)));
_local23 = (_arg5.position.y + ((_local11.col1.y * _local12.x) + (_local11.col2.y * _local12.y)));
_local22 = (_local22 - _local20);
_local23 = (_local23 - _local21);
_local24 = ((_local22 * _local13) + (_local23 * _local14));
return (_local24);
}
public static function b2TestOverlap(_arg1:b2AABB, _arg2:b2AABB):Boolean{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local3 = _arg2.lowerBound;
_local4 = _arg1.upperBound;
_local5 = (_local3.x - _local4.x);
_local6 = (_local3.y - _local4.y);
_local3 = _arg1.lowerBound;
_local4 = _arg2.upperBound;
_local7 = (_local3.x - _local4.x);
_local8 = (_local3.y - _local4.y);
if ((((_local5 > 0)) || ((_local6 > 0)))){
return (false);
};
if ((((_local7 > 0)) || ((_local8 > 0)))){
return (false);
};
return (true);
}
public static function FindIncidentEdge(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:int, _arg5:b2PolygonShape, _arg6:b2XForm):void{
var _local7:int;
var _local8:Array;
var _local9:int;
var _local10:Array;
var _local11:Array;
var _local12:b2Mat22;
var _local13:b2Vec2;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:int;
var _local18:Number;
var _local19:int;
var _local20:ClipVertex;
var _local21:int;
var _local22:int;
var _local23:Number;
_local7 = _arg2.m_vertexCount;
_local8 = _arg2.m_normals;
_local9 = _arg5.m_vertexCount;
_local10 = _arg5.m_vertices;
_local11 = _arg5.m_normals;
_local12 = _arg3.R;
_local13 = _local8[_arg4];
_local14 = ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y));
_local15 = ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y));
_local12 = _arg6.R;
_local16 = ((_local12.col1.x * _local14) + (_local12.col1.y * _local15));
_local15 = ((_local12.col2.x * _local14) + (_local12.col2.y * _local15));
_local14 = _local16;
_local17 = 0;
_local18 = Number.MAX_VALUE;
_local19 = 0;
while (_local19 < _local9) {
_local13 = _local11[_local19];
_local23 = ((_local14 * _local13.x) + (_local15 * _local13.y));
if (_local23 < _local18){
_local18 = _local23;
_local17 = _local19;
};
_local19++;
};
_local21 = _local17;
_local22 = (((_local21 + 1) < _local9)) ? (_local21 + 1) : 0;
_local20 = _arg1[0];
_local13 = _local10[_local21];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local21;
_local20.id.features.incidentVertex = 0;
_local20 = _arg1[1];
_local13 = _local10[_local22];
_local12 = _arg6.R;
_local20.v.x = (_arg6.position.x + ((_local12.col1.x * _local13.x) + (_local12.col2.x * _local13.y)));
_local20.v.y = (_arg6.position.y + ((_local12.col1.y * _local13.x) + (_local12.col2.y * _local13.y)));
_local20.id.features.referenceEdge = _arg4;
_local20.id.features.incidentEdge = _local22;
_local20.id.features.incidentVertex = 1;
}
public static function b2CollidePolygons(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):void{
var _local6:ClipVertex;
var _local7:int;
var _local8:Array;
var _local9:Number;
var _local10:int;
var _local11:Array;
var _local12:Number;
var _local13:b2PolygonShape;
var _local14:b2PolygonShape;
var _local15:b2XForm;
var _local16:b2XForm;
var _local17:int;
var _local18:uint;
var _local19:Number;
var _local20:Number;
var _local21:Array;
var _local22:int;
var _local23:Array;
var _local24:b2Vec2;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:b2Vec2;
var _local28:b2Vec2;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Array;
var _local33:Array;
var _local34:int;
var _local35:int;
var _local36:int;
var _local37:b2Vec2;
var _local38:Number;
var _local39:b2ManifoldPoint;
_arg1.pointCount = 0;
_local7 = 0;
_local8 = [_local7];
_local9 = FindMaxSeparation(_local8, _arg2, _arg3, _arg4, _arg5);
_local7 = _local8[0];
if (_local9 > 0){
return;
};
_local10 = 0;
_local11 = [_local10];
_local12 = FindMaxSeparation(_local11, _arg4, _arg5, _arg2, _arg3);
_local10 = _local11[0];
if (_local12 > 0){
return;
};
_local15 = new b2XForm();
_local16 = new b2XForm();
_local19 = 0.98;
_local20 = 0.001;
if (_local12 > ((_local19 * _local9) + _local20)){
_local13 = _arg4;
_local14 = _arg2;
_local15.Set(_arg5);
_local16.Set(_arg3);
_local17 = _local10;
_local18 = 1;
} else {
_local13 = _arg2;
_local14 = _arg4;
_local15.Set(_arg3);
_local16.Set(_arg5);
_local17 = _local7;
_local18 = 0;
};
_local21 = [new ClipVertex(), new ClipVertex()];
FindIncidentEdge(_local21, _local13, _local15, _local17, _local14, _local16);
_local22 = _local13.m_vertexCount;
_local23 = _local13.m_vertices;
_local24 = _local23[_local17];
_local25 = _local24.Copy();
if ((_local17 + 1) < _local22){
_local24 = _local23[int((_local17 + 1))];
_local37 = _local24.Copy();
} else {
_local24 = _local23[0];
_local37 = _local24.Copy();
};
_local26 = b2Math.SubtractVV(_local37, _local25);
_local27 = b2Math.b2MulMV(_local15.R, b2Math.SubtractVV(_local37, _local25));
_local27.Normalize();
_local28 = b2Math.b2CrossVF(_local27, 1);
_local25 = b2Math.b2MulX(_local15, _local25);
_local37 = b2Math.b2MulX(_local15, _local37);
_local29 = b2Math.b2Dot(_local28, _local25);
_local30 = -(b2Math.b2Dot(_local27, _local25));
_local31 = b2Math.b2Dot(_local27, _local37);
_local32 = [new ClipVertex(), new ClipVertex()];
_local33 = [new ClipVertex(), new ClipVertex()];
_local34 = ClipSegmentToLine(_local32, _local21, _local27.Negative(), _local30);
if (_local34 < 2){
return;
};
_local34 = ClipSegmentToLine(_local33, _local32, _local27, _local31);
if (_local34 < 2){
return;
};
_arg1.normal = (_local18) ? _local28.Negative() : _local28.Copy();
_local35 = 0;
_local36 = 0;
while (_local36 < b2Settings.b2_maxManifoldPoints) {
_local6 = _local33[_local36];
_local38 = (b2Math.b2Dot(_local28, _local6.v) - _local29);
if (_local38 <= 0){
_local39 = _arg1.points[_local35];
_local39.separation = _local38;
_local39.localPoint1 = b2Math.b2MulXT(_arg3, _local6.v);
_local39.localPoint2 = b2Math.b2MulXT(_arg5, _local6.v);
_local39.id.key = _local6.id._key;
_local39.id.features.flip = _local18;
_local35++;
};
_local36++;
};
_arg1.pointCount = _local35;
}
public static function FindMaxSeparation(_arg1:Array, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2PolygonShape, _arg5:b2XForm):Number{
var _local6:int;
var _local7:Array;
var _local8:b2Vec2;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:int;
var _local15:Number;
var _local16:int;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:int;
var _local21:Number;
var _local22:int;
var _local23:Number;
var _local24:int;
var _local25:Number;
_local6 = _arg2.m_vertexCount;
_local7 = _arg2.m_normals;
_local9 = _arg5.R;
_local8 = _arg4.m_centroid;
_local10 = (_arg5.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y)));
_local11 = (_arg5.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y)));
_local9 = _arg3.R;
_local8 = _arg2.m_centroid;
_local10 = (_local10 - (_arg3.position.x + ((_local9.col1.x * _local8.x) + (_local9.col2.x * _local8.y))));
_local11 = (_local11 - (_arg3.position.y + ((_local9.col1.y * _local8.x) + (_local9.col2.y * _local8.y))));
_local12 = ((_local10 * _arg3.R.col1.x) + (_local11 * _arg3.R.col1.y));
_local13 = ((_local10 * _arg3.R.col2.x) + (_local11 * _arg3.R.col2.y));
_local14 = 0;
_local15 = -(Number.MAX_VALUE);
_local16 = 0;
while (_local16 < _local6) {
_local8 = _local7[_local16];
_local25 = ((_local8.x * _local12) + (_local8.y * _local13));
if (_local25 > _local15){
_local15 = _local25;
_local14 = _local16;
};
_local16++;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
_local18 = (((_local14 - 1) >= 0)) ? (_local14 - 1) : (_local6 - 1);
_local19 = EdgeSeparation(_arg2, _arg3, _local18, _arg4, _arg5);
if (_local19 > 0){
return (_local19);
};
_local20 = (((_local14 + 1) < _local6)) ? (_local14 + 1) : 0;
_local21 = EdgeSeparation(_arg2, _arg3, _local20, _arg4, _arg5);
if (_local21 > 0){
return (_local21);
};
if ((((_local19 > _local17)) && ((_local19 > _local21)))){
_local24 = -1;
_local22 = _local18;
_local23 = _local19;
} else {
if (_local21 > _local17){
_local24 = 1;
_local22 = _local20;
_local23 = _local21;
} else {
_arg1[0] = _local14;
return (_local17);
};
};
while (true) {
if (_local24 == -1){
_local14 = (((_local22 - 1) >= 0)) ? (_local22 - 1) : (_local6 - 1);
} else {
_local14 = (((_local22 + 1) < _local6)) ? (_local22 + 1) : 0;
};
_local17 = EdgeSeparation(_arg2, _arg3, _local14, _arg4, _arg5);
if (_local17 > 0){
return (_local17);
};
if (_local17 > _local23){
_local22 = _local14;
_local23 = _local17;
} else {
break;
};
};
_arg1[0] = _local22;
return (_local23);
}
public static function ClipSegmentToLine(_arg1:Array, _arg2:Array, _arg3:b2Vec2, _arg4:Number):int{
var _local5:ClipVertex;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:b2Vec2;
var _local13:ClipVertex;
_local6 = 0;
_local5 = _arg2[0];
_local7 = _local5.v;
_local5 = _arg2[1];
_local8 = _local5.v;
_local9 = (b2Math.b2Dot(_arg3, _local7) - _arg4);
_local10 = (b2Math.b2Dot(_arg3, _local8) - _arg4);
if (_local9 <= 0){
var _temp1 = _local6;
_local6 = (_local6 + 1);
var _local14 = _temp1;
_arg1[_local14] = _arg2[0];
};
if (_local10 <= 0){
var _temp2 = _local6;
_local6 = (_local6 + 1);
_local14 = _temp2;
_arg1[_local14] = _arg2[1];
};
if ((_local9 * _local10) < 0){
_local11 = (_local9 / (_local9 - _local10));
_local5 = _arg1[_local6];
_local12 = _local5.v;
_local12.x = (_local7.x + (_local11 * (_local8.x - _local7.x)));
_local12.y = (_local7.y + (_local11 * (_local8.y - _local7.y)));
_local5 = _arg1[_local6];
if (_local9 > 0){
_local13 = _arg2[0];
_local5.id = _local13.id;
} else {
_local13 = _arg2[1];
_local5.id = _local13.id;
};
_local6++;
};
return (_local6);
}
public static function b2CollideCircles(_arg1:b2Manifold, _arg2:b2CircleShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2Mat22;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:b2ManifoldPoint;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
_arg1.pointCount = 0;
_local6 = _arg3.R;
_local7 = _arg2.m_localPosition;
_local8 = (_arg3.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local9 = (_arg3.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local6 = _arg5.R;
_local7 = _arg4.m_localPosition;
_local10 = (_arg5.position.x + ((_local6.col1.x * _local7.x) + (_local6.col2.x * _local7.y)));
_local11 = (_arg5.position.y + ((_local6.col1.y * _local7.x) + (_local6.col2.y * _local7.y)));
_local12 = (_local10 - _local8);
_local13 = (_local11 - _local9);
_local14 = ((_local12 * _local12) + (_local13 * _local13));
_local15 = _arg2.m_radius;
_local16 = _arg4.m_radius;
_local17 = (_local15 + _local16);
if (_local14 > (_local17 * _local17)){
return;
};
if (_local14 < Number.MIN_VALUE){
_local18 = -(_local17);
_arg1.normal.Set(0, 1);
} else {
_local24 = Math.sqrt(_local14);
_local18 = (_local24 - _local17);
_local25 = (1 / _local24);
_arg1.normal.x = (_local25 * _local12);
_arg1.normal.y = (_local25 * _local13);
};
_arg1.pointCount = 1;
_local19 = _arg1.points[0];
_local19.id.key = 0;
_local19.separation = _local18;
_local8 = (_local8 + (_local15 * _arg1.normal.x));
_local9 = (_local9 + (_local15 * _arg1.normal.y));
_local10 = (_local10 - (_local16 * _arg1.normal.x));
_local11 = (_local11 - (_local16 * _arg1.normal.y));
_local20 = (0.5 * (_local8 + _local10));
_local21 = (0.5 * (_local9 + _local11));
_local22 = (_local20 - _arg3.position.x);
_local23 = (_local21 - _arg3.position.y);
_local19.localPoint1.x = ((_local22 * _arg3.R.col1.x) + (_local23 * _arg3.R.col1.y));
_local19.localPoint1.y = ((_local22 * _arg3.R.col2.x) + (_local23 * _arg3.R.col2.y));
_local22 = (_local20 - _arg5.position.x);
_local23 = (_local21 - _arg5.position.y);
_local19.localPoint2.x = ((_local22 * _arg5.R.col1.x) + (_local23 * _arg5.R.col1.y));
_local19.localPoint2.y = ((_local22 * _arg5.R.col2.x) + (_local23 * _arg5.R.col2.y));
}
public static function b2CollidePolygonAndCircle(_arg1:b2Manifold, _arg2:b2PolygonShape, _arg3:b2XForm, _arg4:b2CircleShape, _arg5:b2XForm):void{
var _local6:b2ManifoldPoint;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:b2Vec2;
var _local12:b2Mat22;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:Number;
var _local20:Number;
var _local21:int;
var _local22:Array;
var _local23:Array;
var _local24:int;
var _local25:int;
var _local26:int;
var _local27:b2Vec2;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
_arg1.pointCount = 0;
_local12 = _arg5.R;
_local11 = _arg4.m_localPosition;
_local13 = (_arg5.position.x + ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y)));
_local14 = (_arg5.position.y + ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y)));
_local7 = (_local13 - _arg3.position.x);
_local8 = (_local14 - _arg3.position.y);
_local12 = _arg3.R;
_local15 = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local16 = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local18 = 0;
_local19 = -(Number.MAX_VALUE);
_local20 = _arg4.m_radius;
_local21 = _arg2.m_vertexCount;
_local22 = _arg2.m_vertices;
_local23 = _arg2.m_normals;
_local24 = 0;
while (_local24 < _local21) {
_local11 = _local22[_local24];
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local11 = _local23[_local24];
_local34 = ((_local11.x * _local7) + (_local11.y * _local8));
if (_local34 > _local20){
return;
};
if (_local34 > _local19){
_local19 = _local34;
_local18 = _local24;
};
_local24++;
};
if (_local19 < Number.MIN_VALUE){
_arg1.pointCount = 1;
_local11 = _local23[_local18];
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local11.x) + (_local12.col2.x * _local11.y));
_arg1.normal.y = ((_local12.col1.y * _local11.x) + (_local12.col2.y * _local11.y));
_local6 = _arg1.points[0];
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = b2_nullFeature;
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local19 - _local20);
return;
};
_local25 = _local18;
_local26 = (((_local25 + 1) < _local21)) ? (_local25 + 1) : 0;
_local11 = _local22[_local25];
_local27 = _local22[_local26];
_local28 = (_local27.x - _local11.x);
_local29 = (_local27.y - _local11.y);
_local30 = Math.sqrt(((_local28 * _local28) + (_local29 * _local29)));
_local28 = (_local28 / _local30);
_local29 = (_local29 / _local30);
_local7 = (_local15 - _local11.x);
_local8 = (_local16 - _local11.y);
_local31 = ((_local7 * _local28) + (_local8 * _local29));
_local6 = _arg1.points[0];
if (_local31 <= 0){
_local32 = _local11.x;
_local33 = _local11.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local25;
} else {
if (_local31 >= _local30){
_local32 = _local27.x;
_local33 = _local27.y;
_local6.id.features.incidentEdge = b2_nullFeature;
_local6.id.features.incidentVertex = _local26;
} else {
_local32 = ((_local28 * _local31) + _local11.x);
_local33 = ((_local29 * _local31) + _local11.y);
_local6.id.features.incidentEdge = _local18;
_local6.id.features.incidentVertex = 0;
};
};
_local7 = (_local15 - _local32);
_local8 = (_local16 - _local33);
_local17 = Math.sqrt(((_local7 * _local7) + (_local8 * _local8)));
_local7 = (_local7 / _local17);
_local8 = (_local8 / _local17);
if (_local17 > _local20){
return;
};
_arg1.pointCount = 1;
_local12 = _arg3.R;
_arg1.normal.x = ((_local12.col1.x * _local7) + (_local12.col2.x * _local8));
_arg1.normal.y = ((_local12.col1.y * _local7) + (_local12.col2.y * _local8));
_local9 = (_local13 - (_local20 * _arg1.normal.x));
_local10 = (_local14 - (_local20 * _arg1.normal.y));
_local7 = (_local9 - _arg3.position.x);
_local8 = (_local10 - _arg3.position.y);
_local12 = _arg3.R;
_local6.localPoint1.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint1.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local7 = (_local9 - _arg5.position.x);
_local8 = (_local10 - _arg5.position.y);
_local12 = _arg5.R;
_local6.localPoint2.x = ((_local7 * _local12.col1.x) + (_local8 * _local12.col1.y));
_local6.localPoint2.y = ((_local7 * _local12.col2.x) + (_local8 * _local12.col2.y));
_local6.separation = (_local17 - _local20);
_local6.id.features.referenceEdge = 0;
_local6.id.features.flip = 0;
}
}
}//package Box2D.Collision
Section 59
//b2ContactID (Box2D.Collision.b2ContactID)
package Box2D.Collision {
public class b2ContactID {
public var _key:uint;
public var features:Features;
public function b2ContactID(){
features = new Features();
super();
features._m_id = this;
}
public function Set(_arg1:b2ContactID):void{
key = _arg1._key;
}
public function Copy():b2ContactID{
var _local1:b2ContactID;
_local1 = new b2ContactID();
_local1.key = key;
return (_local1);
}
public function get key():uint{
return (_key);
}
public function set key(_arg1:uint):void{
_key = _arg1;
features._referenceEdge = (_key & 0xFF);
features._incidentEdge = (((_key & 0xFF00) >> 8) & 0xFF);
features._incidentVertex = (((_key & 0xFF0000) >> 16) & 0xFF);
features._flip = (((_key & 4278190080) >> 24) & 0xFF);
}
}
}//package Box2D.Collision
Section 60
//b2ContactPoint (Box2D.Collision.b2ContactPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class b2ContactPoint {
public var separation:Number;
public var normal:b2Vec2;
public var position:b2Vec2;
public var restitution:Number;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var id:b2ContactID;
public var friction:Number;
public var velocity:b2Vec2;
public function b2ContactPoint(){
position = new b2Vec2();
velocity = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Collision
Section 61
//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_p2s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_p1s:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var s_points:Array = [new b2Vec2(), new b2Vec2(), new b2Vec2()];
private static var gPoint:b2Point = new b2Point();
public static var g_GJK_Iterations:int = 0;
public static function InPoints(_arg1:b2Vec2, _arg2:Array, _arg3:int):Boolean{
var _local4:Number;
var _local5:int;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local4 = (100 * Number.MIN_VALUE);
_local5 = 0;
while (_local5 < _arg3) {
_local6 = _arg2[_local5];
_local7 = Math.abs((_arg1.x - _local6.x));
_local8 = Math.abs((_arg1.y - _local6.y));
_local9 = Math.max(Math.abs(_arg1.x), Math.abs(_local6.x));
_local10 = Math.max(Math.abs(_arg1.y), Math.abs(_local6.y));
if ((((_local7 < (_local4 * (_local9 + 1)))) && ((_local8 < (_local4 * (_local10 + 1)))))){
return (true);
};
_local5++;
};
return (false);
}
public static function DistanceGeneric(_arg1:b2Vec2, _arg2:b2Vec2, _arg3, _arg4:b2XForm, _arg5, _arg6:b2XForm):Number{
var _local7:b2Vec2;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:int;
var _local12:Number;
var _local13:int;
var _local14:int;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:int;
_local8 = s_p1s;
_local9 = s_p2s;
_local10 = s_points;
_local11 = 0;
_arg1.SetV(_arg3.GetFirstVertex(_arg4));
_arg2.SetV(_arg5.GetFirstVertex(_arg6));
_local12 = 0;
_local13 = 20;
_local14 = 0;
while (_local14 < _local13) {
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local17 = _arg3.Support(_arg4, _local15, _local16);
_local18 = _arg5.Support(_arg6, -(_local15), -(_local16));
_local12 = ((_local15 * _local15) + (_local16 * _local16));
_local19 = (_local18.x - _local17.x);
_local20 = (_local18.y - _local17.y);
_local21 = ((_local15 * _local19) + (_local16 * _local20));
if ((_local12 - ((_local15 * _local19) + (_local16 * _local20))) <= (0.01 * _local12)){
if (_local11 == 0){
_arg1.SetV(_local17);
_arg2.SetV(_local18);
};
g_GJK_Iterations = _local14;
return (Math.sqrt(_local12));
};
switch (_local11){
case 0:
_local7 = _local8[0];
_local7.SetV(_local17);
_local7 = _local9[0];
_local7.SetV(_local18);
_local7 = _local10[0];
_local7.x = _local19;
_local7.y = _local20;
_arg1.SetV(_local8[0]);
_arg2.SetV(_local9[0]);
_local11++;
break;
case 1:
_local7 = _local8[1];
_local7.SetV(_local17);
_local7 = _local9[1];
_local7.SetV(_local18);
_local7 = _local10[1];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessTwo(_arg1, _arg2, _local8, _local9, _local10);
break;
case 2:
_local7 = _local8[2];
_local7.SetV(_local17);
_local7 = _local9[2];
_local7.SetV(_local18);
_local7 = _local10[2];
_local7.x = _local19;
_local7.y = _local20;
_local11 = ProcessThree(_arg1, _arg2, _local8, _local9, _local10);
break;
};
if (_local11 == 3){
g_GJK_Iterations = _local14;
return (0);
};
_local22 = -(Number.MAX_VALUE);
_local23 = 0;
while (_local23 < _local11) {
_local7 = _local10[_local23];
_local22 = b2Math.b2Max(_local22, ((_local7.x * _local7.x) + (_local7.y * _local7.y)));
_local23++;
};
if ((((_local11 == 3)) || ((_local12 <= ((100 * Number.MIN_VALUE) * _local22))))){
g_GJK_Iterations = _local14;
_local15 = (_arg2.x - _arg1.x);
_local16 = (_arg2.y - _arg1.y);
_local12 = ((_local15 * _local15) + (_local16 * _local16));
return (Math.sqrt(_local12));
};
_local14++;
};
g_GJK_Iterations = _local13;
return (Math.sqrt(_local12));
}
public static function DistanceCC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2CircleShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local7 = _arg4.R;
_local8 = _arg3.m_localPosition;
_local9 = (_arg4.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local10 = (_arg4.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local7 = _arg6.R;
_local8 = _arg5.m_localPosition;
_local11 = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local12 = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = ((_local13 * _local13) + (_local14 * _local14));
_local16 = (_arg3.m_radius - b2Settings.b2_toiSlop);
_local17 = (_arg5.m_radius - b2Settings.b2_toiSlop);
_local18 = (_local16 + _local17);
if (_local15 > (_local18 * _local18)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_local20 = (_local19 - _local18);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = (_local11 - (_local17 * _local13));
_arg2.y = (_local12 - (_local17 * _local14));
return (_local20);
};
if (_local15 > (Number.MIN_VALUE * Number.MIN_VALUE)){
_local19 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local13 = (_local13 / _local19);
_local14 = (_local14 / _local19);
_arg1.x = (_local9 + (_local16 * _local13));
_arg1.y = (_local10 + (_local16 * _local14));
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
};
_arg1.x = _local9;
_arg1.y = _local10;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
return (0);
}
public static function ProcessThree(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:b2Vec2;
var _local13:b2Vec2;
var _local14:b2Vec2;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg5[2];
_local9 = _arg3[0];
_local10 = _arg3[1];
_local11 = _arg3[2];
_local12 = _arg4[0];
_local13 = _arg4[1];
_local14 = _arg4[2];
_local15 = _local6.x;
_local16 = _local6.y;
_local17 = _local7.x;
_local18 = _local7.y;
_local19 = _local8.x;
_local20 = _local8.y;
_local21 = (_local17 - _local15);
_local22 = (_local18 - _local16);
_local23 = (_local19 - _local15);
_local24 = (_local20 - _local16);
_local25 = (_local19 - _local17);
_local26 = (_local20 - _local18);
_local27 = -(((_local15 * _local21) + (_local16 * _local22)));
_local28 = ((_local17 * _local21) + (_local18 * _local22));
_local29 = -(((_local15 * _local23) + (_local16 * _local24)));
_local30 = ((_local19 * _local23) + (_local20 * _local24));
_local31 = -(((_local17 * _local25) + (_local18 * _local26)));
_local32 = ((_local19 * _local25) + (_local20 * _local26));
if ((((_local30 <= 0)) && ((_local32 <= 0)))){
_arg1.SetV(_local11);
_arg2.SetV(_local14);
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (1);
};
_local33 = ((_local21 * _local24) - (_local22 * _local23));
_local34 = (_local33 * ((_local15 * _local18) - (_local16 * _local17)));
_local36 = (_local33 * ((_local17 * _local20) - (_local18 * _local19)));
if ((((((((_local36 <= 0)) && ((_local31 >= 0)))) && ((_local32 >= 0)))) && (((_local31 + _local32) > 0)))){
_local35 = (_local31 / (_local31 + _local32));
_arg1.x = (_local10.x + (_local35 * (_local11.x - _local10.x)));
_arg1.y = (_local10.y + (_local35 * (_local11.y - _local10.y)));
_arg2.x = (_local13.x + (_local35 * (_local14.x - _local13.x)));
_arg2.y = (_local13.y + (_local35 * (_local14.y - _local13.y)));
_local9.SetV(_local11);
_local12.SetV(_local14);
_local6.SetV(_local8);
return (2);
};
_local37 = (_local33 * ((_local19 * _local16) - (_local20 * _local15)));
if ((((((((_local37 <= 0)) && ((_local29 >= 0)))) && ((_local30 >= 0)))) && (((_local29 + _local30) > 0)))){
_local35 = (_local29 / (_local29 + _local30));
_arg1.x = (_local9.x + (_local35 * (_local11.x - _local9.x)));
_arg1.y = (_local9.y + (_local35 * (_local11.y - _local9.y)));
_arg2.x = (_local12.x + (_local35 * (_local14.x - _local12.x)));
_arg2.y = (_local12.y + (_local35 * (_local14.y - _local12.y)));
_local10.SetV(_local11);
_local13.SetV(_local14);
_local7.SetV(_local8);
return (2);
};
_local38 = ((_local36 + _local37) + _local34);
_local38 = (1 / _local38);
_local39 = (_local36 * _local38);
_local40 = (_local37 * _local38);
_local41 = ((1 - _local39) - _local40);
_arg1.x = (((_local39 * _local9.x) + (_local40 * _local10.x)) + (_local41 * _local11.x));
_arg1.y = (((_local39 * _local9.y) + (_local40 * _local10.y)) + (_local41 * _local11.y));
_arg2.x = (((_local39 * _local12.x) + (_local40 * _local13.x)) + (_local41 * _local14.x));
_arg2.y = (((_local39 * _local12.y) + (_local40 * _local13.y)) + (_local41 * _local14.y));
return (3);
}
public static function DistancePC(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2PolygonShape, _arg4:b2XForm, _arg5:b2CircleShape, _arg6:b2XForm):Number{
var _local7:b2Mat22;
var _local8:b2Vec2;
var _local9:b2Point;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local9 = gPoint;
_local8 = _arg5.m_localPosition;
_local7 = _arg6.R;
_local9.p.x = (_arg6.position.x + ((_local7.col1.x * _local8.x) + (_local7.col2.x * _local8.y)));
_local9.p.y = (_arg6.position.y + ((_local7.col1.y * _local8.x) + (_local7.col2.y * _local8.y)));
_local10 = DistanceGeneric(_arg1, _arg2, _arg3, _arg4, _local9, b2Math.b2XForm_identity);
_local11 = (_arg5.m_radius - b2Settings.b2_toiSlop);
if (_local10 > _local11){
_local10 = (_local10 - _local11);
_local12 = (_arg2.x - _arg1.x);
_local13 = (_arg2.y - _arg1.y);
_local14 = Math.sqrt(((_local12 * _local12) + (_local13 * _local13)));
_local12 = (_local12 / _local14);
_local13 = (_local13 / _local14);
_arg2.x = (_arg2.x - (_local11 * _local12));
_arg2.y = (_arg2.y - (_local11 * _local13));
} else {
_local10 = 0;
_arg2.x = _arg1.x;
_arg2.y = _arg1.y;
};
return (_local10);
}
public static function Distance(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Shape, _arg4:b2XForm, _arg5:b2Shape, _arg6:b2XForm):Number{
var _local7:int;
var _local8:int;
_local7 = _arg3.m_type;
_local8 = _arg5.m_type;
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistanceCC(_arg1, _arg2, (_arg3 as b2CircleShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_circleShape)))){
return (DistancePC(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2CircleShape), _arg6));
};
if ((((_local7 == b2Shape.e_circleShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistancePC(_arg2, _arg1, (_arg5 as b2PolygonShape), _arg6, (_arg3 as b2CircleShape), _arg4));
};
if ((((_local7 == b2Shape.e_polygonShape)) && ((_local8 == b2Shape.e_polygonShape)))){
return (DistanceGeneric(_arg1, _arg2, (_arg3 as b2PolygonShape), _arg4, (_arg5 as b2PolygonShape), _arg6));
};
return (0);
}
public static function ProcessTwo(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:Array, _arg4:Array, _arg5:Array):int{
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Vec2;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local6 = _arg5[0];
_local7 = _arg5[1];
_local8 = _arg3[0];
_local9 = _arg3[1];
_local10 = _arg4[0];
_local11 = _arg4[1];
_local12 = -(_local7.x);
_local13 = -(_local7.y);
_local14 = (_local6.x - _local7.x);
_local15 = (_local6.y - _local7.y);
_local16 = Math.sqrt(((_local14 * _local14) + (_local15 * _local15)));
_local14 = (_local14 / _local16);
_local15 = (_local15 / _local16);
_local17 = ((_local12 * _local14) + (_local13 * _local15));
if ((((_local17 <= 0)) || ((_local16 < Number.MIN_VALUE)))){
_arg1.SetV(_local9);
_arg2.SetV(_local11);
_local8.SetV(_local9);
_local10.SetV(_local11);
_local6.SetV(_local7);
return (1);
};
_local17 = (_local17 / _local16);
_arg1.x = (_local9.x + (_local17 * (_local8.x - _local9.x)));
_arg1.y = (_local9.y + (_local17 * (_local8.y - _local9.y)));
_arg2.x = (_local11.x + (_local17 * (_local10.x - _local11.x)));
_arg2.y = (_local11.y + (_local17 * (_local10.y - _local11.y)));
return (2);
}
}
}//package Box2D.Collision
Section 62
//b2Manifold (Box2D.Collision.b2Manifold)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Manifold {
public var points:Array;
public var pointCount:int;// = 0
public var normal:b2Vec2;
public function b2Manifold(){
var _local1:int;
pointCount = 0;
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ManifoldPoint();
_local1++;
};
normal = new b2Vec2();
}
public function Set(_arg1:b2Manifold):void{
var _local2:int;
pointCount = _arg1.pointCount;
_local2 = 0;
while (_local2 < b2Settings.b2_maxManifoldPoints) {
(points[_local2] as b2ManifoldPoint).Set(_arg1.points[_local2]);
_local2++;
};
normal.SetV(_arg1.normal);
}
public function Reset():void{
var _local1:int;
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
(points[_local1] as b2ManifoldPoint).Reset();
_local1++;
};
normal.SetZero();
pointCount = 0;
}
}
}//package Box2D.Collision
Section 63
//b2ManifoldPoint (Box2D.Collision.b2ManifoldPoint)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2ManifoldPoint {
public var separation:Number;
public var localPoint2:b2Vec2;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var localPoint1:b2Vec2;
public var id:b2ContactID;
public function b2ManifoldPoint(){
localPoint1 = new b2Vec2();
localPoint2 = new b2Vec2();
id = new b2ContactID();
super();
}
public function Set(_arg1:b2ManifoldPoint):void{
localPoint1.SetV(_arg1.localPoint1);
localPoint2.SetV(_arg1.localPoint2);
separation = _arg1.separation;
normalImpulse = _arg1.normalImpulse;
tangentImpulse = _arg1.tangentImpulse;
id.key = _arg1.id.key;
}
public function Reset():void{
localPoint1.SetZero();
localPoint2.SetZero();
separation = 0;
normalImpulse = 0;
tangentImpulse = 0;
id.key = 0;
}
}
}//package Box2D.Collision
Section 64
//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 65
//b2Pair (Box2D.Collision.b2Pair)
package Box2D.Collision {
import Box2D.Common.*;
public class b2Pair {
public var userData;// = null
public var proxyId1:uint;
public var proxyId2:uint;
public var status:uint;
public var next:uint;
public static var e_pairFinal:uint = 4;
public static var b2_tableMask:int = (b2_tableCapacity - 1);
public static var e_pairRemoved:uint = 2;
public static var b2_nullPair:uint = b2Settings.USHRT_MAX;
public static var e_pairBuffered:uint = 1;
public static var b2_nullProxy:uint = b2Settings.USHRT_MAX;
public static var b2_tableCapacity:int = b2Settings.b2_maxPairs;
public function b2Pair(){
userData = null;
super();
}
public function SetBuffered():void{
status = (status | e_pairBuffered);
}
public function IsBuffered():Boolean{
return (((status & e_pairBuffered) == e_pairBuffered));
}
public function IsFinal():Boolean{
return (((status & e_pairFinal) == e_pairFinal));
}
public function ClearRemoved():void{
status = (status & ~(e_pairRemoved));
}
public function SetFinal():void{
status = (status | e_pairFinal);
}
public function IsRemoved():Boolean{
return (((status & e_pairRemoved) == e_pairRemoved));
}
public function ClearBuffered():void{
status = (status & ~(e_pairBuffered));
}
public function SetRemoved():void{
status = (status | e_pairRemoved);
}
}
}//package Box2D.Collision
Section 66
//b2PairCallback (Box2D.Collision.b2PairCallback)
package Box2D.Collision {
public class b2PairCallback {
public function PairRemoved(_arg1, _arg2, _arg3):void{
}
public function PairAdded(_arg1, _arg2){
return (null);
}
}
}//package Box2D.Collision
Section 67
//b2PairManager (Box2D.Collision.b2PairManager)
package Box2D.Collision {
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PairManager {
public var m_pairCount:int;
public var m_pairBuffer:Array;
public var m_callback:b2PairCallback;
public var m_pairs:Array;
public var m_pairBufferCount:int;
public var m_hashTable:Array;
public var m_broadPhase:b2BroadPhase;
public var m_freePair:uint;
public function b2PairManager(){
var _local1:uint;
super();
m_hashTable = new Array(b2Pair.b2_tableCapacity);
_local1 = 0;
while (_local1 < b2Pair.b2_tableCapacity) {
m_hashTable[_local1] = b2Pair.b2_nullPair;
_local1++;
};
m_pairs = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1] = new b2Pair();
_local1++;
};
m_pairBuffer = new Array(b2Settings.b2_maxPairs);
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairBuffer[_local1] = new b2BufferedPair();
_local1++;
};
_local1 = 0;
while (_local1 < b2Settings.b2_maxPairs) {
m_pairs[_local1].proxyId1 = b2Pair.b2_nullProxy;
m_pairs[_local1].proxyId2 = b2Pair.b2_nullProxy;
m_pairs[_local1].userData = null;
m_pairs[_local1].status = 0;
m_pairs[_local1].next = (_local1 + 1);
_local1++;
};
m_pairs[int((b2Settings.b2_maxPairs - 1))].next = b2Pair.b2_nullPair;
m_pairCount = 0;
m_pairBufferCount = 0;
}
private function FindHash(_arg1:uint, _arg2:uint, _arg3:uint):b2Pair{
var _local4:b2Pair;
var _local5:uint;
_local5 = m_hashTable[_arg3];
_local4 = m_pairs[_local5];
while (((!((_local5 == b2Pair.b2_nullPair))) && ((Equals(_local4, _arg1, _arg2) == false)))) {
_local5 = _local4.next;
_local4 = m_pairs[_local5];
};
if (_local5 == b2Pair.b2_nullPair){
return (null);
};
return (_local4);
}
private function Find(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:uint;
if (_arg1 > _arg2){
_local4 = _arg1;
_arg1 = _arg2;
_arg2 = _local4;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
return (FindHash(_arg1, _arg2, _local3));
}
private function ValidateBuffer():void{
}
public function Commit():void{
var _local1:b2BufferedPair;
var _local2:int;
var _local3:int;
var _local4:Array;
var _local5:b2Pair;
var _local6:b2Proxy;
var _local7:b2Proxy;
_local3 = 0;
_local4 = m_broadPhase.m_proxyPool;
_local2 = 0;
while (_local2 < m_pairBufferCount) {
_local1 = m_pairBuffer[_local2];
_local5 = Find(_local1.proxyId1, _local1.proxyId2);
_local5.ClearBuffered();
_local6 = _local4[_local5.proxyId1];
_local7 = _local4[_local5.proxyId2];
if (_local5.IsRemoved()){
if (_local5.IsFinal() == true){
m_callback.PairRemoved(_local6.userData, _local7.userData, _local5.userData);
};
_local1 = m_pairBuffer[_local3];
_local1.proxyId1 = _local5.proxyId1;
_local1.proxyId2 = _local5.proxyId2;
_local3++;
} else {
if (_local5.IsFinal() == false){
_local5.userData = m_callback.PairAdded(_local6.userData, _local7.userData);
_local5.SetFinal();
};
};
_local2++;
};
_local2 = 0;
while (_local2 < _local3) {
_local1 = m_pairBuffer[_local2];
RemovePair(_local1.proxyId1, _local1.proxyId2);
_local2++;
};
m_pairBufferCount = 0;
if (b2BroadPhase.s_validate){
ValidateTable();
};
}
public function RemoveBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = Find(_arg1, _arg2);
if (_local4 == null){
return;
};
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.SetRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function RemovePair(_arg1:uint, _arg2:uint){
var _local3:b2Pair;
var _local4:uint;
var _local5:uint;
var _local6:b2Pair;
var _local7:uint;
var _local8:uint;
var _local9:*;
if (_arg1 > _arg2){
_local7 = _arg1;
_arg1 = _arg2;
_arg2 = _local7;
};
_local4 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local5 = m_hashTable[_local4];
_local6 = null;
while (_local5 != b2Pair.b2_nullPair) {
if (Equals(m_pairs[_local5], _arg1, _arg2)){
_local8 = _local5;
_local3 = m_pairs[_local5];
if (_local6){
_local6.next = _local3.next;
} else {
m_hashTable[_local4] = _local3.next;
};
_local3 = m_pairs[_local8];
_local9 = _local3.userData;
_local3.next = m_freePair;
_local3.proxyId1 = b2Pair.b2_nullProxy;
_local3.proxyId2 = b2Pair.b2_nullProxy;
_local3.userData = null;
_local3.status = 0;
m_freePair = _local8;
m_pairCount--;
return (_local9);
} else {
_local6 = m_pairs[_local5];
_local5 = _local6.next;
};
};
return (null);
}
public function Initialize(_arg1:b2BroadPhase, _arg2:b2PairCallback):void{
m_broadPhase = _arg1;
m_callback = _arg2;
}
public function AddBufferedPair(_arg1:int, _arg2:int):void{
var _local3:b2BufferedPair;
var _local4:b2Pair;
_local4 = AddPair(_arg1, _arg2);
if (_local4.IsBuffered() == false){
_local4.SetBuffered();
_local3 = m_pairBuffer[m_pairBufferCount];
_local3.proxyId1 = _local4.proxyId1;
_local3.proxyId2 = _local4.proxyId2;
m_pairBufferCount++;
};
_local4.ClearRemoved();
if (b2BroadPhase.s_validate){
ValidateBuffer();
};
}
private function AddPair(_arg1:uint, _arg2:uint):b2Pair{
var _local3:uint;
var _local4:b2Pair;
var _local5:uint;
var _local6:uint;
if (_arg1 > _arg2){
_local6 = _arg1;
_arg1 = _arg2;
_arg2 = _local6;
};
_local3 = (Hash(_arg1, _arg2) & b2Pair.b2_tableMask);
_local4 = FindHash(_arg1, _arg2, _local3);
if (_local4 != null){
return (_local4);
};
_local5 = m_freePair;
_local4 = m_pairs[_local5];
m_freePair = _local4.next;
_local4.proxyId1 = _arg1;
_local4.proxyId2 = _arg2;
_local4.status = 0;
_local4.userData = null;
_local4.next = m_hashTable[_local3];
m_hashTable[_local3] = _local5;
m_pairCount++;
return (_local4);
}
private function ValidateTable():void{
}
public static function EqualsPair(_arg1:b2BufferedPair, _arg2:b2BufferedPair):Boolean{
return ((((_arg1.proxyId1 == _arg2.proxyId1)) && ((_arg1.proxyId2 == _arg2.proxyId2))));
}
public static function Hash(_arg1:uint, _arg2:uint):uint{
var _local3:uint;
_local3 = (((_arg2 << 16) & 4294901760) | _arg1);
_local3 = (~(_local3) + ((_local3 << 15) & 4294934528));
_local3 = (_local3 ^ ((_local3 >> 12) & 1048575));
_local3 = (_local3 + ((_local3 << 2) & 4294967292));
_local3 = (_local3 ^ ((_local3 >> 4) & 268435455));
_local3 = (_local3 * 2057);
_local3 = (_local3 ^ ((_local3 >> 16) & 0xFFFF));
return (_local3);
}
public static function Equals(_arg1:b2Pair, _arg2:uint, _arg3:uint):Boolean{
return ((((_arg1.proxyId1 == _arg2)) && ((_arg1.proxyId2 == _arg3))));
}
}
}//package Box2D.Collision
Section 68
//b2Point (Box2D.Collision.b2Point)
package Box2D.Collision {
import Box2D.Common.Math.*;
public class b2Point {
public var p:b2Vec2;
public function b2Point(){
p = new b2Vec2();
super();
}
public function GetFirstVertex(_arg1:b2XForm):b2Vec2{
return (p);
}
public function Support(_arg1:b2XForm, _arg2:Number, _arg3:Number):b2Vec2{
return (p);
}
}
}//package Box2D.Collision
Section 69
//b2Proxy (Box2D.Collision.b2Proxy)
package Box2D.Collision {
public class b2Proxy {
public var overlapCount:uint;
public var lowerBounds:Array;
public var upperBounds:Array;
public var userData;// = null
public var timeStamp:uint;
public function b2Proxy(){
lowerBounds = [uint(0), uint(0)];
upperBounds = [uint(0), uint(0)];
userData = null;
super();
}
public function GetNext():uint{
return (lowerBounds[0]);
}
public function IsValid():Boolean{
return (!((overlapCount == b2BroadPhase.b2_invalid)));
}
public function SetNext(_arg1:uint):void{
lowerBounds[0] = (_arg1 & 0xFFFF);
}
}
}//package Box2D.Collision
Section 70
//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 _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
_local5 = _arg3.p1;
_local6 = (_arg3.p2.x - _local5.x);
_local7 = (_arg3.p2.y - _local5.y);
_local8 = (p2.x - p1.x);
_local9 = (p2.y - p1.y);
_local10 = _local9;
_local11 = -(_local8);
_local12 = (100 * Number.MIN_VALUE);
_local13 = -(((_local6 * _local10) + (_local7 * _local11)));
if (_local13 > _local12){
_local14 = (_local5.x - p1.x);
_local15 = (_local5.y - p1.y);
_local16 = ((_local14 * _local10) + (_local15 * _local11));
if ((((0 <= _local16)) && ((_local16 <= (_arg4 * _local13))))){
_local17 = ((-(_local7) * _local15) + (_local7 * _local14));
if (((((-(_local12) * _local13) <= _local17)) && ((_local17 <= (_local13 * (1 + _local12)))))){
_local16 = (_local16 / _local13);
_local18 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
_local10 = (_local10 / _local18);
_local11 = (_local11 / _local18);
_arg1[0] = _local16;
_arg2.Set(_local10, _local11);
return (true);
};
};
};
return (false);
}
}
}//package Box2D.Collision
Section 71
//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_xf1:b2XForm = new b2XForm();
public static var s_xf2:b2XForm = new b2XForm();
public static var s_p1:b2Vec2 = new b2Vec2();
public static var s_p2:b2Vec2 = new b2Vec2();
public static function TimeOfImpact(_arg1:b2Shape, _arg2:b2Sweep, _arg3:b2Shape, _arg4:b2Sweep):Number{
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Vec2;
var _local18:b2Vec2;
var _local19:int;
var _local20:int;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:b2XForm;
var _local27:b2XForm;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
_local7 = _arg1.m_sweepRadius;
_local8 = _arg3.m_sweepRadius;
_local9 = _arg2.t0;
_local10 = (_arg2.c.x - _arg2.c0.x);
_local11 = (_arg2.c.y - _arg2.c0.y);
_local12 = (_arg4.c.x - _arg4.c0.x);
_local13 = (_arg4.c.y - _arg4.c0.y);
_local14 = (_arg2.a - _arg2.a0);
_local15 = (_arg4.a - _arg4.a0);
_local16 = 0;
_local17 = s_p1;
_local18 = s_p2;
_local19 = 20;
_local20 = 0;
_local21 = 0;
_local22 = 0;
_local23 = 0;
_local24 = 0;
while (true) {
_local25 = (((1 - _local16) * _local9) + _local16);
_local26 = s_xf1;
_local27 = s_xf2;
_arg2.GetXForm(_local26, _local25);
_arg4.GetXForm(_local27, _local25);
_local23 = b2Distance.Distance(_local17, _local18, _arg1, _local26, _arg3, _local27);
if (_local20 == 0){
if (_local23 > (2 * b2Settings.b2_toiSlop)){
_local24 = (1.5 * b2Settings.b2_toiSlop);
} else {
_local5 = (0.05 * b2Settings.b2_toiSlop);
_local6 = (_local23 - (0.5 * b2Settings.b2_toiSlop));
_local24 = ((_local5 > _local6)) ? _local5 : _local6;
};
};
if (((((_local23 - _local24) < (0.05 * b2Settings.b2_toiSlop))) || ((_local20 == _local19)))){
break;
};
_local21 = (_local18.x - _local17.x);
_local22 = (_local18.y - _local17.y);
_local28 = Math.sqrt(((_local21 * _local21) + (_local22 * _local22)));
_local21 = (_local21 / _local28);
_local22 = (_local22 / _local28);
_local29 = ((((_local21 * (_local10 - _local12)) + (_local22 * (_local11 - _local13))) + (((_local14 < 0)) ? -(_local14) : _local14 * _local7)) + (((_local15 < 0)) ? -(_local15) : _local15 * _local8));
if (_local29 == 0){
_local16 = 1;
break;
};
_local30 = ((_local23 - _local24) / _local29);
_local31 = (_local16 + _local30);
if ((((_local31 < 0)) || ((1 < _local31)))){
_local16 = 1;
break;
};
if (_local31 < ((1 + (100 * Number.MIN_VALUE)) * _local16)){
break;
};
_local16 = _local31;
_local20++;
};
return (_local16);
}
}
}//package Box2D.Collision
Section 72
//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 73
//Features (Box2D.Collision.Features)
package Box2D.Collision {
public class Features {
public var _referenceEdge:int;
public var _incidentEdge:int;
public var _flip:int;
public var _incidentVertex:int;
public var _m_id:b2ContactID;
public function get referenceEdge():int{
return (_referenceEdge);
}
public function set incidentVertex(_arg1:int):void{
_incidentVertex = _arg1;
_m_id._key = ((_m_id._key & 4278255615) | ((_incidentVertex << 16) & 0xFF0000));
}
public function get flip():int{
return (_flip);
}
public function get incidentEdge():int{
return (_incidentEdge);
}
public function set referenceEdge(_arg1:int):void{
_referenceEdge = _arg1;
_m_id._key = ((_m_id._key & 4294967040) | (_referenceEdge & 0xFF));
}
public function set flip(_arg1:int):void{
_flip = _arg1;
_m_id._key = ((_m_id._key & 0xFFFFFF) | ((_flip << 24) & 4278190080));
}
public function get incidentVertex():int{
return (_incidentVertex);
}
public function set incidentEdge(_arg1:int):void{
_incidentEdge = _arg1;
_m_id._key = ((_m_id._key & 4294902015) | ((_incidentEdge << 8) & 0xFF00));
}
}
}//package Box2D.Collision
Section 74
//b2Mat22 (Box2D.Common.Math.b2Mat22)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Mat22 {
public var col1:b2Vec2;
public var col2:b2Vec2;
public function b2Mat22(_arg1:Number=0, _arg2:b2Vec2=null, _arg3:b2Vec2=null){
var _local4:Number;
var _local5:Number;
col1 = new b2Vec2();
col2 = new b2Vec2();
super();
if (((!((_arg2 == null))) && (!((_arg3 == null))))){
col1.SetV(_arg2);
col2.SetV(_arg3);
} else {
_local4 = Math.cos(_arg1);
_local5 = Math.sin(_arg1);
col1.x = _local4;
col2.x = -(_local5);
col1.y = _local5;
col2.y = _local4;
};
}
public function SetIdentity():void{
col1.x = 1;
col2.x = 0;
col1.y = 0;
col2.y = 1;
}
public function Set(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
_local2 = Math.cos(_arg1);
_local3 = Math.sin(_arg1);
col1.x = _local2;
col2.x = -(_local3);
col1.y = _local3;
col2.y = _local2;
}
public function SetVV(_arg1:b2Vec2, _arg2:b2Vec2):void{
col1.SetV(_arg1);
col2.SetV(_arg2);
}
public function SetZero():void{
col1.x = 0;
col2.x = 0;
col1.y = 0;
col2.y = 0;
}
public function SetM(_arg1:b2Mat22):void{
col1.SetV(_arg1.col1);
col2.SetV(_arg1.col2);
}
public function AddM(_arg1:b2Mat22):void{
col1.x = (col1.x + _arg1.col1.x);
col1.y = (col1.y + _arg1.col1.y);
col2.x = (col2.x + _arg1.col2.x);
col2.y = (col2.y + _arg1.col2.y);
}
public function Abs():void{
col1.Abs();
col2.Abs();
}
public function Copy():b2Mat22{
return (new b2Mat22(0, col1, col2));
}
public function Invert(_arg1:b2Mat22):b2Mat22{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = col1.x;
_local3 = col2.x;
_local4 = col1.y;
_local5 = col2.y;
_local6 = ((_local2 * _local5) - (_local3 * _local4));
_local6 = (1 / _local6);
_arg1.col1.x = (_local6 * _local5);
_arg1.col2.x = (-(_local6) * _local3);
_arg1.col1.y = (-(_local6) * _local4);
_arg1.col2.y = (_local6 * _local2);
return (_arg1);
}
public function GetAngle():Number{
return (Math.atan2(col1.y, col1.x));
}
public function Solve(_arg1:b2Vec2, _arg2:Number, _arg3:Number):b2Vec2{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local4 = col1.x;
_local5 = col2.x;
_local6 = col1.y;
_local7 = col2.y;
_local8 = ((_local4 * _local7) - (_local5 * _local6));
_local8 = (1 / _local8);
_arg1.x = (_local8 * ((_local7 * _arg2) - (_local5 * _arg3)));
_arg1.y = (_local8 * ((_local4 * _arg3) - (_local6 * _arg2)));
return (_arg1);
}
}
}//package Box2D.Common.Math
Section 75
//b2Math (Box2D.Common.Math.b2Math)
package Box2D.Common.Math {
public class b2Math {
public static const b2Mat22_identity:b2Mat22 = new b2Mat22(0, new b2Vec2(1, 0), new b2Vec2(0, 1));
public static const b2XForm_identity:b2XForm = new b2XForm(b2Vec2_zero, b2Mat22_identity);
public static const b2Vec2_zero:b2Vec2 = new b2Vec2(0, 0);
public static function b2CrossVF(_arg1:b2Vec2, _arg2:Number):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg2 * _arg1.y), (-(_arg2) * _arg1.x));
return (_local3);
}
public static function AddVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x + _arg2.x), (_arg1.y + _arg2.y));
return (_local3);
}
public static function b2IsValid(_arg1:Number):Boolean{
return (isFinite(_arg1));
}
public static function b2MinV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Min(_arg1.x, _arg2.x), b2Min(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2MulX(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = b2MulMV(_arg1.R, _arg2);
_local3.x = (_local3.x + _arg1.position.x);
_local3.y = (_local3.y + _arg1.position.y);
return (_local3);
}
public static function b2DistanceSquared(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (((_local3 * _local3) + (_local4 * _local4)));
}
public static function b2Swap(_arg1:Array, _arg2:Array):void{
var _local3:*;
_local3 = _arg1[0];
_arg1[0] = _arg2[0];
_arg2[0] = _local3;
}
public static function b2AbsM(_arg1:b2Mat22):b2Mat22{
var _local2:b2Mat22;
_local2 = new b2Mat22(0, b2AbsV(_arg1.col1), b2AbsV(_arg1.col2));
return (_local2);
}
public static function SubtractVV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1.x - _arg2.x), (_arg1.y - _arg2.y));
return (_local3);
}
public static function b2MulXT(_arg1:b2XForm, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
var _local4:Number;
_local3 = SubtractVV(_arg2, _arg1.position);
_local4 = ((_local3.x * _arg1.R.col1.x) + (_local3.y * _arg1.R.col1.y));
_local3.y = ((_local3.x * _arg1.R.col2.x) + (_local3.y * _arg1.R.col2.y));
_local3.x = _local4;
return (_local3);
}
public static function b2Abs(_arg1:Number):Number{
return (((_arg1 > 0)) ? _arg1 : -(_arg1));
}
public static function b2Clamp(_arg1:Number, _arg2:Number, _arg3:Number):Number{
return (b2Max(_arg2, b2Min(_arg1, _arg3)));
}
public static function b2AbsV(_arg1:b2Vec2):b2Vec2{
var _local2:b2Vec2;
_local2 = new b2Vec2(b2Abs(_arg1.x), b2Abs(_arg1.y));
return (_local2);
}
public static function MulFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((_arg1 * _arg2.x), (_arg1 * _arg2.y));
return (_local3);
}
public static function b2CrossVV(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.y) - (_arg1.y * _arg2.x)));
}
public static function b2Dot(_arg1:b2Vec2, _arg2:b2Vec2):Number{
return (((_arg1.x * _arg2.x) + (_arg1.y * _arg2.y)));
}
public static function b2CrossFV(_arg1:Number, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2((-(_arg1) * _arg2.y), (_arg1 * _arg2.x));
return (_local3);
}
public static function AddMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, AddVV(_arg1.col1, _arg2.col1), AddVV(_arg1.col2, _arg2.col2));
return (_local3);
}
public static function b2Distance(_arg1:b2Vec2, _arg2:b2Vec2):Number{
var _local3:Number;
var _local4:Number;
_local3 = (_arg1.x - _arg2.x);
_local4 = (_arg1.y - _arg2.y);
return (Math.sqrt(((_local3 * _local3) + (_local4 * _local4))));
}
public static function b2MulTMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2Mat22;
_local3 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col1), b2Dot(_arg1.col2, _arg2.col1));
_local4 = new b2Vec2(b2Dot(_arg1.col1, _arg2.col2), b2Dot(_arg1.col2, _arg2.col2));
_local5 = new b2Mat22(0, _local3, _local4);
return (_local5);
}
public static function b2MaxV(_arg1:b2Vec2, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Max(_arg1.x, _arg2.x), b2Max(_arg1.y, _arg2.y));
return (_local3);
}
public static function b2IsPowerOfTwo(_arg1:uint):Boolean{
var _local2:Boolean;
_local2 = (((_arg1 > 0)) && (((_arg1 & (_arg1 - 1)) == 0)));
return (_local2);
}
public static function b2ClampV(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Vec2):b2Vec2{
return (b2MaxV(_arg2, b2MinV(_arg1, _arg3)));
}
public static function b2RandomRange(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
_local3 = Math.random();
_local3 = (((_arg2 - _arg1) * _local3) + _arg1);
return (_local3);
}
public static function b2MulTMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(b2Dot(_arg2, _arg1.col1), b2Dot(_arg2, _arg1.col2));
return (_local3);
}
public static function b2Min(_arg1:Number, _arg2:Number):Number{
return (((_arg1 < _arg2)) ? _arg1 : _arg2);
}
public static function b2Random():Number{
return (((Math.random() * 2) - 1));
}
public static function b2MulMM(_arg1:b2Mat22, _arg2:b2Mat22):b2Mat22{
var _local3:b2Mat22;
_local3 = new b2Mat22(0, b2MulMV(_arg1, _arg2.col1), b2MulMV(_arg1, _arg2.col2));
return (_local3);
}
public static function b2NextPowerOfTwo(_arg1:uint):uint{
_arg1 = (_arg1 | ((_arg1 >> 1) & 2147483647));
_arg1 = (_arg1 | ((_arg1 >> 2) & 1073741823));
_arg1 = (_arg1 | ((_arg1 >> 4) & 268435455));
_arg1 = (_arg1 | ((_arg1 >> 8) & 0xFFFFFF));
_arg1 = (_arg1 | ((_arg1 >> 16) & 0xFFFF));
return ((_arg1 + 1));
}
public static function b2Max(_arg1:Number, _arg2:Number):Number{
return (((_arg1 > _arg2)) ? _arg1 : _arg2);
}
public static function b2MulMV(_arg1:b2Mat22, _arg2:b2Vec2):b2Vec2{
var _local3:b2Vec2;
_local3 = new b2Vec2(((_arg1.col1.x * _arg2.x) + (_arg1.col2.x * _arg2.y)), ((_arg1.col1.y * _arg2.x) + (_arg1.col2.y * _arg2.y)));
return (_local3);
}
}
}//package Box2D.Common.Math
Section 76
//b2Sweep (Box2D.Common.Math.b2Sweep)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Sweep {
public var localCenter:b2Vec2;
public var c:b2Vec2;
public var a:Number;
public var c0:b2Vec2;
public var a0:Number;
public var t0:Number;
public function b2Sweep(){
localCenter = new b2Vec2();
c0 = new b2Vec2();
c = new b2Vec2();
super();
}
public function Advance(_arg1:Number):void{
var _local2:Number;
if ((((t0 < _arg1)) && (((1 - t0) > Number.MIN_VALUE)))){
_local2 = ((_arg1 - t0) / (1 - t0));
c0.x = (((1 - _local2) * c0.x) + (_local2 * c.x));
c0.y = (((1 - _local2) * c0.y) + (_local2 * c.y));
a0 = (((1 - _local2) * a0) + (_local2 * a));
t0 = _arg1;
};
}
public function GetXForm(_arg1:b2XForm, _arg2:Number):void{
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
if ((1 - t0) > Number.MIN_VALUE){
_local4 = ((_arg2 - t0) / (1 - t0));
_arg1.position.x = (((1 - _local4) * c0.x) + (_local4 * c.x));
_arg1.position.y = (((1 - _local4) * c0.y) + (_local4 * c.y));
_local5 = (((1 - _local4) * a0) + (_local4 * a));
_arg1.R.Set(_local5);
} else {
_arg1.position.SetV(c);
_arg1.R.Set(a);
};
_local3 = _arg1.R;
_arg1.position.x = (_arg1.position.x - ((_local3.col1.x * localCenter.x) + (_local3.col2.x * localCenter.y)));
_arg1.position.y = (_arg1.position.y - ((_local3.col1.y * localCenter.x) + (_local3.col2.y * localCenter.y)));
}
}
}//package Box2D.Common.Math
Section 77
//b2Vec2 (Box2D.Common.Math.b2Vec2)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2Vec2 {
public var x:Number;
public var y:Number;
public function b2Vec2(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Set(_arg1:Number=0, _arg2:Number=0):void{
x = _arg1;
y = _arg2;
}
public function Multiply(_arg1:Number):void{
x = (x * _arg1);
y = (y * _arg1);
}
public function Length():Number{
return (Math.sqrt(((x * x) + (y * y))));
}
public function LengthSquared():Number{
return (((x * x) + (y * y)));
}
public function SetZero():void{
x = 0;
y = 0;
}
public function Add(_arg1:b2Vec2):void{
x = (x + _arg1.x);
y = (y + _arg1.y);
}
public function MaxV(_arg1:b2Vec2):void{
x = ((x > _arg1.x)) ? x : _arg1.x;
y = ((y > _arg1.y)) ? y : _arg1.y;
}
public function SetV(_arg1:b2Vec2):void{
x = _arg1.x;
y = _arg1.y;
}
public function Negative():b2Vec2{
return (new b2Vec2(-(x), -(y)));
}
public function CrossVF(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (_arg1 * y);
y = (-(_arg1) * _local2);
}
public function Abs():void{
if (x < 0){
x = -(x);
};
if (y < 0){
y = -(y);
};
}
public function Copy():b2Vec2{
return (new b2Vec2(x, y));
}
public function MulTM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = b2Math.b2Dot(this, _arg1.col1);
y = b2Math.b2Dot(this, _arg1.col2);
x = _local2;
}
public function IsValid():Boolean{
return (((b2Math.b2IsValid(x)) && (b2Math.b2IsValid(y))));
}
public function MinV(_arg1:b2Vec2):void{
x = ((x < _arg1.x)) ? x : _arg1.x;
y = ((y < _arg1.y)) ? y : _arg1.y;
}
public function MulM(_arg1:b2Mat22):void{
var _local2:Number;
_local2 = x;
x = ((_arg1.col1.x * _local2) + (_arg1.col2.x * y));
y = ((_arg1.col1.y * _local2) + (_arg1.col2.y * y));
}
public function Normalize():Number{
var _local1:Number;
var _local2:Number;
_local1 = Math.sqrt(((x * x) + (y * y)));
if (_local1 < Number.MIN_VALUE){
return (0);
};
_local2 = (1 / _local1);
x = (x * _local2);
y = (y * _local2);
return (_local1);
}
public function Subtract(_arg1:b2Vec2):void{
x = (x - _arg1.x);
y = (y - _arg1.y);
}
public function CrossFV(_arg1:Number):void{
var _local2:Number;
_local2 = x;
x = (-(_arg1) * y);
y = (_arg1 * _local2);
}
public static function Make(_arg1:Number, _arg2:Number):b2Vec2{
return (new b2Vec2(_arg1, _arg2));
}
}
}//package Box2D.Common.Math
Section 78
//b2XForm (Box2D.Common.Math.b2XForm)
package Box2D.Common.Math {
import Box2D.Common.*;
public class b2XForm {
public var R:b2Mat22;
public var position:b2Vec2;
public function b2XForm(_arg1:b2Vec2=null, _arg2:b2Mat22=null):void{
position = new b2Vec2();
R = new b2Mat22();
super();
if (_arg1){
position.SetV(_arg1);
R.SetM(_arg2);
};
}
public function Initialize(_arg1:b2Vec2, _arg2:b2Mat22):void{
position.SetV(_arg1);
R.SetM(_arg2);
}
public function Set(_arg1:b2XForm):void{
position.SetV(_arg1.position);
R.SetM(_arg1.R);
}
public function SetIdentity():void{
position.SetZero();
R.SetIdentity();
}
}
}//package Box2D.Common.Math
Section 79
//b2Color (Box2D.Common.b2Color)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Color {
private var _g:uint;// = 0
private var _b:uint;// = 0
private var _r:uint;// = 0
public function b2Color(_arg1:Number, _arg2:Number, _arg3:Number){
_r = 0;
_g = 0;
_b = 0;
super();
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function Set(_arg1:Number, _arg2:Number, _arg3:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
_g = uint((0xFF * b2Math.b2Clamp(_arg2, 0, 1)));
_b = uint((0xFF * b2Math.b2Clamp(_arg3, 0, 1)));
}
public function get color():uint{
return (((_r | (_g << 8)) | (_b << 16)));
}
public function set r(_arg1:Number):void{
_r = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set b(_arg1:Number):void{
_b = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
public function set g(_arg1:Number):void{
_g = uint((0xFF * b2Math.b2Clamp(_arg1, 0, 1)));
}
}
}//package Box2D.Common
Section 80
//b2Settings (Box2D.Common.b2Settings)
package Box2D.Common {
import Box2D.Common.Math.*;
public class b2Settings {
public static const b2_angularSleepTolerance:Number = 0.0111111111111111;
public static const b2_linearSleepTolerance:Number = 0.01;
public static const b2_angularSlop:Number = 0.0349065850398866;
public static const b2_linearSlop:Number = 0.005;
public static const b2_pi:Number = 3.14159265358979;
public static const b2_maxProxies:int = 0x0200;
public static const b2_maxAngularVelocitySquared:Number = 62500;
public static const b2_maxPolygonVertices:int = 8;
public static const b2_velocityThreshold:Number = 1;
public static const b2_contactBaumgarte:Number = 0.2;
public static const b2_maxPairs:int = 4096;
public static const b2_maxTOIContactsPerIsland:int = 32;
public static const b2_timeToSleep:Number = 0.5;
public static const b2_maxManifoldPoints:int = 2;
public static const b2_maxAngularVelocity:Number = 250;
public static const b2_maxAngularCorrection:Number = 0.139626340159546;
public static const USHRT_MAX:int = 0xFFFF;
public static const b2_maxLinearVelocity:Number = 200;
public static const b2_maxLinearCorrection:Number = 0.2;
public static const b2_toiSlop:Number = 0.04;
public static const b2_maxLinearVelocitySquared:Number = 40000;
public static function b2Assert(_arg1:Boolean):void{
var _local2:b2Vec2;
if (!_arg1){
_local2.x++;
};
}
}
}//package Box2D.Common
Section 81
//b2CircleContact (Box2D.Dynamics.Contacts.b2CircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
public class b2CircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2CircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:b2ManifoldPoint;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollideCircles(m_manifold, (m_shape1 as b2CircleShape), _local5.m_xf, (m_shape2 as b2CircleShape), _local6.m_xf);
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
m_manifoldCount = 1;
_local8 = m_manifold.points[0];
if (m0.pointCount == 0){
_local8.normalImpulse = 0;
_local8.tangentImpulse = 0;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Add(_local7);
};
} else {
_local4 = m0.points[0];
_local8.normalImpulse = _local4.normalImpulse;
_local8.tangentImpulse = _local4.tangentImpulse;
if (_arg1){
_local7.position = _local5.GetWorldPoint(_local8.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local8.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local8.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local8.separation;
_local7.id.key = _local8.id._key;
_arg1.Persist(_local7);
};
};
} else {
m_manifoldCount = 0;
if ((((m0.pointCount > 0)) && (_arg1))){
_local4 = m0.points[0];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2CircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 82
//b2Contact (Box2D.Dynamics.Contacts.b2Contact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
public class b2Contact {
public var m_shape1:b2Shape;
public var m_shape2:b2Shape;
public var m_prev:b2Contact;
public var m_toi:Number;
public var m_next:b2Contact;
public var m_friction:Number;
public var m_manifoldCount:int;
public var m_node1:b2ContactEdge;
public var m_node2:b2ContactEdge;
public var m_restitution:Number;
public var m_flags:uint;
public static var e_toiFlag:uint = 8;
public static var e_nonSolidFlag:uint = 1;
public static var e_slowFlag:uint = 2;
public static var e_islandFlag:uint = 4;
public static var s_registers:Array;
public static var s_initialized:Boolean = false;
public function b2Contact(_arg1:b2Shape=null, _arg2:b2Shape=null){
m_node1 = new b2ContactEdge();
m_node2 = new b2ContactEdge();
super();
m_flags = 0;
if (((!(_arg1)) || (!(_arg2)))){
m_shape1 = null;
m_shape2 = null;
return;
};
if (((_arg1.IsSensor()) || (_arg2.IsSensor()))){
m_flags = (m_flags | e_nonSolidFlag);
};
m_shape1 = _arg1;
m_shape2 = _arg2;
m_manifoldCount = 0;
m_friction = Math.sqrt((m_shape1.m_friction * m_shape2.m_friction));
m_restitution = b2Math.b2Max(m_shape1.m_restitution, m_shape2.m_restitution);
m_prev = null;
m_next = null;
m_node1.contact = null;
m_node1.prev = null;
m_node1.next = null;
m_node1.other = null;
m_node2.contact = null;
m_node2.prev = null;
m_node2.next = null;
m_node2.other = null;
}
public function GetShape1():b2Shape{
return (m_shape1);
}
public function IsSolid():Boolean{
return (((m_flags & e_nonSolidFlag) == 0));
}
public function GetNext():b2Contact{
return (m_next);
}
public function GetManifolds():Array{
return (null);
}
public function GetShape2():b2Shape{
return (m_shape2);
}
public function GetManifoldCount():int{
return (m_manifoldCount);
}
public function Update(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:int;
var _local4:b2Body;
var _local5:b2Body;
_local2 = m_manifoldCount;
Evaluate(_arg1);
_local3 = m_manifoldCount;
_local4 = m_shape1.m_body;
_local5 = m_shape2.m_body;
if ((((_local3 == 0)) && ((_local2 > 0)))){
_local4.WakeUp();
_local5.WakeUp();
};
if (((((((_local4.IsStatic()) || (_local4.IsBullet()))) || (_local5.IsStatic()))) || (_local5.IsBullet()))){
m_flags = (m_flags & ~(e_slowFlag));
} else {
m_flags = (m_flags | e_slowFlag);
};
}
public function Evaluate(_arg1:b2ContactListener):void{
}
public static function InitializeRegisters():void{
var _local1:int;
var _local2:int;
s_registers = new Array(b2Shape.e_shapeTypeCount);
_local1 = 0;
while (_local1 < b2Shape.e_shapeTypeCount) {
s_registers[_local1] = new Array(b2Shape.e_shapeTypeCount);
_local2 = 0;
while (_local2 < b2Shape.e_shapeTypeCount) {
s_registers[_local1][_local2] = new b2ContactRegister();
_local2++;
};
_local1++;
};
AddType(b2CircleContact.Create, b2CircleContact.Destroy, b2Shape.e_circleShape, b2Shape.e_circleShape);
AddType(b2PolyAndCircleContact.Create, b2PolyAndCircleContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_circleShape);
AddType(b2PolygonContact.Create, b2PolygonContact.Destroy, b2Shape.e_polygonShape, b2Shape.e_polygonShape);
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
var _local3:int;
var _local4:int;
var _local5:b2ContactRegister;
var _local6:Function;
if (_arg1.m_manifoldCount > 0){
_arg1.m_shape1.m_body.WakeUp();
_arg1.m_shape2.m_body.WakeUp();
};
_local3 = _arg1.m_shape1.m_type;
_local4 = _arg1.m_shape2.m_type;
_local5 = s_registers[_local3][_local4];
_local6 = _local5.destroyFcn;
_local6(_arg1, _arg2);
}
public static function AddType(_arg1:Function, _arg2:Function, _arg3:int, _arg4:int):void{
s_registers[_arg3][_arg4].createFcn = _arg1;
s_registers[_arg3][_arg4].destroyFcn = _arg2;
s_registers[_arg3][_arg4].primary = true;
if (_arg3 != _arg4){
s_registers[_arg4][_arg3].createFcn = _arg1;
s_registers[_arg4][_arg3].destroyFcn = _arg2;
s_registers[_arg4][_arg3].primary = false;
};
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
var _local4:int;
var _local5:int;
var _local6:b2ContactRegister;
var _local7:Function;
var _local8:b2Contact;
var _local9:int;
var _local10:b2Manifold;
if (s_initialized == false){
InitializeRegisters();
s_initialized = true;
};
_local4 = _arg1.m_type;
_local5 = _arg2.m_type;
_local6 = s_registers[_local4][_local5];
_local7 = _local6.createFcn;
if (_local7 != null){
if (_local6.primary){
return (_local7(_arg1, _arg2, _arg3));
};
_local8 = _local7(_arg2, _arg1, _arg3);
_local9 = 0;
while (_local9 < _local8.m_manifoldCount) {
_local10 = _local8.GetManifolds()[_local9];
_local8.GetManifolds()[_local9].normal = _local10.normal.Negative();
_local9++;
};
return (_local8);
//unresolved jump
};
return (null);
}
}
}//package Box2D.Dynamics.Contacts
Section 83
//b2ContactConstraint (Box2D.Dynamics.Contacts.b2ContactConstraint)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
public class b2ContactConstraint {
public var points:Array;
public var restitution:Number;
public var body1:b2Body;
public var manifold:b2Manifold;
public var normal:b2Vec2;
public var body2:b2Body;
public var friction:Number;
public var pointCount:int;
public function b2ContactConstraint(){
var _local1:int;
normal = new b2Vec2();
super();
points = new Array(b2Settings.b2_maxManifoldPoints);
_local1 = 0;
while (_local1 < b2Settings.b2_maxManifoldPoints) {
points[_local1] = new b2ContactConstraintPoint();
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 84
//b2ContactConstraintPoint (Box2D.Dynamics.Contacts.b2ContactConstraintPoint)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
public class b2ContactConstraintPoint {
public var r2:b2Vec2;
public var separation:Number;
public var positionImpulse:Number;
public var normalImpulse:Number;
public var equalizedMass:Number;
public var tangentMass:Number;
public var tangentImpulse:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var normalMass:Number;
public var velocityBias:Number;
public var r1:b2Vec2;
public function b2ContactConstraintPoint(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
r1 = new b2Vec2();
r2 = new b2Vec2();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 85
//b2ContactEdge (Box2D.Dynamics.Contacts.b2ContactEdge)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2ContactEdge {
public var next:b2ContactEdge;
public var other:b2Body;
public var contact:b2Contact;
public var prev:b2ContactEdge;
}
}//package Box2D.Dynamics.Contacts
Section 86
//b2ContactRegister (Box2D.Dynamics.Contacts.b2ContactRegister)
package Box2D.Dynamics.Contacts {
public class b2ContactRegister {
public var primary:Boolean;
public var createFcn:Function;
public var destroyFcn:Function;
}
}//package Box2D.Dynamics.Contacts
Section 87
//b2ContactResult (Box2D.Dynamics.Contacts.b2ContactResult)
package Box2D.Dynamics.Contacts {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
public class b2ContactResult {
public var normal:b2Vec2;
public var position:b2Vec2;
public var shape1:b2Shape;
public var shape2:b2Shape;
public var normalImpulse:Number;
public var tangentImpulse:Number;
public var id:b2ContactID;
public function b2ContactResult(){
position = new b2Vec2();
normal = new b2Vec2();
id = new b2ContactID();
super();
}
}
}//package Box2D.Dynamics.Contacts
Section 88
//b2ContactSolver (Box2D.Dynamics.Contacts.b2ContactSolver)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
public class b2ContactSolver {
public var m_constraintCount:int;
public var m_constraints:Array;
public var m_allocator;
public var m_step:b2TimeStep;
public function b2ContactSolver(_arg1:b2TimeStep, _arg2:Array, _arg3:int, _arg4){
var _local5:b2Contact;
var _local6:int;
var _local7:b2Vec2;
var _local8:b2Mat22;
var _local9:int;
var _local10:b2Body;
var _local11:b2Body;
var _local12:int;
var _local13:Array;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:int;
var _local23:b2Manifold;
var _local24:Number;
var _local25:Number;
var _local26:b2ContactConstraint;
var _local27:uint;
var _local28:b2ManifoldPoint;
var _local29:b2ContactConstraintPoint;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
var _local39:Number;
var _local40:Number;
var _local41:Number;
var _local42:Number;
var _local43:Number;
var _local44:Number;
var _local45:Number;
var _local46:Number;
var _local47:Number;
m_step = new b2TimeStep();
m_constraints = new Array();
super();
m_step.dt = _arg1.dt;
m_step.inv_dt = _arg1.inv_dt;
m_step.maxIterations = _arg1.maxIterations;
m_allocator = _arg4;
m_constraintCount = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
m_constraintCount = (m_constraintCount + _local5.m_manifoldCount);
_local6++;
};
_local6 = 0;
while (_local6 < m_constraintCount) {
m_constraints[_local6] = new b2ContactConstraint();
_local6++;
};
_local9 = 0;
_local6 = 0;
while (_local6 < _arg3) {
_local5 = _arg2[_local6];
_local10 = _local5.m_shape1.m_body;
_local11 = _local5.m_shape2.m_body;
_local12 = _local5.m_manifoldCount;
_local13 = _local5.GetManifolds();
_local14 = _local5.m_friction;
_local15 = _local5.m_restitution;
_local16 = _local10.m_linearVelocity.x;
_local17 = _local10.m_linearVelocity.y;
_local18 = _local11.m_linearVelocity.x;
_local19 = _local11.m_linearVelocity.y;
_local20 = _local10.m_angularVelocity;
_local21 = _local11.m_angularVelocity;
_local22 = 0;
while (_local22 < _local12) {
_local23 = _local13[_local22];
_local24 = _local23.normal.x;
_local25 = _local23.normal.y;
_local26 = m_constraints[_local9];
_local26.body1 = _local10;
_local26.body2 = _local11;
_local26.manifold = _local23;
_local26.normal.x = _local24;
_local26.normal.y = _local25;
_local26.pointCount = _local23.pointCount;
_local26.friction = _local14;
_local26.restitution = _local15;
_local27 = 0;
while (_local27 < _local26.pointCount) {
_local28 = _local23.points[_local27];
_local29 = _local26.points[_local27];
_local29.normalImpulse = _local28.normalImpulse;
_local29.tangentImpulse = _local28.tangentImpulse;
_local29.separation = _local28.separation;
_local29.positionImpulse = 0;
_local29.localAnchor1.SetV(_local28.localPoint1);
_local29.localAnchor2.SetV(_local28.localPoint2);
_local8 = _local10.m_xf.R;
_local32 = (_local28.localPoint1.x - _local10.m_sweep.localCenter.x);
_local33 = (_local28.localPoint1.y - _local10.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local32) + (_local8.col2.x * _local33));
_local33 = ((_local8.col1.y * _local32) + (_local8.col2.y * _local33));
_local32 = _local30;
_local29.r1.Set(_local32, _local33);
_local8 = _local11.m_xf.R;
_local34 = (_local28.localPoint2.x - _local11.m_sweep.localCenter.x);
_local35 = (_local28.localPoint2.y - _local11.m_sweep.localCenter.y);
_local30 = ((_local8.col1.x * _local34) + (_local8.col2.x * _local35));
_local35 = ((_local8.col1.y * _local34) + (_local8.col2.y * _local35));
_local34 = _local30;
_local29.r2.Set(_local34, _local35);
_local36 = ((_local32 * _local32) + (_local33 * _local33));
_local37 = ((_local34 * _local34) + (_local35 * _local35));
_local38 = ((_local32 * _local24) + (_local33 * _local25));
_local39 = ((_local34 * _local24) + (_local35 * _local25));
_local40 = (_local10.m_invMass + _local11.m_invMass);
_local40 = (_local40 + ((_local10.m_invI * (_local36 - (_local38 * _local38))) + (_local11.m_invI * (_local37 - (_local39 * _local39)))));
_local29.normalMass = (1 / _local40);
_local41 = ((_local10.m_mass * _local10.m_invMass) + (_local11.m_mass * _local11.m_invMass));
_local41 = (_local41 + (((_local10.m_mass * _local10.m_invI) * (_local36 - (_local38 * _local38))) + ((_local11.m_mass * _local11.m_invI) * (_local37 - (_local39 * _local39)))));
_local29.equalizedMass = (1 / _local41);
_local42 = _local25;
_local43 = -(_local24);
_local44 = ((_local32 * _local42) + (_local33 * _local43));
_local45 = ((_local34 * _local42) + (_local35 * _local43));
_local46 = (_local10.m_invMass + _local11.m_invMass);
_local46 = (_local46 + ((_local10.m_invI * (_local36 - (_local44 * _local44))) + (_local11.m_invI * (_local37 - (_local45 * _local45)))));
_local29.tangentMass = (1 / _local46);
_local29.velocityBias = 0;
if (_local29.separation > 0){
_local29.velocityBias = (-60 * _local29.separation);
};
_local30 = (((_local18 + (-(_local21) * _local35)) - _local16) - (-(_local20) * _local33));
_local31 = (((_local19 + (_local21 * _local34)) - _local17) - (_local20 * _local32));
_local47 = ((_local26.normal.x * _local30) + (_local26.normal.y * _local31));
if (_local47 < -(b2Settings.b2_velocityThreshold)){
_local29.velocityBias = (_local29.velocityBias + (-(_local26.restitution) * _local47));
};
_local27++;
};
_local9++;
_local22++;
};
_local6++;
};
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2Mat22;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:int;
var _local19:int;
var _local20:b2ContactConstraintPoint;
var _local21:Number;
var _local22:Number;
var _local23:b2ContactConstraintPoint;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_invMass;
_local10 = _local7.m_invI;
_local11 = _local8.m_invMass;
_local12 = _local8.m_invI;
_local13 = _local6.normal.x;
_local14 = _local6.normal.y;
_local15 = _local14;
_local16 = -(_local13);
if (_arg1.warmStarting){
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local20 = _local6.points[_local18];
_local6.points[_local18].normalImpulse = (_local20.normalImpulse * _arg1.dtRatio);
_local20.tangentImpulse = (_local20.tangentImpulse * _arg1.dtRatio);
_local21 = ((_local20.normalImpulse * _local13) + (_local20.tangentImpulse * _local15));
_local22 = ((_local20.normalImpulse * _local14) + (_local20.tangentImpulse * _local16));
_local7.m_angularVelocity = (_local7.m_angularVelocity - (_local10 * ((_local20.r1.x * _local22) - (_local20.r1.y * _local21))));
_local7.m_linearVelocity.x = (_local7.m_linearVelocity.x - (_local9 * _local21));
_local7.m_linearVelocity.y = (_local7.m_linearVelocity.y - (_local9 * _local22));
_local8.m_angularVelocity = (_local8.m_angularVelocity + (_local12 * ((_local20.r2.x * _local22) - (_local20.r2.y * _local21))));
_local8.m_linearVelocity.x = (_local8.m_linearVelocity.x + (_local11 * _local21));
_local8.m_linearVelocity.y = (_local8.m_linearVelocity.y + (_local11 * _local22));
_local18++;
};
} else {
_local19 = _local6.pointCount;
_local18 = 0;
while (_local18 < _local19) {
_local23 = _local6.points[_local18];
_local23.normalImpulse = 0;
_local23.tangentImpulse = 0;
_local18++;
};
};
_local5++;
};
}
public function SolvePositionConstraints(_arg1:Number):Boolean{
var _local2:Number;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
var _local6:b2ContactConstraint;
var _local7:b2Body;
var _local8:b2Body;
var _local9:b2Vec2;
var _local10:Number;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:int;
var _local20:int;
var _local21:b2ContactConstraintPoint;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:Number;
var _local38:Number;
_local2 = 0;
_local5 = 0;
while (_local5 < m_constraintCount) {
_local6 = m_constraints[_local5];
_local7 = _local6.body1;
_local8 = _local6.body2;
_local9 = _local7.m_sweep.c;
_local10 = _local7.m_sweep.a;
_local11 = _local8.m_sweep.c;
_local12 = _local8.m_sweep.a;
_local13 = (_local7.m_mass * _local7.m_invMass);
_local14 = (_local7.m_mass * _local7.m_invI);
_local15 = (_local8.m_mass * _local8.m_invMass);
_local16 = (_local8.m_mass * _local8.m_invI);
_local17 = _local6.normal.x;
_local18 = _local6.normal.y;
_local19 = _local6.pointCount;
_local20 = 0;
while (_local20 < _local19) {
_local21 = _local6.points[_local20];
_local3 = _local7.m_xf.R;
_local4 = _local7.m_sweep.localCenter;
_local22 = (_local21.localAnchor1.x - _local4.x);
_local23 = (_local21.localAnchor1.y - _local4.y);
_local26 = ((_local3.col1.x * _local22) + (_local3.col2.x * _local23));
_local23 = ((_local3.col1.y * _local22) + (_local3.col2.y * _local23));
_local22 = _local26;
_local3 = _local8.m_xf.R;
_local4 = _local8.m_sweep.localCenter;
_local24 = (_local21.localAnchor2.x - _local4.x);
_local25 = (_local21.localAnchor2.y - _local4.y);
_local26 = ((_local3.col1.x * _local24) + (_local3.col2.x * _local25));
_local25 = ((_local3.col1.y * _local24) + (_local3.col2.y * _local25));
_local24 = _local26;
_local27 = (_local9.x + _local22);
_local28 = (_local9.y + _local23);
_local29 = (_local11.x + _local24);
_local30 = (_local11.y + _local25);
_local31 = (_local29 - _local27);
_local32 = (_local30 - _local28);
_local33 = (((_local31 * _local17) + (_local32 * _local18)) + _local21.separation);
_local2 = b2Math.b2Min(_local2, _local33);
_local34 = (_arg1 * b2Math.b2Clamp((_local33 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0));
_local35 = (-(_local21.equalizedMass) * _local34);
_local36 = _local21.positionImpulse;
_local21.positionImpulse = b2Math.b2Max((_local36 + _local35), 0);
_local35 = (_local21.positionImpulse - _local36);
_local37 = (_local35 * _local17);
_local38 = (_local35 * _local18);
_local9.x = (_local9.x - (_local13 * _local37));
_local9.y = (_local9.y - (_local13 * _local38));
_local10 = (_local10 - (_local14 * ((_local22 * _local38) - (_local23 * _local37))));
_local7.m_sweep.a = _local10;
_local7.SynchronizeTransform();
_local11.x = (_local11.x + (_local15 * _local37));
_local11.y = (_local11.y + (_local15 * _local38));
_local12 = (_local12 + (_local16 * ((_local24 * _local38) - (_local25 * _local37))));
_local8.m_sweep.a = _local12;
_local8.SynchronizeTransform();
_local20++;
};
_local5++;
};
return ((_local2 >= (-1.5 * b2Settings.b2_linearSlop)));
}
public function SolveVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraintPoint;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:b2Mat22;
var _local18:b2Vec2;
var _local19:int;
var _local20:b2ContactConstraint;
var _local21:b2Body;
var _local22:b2Body;
var _local23:Number;
var _local24:Number;
var _local25:b2Vec2;
var _local26:b2Vec2;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
var _local33:Number;
var _local34:Number;
var _local35:Number;
var _local36:Number;
var _local37:int;
var _local38:Number;
_local19 = 0;
while (_local19 < m_constraintCount) {
_local20 = m_constraints[_local19];
_local21 = _local20.body1;
_local22 = _local20.body2;
_local23 = _local21.m_angularVelocity;
_local24 = _local22.m_angularVelocity;
_local25 = _local21.m_linearVelocity;
_local26 = _local22.m_linearVelocity;
_local27 = _local21.m_invMass;
_local28 = _local21.m_invI;
_local29 = _local22.m_invMass;
_local30 = _local22.m_invI;
_local31 = _local20.normal.x;
_local32 = _local20.normal.y;
_local33 = _local32;
_local34 = -(_local31);
_local35 = _local20.friction;
_local37 = _local20.pointCount;
_local1 = 0;
while (_local1 < _local37) {
_local2 = _local20.points[_local1];
_local7 = (((_local26.x + (-(_local24) * _local2.r2.y)) - _local25.x) - (-(_local23) * _local2.r1.y));
_local8 = (((_local26.y + (_local24 * _local2.r2.x)) - _local25.y) - (_local23 * _local2.r1.x));
_local9 = ((_local7 * _local31) + (_local8 * _local32));
_local11 = (-(_local2.normalMass) * (_local9 - _local2.velocityBias));
_local10 = ((_local7 * _local33) + (_local8 * _local34));
_local12 = (_local2.tangentMass * -(_local10));
_local13 = b2Math.b2Max((_local2.normalImpulse + _local11), 0);
_local11 = (_local13 - _local2.normalImpulse);
_local38 = (_local35 * _local2.normalImpulse);
_local14 = b2Math.b2Clamp((_local2.tangentImpulse + _local12), -(_local38), _local38);
_local12 = (_local14 - _local2.tangentImpulse);
_local15 = ((_local11 * _local31) + (_local12 * _local33));
_local16 = ((_local11 * _local32) + (_local12 * _local34));
_local25.x = (_local25.x - (_local27 * _local15));
_local25.y = (_local25.y - (_local27 * _local16));
_local23 = (_local23 - (_local28 * ((_local2.r1.x * _local16) - (_local2.r1.y * _local15))));
_local26.x = (_local26.x + (_local29 * _local15));
_local26.y = (_local26.y + (_local29 * _local16));
_local24 = (_local24 + (_local30 * ((_local2.r2.x * _local16) - (_local2.r2.y * _local15))));
_local2.normalImpulse = _local13;
_local2.tangentImpulse = _local14;
_local1++;
};
_local21.m_angularVelocity = _local23;
_local22.m_angularVelocity = _local24;
_local19++;
};
}
public function FinalizeVelocityConstraints():void{
var _local1:int;
var _local2:b2ContactConstraint;
var _local3:b2Manifold;
var _local4:int;
var _local5:b2ManifoldPoint;
var _local6:b2ContactConstraintPoint;
_local1 = 0;
while (_local1 < m_constraintCount) {
_local2 = m_constraints[_local1];
_local3 = _local2.manifold;
_local4 = 0;
while (_local4 < _local2.pointCount) {
_local5 = _local3.points[_local4];
_local6 = _local2.points[_local4];
_local5.normalImpulse = _local6.normalImpulse;
_local5.tangentImpulse = _local6.tangentImpulse;
_local4++;
};
_local1++;
};
}
}
}//package Box2D.Dynamics.Contacts
Section 89
//b2NullContact (Box2D.Dynamics.Contacts.b2NullContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
public class b2NullContact extends b2Contact {
override public function GetManifolds():Array{
return (null);
}
override public function Evaluate(_arg1:b2ContactListener):void{
}
}
}//package Box2D.Dynamics.Contacts
Section 90
//b2PolyAndCircleContact (Box2D.Dynamics.Contacts.b2PolyAndCircleContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
public class b2PolyAndCircleContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolyAndCircleContact(_arg1:b2Shape, _arg2:b2Shape){
var _local3:b2ManifoldPoint;
m_manifolds = [new b2Manifold()];
m0 = new b2Manifold();
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
b2Settings.b2Assert((m_shape1.m_type == b2Shape.e_polygonShape));
b2Settings.b2Assert((m_shape2.m_type == b2Shape.e_circleShape));
m_manifold.pointCount = 0;
_local3 = m_manifold.points[0];
_local3.normalImpulse = 0;
_local3.tangentImpulse = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:int;
var _local3:b2Vec2;
var _local4:b2Vec2;
var _local5:b2ManifoldPoint;
var _local6:b2Body;
var _local7:b2Body;
var _local8:Array;
var _local9:b2ContactPoint;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local6 = m_shape1.m_body;
_local7 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygonAndCircle(m_manifold, (m_shape1 as b2PolygonShape), _local6.m_xf, (m_shape2 as b2CircleShape), _local7.m_xf);
_local8 = [false, false];
_local9 = s_evalCP;
_local9.shape1 = m_shape1;
_local9.shape2 = m_shape2;
_local9.friction = m_friction;
_local9.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local2 = 0;
while (_local2 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local2];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local8[_local13] == true){
} else {
_local5 = m0.points[_local13];
if (_local5.id._key == _local12){
_local8[_local13] = true;
_local10.normalImpulse = _local5.normalImpulse;
_local10.tangentImpulse = _local5.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Persist(_local9);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local9.position = _local6.GetWorldPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m_manifold.normal);
_local9.separation = _local10.separation;
_local9.id.key = _local12;
_arg1.Add(_local9);
};
_local2++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local2 = 0;
while (_local2 < m0.pointCount) {
if (_local8[_local2]){
} else {
_local5 = m0.points[_local2];
_local9.position = _local6.GetWorldPoint(_local5.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local5.localPoint1);
_local4 = _local7.GetLinearVelocityFromLocalPoint(_local5.localPoint2);
_local9.velocity.Set((_local4.x - _local3.x), (_local4.y - _local3.y));
_local9.normal.SetV(m0.normal);
_local9.separation = _local5.separation;
_local9.id.key = _local5.id._key;
_arg1.Remove(_local9);
};
_local2++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolyAndCircleContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 91
//b2PolygonContact (Box2D.Dynamics.Contacts.b2PolygonContact)
package Box2D.Dynamics.Contacts {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
public class b2PolygonContact extends b2Contact {
private var m_manifolds:Array;
private var m0:b2Manifold;
public var m_manifold:b2Manifold;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2PolygonContact(_arg1:b2Shape, _arg2:b2Shape):void{
m0 = new b2Manifold();
m_manifolds = [new b2Manifold()];
super(_arg1, _arg2);
m_manifold = m_manifolds[0];
m_manifold.pointCount = 0;
}
override public function GetManifolds():Array{
return (m_manifolds);
}
override public function Evaluate(_arg1:b2ContactListener):void{
var _local2:b2Vec2;
var _local3:b2Vec2;
var _local4:b2ManifoldPoint;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactPoint;
var _local8:int;
var _local9:Array;
var _local10:b2ManifoldPoint;
var _local11:Boolean;
var _local12:uint;
var _local13:int;
_local5 = m_shape1.m_body;
_local6 = m_shape2.m_body;
m0.Set(m_manifold);
b2Collision.b2CollidePolygons(m_manifold, (m_shape1 as b2PolygonShape), _local5.m_xf, (m_shape2 as b2PolygonShape), _local6.m_xf);
_local9 = [false, false];
_local7 = s_evalCP;
_local7.shape1 = m_shape1;
_local7.shape2 = m_shape2;
_local7.friction = m_friction;
_local7.restitution = m_restitution;
if (m_manifold.pointCount > 0){
_local8 = 0;
while (_local8 < m_manifold.pointCount) {
_local10 = m_manifold.points[_local8];
_local10.normalImpulse = 0;
_local10.tangentImpulse = 0;
_local11 = false;
_local12 = _local10.id._key;
_local13 = 0;
while (_local13 < m0.pointCount) {
if (_local9[_local13] == true){
} else {
_local4 = m0.points[_local13];
if (_local4.id._key == _local12){
_local9[_local13] = true;
_local10.normalImpulse = _local4.normalImpulse;
_local10.tangentImpulse = _local4.tangentImpulse;
_local11 = true;
if (_arg1 != null){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Persist(_local7);
};
break;
};
};
_local13++;
};
if ((((_local11 == false)) && (!((_arg1 == null))))){
_local7.position = _local5.GetWorldPoint(_local10.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local10.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local10.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m_manifold.normal);
_local7.separation = _local10.separation;
_local7.id.key = _local12;
_arg1.Add(_local7);
};
_local8++;
};
m_manifoldCount = 1;
} else {
m_manifoldCount = 0;
};
if (_arg1 == null){
return;
};
_local8 = 0;
while (_local8 < m0.pointCount) {
if (_local9[_local8]){
} else {
_local4 = m0.points[_local8];
_local7.position = _local5.GetWorldPoint(_local4.localPoint1);
_local2 = _local5.GetLinearVelocityFromLocalPoint(_local4.localPoint1);
_local3 = _local6.GetLinearVelocityFromLocalPoint(_local4.localPoint2);
_local7.velocity.Set((_local3.x - _local2.x), (_local3.y - _local2.y));
_local7.normal.SetV(m0.normal);
_local7.separation = _local4.separation;
_local7.id.key = _local4.id._key;
_arg1.Remove(_local7);
};
_local8++;
};
}
public static function Destroy(_arg1:b2Contact, _arg2):void{
}
public static function Create(_arg1:b2Shape, _arg2:b2Shape, _arg3):b2Contact{
return (new b2PolygonContact(_arg1, _arg2));
}
}
}//package Box2D.Dynamics.Contacts
Section 92
//b2DistanceJoint (Box2D.Dynamics.Joints.b2DistanceJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2DistanceJoint extends b2Joint {
public var m_mass:Number;
public var m_u:b2Vec2;
public var m_impulse:Number;
public var m_dampingRatio:Number;
public var m_frequencyHz:Number;
public var m_localAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_bias:Number;
public var m_gamma:Number;
public var m_length:Number;
public function b2DistanceJoint(_arg1:b2DistanceJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u = new b2Vec2();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_length = _arg1.length;
m_frequencyHz = _arg1.frequencyHz;
m_dampingRatio = _arg1.dampingRatio;
m_impulse = 0;
m_gamma = 0;
m_bias = 0;
m_inv_dt = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2();
_local1.SetV(m_u);
_local1.Multiply((m_inv_dt * m_impulse));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Mat22;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
if (m_frequencyHz > 0){
return (true);
};
_local2 = m_body1;
_local3 = m_body2;
_local1 = _local2.m_xf.R;
_local4 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local4) + (_local1.col2.x * _local5));
_local5 = ((_local1.col1.y * _local4) + (_local1.col2.y * _local5));
_local4 = _local6;
_local1 = _local3.m_xf.R;
_local7 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local6 = ((_local1.col1.x * _local7) + (_local1.col2.x * _local8));
_local8 = ((_local1.col1.y * _local7) + (_local1.col2.y * _local8));
_local7 = _local6;
_local9 = (((_local3.m_sweep.c.x + _local7) - _local2.m_sweep.c.x) - _local4);
_local10 = (((_local3.m_sweep.c.y + _local8) - _local2.m_sweep.c.y) - _local5);
_local11 = Math.sqrt(((_local9 * _local9) + (_local10 * _local10)));
_local9 = (_local9 / _local11);
_local10 = (_local10 / _local11);
_local12 = (_local11 - m_length);
_local12 = b2Math.b2Clamp(_local12, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local13 = (-(m_mass) * _local12);
m_u.Set(_local9, _local10);
_local14 = (_local13 * m_u.x);
_local15 = (_local13 * m_u.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x - (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y - (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a - (_local2.m_invI * ((_local4 * _local15) - (_local5 * _local14))));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + (_local3.m_invMass * _local14));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + (_local3.m_invMass * _local15));
_local3.m_sweep.a = (_local3.m_sweep.a + (_local3.m_invI * ((_local7 * _local15) - (_local8 * _local14))));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((b2Math.b2Abs(_local12) < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:Number;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
m_inv_dt = _arg1.inv_dt;
_local4 = m_body1;
_local5 = m_body2;
_local2 = _local4.m_xf.R;
_local6 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local6) + (_local2.col2.x * _local7));
_local7 = ((_local2.col1.y * _local6) + (_local2.col2.y * _local7));
_local6 = _local3;
_local2 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local3 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local3;
m_u.x = (((_local5.m_sweep.c.x + _local8) - _local4.m_sweep.c.x) - _local6);
m_u.y = (((_local5.m_sweep.c.y + _local9) - _local4.m_sweep.c.y) - _local7);
_local10 = Math.sqrt(((m_u.x * m_u.x) + (m_u.y * m_u.y)));
if (_local10 > b2Settings.b2_linearSlop){
m_u.Multiply((1 / _local10));
} else {
m_u.SetZero();
};
_local11 = ((_local6 * m_u.y) - (_local7 * m_u.x));
_local12 = ((_local8 * m_u.y) - (_local9 * m_u.x));
_local13 = (((_local4.m_invMass + ((_local4.m_invI * _local11) * _local11)) + _local5.m_invMass) + ((_local5.m_invI * _local12) * _local12));
m_mass = (1 / _local13);
if (m_frequencyHz > 0){
_local14 = (_local10 - m_length);
_local15 = ((2 * Math.PI) * m_frequencyHz);
_local16 = (((2 * m_mass) * m_dampingRatio) * _local15);
_local17 = ((m_mass * _local15) * _local15);
m_gamma = (1 / (_arg1.dt * (_local16 + (_arg1.dt * _local17))));
m_bias = (((_local14 * _arg1.dt) * _local17) * m_gamma);
m_mass = (1 / (_local13 + m_gamma));
};
if (_arg1.warmStarting){
m_impulse = (m_impulse * _arg1.dtRatio);
_local18 = (m_impulse * m_u.x);
_local19 = (m_impulse * m_u.y);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x - (_local4.m_invMass * _local18));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y - (_local4.m_invMass * _local19));
_local4.m_angularVelocity = (_local4.m_angularVelocity - (_local4.m_invI * ((_local6 * _local19) - (_local7 * _local18))));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + (_local5.m_invMass * _local18));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + (_local5.m_invMass * _local19));
_local5.m_angularVelocity = (_local5.m_angularVelocity + (_local5.m_invI * ((_local8 * _local19) - (_local9 * _local18))));
} else {
m_impulse = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Mat22;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
_local3 = m_body1;
_local4 = m_body2;
_local2 = _local3.m_xf.R;
_local5 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local5) + (_local2.col2.x * _local6));
_local6 = ((_local2.col1.y * _local5) + (_local2.col2.y * _local6));
_local5 = _local7;
_local2 = _local4.m_xf.R;
_local8 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local7 = ((_local2.col1.x * _local8) + (_local2.col2.x * _local9));
_local9 = ((_local2.col1.y * _local8) + (_local2.col2.y * _local9));
_local8 = _local7;
_local10 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local6));
_local11 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local5));
_local12 = (_local4.m_linearVelocity.x + (-(_local4.m_angularVelocity) * _local9));
_local13 = (_local4.m_linearVelocity.y + (_local4.m_angularVelocity * _local8));
_local14 = ((m_u.x * (_local12 - _local10)) + (m_u.y * (_local13 - _local11)));
_local15 = (-(m_mass) * ((_local14 + m_bias) + (m_gamma * m_impulse)));
m_impulse = (m_impulse + _local15);
_local16 = (_local15 * m_u.x);
_local17 = (_local15 * m_u.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x - (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y - (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity - (_local3.m_invI * ((_local5 * _local17) - (_local6 * _local16))));
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + (_local4.m_invMass * _local16));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + (_local4.m_invMass * _local17));
_local4.m_angularVelocity = (_local4.m_angularVelocity + (_local4.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
}
}
}//package Box2D.Dynamics.Joints
Section 93
//b2DistanceJointDef (Box2D.Dynamics.Joints.b2DistanceJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2DistanceJointDef extends b2JointDef {
public var length:Number;
public var dampingRatio:Number;
public var frequencyHz:Number;
public var localAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public function b2DistanceJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_distanceJoint;
length = 1;
frequencyHz = 0;
dampingRatio = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
var _local5:Number;
var _local6:Number;
body1 = _arg1;
body2 = _arg2;
localAnchor1.SetV(body1.GetLocalPoint(_arg3));
localAnchor2.SetV(body2.GetLocalPoint(_arg4));
_local5 = (_arg4.x - _arg3.x);
_local6 = (_arg4.y - _arg3.y);
length = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
frequencyHz = 0;
dampingRatio = 0;
}
}
}//package Box2D.Dynamics.Joints
Section 94
//b2GearJoint (Box2D.Dynamics.Joints.b2GearJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2GearJoint extends b2Joint {
public var m_force:Number;
public var m_mass:Number;
public var m_prismatic1:b2PrismaticJoint;
public var m_prismatic2:b2PrismaticJoint;
public var m_ground1:b2Body;
public var m_ground2:b2Body;
public var m_constant:Number;
public var m_revolute1:b2RevoluteJoint;
public var m_revolute2:b2RevoluteJoint;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_ratio:Number;
public var m_J:b2Jacobian;
public function b2GearJoint(_arg1:b2GearJointDef){
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_J = new b2Jacobian();
super(_arg1);
_local2 = _arg1.joint1.m_type;
_local3 = _arg1.joint2.m_type;
m_revolute1 = null;
m_prismatic1 = null;
m_revolute2 = null;
m_prismatic2 = null;
m_ground1 = _arg1.joint1.m_body1;
m_body1 = _arg1.joint1.m_body2;
if (_local2 == b2Joint.e_revoluteJoint){
m_revolute1 = (_arg1.joint1 as b2RevoluteJoint);
m_groundAnchor1.SetV(m_revolute1.m_localAnchor1);
m_localAnchor1.SetV(m_revolute1.m_localAnchor2);
_local4 = m_revolute1.GetJointAngle();
} else {
m_prismatic1 = (_arg1.joint1 as b2PrismaticJoint);
m_groundAnchor1.SetV(m_prismatic1.m_localAnchor1);
m_localAnchor1.SetV(m_prismatic1.m_localAnchor2);
_local4 = m_prismatic1.GetJointTranslation();
};
m_ground2 = _arg1.joint2.m_body1;
m_body2 = _arg1.joint2.m_body2;
if (_local3 == b2Joint.e_revoluteJoint){
m_revolute2 = (_arg1.joint2 as b2RevoluteJoint);
m_groundAnchor2.SetV(m_revolute2.m_localAnchor1);
m_localAnchor2.SetV(m_revolute2.m_localAnchor2);
_local5 = m_revolute2.GetJointAngle();
} else {
m_prismatic2 = (_arg1.joint2 as b2PrismaticJoint);
m_groundAnchor2.SetV(m_prismatic2.m_localAnchor1);
m_localAnchor2.SetV(m_prismatic2.m_localAnchor2);
_local5 = m_prismatic2.GetJointTranslation();
};
m_ratio = _arg1.ratio;
m_constant = (_local4 + (m_ratio * _local5));
m_force = 0;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = new b2Vec2((m_force * m_J.linear2.x), (m_force * m_J.linear2.y));
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
_local1 = 0;
_local2 = m_body1;
_local3 = m_body2;
if (m_revolute1){
_local4 = m_revolute1.GetJointAngle();
} else {
_local4 = m_prismatic1.GetJointTranslation();
};
if (m_revolute2){
_local5 = m_revolute2.GetJointAngle();
} else {
_local5 = m_prismatic2.GetJointTranslation();
};
_local6 = (m_constant - (_local4 + (m_ratio * _local5)));
_local7 = (-(m_mass) * _local6);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + ((_local2.m_invMass * _local7) * m_J.linear1.x));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + ((_local2.m_invMass * _local7) * m_J.linear1.y));
_local2.m_sweep.a = (_local2.m_sweep.a + ((_local2.m_invI * _local7) * m_J.angular1));
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local3.m_invMass * _local7) * m_J.linear2.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local3.m_invMass * _local7) * m_J.linear2.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local3.m_invI * _local7) * m_J.angular2));
_local2.SynchronizeTransform();
_local3.SynchronizeTransform();
return ((_local1 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:b2Mat22;
var _local11:b2Vec2;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local2 = m_ground1;
_local3 = m_ground2;
_local4 = m_body1;
_local5 = m_body2;
_local14 = 0;
m_J.SetZero();
if (m_revolute1){
m_J.angular1 = -1;
_local14 = (_local14 + _local4.m_invI);
} else {
_local10 = _local2.m_xf.R;
_local11 = m_prismatic1.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local4.m_xf.R;
_local8 = (m_localAnchor1.x - _local4.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local4.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear1.Set(-(_local6), -(_local7));
m_J.angular1 = -(_local12);
_local14 = (_local14 + (_local4.m_invMass + ((_local4.m_invI * _local12) * _local12)));
};
if (m_revolute2){
m_J.angular2 = -(m_ratio);
_local14 = (_local14 + ((m_ratio * m_ratio) * _local5.m_invI));
} else {
_local10 = _local3.m_xf.R;
_local11 = m_prismatic2.m_localXAxis1;
_local6 = ((_local10.col1.x * _local11.x) + (_local10.col2.x * _local11.y));
_local7 = ((_local10.col1.y * _local11.x) + (_local10.col2.y * _local11.y));
_local10 = _local5.m_xf.R;
_local8 = (m_localAnchor2.x - _local5.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local5.m_sweep.localCenter.y);
_local13 = ((_local10.col1.x * _local8) + (_local10.col2.x * _local9));
_local9 = ((_local10.col1.y * _local8) + (_local10.col2.y * _local9));
_local8 = _local13;
_local12 = ((_local8 * _local7) - (_local9 * _local6));
m_J.linear2.Set((-(m_ratio) * _local6), (-(m_ratio) * _local7));
m_J.angular2 = (-(m_ratio) * _local12);
_local14 = (_local14 + ((m_ratio * m_ratio) * (_local5.m_invMass + ((_local5.m_invI * _local12) * _local12))));
};
m_mass = (1 / _local14);
if (_arg1.warmStarting){
_local15 = (_arg1.dt * m_force);
_local4.m_linearVelocity.x = (_local4.m_linearVelocity.x + ((_local4.m_invMass * _local15) * m_J.linear1.x));
_local4.m_linearVelocity.y = (_local4.m_linearVelocity.y + ((_local4.m_invMass * _local15) * m_J.linear1.y));
_local4.m_angularVelocity = (_local4.m_angularVelocity + ((_local4.m_invI * _local15) * m_J.angular1));
_local5.m_linearVelocity.x = (_local5.m_linearVelocity.x + ((_local5.m_invMass * _local15) * m_J.linear2.x));
_local5.m_linearVelocity.y = (_local5.m_linearVelocity.y + ((_local5.m_invMass * _local15) * m_J.linear2.y));
_local5.m_angularVelocity = (_local5.m_angularVelocity + ((_local5.m_invI * _local15) * m_J.angular2));
} else {
m_force = 0;
};
}
override public function GetReactionTorque():Number{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
_local1 = m_body2.m_xf.R;
_local2 = (m_localAnchor1.x - m_body2.m_sweep.localCenter.x);
_local3 = (m_localAnchor1.y - m_body2.m_sweep.localCenter.y);
_local4 = ((_local1.col1.x * _local2) + (_local1.col2.x * _local3));
_local3 = ((_local1.col1.y * _local2) + (_local1.col2.y * _local3));
_local2 = _local4;
_local4 = ((m_force * m_J.angular2) - ((_local2 * (m_force * m_J.linear2.y)) - (_local3 * (m_force * m_J.linear2.x))));
return (_local4);
}
public function GetRatio():Number{
return (m_ratio);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = m_J.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local5 = ((-(_arg1.inv_dt) * m_mass) * _local4);
m_force = (m_force + _local5);
_local6 = (_arg1.dt * _local5);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local2.m_invMass * _local6) * m_J.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local2.m_invMass * _local6) * m_J.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local2.m_invI * _local6) * m_J.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local3.m_invMass * _local6) * m_J.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local3.m_invMass * _local6) * m_J.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _local6) * m_J.angular2));
}
}
}//package Box2D.Dynamics.Joints
Section 95
//b2GearJointDef (Box2D.Dynamics.Joints.b2GearJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2GearJointDef extends b2JointDef {
public var joint2:b2Joint;
public var joint1:b2Joint;
public var ratio:Number;
public function b2GearJointDef(){
type = b2Joint.e_gearJoint;
joint1 = null;
joint2 = null;
ratio = 1;
}
}
}//package Box2D.Dynamics.Joints
Section 96
//b2Jacobian (Box2D.Dynamics.Joints.b2Jacobian)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2Jacobian {
public var linear1:b2Vec2;
public var linear2:b2Vec2;
public var angular2:Number;
public var angular1:Number;
public function b2Jacobian(){
linear1 = new b2Vec2();
linear2 = new b2Vec2();
super();
}
public function Set(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):void{
linear1.SetV(_arg1);
angular1 = _arg2;
linear2.SetV(_arg3);
angular2 = _arg4;
}
public function SetZero():void{
linear1.SetZero();
angular1 = 0;
linear2.SetZero();
angular2 = 0;
}
public function Compute(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:Number):Number{
return ((((((linear1.x * _arg1.x) + (linear1.y * _arg1.y)) + (angular1 * _arg2)) + ((linear2.x * _arg3.x) + (linear2.y * _arg3.y))) + (angular2 * _arg4)));
}
}
}//package Box2D.Dynamics.Joints
Section 97
//b2Joint (Box2D.Dynamics.Joints.b2Joint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2Joint {
public var m_islandFlag:Boolean;
public var m_body1:b2Body;
public var m_prev:b2Joint;
public var m_next:b2Joint;
public var m_type:int;
public var m_collideConnected:Boolean;
public var m_node1:b2JointEdge;
public var m_node2:b2JointEdge;
public var m_inv_dt:Number;
public var m_userData;
public var m_body2:b2Body;
public static const e_unknownJoint:int = 0;
public static const e_inactiveLimit:int = 0;
public static const e_atUpperLimit:int = 2;
public static const e_atLowerLimit:int = 1;
public static const e_gearJoint:int = 6;
public static const e_revoluteJoint:int = 1;
public static const e_equalLimits:int = 3;
public static const e_distanceJoint:int = 3;
public static const e_pulleyJoint:int = 4;
public static const e_prismaticJoint:int = 2;
public static const e_mouseJoint:int = 5;
public function b2Joint(_arg1:b2JointDef){
m_node1 = new b2JointEdge();
m_node2 = new b2JointEdge();
super();
m_type = _arg1.type;
m_prev = null;
m_next = null;
m_body1 = _arg1.body1;
m_body2 = _arg1.body2;
m_collideConnected = _arg1.collideConnected;
m_islandFlag = false;
m_userData = _arg1.userData;
}
public function GetAnchor1():b2Vec2{
return (null);
}
public function GetAnchor2():b2Vec2{
return (null);
}
public function InitVelocityConstraints(_arg1:b2TimeStep):void{
}
public function GetType():int{
return (m_type);
}
public function GetBody2():b2Body{
return (m_body2);
}
public function GetNext():b2Joint{
return (m_next);
}
public function GetReactionTorque():Number{
return (0);
}
public function GetUserData(){
return (m_userData);
}
public function GetReactionForce():b2Vec2{
return (null);
}
public function SolvePositionConstraints():Boolean{
return (false);
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetBody1():b2Body{
return (m_body1);
}
public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
}
public function InitPositionConstraints():void{
}
public static function Destroy(_arg1:b2Joint, _arg2):void{
}
public static function Create(_arg1:b2JointDef, _arg2):b2Joint{
var _local3:b2Joint;
_local3 = null;
switch (_arg1.type){
case e_distanceJoint:
_local3 = new b2DistanceJoint((_arg1 as b2DistanceJointDef));
break;
case e_mouseJoint:
_local3 = new b2MouseJoint((_arg1 as b2MouseJointDef));
break;
case e_prismaticJoint:
_local3 = new b2PrismaticJoint((_arg1 as b2PrismaticJointDef));
break;
case e_revoluteJoint:
_local3 = new b2RevoluteJoint((_arg1 as b2RevoluteJointDef));
break;
case e_pulleyJoint:
_local3 = new b2PulleyJoint((_arg1 as b2PulleyJointDef));
break;
case e_gearJoint:
_local3 = new b2GearJoint((_arg1 as b2GearJointDef));
break;
default:
break;
};
return (_local3);
}
}
}//package Box2D.Dynamics.Joints
Section 98
//b2JointDef (Box2D.Dynamics.Joints.b2JointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2JointDef {
public var collideConnected:Boolean;
public var body1:b2Body;
public var body2:b2Body;
public var userData;
public var type:int;
public function b2JointDef(){
type = b2Joint.e_unknownJoint;
userData = null;
body1 = null;
body2 = null;
collideConnected = false;
}
}
}//package Box2D.Dynamics.Joints
Section 99
//b2JointEdge (Box2D.Dynamics.Joints.b2JointEdge)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
public class b2JointEdge {
public var joint:b2Joint;
public var other:b2Body;
public var next:b2JointEdge;
public var prev:b2JointEdge;
}
}//package Box2D.Dynamics.Joints
Section 100
//b2MouseJoint (Box2D.Dynamics.Joints.b2MouseJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2MouseJoint extends b2Joint {
public var m_beta:Number;
public var m_mass:b2Mat22;
public var m_target:b2Vec2;
public var m_impulse:b2Vec2;
public var m_localAnchor:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K:b2Mat22;
public var m_gamma:Number;
public var m_C:b2Vec2;
public var m_maxForce:Number;
public function b2MouseJoint(_arg1:b2MouseJointDef){
var _local2:Number;
var _local3:Number;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
m_localAnchor = new b2Vec2();
m_target = new b2Vec2();
m_impulse = new b2Vec2();
m_mass = new b2Mat22();
m_C = new b2Vec2();
super(_arg1);
m_target.SetV(_arg1.target);
_local2 = (m_target.x - m_body2.m_xf.position.x);
_local3 = (m_target.y - m_body2.m_xf.position.y);
_local4 = m_body2.m_xf.R;
m_localAnchor.x = ((_local2 * _local4.col1.x) + (_local3 * _local4.col1.y));
m_localAnchor.y = ((_local2 * _local4.col2.x) + (_local3 * _local4.col2.y));
m_maxForce = _arg1.maxForce;
m_impulse.SetZero();
_local5 = m_body2.m_mass;
_local6 = ((2 * b2Settings.b2_pi) * _arg1.frequencyHz);
_local7 = (((2 * _local5) * _arg1.dampingRatio) * _local6);
_local8 = ((_arg1.timeStep * _local5) * (_local6 * _local6));
m_gamma = (1 / (_local7 + _local8));
m_beta = (_local8 / (_local7 + _local8));
}
override public function GetAnchor1():b2Vec2{
return (m_target);
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor));
}
override public function GetReactionForce():b2Vec2{
return (m_impulse);
}
override public function SolvePositionConstraints():Boolean{
return (true);
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local4 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local5 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local7 = _local2.m_invMass;
_local8 = _local2.m_invI;
K1.col1.x = _local7;
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = _local7;
K2.col1.x = ((_local8 * _local5) * _local5);
K2.col2.x = ((-(_local8) * _local4) * _local5);
K2.col1.y = ((-(_local8) * _local4) * _local5);
K2.col2.y = ((_local8 * _local4) * _local4);
K.SetM(K1);
K.AddM(K2);
K.col1.x = (K.col1.x + m_gamma);
K.col2.y = (K.col2.y + m_gamma);
K.Invert(m_mass);
m_C.x = ((_local2.m_sweep.c.x + _local4) - m_target.x);
m_C.y = ((_local2.m_sweep.c.y + _local5) - m_target.y);
_local2.m_angularVelocity = (_local2.m_angularVelocity * 0.98);
_local9 = (_arg1.dt * m_impulse.x);
_local10 = (_arg1.dt * m_impulse.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local7 * _local9));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local7 * _local10));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local8 * ((_local4 * _local10) - (_local5 * _local9))));
}
override public function GetReactionTorque():Number{
return (0);
}
public function SetTarget(_arg1:b2Vec2):void{
if (m_body2.IsSleeping()){
m_body2.WakeUp();
};
m_target = _arg1;
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
_local2 = m_body2;
_local3 = _local2.m_xf.R;
_local6 = (m_localAnchor.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor.y - _local2.m_sweep.localCenter.y);
_local4 = ((_local3.col1.x * _local6) + (_local3.col2.x * _local7));
_local7 = ((_local3.col1.y * _local6) + (_local3.col2.y * _local7));
_local6 = _local4;
_local8 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local7));
_local9 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local6));
_local3 = m_mass;
_local4 = ((_local8 + ((m_beta * _arg1.inv_dt) * m_C.x)) + ((m_gamma * _arg1.dt) * m_impulse.x));
_local5 = ((_local9 + ((m_beta * _arg1.inv_dt) * m_C.y)) + ((m_gamma * _arg1.dt) * m_impulse.y));
_local10 = (-(_arg1.inv_dt) * ((_local3.col1.x * _local4) + (_local3.col2.x * _local5)));
_local11 = (-(_arg1.inv_dt) * ((_local3.col1.y * _local4) + (_local3.col2.y * _local5)));
_local12 = m_impulse.x;
_local13 = m_impulse.y;
m_impulse.x = (m_impulse.x + _local10);
m_impulse.y = (m_impulse.y + _local11);
_local14 = m_impulse.Length();
if (_local14 > m_maxForce){
m_impulse.Multiply((m_maxForce / _local14));
};
_local10 = (m_impulse.x - _local12);
_local11 = (m_impulse.y - _local13);
_local15 = (_arg1.dt * _local10);
_local16 = (_arg1.dt * _local11);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
}
}
}//package Box2D.Dynamics.Joints
Section 101
//b2MouseJointDef (Box2D.Dynamics.Joints.b2MouseJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Common.Math.*;
public class b2MouseJointDef extends b2JointDef {
public var frequencyHz:Number;
public var dampingRatio:Number;
public var maxForce:Number;
public var target:b2Vec2;
public var timeStep:Number;
public function b2MouseJointDef(){
target = new b2Vec2();
super();
type = b2Joint.e_mouseJoint;
maxForce = 0;
frequencyHz = 5;
dampingRatio = 0.7;
timeStep = (1 / 60);
}
}
}//package Box2D.Dynamics.Joints
Section 102
//b2PrismaticJoint (Box2D.Dynamics.Joints.b2PrismaticJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PrismaticJoint extends b2Joint {
public var m_limitForce:Number;
public var m_refAngle:Number;
public var m_lowerTranslation:Number;
public var m_localXAxis1:b2Vec2;
public var m_torque:Number;
public var m_enableLimit:Boolean;
public var m_motorForce:Number;
public var m_force:Number;
public var m_localYAxis1:b2Vec2;
public var m_motorMass:Number;
public var m_maxMotorForce:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_angularMass:Number;
public var m_limitState:int;
public var m_linearMass:Number;
public var m_upperTranslation:Number;
public var m_motorJacobian:b2Jacobian;
public var m_limitPositionImpulse:Number;
public var m_motorSpeed:Number;
public var m_linearJacobian:b2Jacobian;
public var m_enableMotor:Boolean;
public function b2PrismaticJoint(_arg1:b2PrismaticJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_localXAxis1 = new b2Vec2();
m_localYAxis1 = new b2Vec2();
m_linearJacobian = new b2Jacobian();
m_motorJacobian = new b2Jacobian();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_localXAxis1.SetV(_arg1.localAxis1);
m_localYAxis1.x = -(m_localXAxis1.y);
m_localYAxis1.y = m_localXAxis1.x;
m_refAngle = _arg1.referenceAngle;
m_linearJacobian.SetZero();
m_linearMass = 0;
m_force = 0;
m_angularMass = 0;
m_torque = 0;
m_motorJacobian.SetZero();
m_motorMass = 0;
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerTranslation = _arg1.lowerTranslation;
m_upperTranslation = _arg1.upperTranslation;
m_maxMotorForce = _arg1.maxMotorForce;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperTranslation);
}
public function GetLowerLimit():Number{
return (m_lowerTranslation);
}
public function GetJointTranslation():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:b2Vec2;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = _local1.GetWorldPoint(m_localAnchor1);
_local5 = _local2.GetWorldPoint(m_localAnchor2);
_local6 = (_local5.x - _local4.x);
_local7 = (_local5.y - _local4.y);
_local8 = _local1.GetWorldVector(m_localXAxis1);
_local9 = ((_local8.x * _local6) + (_local8.y * _local7));
return (_local9);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerTranslation = _arg1;
m_upperTranslation = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Mat22;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.m_xf.R;
_local2 = (m_limitForce * ((_local1.col1.x * m_localXAxis1.x) + (_local1.col2.x * m_localXAxis1.y)));
_local3 = (m_limitForce * ((_local1.col1.y * m_localXAxis1.x) + (_local1.col2.y * m_localXAxis1.y)));
_local4 = (m_force * ((_local1.col1.x * m_localYAxis1.x) + (_local1.col2.x * m_localYAxis1.y)));
_local5 = (m_force * ((_local1.col1.y * m_localYAxis1.x) + (_local1.col2.y * m_localYAxis1.y)));
return (new b2Vec2(((m_limitForce * _local2) + (m_force * _local4)), ((m_limitForce * _local3) + (m_force * _local5))));
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:b2Mat22;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
var _local29:Number;
var _local30:Number;
var _local31:Number;
var _local32:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = _local3.m_invMass;
_local6 = _local4.m_invMass;
_local7 = _local3.m_invI;
_local8 = _local4.m_invI;
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local21 = ((_local9.col1.x * m_localYAxis1.x) + (_local9.col2.x * m_localYAxis1.y));
_local22 = ((_local9.col1.y * m_localYAxis1.x) + (_local9.col2.y * m_localYAxis1.y));
_local23 = ((_local21 * _local19) + (_local22 * _local20));
_local23 = b2Math.b2Clamp(_local23, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local24 = (-(m_linearMass) * _local23);
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local24) * m_linearJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local24) * m_linearJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local24) * m_linearJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local24) * m_linearJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local24) * m_linearJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local24) * m_linearJacobian.angular2));
_local25 = b2Math.b2Abs(_local23);
_local26 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_refAngle);
_local26 = b2Math.b2Clamp(_local26, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local27 = (-(m_angularMass) * _local26);
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local27));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local27));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local28 = b2Math.b2Abs(_local26);
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local9 = _local3.m_xf.R;
_local11 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local12 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local11) + (_local9.col2.x * _local12));
_local12 = ((_local9.col1.y * _local11) + (_local9.col2.y * _local12));
_local11 = _local10;
_local9 = _local4.m_xf.R;
_local13 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local14 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local10 = ((_local9.col1.x * _local13) + (_local9.col2.x * _local14));
_local14 = ((_local9.col1.y * _local13) + (_local9.col2.y * _local14));
_local13 = _local10;
_local15 = (_local3.m_sweep.c.x + _local11);
_local16 = (_local3.m_sweep.c.y + _local12);
_local17 = (_local4.m_sweep.c.x + _local13);
_local18 = (_local4.m_sweep.c.y + _local14);
_local19 = (_local17 - _local15);
_local20 = (_local18 - _local16);
_local9 = _local3.m_xf.R;
_local29 = ((_local9.col1.x * m_localXAxis1.x) + (_local9.col2.x * m_localXAxis1.y));
_local30 = ((_local9.col1.y * m_localXAxis1.x) + (_local9.col2.y * m_localXAxis1.y));
_local31 = ((_local29 * _local19) + (_local30 * _local20));
_local32 = 0;
if (m_limitState == e_equalLimits){
_local1 = b2Math.b2Clamp(_local31, -(b2Settings.b2_maxLinearCorrection), b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local25 = b2Math.b2Max(_local25, b2Math.b2Abs(_local26));
} else {
if (m_limitState == e_atLowerLimit){
_local1 = (_local31 - m_lowerTranslation);
_local25 = b2Math.b2Max(_local25, -(_local1));
_local1 = b2Math.b2Clamp((_local1 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
} else {
if (m_limitState == e_atUpperLimit){
_local1 = (_local31 - m_upperTranslation);
_local25 = b2Math.b2Max(_local25, _local1);
_local1 = b2Math.b2Clamp((_local1 - b2Settings.b2_linearSlop), 0, b2Settings.b2_maxLinearCorrection);
_local32 = (-(m_motorMass) * _local1);
_local2 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local32), 0);
_local32 = (m_limitPositionImpulse - _local2);
};
};
};
_local3.m_sweep.c.x = (_local3.m_sweep.c.x + ((_local5 * _local32) * m_motorJacobian.linear1.x));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y + ((_local5 * _local32) * m_motorJacobian.linear1.y));
_local3.m_sweep.a = (_local3.m_sweep.a + ((_local7 * _local32) * m_motorJacobian.angular1));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + ((_local6 * _local32) * m_motorJacobian.linear2.x));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + ((_local6 * _local32) * m_motorJacobian.linear2.y));
_local4.m_sweep.a = (_local4.m_sweep.a + ((_local8 * _local32) * m_motorJacobian.angular2));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local25 <= b2Settings.b2_linearSlop)) && ((_local28 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:b2Vec2;
var _local16:b2Vec2;
var _local17:b2Vec2;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local1 = m_body1;
_local2 = m_body2;
_local3 = _local1.m_xf.R;
_local4 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local5 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local4) + (_local3.col2.x * _local5));
_local5 = ((_local3.col1.y * _local4) + (_local3.col2.y * _local5));
_local4 = _local6;
_local3 = _local2.m_xf.R;
_local7 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local8 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local6 = ((_local3.col1.x * _local7) + (_local3.col2.x * _local8));
_local8 = ((_local3.col1.y * _local7) + (_local3.col2.y * _local8));
_local7 = _local6;
_local9 = (_local1.m_sweep.c.x + _local4);
_local10 = (_local1.m_sweep.c.y + _local5);
_local11 = (_local2.m_sweep.c.x + _local7);
_local12 = (_local2.m_sweep.c.y + _local8);
_local13 = (_local11 - _local9);
_local14 = (_local12 - _local10);
_local15 = _local1.GetWorldVector(m_localXAxis1);
_local16 = _local1.m_linearVelocity;
_local17 = _local2.m_linearVelocity;
_local18 = _local1.m_angularVelocity;
_local19 = _local2.m_angularVelocity;
_local20 = (((_local13 * (-(_local18) * _local15.y)) + (_local14 * (_local18 * _local15.x))) + ((_local15.x * (((_local17.x + (-(_local19) * _local8)) - _local16.x) - (-(_local18) * _local5))) + (_local15.y * (((_local17.y + (_local19 * _local7)) - _local16.y) - (_local18 * _local4)))));
return (_local20);
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
var _local27:Number;
var _local28:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
_local4 = _local2.m_xf.R;
_local14 = ((_local4.col1.x * m_localYAxis1.x) + (_local4.col2.x * m_localYAxis1.y));
_local15 = ((_local4.col1.y * m_localYAxis1.x) + (_local4.col2.y * m_localYAxis1.y));
_local16 = ((_local3.m_sweep.c.x + _local8) - _local2.m_sweep.c.x);
_local17 = ((_local3.m_sweep.c.y + _local9) - _local2.m_sweep.c.y);
m_linearJacobian.linear1.x = -(_local14);
m_linearJacobian.linear1.y = -(_local15);
m_linearJacobian.linear2.x = _local14;
m_linearJacobian.linear2.y = _local15;
m_linearJacobian.angular1 = -(((_local16 * _local15) - (_local17 * _local14)));
m_linearJacobian.angular2 = ((_local8 * _local15) - (_local9 * _local14));
m_linearMass = (((_local10 + ((_local12 * m_linearJacobian.angular1) * m_linearJacobian.angular1)) + _local11) + ((_local13 * m_linearJacobian.angular2) * m_linearJacobian.angular2));
m_linearMass = (1 / m_linearMass);
m_angularMass = (_local12 + _local13);
if (m_angularMass > Number.MIN_VALUE){
m_angularMass = (1 / m_angularMass);
};
if (((m_enableLimit) || (m_enableMotor))){
_local4 = _local2.m_xf.R;
_local18 = ((_local4.col1.x * m_localXAxis1.x) + (_local4.col2.x * m_localXAxis1.y));
_local19 = ((_local4.col1.y * m_localXAxis1.x) + (_local4.col2.y * m_localXAxis1.y));
m_motorJacobian.linear1.x = -(_local18);
m_motorJacobian.linear1.y = -(_local19);
m_motorJacobian.linear2.x = _local18;
m_motorJacobian.linear2.y = _local19;
m_motorJacobian.angular1 = -(((_local16 * _local19) - (_local17 * _local18)));
m_motorJacobian.angular2 = ((_local8 * _local19) - (_local9 * _local18));
m_motorMass = (((_local10 + ((_local12 * m_motorJacobian.angular1) * m_motorJacobian.angular1)) + _local11) + ((_local13 * m_motorJacobian.angular2) * m_motorJacobian.angular2));
m_motorMass = (1 / m_motorMass);
if (m_enableLimit){
_local20 = (_local16 - _local6);
_local21 = (_local17 - _local7);
_local22 = ((_local18 * _local20) + (_local19 * _local21));
if (b2Math.b2Abs((m_upperTranslation - m_lowerTranslation)) < (2 * b2Settings.b2_linearSlop)){
m_limitState = e_equalLimits;
} else {
if (_local22 <= m_lowerTranslation){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local22 >= m_upperTranslation){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
};
};
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit == false){
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local23 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.x)));
_local24 = (_arg1.dt * ((m_force * m_linearJacobian.linear1.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear1.y)));
_local25 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.x) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.x)));
_local26 = (_arg1.dt * ((m_force * m_linearJacobian.linear2.y) + ((m_motorForce + m_limitForce) * m_motorJacobian.linear2.y)));
_local27 = (_arg1.dt * (((m_force * m_linearJacobian.angular1) - m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular1)));
_local28 = (_arg1.dt * (((m_force * m_linearJacobian.angular2) + m_torque) + ((m_motorForce + m_limitForce) * m_motorJacobian.angular2)));
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local10 * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local10 * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local12 * _local27));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local11 * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local11 * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local13 * _local28));
} else {
m_force = 0;
m_torque = 0;
m_limitForce = 0;
m_motorForce = 0;
};
m_limitPositionImpulse = 0;
}
public function GetMotorForce():Number{
return (m_motorForce);
}
public function SetMaxMotorForce(_arg1:Number):void{
m_maxMotorForce = _arg1;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
override public function GetReactionTorque():Number{
return (m_torque);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_invMass;
_local5 = _local3.m_invMass;
_local6 = _local2.m_invI;
_local7 = _local3.m_invI;
_local9 = m_linearJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local10 = ((-(_arg1.inv_dt) * m_linearMass) * _local9);
m_force = (m_force + _local10);
_local11 = (_arg1.dt * _local10);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_linearJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_linearJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_linearJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_linearJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_linearJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_linearJacobian.angular2));
_local12 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local13 = ((-(_arg1.inv_dt) * m_angularMass) * _local12);
m_torque = (m_torque + _local13);
_local14 = (_arg1.dt * _local13);
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local6 * _local14));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local7 * _local14));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local15 = (m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity) - m_motorSpeed);
_local16 = ((-(_arg1.inv_dt) * m_motorMass) * _local15);
_local17 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local16), -(m_maxMotorForce), m_maxMotorForce);
_local16 = (m_motorForce - _local17);
_local11 = (_arg1.dt * _local16);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local18 = m_motorJacobian.Compute(_local2.m_linearVelocity, _local2.m_angularVelocity, _local3.m_linearVelocity, _local3.m_angularVelocity);
_local19 = ((-(_arg1.inv_dt) * m_motorMass) * _local18);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local19);
} else {
if (m_limitState == e_atLowerLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
} else {
if (m_limitState == e_atUpperLimit){
_local8 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local19), 0);
_local19 = (m_limitForce - _local8);
};
};
};
_local11 = (_arg1.dt * _local19);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + ((_local4 * _local11) * m_motorJacobian.linear1.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + ((_local4 * _local11) * m_motorJacobian.linear1.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity + ((_local6 * _local11) * m_motorJacobian.angular1));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_local5 * _local11) * m_motorJacobian.linear2.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_local5 * _local11) * m_motorJacobian.linear2.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local7 * _local11) * m_motorJacobian.angular2));
};
}
}
}//package Box2D.Dynamics.Joints
Section 103
//b2PrismaticJointDef (Box2D.Dynamics.Joints.b2PrismaticJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PrismaticJointDef extends b2JointDef {
public var localAxis1:b2Vec2;
public var referenceAngle:Number;
public var maxMotorForce:Number;
public var motorSpeed:Number;
public var upperTranslation:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public var lowerTranslation:Number;
public function b2PrismaticJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
localAxis1 = new b2Vec2();
super();
type = b2Joint.e_prismaticJoint;
localAxis1.Set(1, 0);
referenceAngle = 0;
enableLimit = false;
lowerTranslation = 0;
upperTranslation = 0;
enableMotor = false;
maxMotorForce = 0;
motorSpeed = 0;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
localAxis1 = body1.GetLocalVector(_arg4);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 104
//b2PulleyJoint (Box2D.Dynamics.Joints.b2PulleyJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2PulleyJoint extends b2Joint {
public var m_ground:b2Body;
public var m_maxLength2:Number;
public var m_limitForce1:Number;
public var m_maxLength1:Number;
public var m_limitState1:int;
public var m_limitState2:int;
public var m_limitPositionImpulse2:Number;
public var m_force:Number;
public var m_limitPositionImpulse1:Number;
public var m_constant:Number;
public var m_state:int;
public var m_ratio:Number;
public var m_groundAnchor1:b2Vec2;
public var m_groundAnchor2:b2Vec2;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
public var m_positionImpulse:Number;
public var m_limitMass2:Number;
public var m_limitMass1:Number;
public var m_pulleyMass:Number;
public var m_u1:b2Vec2;
public var m_u2:b2Vec2;
public var m_limitForce2:Number;
public static const b2_minPulleyLength:Number = 2;
public function b2PulleyJoint(_arg1:b2PulleyJointDef){
var _local2:b2Mat22;
var _local3:Number;
var _local4:Number;
m_groundAnchor1 = new b2Vec2();
m_groundAnchor2 = new b2Vec2();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_u1 = new b2Vec2();
m_u2 = new b2Vec2();
super(_arg1);
m_ground = m_body1.m_world.m_groundBody;
m_groundAnchor1.x = (_arg1.groundAnchor1.x - m_ground.m_xf.position.x);
m_groundAnchor1.y = (_arg1.groundAnchor1.y - m_ground.m_xf.position.y);
m_groundAnchor2.x = (_arg1.groundAnchor2.x - m_ground.m_xf.position.x);
m_groundAnchor2.y = (_arg1.groundAnchor2.y - m_ground.m_xf.position.y);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_ratio = _arg1.ratio;
m_constant = (_arg1.length1 + (m_ratio * _arg1.length2));
m_maxLength1 = b2Math.b2Min(_arg1.maxLength1, (m_constant - (m_ratio * b2_minPulleyLength)));
m_maxLength2 = b2Math.b2Min(_arg1.maxLength2, ((m_constant - b2_minPulleyLength) / m_ratio));
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
}
public function GetGroundAnchor2():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor2);
return (_local1);
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
override public function GetReactionForce():b2Vec2{
var _local1:b2Vec2;
_local1 = m_u2.Copy();
_local1.Multiply(m_force);
return (_local1);
}
override public function SolvePositionConstraints():Boolean{
var _local1:b2Body;
var _local2:b2Body;
var _local3:b2Mat22;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
_local1 = m_body1;
_local2 = m_body2;
_local4 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local5 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local6 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local7 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local23 = 0;
if (m_state == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local16 = m_u1.Length();
_local17 = m_u2.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local16));
} else {
m_u1.SetZero();
};
if (_local17 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = ((m_constant - _local16) - (m_ratio * _local17));
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_pulleyMass) * _local18);
_local20 = m_positionImpulse;
m_positionImpulse = b2Math.b2Max(0, (m_positionImpulse + _local19));
_local19 = (m_positionImpulse - _local20);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local14 = ((-(m_ratio) * _local19) * m_u2.x);
_local15 = ((-(m_ratio) * _local19) * m_u2.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local1.SynchronizeTransform();
_local2.SynchronizeTransform();
};
if (m_limitState1 == e_atUpperLimit){
_local3 = _local1.m_xf.R;
_local8 = (m_localAnchor1.x - _local1.m_sweep.localCenter.x);
_local9 = (m_localAnchor1.y - _local1.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local8) + (_local3.col2.x * _local9));
_local9 = ((_local3.col1.y * _local8) + (_local3.col2.y * _local9));
_local8 = _local22;
_local12 = (_local1.m_sweep.c.x + _local8);
_local13 = (_local1.m_sweep.c.y + _local9);
m_u1.Set((_local12 - _local4), (_local13 - _local5));
_local16 = m_u1.Length();
if (_local16 > b2Settings.b2_linearSlop){
m_u1.x = (m_u1.x * (1 / _local16));
m_u1.y = (m_u1.y * (1 / _local16));
} else {
m_u1.SetZero();
};
_local18 = (m_maxLength1 - _local16);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass1) * _local18);
_local21 = m_limitPositionImpulse1;
m_limitPositionImpulse1 = b2Math.b2Max(0, (m_limitPositionImpulse1 + _local19));
_local19 = (m_limitPositionImpulse1 - _local21);
_local12 = (-(_local19) * m_u1.x);
_local13 = (-(_local19) * m_u1.y);
_local1.m_sweep.c.x = (_local1.m_sweep.c.x + (_local1.m_invMass * _local12));
_local1.m_sweep.c.y = (_local1.m_sweep.c.y + (_local1.m_invMass * _local13));
_local1.m_sweep.a = (_local1.m_sweep.a + (_local1.m_invI * ((_local8 * _local13) - (_local9 * _local12))));
_local1.SynchronizeTransform();
};
if (m_limitState2 == e_atUpperLimit){
_local3 = _local2.m_xf.R;
_local10 = (m_localAnchor2.x - _local2.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local2.m_sweep.localCenter.y);
_local22 = ((_local3.col1.x * _local10) + (_local3.col2.x * _local11));
_local11 = ((_local3.col1.y * _local10) + (_local3.col2.y * _local11));
_local10 = _local22;
_local14 = (_local2.m_sweep.c.x + _local10);
_local15 = (_local2.m_sweep.c.y + _local11);
m_u2.Set((_local14 - _local6), (_local15 - _local7));
_local17 = m_u2.Length();
if (_local17 > b2Settings.b2_linearSlop){
m_u2.x = (m_u2.x * (1 / _local17));
m_u2.y = (m_u2.y * (1 / _local17));
} else {
m_u2.SetZero();
};
_local18 = (m_maxLength2 - _local17);
_local23 = b2Math.b2Max(_local23, -(_local18));
_local18 = b2Math.b2Clamp((_local18 + b2Settings.b2_linearSlop), -(b2Settings.b2_maxLinearCorrection), 0);
_local19 = (-(m_limitMass2) * _local18);
_local21 = m_limitPositionImpulse2;
m_limitPositionImpulse2 = b2Math.b2Max(0, (m_limitPositionImpulse2 + _local19));
_local19 = (m_limitPositionImpulse2 - _local21);
_local14 = (-(_local19) * m_u2.x);
_local15 = (-(_local19) * m_u2.y);
_local2.m_sweep.c.x = (_local2.m_sweep.c.x + (_local2.m_invMass * _local14));
_local2.m_sweep.c.y = (_local2.m_sweep.c.y + (_local2.m_invMass * _local15));
_local2.m_sweep.a = (_local2.m_sweep.a + (_local2.m_invI * ((_local10 * _local15) - (_local11 * _local14))));
_local2.SynchronizeTransform();
};
return ((_local23 < b2Settings.b2_linearSlop));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
_local10 = (_local2.m_sweep.c.x + _local5);
_local11 = (_local2.m_sweep.c.y + _local6);
_local12 = (_local3.m_sweep.c.x + _local8);
_local13 = (_local3.m_sweep.c.y + _local9);
_local14 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local15 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local16 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local17 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
m_u1.Set((_local10 - _local14), (_local11 - _local15));
m_u2.Set((_local12 - _local16), (_local13 - _local17));
_local18 = m_u1.Length();
_local19 = m_u2.Length();
if (_local18 > b2Settings.b2_linearSlop){
m_u1.Multiply((1 / _local18));
} else {
m_u1.SetZero();
};
if (_local19 > b2Settings.b2_linearSlop){
m_u2.Multiply((1 / _local19));
} else {
m_u2.SetZero();
};
_local20 = ((m_constant - _local18) - (m_ratio * _local19));
if (_local20 > 0){
m_state = e_inactiveLimit;
m_force = 0;
} else {
m_state = e_atUpperLimit;
m_positionImpulse = 0;
};
if (_local18 < m_maxLength1){
m_limitState1 = e_inactiveLimit;
m_limitForce1 = 0;
} else {
m_limitState1 = e_atUpperLimit;
m_limitPositionImpulse1 = 0;
};
if (_local19 < m_maxLength2){
m_limitState2 = e_inactiveLimit;
m_limitForce2 = 0;
} else {
m_limitState2 = e_atUpperLimit;
m_limitPositionImpulse2 = 0;
};
_local21 = ((_local5 * m_u1.y) - (_local6 * m_u1.x));
_local22 = ((_local8 * m_u2.y) - (_local9 * m_u2.x));
m_limitMass1 = (_local2.m_invMass + ((_local2.m_invI * _local21) * _local21));
m_limitMass2 = (_local3.m_invMass + ((_local3.m_invI * _local22) * _local22));
m_pulleyMass = (m_limitMass1 + ((m_ratio * m_ratio) * m_limitMass2));
m_limitMass1 = (1 / m_limitMass1);
m_limitMass2 = (1 / m_limitMass2);
m_pulleyMass = (1 / m_pulleyMass);
if (_arg1.warmStarting){
_local23 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.x);
_local24 = ((_arg1.dt * (-(m_force) - m_limitForce1)) * m_u1.y);
_local25 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.x);
_local26 = ((_arg1.dt * ((-(m_ratio) * m_force) - m_limitForce2)) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local23));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local24));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local24) - (_local6 * _local23))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local25));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local26));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local26) - (_local9 * _local25))));
} else {
m_force = 0;
m_limitForce1 = 0;
m_limitForce2 = 0;
};
}
override public function GetReactionTorque():Number{
return (0);
}
public function GetRatio():Number{
return (m_ratio);
}
public function GetLength2():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body2.GetWorldPoint(m_localAnchor2);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor2.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor2.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local5 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local6 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local5) + (_local4.col2.x * _local6));
_local6 = ((_local4.col1.y * _local5) + (_local4.col2.y * _local6));
_local5 = _local7;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local7 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local7;
if (m_state == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = (-(((m_u1.x * _local10) + (m_u1.y * _local11))) - (m_ratio * ((m_u2.x * _local12) + (m_u2.y * _local13))));
_local19 = ((-(_arg1.inv_dt) * m_pulleyMass) * _local18);
_local20 = m_force;
m_force = b2Math.b2Max(0, (m_force + _local19));
_local19 = (m_force - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local16 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.x);
_local17 = (((-(_arg1.dt) * m_ratio) * _local19) * m_u2.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
if (m_limitState1 == e_atUpperLimit){
_local10 = (_local2.m_linearVelocity.x + (-(_local2.m_angularVelocity) * _local6));
_local11 = (_local2.m_linearVelocity.y + (_local2.m_angularVelocity * _local5));
_local18 = -(((m_u1.x * _local10) + (m_u1.y * _local11)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass1) * _local18);
_local20 = m_limitForce1;
m_limitForce1 = b2Math.b2Max(0, (m_limitForce1 + _local19));
_local19 = (m_limitForce1 - _local20);
_local14 = ((-(_arg1.dt) * _local19) * m_u1.x);
_local15 = ((-(_arg1.dt) * _local19) * m_u1.y);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x + (_local2.m_invMass * _local14));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y + (_local2.m_invMass * _local15));
_local2.m_angularVelocity = (_local2.m_angularVelocity + (_local2.m_invI * ((_local5 * _local15) - (_local6 * _local14))));
};
if (m_limitState2 == e_atUpperLimit){
_local12 = (_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9));
_local13 = (_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8));
_local18 = -(((m_u2.x * _local12) + (m_u2.y * _local13)));
_local19 = ((-(_arg1.inv_dt) * m_limitMass2) * _local18);
_local20 = m_limitForce2;
m_limitForce2 = b2Math.b2Max(0, (m_limitForce2 + _local19));
_local19 = (m_limitForce2 - _local20);
_local16 = ((-(_arg1.dt) * _local19) * m_u2.x);
_local17 = ((-(_arg1.dt) * _local19) * m_u2.y);
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local16));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local17));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local17) - (_local9 * _local16))));
};
}
public function GetLength1():Number{
var _local1:b2Vec2;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
_local1 = m_body1.GetWorldPoint(m_localAnchor1);
_local2 = (m_ground.m_xf.position.x + m_groundAnchor1.x);
_local3 = (m_ground.m_xf.position.y + m_groundAnchor1.y);
_local4 = (_local1.x - _local2);
_local5 = (_local1.y - _local3);
return (Math.sqrt(((_local4 * _local4) + (_local5 * _local5))));
}
public function GetGroundAnchor1():b2Vec2{
var _local1:b2Vec2;
_local1 = m_ground.m_xf.position.Copy();
_local1.Add(m_groundAnchor1);
return (_local1);
}
}
}//package Box2D.Dynamics.Joints
Section 105
//b2PulleyJointDef (Box2D.Dynamics.Joints.b2PulleyJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2PulleyJointDef extends b2JointDef {
public var maxLength2:Number;
public var length1:Number;
public var length2:Number;
public var maxLength1:Number;
public var ratio:Number;
public var groundAnchor1:b2Vec2;
public var groundAnchor2:b2Vec2;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public function b2PulleyJointDef(){
groundAnchor1 = new b2Vec2();
groundAnchor2 = new b2Vec2();
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_pulleyJoint;
groundAnchor1.Set(-1, 1);
groundAnchor2.Set(1, 1);
localAnchor1.Set(-1, 0);
localAnchor2.Set(1, 0);
length1 = 0;
maxLength1 = 0;
length2 = 0;
maxLength2 = 0;
ratio = 1;
collideConnected = true;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2, _arg4:b2Vec2, _arg5:b2Vec2, _arg6:b2Vec2, _arg7:Number):void{
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
body1 = _arg1;
body2 = _arg2;
groundAnchor1.SetV(_arg3);
groundAnchor2.SetV(_arg4);
localAnchor1 = body1.GetLocalPoint(_arg5);
localAnchor2 = body2.GetLocalPoint(_arg6);
_local8 = (_arg5.x - _arg3.x);
_local9 = (_arg5.y - _arg3.y);
length1 = Math.sqrt(((_local8 * _local8) + (_local9 * _local9)));
_local10 = (_arg6.x - _arg4.x);
_local11 = (_arg6.y - _arg4.y);
length2 = Math.sqrt(((_local10 * _local10) + (_local11 * _local11)));
ratio = _arg7;
_local12 = (length1 + (ratio * length2));
maxLength1 = (_local12 - (ratio * b2PulleyJoint.b2_minPulleyLength));
maxLength2 = ((_local12 - b2PulleyJoint.b2_minPulleyLength) / ratio);
}
}
}//package Box2D.Dynamics.Joints
Section 106
//b2RevoluteJoint (Box2D.Dynamics.Joints.b2RevoluteJoint)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
public class b2RevoluteJoint extends b2Joint {
public var m_limitForce:Number;
public var m_motorForce:Number;
public var m_pivotMass:b2Mat22;
public var m_enableLimit:Boolean;
public var m_limitState:int;
public var m_motorMass:Number;
public var m_localAnchor1:b2Vec2;
public var m_localAnchor2:b2Vec2;
private var K1:b2Mat22;
private var K2:b2Mat22;
private var K3:b2Mat22;
private var K:b2Mat22;
public var m_pivotForce:b2Vec2;
public var m_motorSpeed:Number;
public var m_enableMotor:Boolean;
public var m_limitPositionImpulse:Number;
public var m_maxMotorTorque:Number;
public var m_referenceAngle:Number;
public var m_lowerAngle:Number;
public var m_upperAngle:Number;
public static var tImpulse:b2Vec2 = new b2Vec2();
public function b2RevoluteJoint(_arg1:b2RevoluteJointDef){
K = new b2Mat22();
K1 = new b2Mat22();
K2 = new b2Mat22();
K3 = new b2Mat22();
m_localAnchor1 = new b2Vec2();
m_localAnchor2 = new b2Vec2();
m_pivotForce = new b2Vec2();
m_pivotMass = new b2Mat22();
super(_arg1);
m_localAnchor1.SetV(_arg1.localAnchor1);
m_localAnchor2.SetV(_arg1.localAnchor2);
m_referenceAngle = _arg1.referenceAngle;
m_pivotForce.Set(0, 0);
m_motorForce = 0;
m_limitForce = 0;
m_limitPositionImpulse = 0;
m_lowerAngle = _arg1.lowerAngle;
m_upperAngle = _arg1.upperAngle;
m_maxMotorTorque = _arg1.maxMotorTorque;
m_motorSpeed = _arg1.motorSpeed;
m_enableLimit = _arg1.enableLimit;
m_enableMotor = _arg1.enableMotor;
}
override public function GetAnchor1():b2Vec2{
return (m_body1.GetWorldPoint(m_localAnchor1));
}
override public function GetAnchor2():b2Vec2{
return (m_body2.GetWorldPoint(m_localAnchor2));
}
public function EnableMotor(_arg1:Boolean):void{
m_enableMotor = _arg1;
}
public function GetUpperLimit():Number{
return (m_upperAngle);
}
public function GetLowerLimit():Number{
return (m_lowerAngle);
}
public function SetLimits(_arg1:Number, _arg2:Number):void{
m_lowerAngle = _arg1;
m_upperAngle = _arg2;
}
public function GetMotorSpeed():Number{
return (m_motorSpeed);
}
override public function GetReactionForce():b2Vec2{
return (m_pivotForce);
}
override public function SolvePositionConstraints():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:b2Body;
var _local4:b2Body;
var _local5:Number;
var _local6:b2Mat22;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
var _local22:Number;
var _local23:Number;
var _local24:Number;
var _local25:Number;
var _local26:Number;
_local3 = m_body1;
_local4 = m_body2;
_local5 = 0;
_local6 = _local3.m_xf.R;
_local7 = (m_localAnchor1.x - _local3.m_sweep.localCenter.x);
_local8 = (m_localAnchor1.y - _local3.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local7) + (_local6.col2.x * _local8));
_local8 = ((_local6.col1.y * _local7) + (_local6.col2.y * _local8));
_local7 = _local9;
_local6 = _local4.m_xf.R;
_local10 = (m_localAnchor2.x - _local4.m_sweep.localCenter.x);
_local11 = (m_localAnchor2.y - _local4.m_sweep.localCenter.y);
_local9 = ((_local6.col1.x * _local10) + (_local6.col2.x * _local11));
_local11 = ((_local6.col1.y * _local10) + (_local6.col2.y * _local11));
_local10 = _local9;
_local12 = (_local3.m_sweep.c.x + _local7);
_local13 = (_local3.m_sweep.c.y + _local8);
_local14 = (_local4.m_sweep.c.x + _local10);
_local15 = (_local4.m_sweep.c.y + _local11);
_local16 = (_local14 - _local12);
_local17 = (_local15 - _local13);
_local5 = Math.sqrt(((_local16 * _local16) + (_local17 * _local17)));
_local18 = _local3.m_invMass;
_local19 = _local4.m_invMass;
_local20 = _local3.m_invI;
_local21 = _local4.m_invI;
K1.col1.x = (_local18 + _local19);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local18 + _local19);
K2.col1.x = ((_local20 * _local8) * _local8);
K2.col2.x = ((-(_local20) * _local7) * _local8);
K2.col1.y = ((-(_local20) * _local7) * _local8);
K2.col2.y = ((_local20 * _local7) * _local7);
K3.col1.x = ((_local21 * _local11) * _local11);
K3.col2.x = ((-(_local21) * _local10) * _local11);
K3.col1.y = ((-(_local21) * _local10) * _local11);
K3.col2.y = ((_local21 * _local10) * _local10);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Solve(tImpulse, -(_local16), -(_local17));
_local22 = tImpulse.x;
_local23 = tImpulse.y;
_local3.m_sweep.c.x = (_local3.m_sweep.c.x - (_local3.m_invMass * _local22));
_local3.m_sweep.c.y = (_local3.m_sweep.c.y - (_local3.m_invMass * _local23));
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * ((_local7 * _local23) - (_local8 * _local22))));
_local4.m_sweep.c.x = (_local4.m_sweep.c.x + (_local4.m_invMass * _local22));
_local4.m_sweep.c.y = (_local4.m_sweep.c.y + (_local4.m_invMass * _local23));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * ((_local10 * _local23) - (_local11 * _local22))));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
_local24 = 0;
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local25 = ((_local4.m_sweep.a - _local3.m_sweep.a) - m_referenceAngle);
_local26 = 0;
if (m_limitState == e_equalLimits){
_local2 = b2Math.b2Clamp(_local25, -(b2Settings.b2_maxAngularCorrection), b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local24 = b2Math.b2Abs(_local2);
} else {
if (m_limitState == e_atLowerLimit){
_local2 = (_local25 - m_lowerAngle);
_local24 = b2Math.b2Max(0, -(_local2));
_local2 = b2Math.b2Clamp((_local2 + b2Settings.b2_angularSlop), -(b2Settings.b2_maxAngularCorrection), 0);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Max((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
} else {
if (m_limitState == e_atUpperLimit){
_local2 = (_local25 - m_upperAngle);
_local24 = b2Math.b2Max(0, _local2);
_local2 = b2Math.b2Clamp((_local2 - b2Settings.b2_angularSlop), 0, b2Settings.b2_maxAngularCorrection);
_local26 = (-(m_motorMass) * _local2);
_local1 = m_limitPositionImpulse;
m_limitPositionImpulse = b2Math.b2Min((m_limitPositionImpulse + _local26), 0);
_local26 = (m_limitPositionImpulse - _local1);
};
};
};
_local3.m_sweep.a = (_local3.m_sweep.a - (_local3.m_invI * _local26));
_local4.m_sweep.a = (_local4.m_sweep.a + (_local4.m_invI * _local26));
_local3.SynchronizeTransform();
_local4.SynchronizeTransform();
};
return ((((_local5 <= b2Settings.b2_linearSlop)) && ((_local24 <= b2Settings.b2_angularSlop))));
}
public function GetJointSpeed():Number{
return ((m_body2.m_angularVelocity - m_body1.m_angularVelocity));
}
public function SetMotorSpeed(_arg1:Number):void{
m_motorSpeed = _arg1;
}
public function SetMaxMotorTorque(_arg1:Number):void{
m_maxMotorTorque = _arg1;
}
public function GetJointAngle():Number{
return (((m_body2.m_sweep.a - m_body1.m_sweep.a) - m_referenceAngle));
}
override public function InitVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local10 = _local2.m_invMass;
_local11 = _local3.m_invMass;
_local12 = _local2.m_invI;
_local13 = _local3.m_invI;
K1.col1.x = (_local10 + _local11);
K1.col2.x = 0;
K1.col1.y = 0;
K1.col2.y = (_local10 + _local11);
K2.col1.x = ((_local12 * _local7) * _local7);
K2.col2.x = ((-(_local12) * _local6) * _local7);
K2.col1.y = ((-(_local12) * _local6) * _local7);
K2.col2.y = ((_local12 * _local6) * _local6);
K3.col1.x = ((_local13 * _local9) * _local9);
K3.col2.x = ((-(_local13) * _local8) * _local9);
K3.col1.y = ((-(_local13) * _local8) * _local9);
K3.col2.y = ((_local13 * _local8) * _local8);
K.SetM(K1);
K.AddM(K2);
K.AddM(K3);
K.Invert(m_pivotMass);
m_motorMass = (1 / (_local12 + _local13));
if (m_enableMotor == false){
m_motorForce = 0;
};
if (m_enableLimit){
_local14 = ((_local3.m_sweep.a - _local2.m_sweep.a) - m_referenceAngle);
if (b2Math.b2Abs((m_upperAngle - m_lowerAngle)) < (2 * b2Settings.b2_angularSlop)){
m_limitState = e_equalLimits;
} else {
if (_local14 <= m_lowerAngle){
if (m_limitState != e_atLowerLimit){
m_limitForce = 0;
};
m_limitState = e_atLowerLimit;
} else {
if (_local14 >= m_upperAngle){
if (m_limitState != e_atUpperLimit){
m_limitForce = 0;
};
m_limitState = e_atUpperLimit;
} else {
m_limitState = e_inactiveLimit;
m_limitForce = 0;
};
};
};
} else {
m_limitForce = 0;
};
if (_arg1.warmStarting){
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - ((_arg1.dt * _local10) * m_pivotForce.x));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - ((_arg1.dt * _local10) * m_pivotForce.y));
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_arg1.dt * _local12) * ((((_local6 * m_pivotForce.y) - (_local7 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + ((_arg1.dt * _local11) * m_pivotForce.x));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + ((_arg1.dt * _local11) * m_pivotForce.y));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_arg1.dt * _local13) * ((((_local8 * m_pivotForce.y) - (_local9 * m_pivotForce.x)) + m_motorForce) + m_limitForce)));
} else {
m_pivotForce.SetZero();
m_motorForce = 0;
m_limitForce = 0;
};
m_limitPositionImpulse = 0;
}
public function EnableLimit(_arg1:Boolean):void{
m_enableLimit = _arg1;
}
public function GetMotorTorque():Number{
return (m_motorForce);
}
override public function GetReactionTorque():Number{
return (m_limitForce);
}
public function IsLimitEnabled():Boolean{
return (m_enableLimit);
}
public function IsMotorEnabled():Boolean{
return (m_enableMotor);
}
override public function SolveVelocityConstraints(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2Mat22;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local18:Number;
var _local19:Number;
var _local20:Number;
var _local21:Number;
_local2 = m_body1;
_local3 = m_body2;
_local4 = _local2.m_xf.R;
_local6 = (m_localAnchor1.x - _local2.m_sweep.localCenter.x);
_local7 = (m_localAnchor1.y - _local2.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local6) + (_local4.col2.x * _local7));
_local7 = ((_local4.col1.y * _local6) + (_local4.col2.y * _local7));
_local6 = _local5;
_local4 = _local3.m_xf.R;
_local8 = (m_localAnchor2.x - _local3.m_sweep.localCenter.x);
_local9 = (m_localAnchor2.y - _local3.m_sweep.localCenter.y);
_local5 = ((_local4.col1.x * _local8) + (_local4.col2.x * _local9));
_local9 = ((_local4.col1.y * _local8) + (_local4.col2.y * _local9));
_local8 = _local5;
_local11 = (((_local3.m_linearVelocity.x + (-(_local3.m_angularVelocity) * _local9)) - _local2.m_linearVelocity.x) - (-(_local2.m_angularVelocity) * _local7));
_local12 = (((_local3.m_linearVelocity.y + (_local3.m_angularVelocity * _local8)) - _local2.m_linearVelocity.y) - (_local2.m_angularVelocity * _local6));
_local13 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.x * _local11) + (m_pivotMass.col2.x * _local12)));
_local14 = (-(_arg1.inv_dt) * ((m_pivotMass.col1.y * _local11) + (m_pivotMass.col2.y * _local12)));
m_pivotForce.x = (m_pivotForce.x + _local13);
m_pivotForce.y = (m_pivotForce.y + _local14);
_local15 = (_arg1.dt * _local13);
_local16 = (_arg1.dt * _local14);
_local2.m_linearVelocity.x = (_local2.m_linearVelocity.x - (_local2.m_invMass * _local15));
_local2.m_linearVelocity.y = (_local2.m_linearVelocity.y - (_local2.m_invMass * _local16));
_local2.m_angularVelocity = (_local2.m_angularVelocity - (_local2.m_invI * ((_local6 * _local16) - (_local7 * _local15))));
_local3.m_linearVelocity.x = (_local3.m_linearVelocity.x + (_local3.m_invMass * _local15));
_local3.m_linearVelocity.y = (_local3.m_linearVelocity.y + (_local3.m_invMass * _local16));
_local3.m_angularVelocity = (_local3.m_angularVelocity + (_local3.m_invI * ((_local8 * _local16) - (_local9 * _local15))));
if (((m_enableMotor) && (!((m_limitState == e_equalLimits))))){
_local17 = ((_local3.m_angularVelocity - _local2.m_angularVelocity) - m_motorSpeed);
_local18 = ((-(_arg1.inv_dt) * m_motorMass) * _local17);
_local19 = m_motorForce;
m_motorForce = b2Math.b2Clamp((m_motorForce + _local18), -(m_maxMotorTorque), m_maxMotorTorque);
_local18 = (m_motorForce - _local19);
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local18));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local18));
};
if (((m_enableLimit) && (!((m_limitState == e_inactiveLimit))))){
_local20 = (_local3.m_angularVelocity - _local2.m_angularVelocity);
_local21 = ((-(_arg1.inv_dt) * m_motorMass) * _local20);
if (m_limitState == e_equalLimits){
m_limitForce = (m_limitForce + _local21);
} else {
if (m_limitState == e_atLowerLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Max((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
} else {
if (m_limitState == e_atUpperLimit){
_local10 = m_limitForce;
m_limitForce = b2Math.b2Min((m_limitForce + _local21), 0);
_local21 = (m_limitForce - _local10);
};
};
};
_local2.m_angularVelocity = (_local2.m_angularVelocity - ((_local2.m_invI * _arg1.dt) * _local21));
_local3.m_angularVelocity = (_local3.m_angularVelocity + ((_local3.m_invI * _arg1.dt) * _local21));
};
}
}
}//package Box2D.Dynamics.Joints
Section 107
//b2RevoluteJointDef (Box2D.Dynamics.Joints.b2RevoluteJointDef)
package Box2D.Dynamics.Joints {
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class b2RevoluteJointDef extends b2JointDef {
public var referenceAngle:Number;
public var upperAngle:Number;
public var lowerAngle:Number;
public var motorSpeed:Number;
public var maxMotorTorque:Number;
public var localAnchor1:b2Vec2;
public var localAnchor2:b2Vec2;
public var enableLimit:Boolean;
public var enableMotor:Boolean;
public function b2RevoluteJointDef(){
localAnchor1 = new b2Vec2();
localAnchor2 = new b2Vec2();
super();
type = b2Joint.e_revoluteJoint;
localAnchor1.Set(0, 0);
localAnchor2.Set(0, 0);
referenceAngle = 0;
lowerAngle = 0;
upperAngle = 0;
maxMotorTorque = 0;
motorSpeed = 0;
enableLimit = false;
enableMotor = false;
}
public function Initialize(_arg1:b2Body, _arg2:b2Body, _arg3:b2Vec2):void{
body1 = _arg1;
body2 = _arg2;
localAnchor1 = body1.GetLocalPoint(_arg3);
localAnchor2 = body2.GetLocalPoint(_arg3);
referenceAngle = (body2.GetAngle() - body1.GetAngle());
}
}
}//package Box2D.Dynamics.Joints
Section 108
//b2Body (Box2D.Dynamics.b2Body)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2Body {
public var m_next:b2Body;
public var m_contactList:b2ContactEdge;
public var m_angularVelocity:Number;
public var m_shapeList:b2Shape;
public var m_force:b2Vec2;
public var m_mass:Number;
public var m_sweep:b2Sweep;
public var m_xf:b2XForm;
public var m_torque:Number;
public var m_userData;
public var m_flags:uint;
public var m_world:b2World;
public var m_prev:b2Body;
public var m_invMass:Number;
public var m_type:int;
public var m_linearDamping:Number;
public var m_angularDamping:Number;
public var m_invI:Number;
public var m_linearVelocity:b2Vec2;
public var m_sleepTime:Number;
public var m_shapeCount:int;
public var m_jointList:b2JointEdge;
public var m_I:Number;
public static var e_fixedRotationFlag:uint = 64;
public static var e_frozenFlag:uint = 2;
public static var e_maxTypes:uint = 3;
public static var e_sleepFlag:uint = 8;
private static var s_massData:b2MassData = new b2MassData();
public static var e_bulletFlag:uint = 32;
public static var e_staticType:uint = 1;
public static var e_islandFlag:uint = 4;
public static var e_allowSleepFlag:uint = 16;
private static var s_xf1:b2XForm = new b2XForm();
public static var e_dynamicType:uint = 2;
public function b2Body(_arg1:b2BodyDef, _arg2:b2World){
var _local3:b2Mat22;
var _local4:b2Vec2;
m_xf = new b2XForm();
m_sweep = new b2Sweep();
m_linearVelocity = new b2Vec2();
m_force = new b2Vec2();
super();
m_flags = 0;
if (_arg1.isBullet){
m_flags = (m_flags | e_bulletFlag);
};
if (_arg1.fixedRotation){
m_flags = (m_flags | e_fixedRotationFlag);
};
if (_arg1.allowSleep){
m_flags = (m_flags | e_allowSleepFlag);
};
if (_arg1.isSleeping){
m_flags = (m_flags | e_sleepFlag);
};
m_world = _arg2;
m_xf.position.SetV(_arg1.position);
m_xf.R.Set(_arg1.angle);
m_sweep.localCenter.SetV(_arg1.massData.center);
m_sweep.t0 = 1;
m_sweep.a0 = (m_sweep.a = _arg1.angle);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_jointList = null;
m_contactList = null;
m_prev = null;
m_next = null;
m_linearDamping = _arg1.linearDamping;
m_angularDamping = _arg1.angularDamping;
m_force.Set(0, 0);
m_torque = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_sleepTime = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.massData.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.massData.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
m_userData = _arg1.userData;
m_shapeList = null;
m_shapeCount = 0;
}
public function GetLinearVelocityFromWorldPoint(_arg1:b2Vec2):b2Vec2{
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_arg1.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_arg1.x - m_sweep.c.x)))));
}
public function SetLinearVelocity(_arg1:b2Vec2):void{
m_linearVelocity.SetV(_arg1);
}
public function WakeUp():void{
m_flags = (m_flags & ~(e_sleepFlag));
m_sleepTime = 0;
}
public function GetLocalCenter():b2Vec2{
return (m_sweep.localCenter);
}
public function ApplyTorque(_arg1:Number):void{
if (IsSleeping()){
WakeUp();
};
m_torque = (m_torque + _arg1);
}
public function IsFrozen():Boolean{
return (((m_flags & e_frozenFlag) == e_frozenFlag));
}
public function IsDynamic():Boolean{
return ((m_type == e_dynamicType));
}
public function GetLinearVelocity():b2Vec2{
return (m_linearVelocity);
}
public function SynchronizeTransform():void{
var _local1:b2Mat22;
var _local2:b2Vec2;
m_xf.R.Set(m_sweep.a);
_local1 = m_xf.R;
_local2 = m_sweep.localCenter;
m_xf.position.x = (m_sweep.c.x - ((_local1.col1.x * _local2.x) + (_local1.col2.x * _local2.y)));
m_xf.position.y = (m_sweep.c.y - ((_local1.col1.y * _local2.x) + (_local1.col2.y * _local2.y)));
}
public function GetInertia():Number{
return (m_I);
}
public function IsSleeping():Boolean{
return (((m_flags & e_sleepFlag) == e_sleepFlag));
}
public function SetMassFromShapes():void{
var _local1:b2Shape;
var _local2:Number;
var _local3:Number;
var _local4:b2MassData;
var _local5:b2Mat22;
var _local6:b2Vec2;
var _local7:int;
if (m_world.m_lock == true){
return;
};
m_mass = 0;
m_invMass = 0;
m_I = 0;
m_invI = 0;
_local2 = 0;
_local3 = 0;
_local4 = s_massData;
_local1 = m_shapeList;
while (_local1) {
_local1.ComputeMass(_local4);
m_mass = (m_mass + _local4.mass);
_local2 = (_local2 + (_local4.mass * _local4.center.x));
_local3 = (_local3 + (_local4.mass * _local4.center.y));
m_I = (m_I + _local4.I);
_local1 = _local1.m_next;
};
if (m_mass > 0){
m_invMass = (1 / m_mass);
_local2 = (_local2 * m_invMass);
_local3 = (_local3 * m_invMass);
};
if ((((m_I > 0)) && (((m_flags & e_fixedRotationFlag) == 0)))){
m_I = (m_I - (m_mass * ((_local2 * _local2) + (_local3 * _local3))));
m_invI = (1 / m_I);
} else {
m_I = 0;
m_invI = 0;
};
m_sweep.localCenter.Set(_local2, _local3);
_local5 = m_xf.R;
_local6 = m_sweep.localCenter;
m_sweep.c.x = ((_local5.col1.x * _local6.x) + (_local5.col2.x * _local6.y));
m_sweep.c.y = ((_local5.col1.y * _local6.x) + (_local5.col2.y * _local6.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local1 = m_shapeList;
while (_local1) {
_local1.UpdateSweepRadius(m_sweep.localCenter);
_local1 = _local1.m_next;
};
_local7 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local7 != m_type){
_local1 = m_shapeList;
while (_local1) {
_local1.RefilterProxy(m_world.m_broadPhase, m_xf);
_local1 = _local1.m_next;
};
};
}
public function PutToSleep():void{
m_flags = (m_flags | e_sleepFlag);
m_sleepTime = 0;
m_linearVelocity.SetZero();
m_angularVelocity = 0;
m_force.SetZero();
m_torque = 0;
}
public function GetJointList():b2JointEdge{
return (m_jointList);
}
public function SetXForm(_arg1:b2Vec2, _arg2:Number):Boolean{
var _local3:b2Shape;
var _local4:b2Mat22;
var _local5:b2Vec2;
var _local6:Boolean;
var _local7:Boolean;
if (m_world.m_lock == true){
return (true);
};
if (IsFrozen()){
return (false);
};
m_xf.R.Set(_arg2);
m_xf.position.SetV(_arg1);
_local4 = m_xf.R;
_local5 = m_sweep.localCenter;
m_sweep.c.x = ((_local4.col1.x * _local5.x) + (_local4.col2.x * _local5.y));
m_sweep.c.y = ((_local4.col1.y * _local5.x) + (_local4.col2.y * _local5.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
m_sweep.a0 = (m_sweep.a = _arg2);
_local6 = false;
_local3 = m_shapeList;
while (_local3) {
_local7 = _local3.Synchronize(m_world.m_broadPhase, m_xf, m_xf);
if (_local7 == false){
_local6 = true;
break;
};
_local3 = _local3.m_next;
};
if (_local6 == true){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local3 = m_shapeList;
while (_local3) {
_local3.DestroyProxy(m_world.m_broadPhase);
_local3 = _local3.m_next;
};
return (false);
};
m_world.m_broadPhase.Commit();
return (true);
}
public function GetLocalPoint(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulXT(m_xf, _arg1));
}
public function ApplyForce(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_force.x = (m_force.x + _arg1.x);
m_force.y = (m_force.y + _arg1.y);
m_torque = (m_torque + (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x)));
}
public function SynchronizeShapes():Boolean{
var _local1:b2XForm;
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:b2Shape;
var _local5:Boolean;
_local1 = s_xf1;
_local1.R.Set(m_sweep.a0);
_local2 = _local1.R;
_local3 = m_sweep.localCenter;
_local1.position.x = (m_sweep.c0.x - ((_local2.col1.x * _local3.x) + (_local2.col2.x * _local3.y)));
_local1.position.y = (m_sweep.c0.y - ((_local2.col1.y * _local3.x) + (_local2.col2.y * _local3.y)));
_local5 = true;
_local4 = m_shapeList;
while (_local4) {
_local5 = _local4.Synchronize(m_world.m_broadPhase, _local1, m_xf);
if (_local5 == false){
break;
};
_local4 = _local4.m_next;
};
if (_local5 == false){
m_flags = (m_flags | e_frozenFlag);
m_linearVelocity.SetZero();
m_angularVelocity = 0;
_local4 = m_shapeList;
while (_local4) {
_local4.DestroyProxy(m_world.m_broadPhase);
_local4 = _local4.m_next;
};
return (false);
};
return (true);
}
public function GetAngle():Number{
return (m_sweep.a);
}
public function GetXForm():b2XForm{
return (m_xf);
}
public function ApplyImpulse(_arg1:b2Vec2, _arg2:b2Vec2):void{
if (IsSleeping()){
WakeUp();
};
m_linearVelocity.x = (m_linearVelocity.x + (m_invMass * _arg1.x));
m_linearVelocity.y = (m_linearVelocity.y + (m_invMass * _arg1.y));
m_angularVelocity = (m_angularVelocity + (m_invI * (((_arg2.x - m_sweep.c.x) * _arg1.y) - ((_arg2.y - m_sweep.c.y) * _arg1.x))));
}
public function GetNext():b2Body{
return (m_next);
}
public function GetMass():Number{
return (m_mass);
}
public function GetLinearVelocityFromLocalPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (new b2Vec2((m_linearVelocity.x + (m_angularVelocity * (_local3.y - m_sweep.c.y))), (m_linearVelocity.x - (m_angularVelocity * (_local3.x - m_sweep.c.x)))));
}
public function GetAngularVelocity():Number{
return (m_angularVelocity);
}
public function SetAngularVelocity(_arg1:Number):void{
m_angularVelocity = _arg1;
}
public function SetMass(_arg1:b2MassData):void{
var _local2:b2Shape;
var _local3:b2Mat22;
var _local4:b2Vec2;
var _local5:int;
if (m_world.m_lock == true){
return;
};
m_invMass = 0;
m_I = 0;
m_invI = 0;
m_mass = _arg1.mass;
if (m_mass > 0){
m_invMass = (1 / m_mass);
};
if ((m_flags & b2Body.e_fixedRotationFlag) == 0){
m_I = _arg1.I;
};
if (m_I > 0){
m_invI = (1 / m_I);
};
m_sweep.localCenter.SetV(_arg1.center);
_local3 = m_xf.R;
_local4 = m_sweep.localCenter;
m_sweep.c.x = ((_local3.col1.x * _local4.x) + (_local3.col2.x * _local4.y));
m_sweep.c.y = ((_local3.col1.y * _local4.x) + (_local3.col2.y * _local4.y));
m_sweep.c.x = (m_sweep.c.x + m_xf.position.x);
m_sweep.c.y = (m_sweep.c.y + m_xf.position.y);
m_sweep.c0.SetV(m_sweep.c);
_local2 = m_shapeList;
while (_local2) {
_local2.UpdateSweepRadius(m_sweep.localCenter);
_local2 = _local2.m_next;
};
_local5 = m_type;
if ((((m_invMass == 0)) && ((m_invI == 0)))){
m_type = e_staticType;
} else {
m_type = e_dynamicType;
};
if (_local5 != m_type){
_local2 = m_shapeList;
while (_local2) {
_local2.RefilterProxy(m_world.m_broadPhase, m_xf);
_local2 = _local2.m_next;
};
};
}
public function IsStatic():Boolean{
return ((m_type == e_staticType));
}
public function GetWorldVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulMV(m_xf.R, _arg1));
}
public function GetShapeList():b2Shape{
return (m_shapeList);
}
public function Advance(_arg1:Number):void{
m_sweep.Advance(_arg1);
m_sweep.c.SetV(m_sweep.c0);
m_sweep.a = m_sweep.a0;
SynchronizeTransform();
}
public function SetBullet(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_bulletFlag);
} else {
m_flags = (m_flags & ~(e_bulletFlag));
};
}
public function CreateShape(_arg1:b2ShapeDef):b2Shape{
var _local2:b2Shape;
if (m_world.m_lock == true){
return (null);
};
_local2 = b2Shape.Create(_arg1, m_world.m_blockAllocator);
_local2.m_next = m_shapeList;
m_shapeList = _local2;
m_shapeCount++;
_local2.m_body = this;
_local2.CreateProxy(m_world.m_broadPhase, m_xf);
_local2.UpdateSweepRadius(m_sweep.localCenter);
return (_local2);
}
public function IsConnected(_arg1:b2Body):Boolean{
var _local2:b2JointEdge;
_local2 = m_jointList;
while (_local2) {
if (_local2.other == _arg1){
return ((_local2.joint.m_collideConnected == false));
};
_local2 = _local2.next;
};
return (false);
}
public function DestroyShape(_arg1:b2Shape):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:Boolean;
if (m_world.m_lock == true){
return;
};
_arg1.DestroyProxy(m_world.m_broadPhase);
_local2 = m_shapeList;
_local3 = null;
_local4 = false;
while (_local2 != null) {
if (_local2 == _arg1){
if (_local3){
_local3.m_next = _arg1.m_next;
} else {
m_shapeList = _arg1.m_next;
};
_local4 = true;
break;
};
_local3 = _local2;
_local2 = _local2.m_next;
};
_arg1.m_body = null;
_arg1.m_next = null;
m_shapeCount--;
b2Shape.Destroy(_arg1, m_world.m_blockAllocator);
}
public function GetUserData(){
return (m_userData);
}
public function IsBullet():Boolean{
return (((m_flags & e_bulletFlag) == e_bulletFlag));
}
public function GetWorldCenter():b2Vec2{
return (m_sweep.c);
}
public function AllowSleeping(_arg1:Boolean):void{
if (_arg1){
m_flags = (m_flags | e_allowSleepFlag);
} else {
m_flags = (m_flags & ~(e_allowSleepFlag));
WakeUp();
};
}
public function SetUserData(_arg1):void{
m_userData = _arg1;
}
public function GetLocalVector(_arg1:b2Vec2):b2Vec2{
return (b2Math.b2MulTMV(m_xf.R, _arg1));
}
public function GetWorldPoint(_arg1:b2Vec2):b2Vec2{
var _local2:b2Mat22;
var _local3:b2Vec2;
_local2 = m_xf.R;
_local3 = new b2Vec2(((_local2.col1.x * _arg1.x) + (_local2.col2.x * _arg1.y)), ((_local2.col1.y * _arg1.x) + (_local2.col2.y * _arg1.y)));
_local3.x = (_local3.x + m_xf.position.x);
_local3.y = (_local3.y + m_xf.position.y);
return (_local3);
}
public function GetWorld():b2World{
return (m_world);
}
public function GetPosition():b2Vec2{
return (m_xf.position);
}
}
}//package Box2D.Dynamics
Section 109
//b2BodyDef (Box2D.Dynamics.b2BodyDef)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2BodyDef {
public var isSleeping:Boolean;
public var position:b2Vec2;
public var isBullet:Boolean;
public var allowSleep:Boolean;
public var userData;
public var angularDamping:Number;
public var fixedRotation:Boolean;
public var angle:Number;
public var linearDamping:Number;
public var massData:b2MassData;
public function b2BodyDef(){
massData = new b2MassData();
position = new b2Vec2();
super();
massData.center.SetZero();
massData.mass = 0;
massData.I = 0;
userData = null;
position.Set(0, 0);
angle = 0;
linearDamping = 0;
angularDamping = 0;
allowSleep = true;
isSleeping = false;
fixedRotation = false;
isBullet = false;
}
}
}//package Box2D.Dynamics
Section 110
//b2BoundaryListener (Box2D.Dynamics.b2BoundaryListener)
package Box2D.Dynamics {
public class b2BoundaryListener {
public function Violation(_arg1:b2Body):void{
}
}
}//package Box2D.Dynamics
Section 111
//b2ContactFilter (Box2D.Dynamics.b2ContactFilter)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactFilter {
public static var b2_defaultFilter:b2ContactFilter = new (b2ContactFilter);
;
public function ShouldCollide(_arg1:b2Shape, _arg2:b2Shape):Boolean{
var _local3:b2FilterData;
var _local4:b2FilterData;
var _local5:Boolean;
_local3 = _arg1.GetFilterData();
_local4 = _arg2.GetFilterData();
if ((((_local3.groupIndex == _local4.groupIndex)) && (!((_local3.groupIndex == 0))))){
return ((_local3.groupIndex > 0));
};
_local5 = ((!(((_local3.maskBits & _local4.categoryBits) == 0))) && (!(((_local3.categoryBits & _local4.maskBits) == 0))));
return (_local5);
}
}
}//package Box2D.Dynamics
Section 112
//b2ContactListener (Box2D.Dynamics.b2ContactListener)
package Box2D.Dynamics {
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactListener {
public function Add(_arg1:b2ContactPoint):void{
}
public function Remove(_arg1:b2ContactPoint):void{
}
public function Persist(_arg1:b2ContactPoint):void{
}
public function Result(_arg1:b2ContactResult):void{
}
}
}//package Box2D.Dynamics
Section 113
//b2ContactManager (Box2D.Dynamics.b2ContactManager)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2ContactManager extends b2PairCallback {
public var m_world:b2World;
public var m_destroyImmediate:Boolean;
public var m_nullContact:b2NullContact;
private static const s_evalCP:b2ContactPoint = new b2ContactPoint();
public function b2ContactManager(){
m_nullContact = new b2NullContact();
super();
m_world = null;
m_destroyImmediate = false;
}
override public function PairAdded(_arg1, _arg2){
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Contact;
_local3 = (_arg1 as b2Shape);
_local4 = (_arg2 as b2Shape);
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((_local5.IsStatic()) && (_local6.IsStatic()))){
return (m_nullContact);
};
if (_local3.m_body == _local4.m_body){
return (m_nullContact);
};
if (_local6.IsConnected(_local5)){
return (m_nullContact);
};
if (((!((m_world.m_contactFilter == null))) && ((m_world.m_contactFilter.ShouldCollide(_local3, _local4) == false)))){
return (m_nullContact);
};
_local7 = b2Contact.Create(_local3, _local4, m_world.m_blockAllocator);
if (_local7 == null){
return (m_nullContact);
};
_local3 = _local7.m_shape1;
_local4 = _local7.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local7.m_prev = null;
_local7.m_next = m_world.m_contactList;
if (m_world.m_contactList != null){
m_world.m_contactList.m_prev = _local7;
};
m_world.m_contactList = _local7;
_local7.m_node1.contact = _local7;
_local7.m_node1.other = _local6;
_local7.m_node1.prev = null;
_local7.m_node1.next = _local5.m_contactList;
if (_local5.m_contactList != null){
_local5.m_contactList.prev = _local7.m_node1;
};
_local5.m_contactList = _local7.m_node1;
_local7.m_node2.contact = _local7;
_local7.m_node2.other = _local5;
_local7.m_node2.prev = null;
_local7.m_node2.next = _local6.m_contactList;
if (_local6.m_contactList != null){
_local6.m_contactList.prev = _local7.m_node2;
};
_local6.m_contactList = _local7.m_node2;
m_world.m_contactCount++;
return (_local7);
}
override public function PairRemoved(_arg1, _arg2, _arg3):void{
var _local4:b2Contact;
if (_arg3 == null){
return;
};
_local4 = (_arg3 as b2Contact);
if (_local4 == m_nullContact){
return;
};
Destroy(_local4);
}
public function Destroy(_arg1:b2Contact):void{
var _local2:b2Shape;
var _local3:b2Shape;
var _local4:int;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2Body;
var _local8:b2Body;
var _local9:Array;
var _local10:b2ContactPoint;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2Vec2;
var _local16:b2Vec2;
_local2 = _arg1.m_shape1;
_local3 = _arg1.m_shape2;
_local4 = _arg1.m_manifoldCount;
if ((((_local4 > 0)) && (m_world.m_contactListener))){
_local7 = _local2.m_body;
_local8 = _local3.m_body;
_local9 = _arg1.GetManifolds();
_local10 = s_evalCP;
_local10.shape1 = _arg1.m_shape1;
_local10.shape2 = _arg1.m_shape1;
_local10.friction = _arg1.m_friction;
_local10.restitution = _arg1.m_restitution;
_local11 = 0;
while (_local11 < _local4) {
_local12 = _local9[_local11];
_local10.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local10.position = _local7.GetWorldPoint(_local14.localPoint1);
_local15 = _local7.GetLinearVelocityFromLocalPoint(_local14.localPoint1);
_local16 = _local8.GetLinearVelocityFromLocalPoint(_local14.localPoint2);
_local10.velocity.Set((_local16.x - _local15.x), (_local16.y - _local15.y));
_local10.separation = _local14.separation;
_local10.id.key = _local14.id._key;
m_world.m_contactListener.Remove(_local10);
_local13++;
};
_local11++;
};
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_world.m_contactList){
m_world.m_contactList = _arg1.m_next;
};
_local5 = _local2.m_body;
_local6 = _local3.m_body;
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local5.m_contactList){
_local5.m_contactList = _arg1.m_node1.next;
};
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local6.m_contactList){
_local6.m_contactList = _arg1.m_node2.next;
};
b2Contact.Destroy(_arg1, m_world.m_blockAllocator);
m_world.m_contactCount--;
}
public function Collide():void{
var _local1:b2Contact;
var _local2:b2Body;
var _local3:b2Body;
_local1 = m_world.m_contactList;
while (_local1) {
_local2 = _local1.m_shape1.m_body;
_local3 = _local1.m_shape2.m_body;
if (((_local2.IsSleeping()) && (_local3.IsSleeping()))){
} else {
_local1.Update(m_world.m_contactListener);
};
_local1 = _local1.m_next;
};
}
}
}//package Box2D.Dynamics
Section 114
//b2DebugDraw (Box2D.Dynamics.b2DebugDraw)
package Box2D.Dynamics {
import flash.display.*;
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2DebugDraw {
public var m_xformScale:Number;// = 1
public var m_fillAlpha:Number;// = 1
public var m_alpha:Number;// = 1
public var m_lineThickness:Number;// = 1
public var m_drawFlags:uint;
public var m_sprite:Sprite;
public var m_drawScale:Number;// = 1
public static var e_coreShapeBit:uint = 4;
public static var e_shapeBit:uint = 1;
public static var e_centerOfMassBit:uint = 64;
public static var e_aabbBit:uint = 8;
public static var e_obbBit:uint = 16;
public static var e_pairBit:uint = 32;
public static var e_jointBit:uint = 2;
public function b2DebugDraw(){
m_drawScale = 1;
m_lineThickness = 1;
m_alpha = 1;
m_fillAlpha = 1;
m_xformScale = 1;
super();
m_drawFlags = 0;
}
public function DrawSolidPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.beginFill(_arg3.color, m_fillAlpha);
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
m_sprite.graphics.endFill();
}
public function DrawCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
}
public function DrawXForm(_arg1:b2XForm):void{
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF0000, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col1.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col1.y)) * m_drawScale));
m_sprite.graphics.lineStyle(m_lineThickness, 0xFF00, m_alpha);
m_sprite.graphics.moveTo((_arg1.position.x * m_drawScale), (_arg1.position.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.position.x + (m_xformScale * _arg1.R.col2.x)) * m_drawScale), ((_arg1.position.y + (m_xformScale * _arg1.R.col2.y)) * m_drawScale));
}
public function ClearFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags & ~(_arg1));
}
public function DrawSolidCircle(_arg1:b2Vec2, _arg2:Number, _arg3:b2Vec2, _arg4:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg4.color, m_alpha);
m_sprite.graphics.moveTo(0, 0);
m_sprite.graphics.beginFill(_arg4.color, m_fillAlpha);
m_sprite.graphics.drawCircle((_arg1.x * m_drawScale), (_arg1.y * m_drawScale), (_arg2 * m_drawScale));
m_sprite.graphics.endFill();
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo(((_arg1.x + (_arg3.x * _arg2)) * m_drawScale), ((_arg1.y + (_arg3.y * _arg2)) * m_drawScale));
}
public function SetFlags(_arg1:uint):void{
m_drawFlags = _arg1;
}
public function AppendFlags(_arg1:uint):void{
m_drawFlags = (m_drawFlags | _arg1);
}
public function DrawSegment(_arg1:b2Vec2, _arg2:b2Vec2, _arg3:b2Color):void{
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1.x * m_drawScale), (_arg1.y * m_drawScale));
m_sprite.graphics.lineTo((_arg2.x * m_drawScale), (_arg2.y * m_drawScale));
}
public function GetFlags():uint{
return (m_drawFlags);
}
public function DrawPolygon(_arg1:Array, _arg2:int, _arg3:b2Color):void{
var _local4:int;
m_sprite.graphics.lineStyle(m_lineThickness, _arg3.color, m_alpha);
m_sprite.graphics.moveTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
_local4 = 1;
while (_local4 < _arg2) {
m_sprite.graphics.lineTo((_arg1[_local4].x * m_drawScale), (_arg1[_local4].y * m_drawScale));
_local4++;
};
m_sprite.graphics.lineTo((_arg1[0].x * m_drawScale), (_arg1[0].y * m_drawScale));
}
}
}//package Box2D.Dynamics
Section 115
//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 116
//b2Island (Box2D.Dynamics.b2Island)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Dynamics.Contacts.*;
public class b2Island {
public var m_joints:Array;
public var m_listener:b2ContactListener;
public var m_positionIterationCount:int;
public var m_bodyCapacity:int;
public var m_bodies:Array;
public var m_jointCapacity:int;
public var m_contactCount:int;
public var m_contacts:Array;
public var m_contactCapacity:int;
public var m_jointCount:int;
public var m_allocator;
public var m_bodyCount:int;
private static var s_reportCR:b2ContactResult = new b2ContactResult();
public function b2Island(_arg1:int, _arg2:int, _arg3:int, _arg4, _arg5:b2ContactListener){
var _local6:int;
super();
m_bodyCapacity = _arg1;
m_contactCapacity = _arg2;
m_jointCapacity = _arg3;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_allocator = _arg4;
m_listener = _arg5;
m_bodies = new Array(_arg1);
_local6 = 0;
while (_local6 < _arg1) {
m_bodies[_local6] = null;
_local6++;
};
m_contacts = new Array(_arg2);
_local6 = 0;
while (_local6 < _arg2) {
m_contacts[_local6] = null;
_local6++;
};
m_joints = new Array(_arg3);
_local6 = 0;
while (_local6 < _arg3) {
m_joints[_local6] = null;
_local6++;
};
m_positionIterationCount = 0;
}
public function AddBody(_arg1:b2Body):void{
var _local2 = m_bodyCount++;
m_bodies[_local2] = _arg1;
}
public function AddJoint(_arg1:b2Joint):void{
var _local2 = m_jointCount++;
m_joints[_local2] = _arg1;
}
public function Report(_arg1:Array):void{
var _local2:b2Mat22;
var _local3:b2Vec2;
var _local4:int;
var _local5:b2Contact;
var _local6:b2ContactConstraint;
var _local7:b2ContactResult;
var _local8:b2Body;
var _local9:int;
var _local10:Array;
var _local11:int;
var _local12:b2Manifold;
var _local13:int;
var _local14:b2ManifoldPoint;
var _local15:b2ContactConstraintPoint;
if (m_listener == null){
return;
};
_local4 = 0;
while (_local4 < m_contactCount) {
_local5 = m_contacts[_local4];
_local6 = _arg1[_local4];
_local7 = s_reportCR;
_local7.shape1 = _local5.m_shape1;
_local7.shape2 = _local5.m_shape2;
_local8 = _local7.shape1.m_body;
_local9 = _local5.m_manifoldCount;
_local10 = _local5.GetManifolds();
_local11 = 0;
while (_local11 < _local9) {
_local12 = _local10[_local11];
_local7.normal.SetV(_local12.normal);
_local13 = 0;
while (_local13 < _local12.pointCount) {
_local14 = _local12.points[_local13];
_local15 = _local6.points[_local13];
_local7.position = _local8.GetWorldPoint(_local14.localPoint1);
_local7.normalImpulse = _local15.normalImpulse;
_local7.tangentImpulse = _local15.tangentImpulse;
_local7.id.key = _local14.id.key;
m_listener.Result(_local7);
_local13++;
};
_local11++;
};
_local4++;
};
}
public function Solve(_arg1:b2TimeStep, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean):void{
var _local5:int;
var _local6:b2Body;
var _local7:b2Joint;
var _local8:b2ContactSolver;
var _local9:int;
var _local10:Boolean;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:Number;
var _local15:Number;
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x + (_arg1.dt * (_arg2.x + (_local6.m_invMass * _local6.m_force.x))));
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y + (_arg1.dt * (_arg2.y + (_local6.m_invMass * _local6.m_force.y))));
_local6.m_angularVelocity = (_local6.m_angularVelocity + ((_arg1.dt * _local6.m_invI) * _local6.m_torque));
_local6.m_force.SetZero();
_local6.m_torque = 0;
_local6.m_linearVelocity.Multiply(b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_linearDamping)), 0, 1));
_local6.m_angularVelocity = (_local6.m_angularVelocity * b2Math.b2Clamp((1 - (_arg1.dt * _local6.m_angularDamping)), 0, 1));
if (_local6.m_linearVelocity.LengthSquared() > b2Settings.b2_maxLinearVelocitySquared){
_local6.m_linearVelocity.Normalize();
_local6.m_linearVelocity.x = (_local6.m_linearVelocity.x * b2Settings.b2_maxLinearVelocity);
_local6.m_linearVelocity.y = (_local6.m_linearVelocity.y * b2Settings.b2_maxLinearVelocity);
};
if ((_local6.m_angularVelocity * _local6.m_angularVelocity) > b2Settings.b2_maxAngularVelocitySquared){
if (_local6.m_angularVelocity < 0){
_local6.m_angularVelocity = -(b2Settings.b2_maxAngularVelocity);
} else {
_local6.m_angularVelocity = b2Settings.b2_maxAngularVelocity;
};
};
};
_local5++;
};
_local8 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local8.InitVelocityConstraints(_arg1);
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitVelocityConstraints(_arg1);
_local5++;
};
_local5 = 0;
while (_local5 < _arg1.maxIterations) {
_local8.SolveVelocityConstraints();
_local9 = 0;
while (_local9 < m_jointCount) {
_local7 = m_joints[_local9];
_local7.SolveVelocityConstraints(_arg1);
_local9++;
};
_local5++;
};
_local8.FinalizeVelocityConstraints();
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.IsStatic()){
} else {
_local6.m_sweep.c0.SetV(_local6.m_sweep.c);
_local6.m_sweep.a0 = _local6.m_sweep.a;
_local6.m_sweep.c.x = (_local6.m_sweep.c.x + (_arg1.dt * _local6.m_linearVelocity.x));
_local6.m_sweep.c.y = (_local6.m_sweep.c.y + (_arg1.dt * _local6.m_linearVelocity.y));
_local6.m_sweep.a = (_local6.m_sweep.a + (_arg1.dt * _local6.m_angularVelocity));
_local6.SynchronizeTransform();
};
_local5++;
};
if (_arg3){
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local7.InitPositionConstraints();
_local5++;
};
m_positionIterationCount = 0;
while (m_positionIterationCount < _arg1.maxIterations) {
_local10 = _local8.SolvePositionConstraints(b2Settings.b2_contactBaumgarte);
_local11 = true;
_local5 = 0;
while (_local5 < m_jointCount) {
_local7 = m_joints[_local5];
_local12 = _local7.SolvePositionConstraints();
_local11 = ((_local11) && (_local12));
_local5++;
};
if (((_local10) && (_local11))){
break;
};
m_positionIterationCount++;
};
};
Report(_local8.m_constraints);
if (_arg4){
_local13 = Number.MAX_VALUE;
_local14 = (b2Settings.b2_linearSleepTolerance * b2Settings.b2_linearSleepTolerance);
_local15 = (b2Settings.b2_angularSleepTolerance * b2Settings.b2_angularSleepTolerance);
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
if (_local6.m_invMass == 0){
} else {
if ((_local6.m_flags & b2Body.e_allowSleepFlag) == 0){
_local6.m_sleepTime = 0;
_local13 = 0;
};
if (((((((_local6.m_flags & b2Body.e_allowSleepFlag) == 0)) || (((_local6.m_angularVelocity * _local6.m_angularVelocity) > _local15)))) || ((b2Math.b2Dot(_local6.m_linearVelocity, _local6.m_linearVelocity) > _local14)))){
_local6.m_sleepTime = 0;
_local13 = 0;
} else {
_local6.m_sleepTime = (_local6.m_sleepTime + _arg1.dt);
_local13 = b2Math.b2Min(_local13, _local6.m_sleepTime);
};
};
_local5++;
};
if (_local13 >= b2Settings.b2_timeToSleep){
_local5 = 0;
while (_local5 < m_bodyCount) {
_local6 = m_bodies[_local5];
m_bodies[_local5].m_flags = (_local6.m_flags | b2Body.e_sleepFlag);
_local6.m_linearVelocity.SetZero();
_local6.m_angularVelocity = 0;
_local5++;
};
};
};
}
public function AddContact(_arg1:b2Contact):void{
var _local2 = m_contactCount++;
m_contacts[_local2] = _arg1;
}
public function Clear():void{
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:int;
var _local3:b2ContactSolver;
var _local4:Number;
var _local5:b2Body;
var _local6:Boolean;
_local3 = new b2ContactSolver(_arg1, m_contacts, m_contactCount, m_allocator);
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local3.SolveVelocityConstraints();
_local2++;
};
_local2 = 0;
while (_local2 < m_bodyCount) {
_local5 = m_bodies[_local2];
if (_local5.IsStatic()){
} else {
_local5.m_sweep.c0.SetV(_local5.m_sweep.c);
_local5.m_sweep.a0 = _local5.m_sweep.a;
_local5.m_sweep.c.x = (_local5.m_sweep.c.x + (_arg1.dt * _local5.m_linearVelocity.x));
_local5.m_sweep.c.y = (_local5.m_sweep.c.y + (_arg1.dt * _local5.m_linearVelocity.y));
_local5.m_sweep.a = (_local5.m_sweep.a + (_arg1.dt * _local5.m_angularVelocity));
_local5.SynchronizeTransform();
};
_local2++;
};
_local4 = 0.75;
_local2 = 0;
while (_local2 < _arg1.maxIterations) {
_local6 = _local3.SolvePositionConstraints(_local4);
if (_local6){
break;
};
_local2++;
};
Report(_local3.m_constraints);
}
}
}//package Box2D.Dynamics
Section 117
//b2TimeStep (Box2D.Dynamics.b2TimeStep)
package Box2D.Dynamics {
public class b2TimeStep {
public var warmStarting:Boolean;
public var positionCorrection:Boolean;
public var dt:Number;
public var maxIterations:int;
public var dtRatio:Number;
public var inv_dt:Number;
}
}//package Box2D.Dynamics
Section 118
//b2World (Box2D.Dynamics.b2World)
package Box2D.Dynamics {
import Box2D.Common.Math.*;
import Box2D.Common.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Joints.*;
import Box2D.Collision.Shapes.*;
import Box2D.Dynamics.Contacts.*;
public class b2World {
public var m_inv_dt0:Number;
public var m_boundaryListener:b2BoundaryListener;
public var m_contactList:b2Contact;
public var m_blockAllocator;
public var m_contactListener:b2ContactListener;
public var m_allowSleep:Boolean;
public var m_broadPhase:b2BroadPhase;
public var m_destructionListener:b2DestructionListener;
public var m_jointCount:int;
public var m_bodyCount:int;
public var m_lock:Boolean;
public var m_positionIterationCount:int;
public var m_groundBody:b2Body;
public var m_contactCount:int;
public var m_debugDraw:b2DebugDraw;
public var m_contactFilter:b2ContactFilter;
public var m_bodyList:b2Body;
public var m_stackAllocator;
public var m_jointList:b2Joint;
public var m_gravity:b2Vec2;
public var m_contactManager:b2ContactManager;
private static var s_jointColor:b2Color = new b2Color(0.5, 0.8, 0.8);
public static var m_continuousPhysics:Boolean;
public static var m_warmStarting:Boolean;
private static var s_coreColor:b2Color = new b2Color(0.9, 0.6, 0.6);
public static var m_positionCorrection:Boolean;
private static var s_xf:b2XForm = new b2XForm();
public function b2World(_arg1:b2AABB, _arg2:b2Vec2, _arg3:Boolean){
var _local4:b2BodyDef;
m_contactManager = new b2ContactManager();
super();
m_destructionListener = null;
m_boundaryListener = null;
m_contactFilter = b2ContactFilter.b2_defaultFilter;
m_contactListener = null;
m_debugDraw = null;
m_bodyList = null;
m_contactList = null;
m_jointList = null;
m_bodyCount = 0;
m_contactCount = 0;
m_jointCount = 0;
m_positionCorrection = true;
m_warmStarting = true;
m_continuousPhysics = true;
m_allowSleep = _arg3;
m_gravity = _arg2;
m_lock = false;
m_inv_dt0 = 0;
m_contactManager.m_world = this;
m_broadPhase = new b2BroadPhase(_arg1, m_contactManager);
_local4 = new b2BodyDef();
m_groundBody = CreateBody(_local4);
}
public function DrawJoint(_arg1:b2Joint):void{
var _local2:b2Body;
var _local3:b2Body;
var _local4:b2XForm;
var _local5:b2XForm;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2PulleyJoint;
var _local12:b2Vec2;
var _local13:b2Vec2;
_local2 = _arg1.m_body1;
_local3 = _arg1.m_body2;
_local4 = _local2.m_xf;
_local5 = _local3.m_xf;
_local6 = _local4.position;
_local7 = _local5.position;
_local8 = _arg1.GetAnchor1();
_local9 = _arg1.GetAnchor2();
_local10 = s_jointColor;
switch (_arg1.m_type){
case b2Joint.e_distanceJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
case b2Joint.e_pulleyJoint:
_local11 = (_arg1 as b2PulleyJoint);
_local12 = _local11.GetGroundAnchor1();
_local13 = _local11.GetGroundAnchor2();
m_debugDraw.DrawSegment(_local12, _local8, _local10);
m_debugDraw.DrawSegment(_local13, _local9, _local10);
m_debugDraw.DrawSegment(_local12, _local13, _local10);
break;
case b2Joint.e_mouseJoint:
m_debugDraw.DrawSegment(_local8, _local9, _local10);
break;
default:
if (_local2 != m_groundBody){
m_debugDraw.DrawSegment(_local6, _local8, _local10);
};
m_debugDraw.DrawSegment(_local8, _local9, _local10);
if (_local3 != m_groundBody){
m_debugDraw.DrawSegment(_local7, _local9, _local10);
};
};
}
public function Refilter(_arg1:b2Shape):void{
_arg1.RefilterProxy(m_broadPhase, _arg1.m_body.m_xf);
}
public function SetDebugDraw(_arg1:b2DebugDraw):void{
m_debugDraw = _arg1;
}
public function SetContinuousPhysics(_arg1:Boolean):void{
m_continuousPhysics = _arg1;
}
public function GetProxyCount():int{
return (m_broadPhase.m_proxyCount);
}
public function DrawDebugData():void{
var _local1:uint;
var _local2:int;
var _local3:b2Body;
var _local4:b2Shape;
var _local5:b2Joint;
var _local6:b2BroadPhase;
var _local7:b2Vec2;
var _local8:b2Vec2;
var _local9:b2Vec2;
var _local10:b2Color;
var _local11:b2XForm;
var _local12:b2AABB;
var _local13:b2AABB;
var _local14:Array;
var _local15:Boolean;
var _local16:uint;
var _local17:b2Pair;
var _local18:b2Proxy;
var _local19:b2Proxy;
var _local20:b2Vec2;
var _local21:b2Vec2;
var _local22:b2Proxy;
var _local23:b2PolygonShape;
var _local24:b2OBB;
var _local25:b2Vec2;
var _local26:b2Mat22;
var _local27:b2Vec2;
var _local28:Number;
if (m_debugDraw == null){
return;
};
m_debugDraw.m_sprite.graphics.clear();
_local1 = m_debugDraw.GetFlags();
_local7 = new b2Vec2();
_local8 = new b2Vec2();
_local9 = new b2Vec2();
_local10 = new b2Color(0, 0, 0);
_local12 = new b2AABB();
_local13 = new b2AABB();
_local14 = [new b2Vec2(), new b2Vec2(), new b2Vec2(), new b2Vec2()];
if ((_local1 & b2DebugDraw.e_shapeBit)){
_local15 = ((_local1 & b2DebugDraw.e_coreShapeBit) == b2DebugDraw.e_coreShapeBit);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local3.IsStatic()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.9, 0.5), _local15);
} else {
if (_local3.IsSleeping()){
DrawShape(_local4, _local11, new b2Color(0.5, 0.5, 0.9), _local15);
} else {
DrawShape(_local4, _local11, new b2Color(0.9, 0.9, 0.9), _local15);
};
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_jointBit)){
_local5 = m_jointList;
while (_local5) {
DrawJoint(_local5);
_local5 = _local5.m_next;
};
};
if ((_local1 & b2DebugDraw.e_pairBit)){
_local6 = m_broadPhase;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.9, 0.3);
_local2 = 0;
while (_local2 < b2Pair.b2_tableCapacity) {
_local16 = _local6.m_pairManager.m_hashTable[_local2];
while (_local16 != b2Pair.b2_nullPair) {
_local17 = _local6.m_pairManager.m_pairs[_local16];
_local18 = _local6.m_proxyPool[_local17.proxyId1];
_local19 = _local6.m_proxyPool[_local17.proxyId2];
_local12.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.lowerBounds[0]].value));
_local12.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.lowerBounds[1]].value));
_local12.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local18.upperBounds[0]].value));
_local12.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local18.upperBounds[1]].value));
_local13.lowerBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.lowerBounds[0]].value));
_local13.lowerBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.lowerBounds[1]].value));
_local13.upperBound.x = (_local6.m_worldAABB.lowerBound.x + (_local7.x * _local6.m_bounds[0][_local19.upperBounds[0]].value));
_local13.upperBound.y = (_local6.m_worldAABB.lowerBound.y + (_local7.y * _local6.m_bounds[1][_local19.upperBounds[1]].value));
_local8.x = (0.5 * (_local12.lowerBound.x + _local12.upperBound.x));
_local8.y = (0.5 * (_local12.lowerBound.y + _local12.upperBound.y));
_local9.x = (0.5 * (_local13.lowerBound.x + _local13.upperBound.x));
_local9.y = (0.5 * (_local13.lowerBound.y + _local13.upperBound.y));
m_debugDraw.DrawSegment(_local8, _local9, _local10);
_local16 = _local17.next;
};
_local2++;
};
};
if ((_local1 & b2DebugDraw.e_aabbBit)){
_local6 = m_broadPhase;
_local20 = _local6.m_worldAABB.lowerBound;
_local21 = _local6.m_worldAABB.upperBound;
_local7.Set((1 / _local6.m_quantizationFactor.x), (1 / _local6.m_quantizationFactor.y));
_local10.Set(0.9, 0.3, 0.9);
_local2 = 0;
while (_local2 < b2Settings.b2_maxProxies) {
_local22 = _local6.m_proxyPool[_local2];
if (_local22.IsValid() == false){
} else {
_local12.lowerBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.lowerBounds[0]].value));
_local12.lowerBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.lowerBounds[1]].value));
_local12.upperBound.x = (_local20.x + (_local7.x * _local6.m_bounds[0][_local22.upperBounds[0]].value));
_local12.upperBound.y = (_local20.y + (_local7.y * _local6.m_bounds[1][_local22.upperBounds[1]].value));
_local14[0].Set(_local12.lowerBound.x, _local12.lowerBound.y);
_local14[1].Set(_local12.upperBound.x, _local12.lowerBound.y);
_local14[2].Set(_local12.upperBound.x, _local12.upperBound.y);
_local14[3].Set(_local12.lowerBound.x, _local12.upperBound.y);
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local2++;
};
_local14[0].Set(_local20.x, _local20.y);
_local14[1].Set(_local21.x, _local20.y);
_local14[2].Set(_local21.x, _local21.y);
_local14[3].Set(_local20.x, _local21.y);
m_debugDraw.DrawPolygon(_local14, 4, new b2Color(0.3, 0.9, 0.9));
};
if ((_local1 & b2DebugDraw.e_obbBit)){
_local10.Set(0.5, 0.3, 0.5);
_local3 = m_bodyList;
while (_local3) {
_local11 = _local3.m_xf;
_local4 = _local3.GetShapeList();
while (_local4) {
if (_local4.m_type != b2Shape.e_polygonShape){
} else {
_local23 = (_local4 as b2PolygonShape);
_local24 = _local23.GetOBB();
_local25 = _local24.extents;
_local14[0].Set(-(_local25.x), -(_local25.y));
_local14[1].Set(_local25.x, -(_local25.y));
_local14[2].Set(_local25.x, _local25.y);
_local14[3].Set(-(_local25.x), _local25.y);
_local2 = 0;
while (_local2 < 4) {
_local26 = _local24.R;
_local27 = _local14[_local2];
_local28 = (_local24.center.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local24.center.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local26 = _local11.R;
_local28 = (_local11.position.x + ((_local26.col1.x * _local27.x) + (_local26.col2.x * _local27.y)));
_local14[_local2].y = (_local11.position.y + ((_local26.col1.y * _local27.x) + (_local26.col2.y * _local27.y)));
_local14[_local2].x = _local28;
_local2++;
};
m_debugDraw.DrawPolygon(_local14, 4, _local10);
};
_local4 = _local4.m_next;
};
_local3 = _local3.m_next;
};
};
if ((_local1 & b2DebugDraw.e_centerOfMassBit)){
_local3 = m_bodyList;
while (_local3) {
_local11 = s_xf;
_local11.R = _local3.m_xf.R;
_local11.position = _local3.GetWorldCenter();
m_debugDraw.DrawXForm(_local11);
_local3 = _local3.m_next;
};
};
}
public function DestroyBody(_arg1:b2Body):void{
var _local2:b2JointEdge;
var _local3:b2Shape;
var _local4:b2JointEdge;
var _local5:b2Shape;
if (m_lock == true){
return;
};
_local2 = _arg1.m_jointList;
while (_local2) {
_local4 = _local2;
_local2 = _local2.next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeJoint(_local4.joint);
};
DestroyJoint(_local4.joint);
};
_local3 = _arg1.m_shapeList;
while (_local3) {
_local5 = _local3;
_local3 = _local3.m_next;
if (m_destructionListener){
m_destructionListener.SayGoodbyeShape(_local5);
};
_local5.DestroyProxy(m_broadPhase);
b2Shape.Destroy(_local5, m_blockAllocator);
};
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_bodyList){
m_bodyList = _arg1.m_next;
};
m_bodyCount--;
}
public function SetContactFilter(_arg1:b2ContactFilter):void{
m_contactFilter = _arg1;
}
public function GetGroundBody():b2Body{
return (m_groundBody);
}
public function DrawShape(_arg1:b2Shape, _arg2:b2XForm, _arg3:b2Color, _arg4:Boolean):void{
var _local5:b2Color;
var _local6:b2CircleShape;
var _local7:b2Vec2;
var _local8:Number;
var _local9:b2Vec2;
var _local10:int;
var _local11:b2PolygonShape;
var _local12:int;
var _local13:Array;
var _local14:Array;
var _local15:Array;
_local5 = s_coreColor;
switch (_arg1.m_type){
case b2Shape.e_circleShape:
_local6 = (_arg1 as b2CircleShape);
_local7 = b2Math.b2MulX(_arg2, _local6.m_localPosition);
_local8 = _local6.m_radius;
_local9 = _arg2.R.col1;
m_debugDraw.DrawSolidCircle(_local7, _local8, _local9, _arg3);
if (_arg4){
m_debugDraw.DrawCircle(_local7, (_local8 - b2Settings.b2_toiSlop), _local5);
};
break;
case b2Shape.e_polygonShape:
_local11 = (_arg1 as b2PolygonShape);
_local12 = _local11.GetVertexCount();
_local13 = _local11.GetVertices();
_local14 = new Array(b2Settings.b2_maxPolygonVertices);
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local13[_local10]);
_local10++;
};
m_debugDraw.DrawSolidPolygon(_local14, _local12, _arg3);
if (_arg4){
_local15 = _local11.GetCoreVertices();
_local10 = 0;
while (_local10 < _local12) {
_local14[_local10] = b2Math.b2MulX(_arg2, _local15[_local10]);
_local10++;
};
m_debugDraw.DrawPolygon(_local14, _local12, _local5);
};
break;
};
}
public function GetContactCount():int{
return (m_contactCount);
}
public function Solve(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Island;
var _local4:b2Contact;
var _local5:b2Joint;
var _local6:int;
var _local7:Array;
var _local8:b2Body;
var _local9:int;
var _local10:int;
var _local11:b2Body;
var _local12:b2ContactEdge;
var _local13:b2JointEdge;
var _local14:Boolean;
m_positionIterationCount = 0;
_local3 = new b2Island(m_bodyCount, m_contactCount, m_jointCount, m_stackAllocator, m_contactListener);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2 = _local2.m_next;
};
_local4 = m_contactList;
while (_local4) {
_local4.m_flags = (_local4.m_flags & ~(b2Contact.e_islandFlag));
_local4 = _local4.m_next;
};
_local5 = m_jointList;
while (_local5) {
_local5.m_islandFlag = false;
_local5 = _local5.m_next;
};
_local6 = m_bodyCount;
_local7 = new Array(_local6);
_local8 = m_bodyList;
while (_local8) {
if ((_local8.m_flags & ((b2Body.e_islandFlag | b2Body.e_sleepFlag) | b2Body.e_frozenFlag))){
} else {
if (_local8.IsStatic()){
} else {
_local3.Clear();
_local9 = 0;
var _temp1 = _local9;
_local9 = (_local9 + 1);
var _local15 = _temp1;
_local7[_local15] = _local8;
_local8.m_flags = (_local8.m_flags | b2Body.e_islandFlag);
while (_local9 > 0) {
--_local9;
_local2 = _local7[_local9];
_local3.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local12 = _local2.m_contactList;
while (_local12) {
if ((_local12.contact.m_flags & (b2Contact.e_islandFlag | b2Contact.e_nonSolidFlag))){
} else {
if (_local12.contact.m_manifoldCount == 0){
} else {
_local3.AddContact(_local12.contact);
_local12.contact.m_flags = (_local12.contact.m_flags | b2Contact.e_islandFlag);
_local11 = _local12.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp2 = _local9;
_local9 = (_local9 + 1);
var _local16 = _temp2;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
};
_local12 = _local12.next;
};
_local13 = _local2.m_jointList;
while (_local13) {
if (_local13.joint.m_islandFlag == true){
} else {
_local3.AddJoint(_local13.joint);
_local13.joint.m_islandFlag = true;
_local11 = _local13.other;
if ((_local11.m_flags & b2Body.e_islandFlag)){
} else {
var _temp3 = _local9;
_local9 = (_local9 + 1);
_local16 = _temp3;
_local7[_local16] = _local11;
_local11.m_flags = (_local11.m_flags | b2Body.e_islandFlag);
};
};
_local13 = _local13.next;
};
};
};
_local3.Solve(_arg1, m_gravity, m_positionCorrection, m_allowSleep);
if (_local3.m_positionIterationCount > m_positionIterationCount){
m_positionIterationCount = _local3.m_positionIterationCount;
};
_local10 = 0;
while (_local10 < _local3.m_bodyCount) {
_local2 = _local3.m_bodies[_local10];
if (_local2.IsStatic()){
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
};
_local10++;
};
};
};
_local8 = _local8.m_next;
};
_local2 = m_bodyList;
while (_local2) {
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local14 = _local2.SynchronizeShapes();
if ((((_local14 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
};
};
_local2 = _local2.m_next;
};
m_broadPhase.Commit();
}
public function Query(_arg1:b2AABB, _arg2:Array, _arg3:int):int{
var _local4:Array;
var _local5:int;
var _local6:int;
_local4 = new Array(_arg3);
_local5 = m_broadPhase.QueryAABB(_arg1, _local4, _arg3);
_local6 = 0;
while (_local6 < _local5) {
_arg2[_local6] = _local4[_local6];
_local6++;
};
return (_local5);
}
public function SetGravity(_arg1:b2Vec2):void{
m_gravity = _arg1;
}
public function SolveTOI(_arg1:b2TimeStep):void{
var _local2:b2Body;
var _local3:b2Shape;
var _local4:b2Shape;
var _local5:b2Body;
var _local6:b2Body;
var _local7:b2ContactEdge;
var _local8:b2Island;
var _local9:int;
var _local10:Array;
var _local11:b2Contact;
var _local12:b2Contact;
var _local13:Number;
var _local14:b2Body;
var _local15:int;
var _local16:b2TimeStep;
var _local17:int;
var _local18:Number;
var _local19:Number;
var _local20:b2Body;
var _local21:Boolean;
_local8 = new b2Island(m_bodyCount, b2Settings.b2_maxTOIContactsPerIsland, 0, m_stackAllocator, m_contactListener);
_local9 = m_bodyCount;
_local10 = new Array(_local9);
_local2 = m_bodyList;
while (_local2) {
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
_local2.m_sweep.t0 = 0;
_local2 = _local2.m_next;
};
_local11 = m_contactList;
while (_local11) {
_local11.m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local11 = _local11.m_next;
};
while (true) {
_local12 = null;
_local13 = 1;
_local11 = m_contactList;
for (;_local11;(_local11 = _local11.m_next)) {
if ((_local11.m_flags & (b2Contact.e_slowFlag | b2Contact.e_nonSolidFlag))){
} else {
_local18 = 1;
if ((_local11.m_flags & b2Contact.e_toiFlag)){
_local18 = _local11.m_toi;
} else {
_local3 = _local11.m_shape1;
_local4 = _local11.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
if (((((_local5.IsStatic()) || (_local5.IsSleeping()))) && (((_local6.IsStatic()) || (_local6.IsSleeping()))))){
continue;
};
_local19 = _local5.m_sweep.t0;
if (_local5.m_sweep.t0 < _local6.m_sweep.t0){
_local19 = _local6.m_sweep.t0;
_local5.m_sweep.Advance(_local19);
} else {
if (_local6.m_sweep.t0 < _local5.m_sweep.t0){
_local19 = _local5.m_sweep.t0;
_local6.m_sweep.Advance(_local19);
};
};
_local18 = b2TimeOfImpact.TimeOfImpact(_local11.m_shape1, _local5.m_sweep, _local11.m_shape2, _local6.m_sweep);
if ((((_local18 > 0)) && ((_local18 < 1)))){
_local18 = (((1 - _local18) * _local19) + _local18);
if (_local18 > 1){
_local18 = 1;
};
};
_local11.m_toi = _local18;
_local11.m_flags = (_local11.m_flags | b2Contact.e_toiFlag);
};
if ((((Number.MIN_VALUE < _local18)) && ((_local18 < _local13)))){
_local12 = _local11;
_local13 = _local18;
};
};
};
if ((((_local12 == null)) || (((1 - (100 * Number.MIN_VALUE)) < _local13)))){
break;
};
_local3 = _local12.m_shape1;
_local4 = _local12.m_shape2;
_local5 = _local3.m_body;
_local6 = _local4.m_body;
_local5.Advance(_local13);
_local6.Advance(_local13);
_local12.Update(m_contactListener);
_local12.m_flags = (_local12.m_flags & ~(b2Contact.e_toiFlag));
if (_local12.m_manifoldCount == 0){
} else {
_local14 = _local5;
if (_local14.IsStatic()){
_local14 = _local6;
};
_local8.Clear();
_local15 = 0;
var _temp1 = _local15;
_local15 = (_local15 + 1);
var _local22 = _temp1;
_local10[_local22] = _local14;
_local14.m_flags = (_local14.m_flags | b2Body.e_islandFlag);
while (_local15 > 0) {
--_local15;
_local2 = _local10[_local15];
_local8.AddBody(_local2);
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_sleepFlag));
if (_local2.IsStatic()){
} else {
_local7 = _local2.m_contactList;
while (_local7) {
if (_local8.m_contactCount == _local8.m_contactCapacity){
} else {
if ((_local7.contact.m_flags & ((b2Contact.e_islandFlag | b2Contact.e_slowFlag) | b2Contact.e_nonSolidFlag))){
} else {
if (_local7.contact.m_manifoldCount == 0){
} else {
_local8.AddContact(_local7.contact);
_local7.contact.m_flags = (_local7.contact.m_flags | b2Contact.e_islandFlag);
_local20 = _local7.other;
if ((_local20.m_flags & b2Body.e_islandFlag)){
} else {
if (_local20.IsStatic() == false){
_local20.Advance(_local13);
_local20.WakeUp();
};
var _temp2 = _local15;
_local15 = (_local15 + 1);
var _local23 = _temp2;
_local10[_local23] = _local20;
_local20.m_flags = (_local20.m_flags | b2Body.e_islandFlag);
};
};
};
};
_local7 = _local7.next;
};
};
};
_local16 = new b2TimeStep();
_local16.dt = ((1 - _local13) * _arg1.dt);
_local16.inv_dt = (1 / _local16.dt);
_local16.maxIterations = _arg1.maxIterations;
_local8.SolveTOI(_local16);
_local17 = 0;
while (_local17 < _local8.m_bodyCount) {
_local2 = _local8.m_bodies[_local17];
_local2.m_flags = (_local2.m_flags & ~(b2Body.e_islandFlag));
if ((_local2.m_flags & (b2Body.e_sleepFlag | b2Body.e_frozenFlag))){
} else {
if (_local2.IsStatic()){
} else {
_local21 = _local2.SynchronizeShapes();
if ((((_local21 == false)) && (!((m_boundaryListener == null))))){
m_boundaryListener.Violation(_local2);
};
_local7 = _local2.m_contactList;
while (_local7) {
_local7.contact.m_flags = (_local7.contact.m_flags & ~(b2Contact.e_toiFlag));
_local7 = _local7.next;
};
};
};
_local17++;
};
_local17 = 0;
while (_local17 < _local8.m_contactCount) {
_local11 = _local8.m_contacts[_local17];
_local8.m_contacts[_local17].m_flags = (_local11.m_flags & ~((b2Contact.e_toiFlag | b2Contact.e_islandFlag)));
_local17++;
};
m_broadPhase.Commit();
};
};
}
public function GetJointList():b2Joint{
return (m_jointList);
}
public function Validate():void{
m_broadPhase.Validate();
}
public function GetPairCount():int{
return (m_broadPhase.m_pairManager.m_pairCount);
}
public function GetBodyList():b2Body{
return (m_bodyList);
}
public function SetWarmStarting(_arg1:Boolean):void{
m_warmStarting = _arg1;
}
public function SetPositionCorrection(_arg1:Boolean):void{
m_positionCorrection = _arg1;
}
public function CreateJoint(_arg1:b2JointDef):b2Joint{
var _local2:b2Joint;
var _local3:b2Body;
var _local4:b2Shape;
_local2 = b2Joint.Create(_arg1, m_blockAllocator);
_local2.m_prev = null;
_local2.m_next = m_jointList;
if (m_jointList){
m_jointList.m_prev = _local2;
};
m_jointList = _local2;
m_jointCount++;
_local2.m_node1.joint = _local2;
_local2.m_node1.other = _local2.m_body2;
_local2.m_node1.prev = null;
_local2.m_node1.next = _local2.m_body1.m_jointList;
if (_local2.m_body1.m_jointList){
_local2.m_body1.m_jointList.prev = _local2.m_node1;
};
_local2.m_body1.m_jointList = _local2.m_node1;
_local2.m_node2.joint = _local2;
_local2.m_node2.other = _local2.m_body1;
_local2.m_node2.prev = null;
_local2.m_node2.next = _local2.m_body2.m_jointList;
if (_local2.m_body2.m_jointList){
_local2.m_body2.m_jointList.prev = _local2.m_node2;
};
_local2.m_body2.m_jointList = _local2.m_node2;
if (_arg1.collideConnected == false){
_local3 = ((_arg1.body1.m_shapeCount < _arg1.body2.m_shapeCount)) ? _arg1.body1 : _arg1.body2;
_local4 = _local3.m_shapeList;
while (_local4) {
_local4.RefilterProxy(m_broadPhase, _local3.m_xf);
_local4 = _local4.m_next;
};
};
return (_local2);
}
public function DestroyJoint(_arg1:b2Joint):void{
var _local2:Boolean;
var _local3:b2Body;
var _local4:b2Body;
var _local5:b2Body;
var _local6:b2Shape;
_local2 = _arg1.m_collideConnected;
if (_arg1.m_prev){
_arg1.m_prev.m_next = _arg1.m_next;
};
if (_arg1.m_next){
_arg1.m_next.m_prev = _arg1.m_prev;
};
if (_arg1 == m_jointList){
m_jointList = _arg1.m_next;
};
_local3 = _arg1.m_body1;
_local4 = _arg1.m_body2;
_local3.WakeUp();
_local4.WakeUp();
if (_arg1.m_node1.prev){
_arg1.m_node1.prev.next = _arg1.m_node1.next;
};
if (_arg1.m_node1.next){
_arg1.m_node1.next.prev = _arg1.m_node1.prev;
};
if (_arg1.m_node1 == _local3.m_jointList){
_local3.m_jointList = _arg1.m_node1.next;
};
_arg1.m_node1.prev = null;
_arg1.m_node1.next = null;
if (_arg1.m_node2.prev){
_arg1.m_node2.prev.next = _arg1.m_node2.next;
};
if (_arg1.m_node2.next){
_arg1.m_node2.next.prev = _arg1.m_node2.prev;
};
if (_arg1.m_node2 == _local4.m_jointList){
_local4.m_jointList = _arg1.m_node2.next;
};
_arg1.m_node2.prev = null;
_arg1.m_node2.next = null;
b2Joint.Destroy(_arg1, m_blockAllocator);
m_jointCount--;
if (_local2 == false){
_local5 = ((_local3.m_shapeCount < _local4.m_shapeCount)) ? _local3 : _local4;
_local6 = _local5.m_shapeList;
while (_local6) {
_local6.RefilterProxy(m_broadPhase, _local5.m_xf);
_local6 = _local6.m_next;
};
};
}
public function SetContactListener(_arg1:b2ContactListener):void{
m_contactListener = _arg1;
}
public function CreateBody(_arg1:b2BodyDef):b2Body{
var _local2:b2Body;
if (m_lock == true){
return (null);
};
_local2 = new b2Body(_arg1, this);
_local2.m_prev = null;
_local2.m_next = m_bodyList;
if (m_bodyList){
m_bodyList.m_prev = _local2;
};
m_bodyList = _local2;
m_bodyCount++;
return (_local2);
}
public function SetBoundaryListener(_arg1:b2BoundaryListener):void{
m_boundaryListener = _arg1;
}
public function SetDestructionListener(_arg1:b2DestructionListener):void{
m_destructionListener = _arg1;
}
public function Step(_arg1:Number, _arg2:int):void{
var _local3:b2TimeStep;
m_lock = true;
_local3 = new b2TimeStep();
_local3.dt = _arg1;
_local3.maxIterations = _arg2;
if (_arg1 > 0){
_local3.inv_dt = (1 / _arg1);
} else {
_local3.inv_dt = 0;
};
_local3.dtRatio = (m_inv_dt0 * _arg1);
_local3.positionCorrection = m_positionCorrection;
_local3.warmStarting = m_warmStarting;
m_contactManager.Collide();
if (_local3.dt > 0){
Solve(_local3);
};
if (((m_continuousPhysics) && ((_local3.dt > 0)))){
SolveTOI(_local3);
};
DrawDebugData();
m_inv_dt0 = _local3.inv_dt;
m_lock = false;
}
public function GetBodyCount():int{
return (m_bodyCount);
}
public function GetJointCount():int{
return (m_jointCount);
}
}
}//package Box2D.Dynamics
Section 119
//DrawSine (com.midasplayer.extras.DrawSine)
package com.midasplayer.extras {
import flash.display.*;
public class DrawSine extends MovieClip {
private var target_mc:MovieClip;
private var my_height:Number;
private var steps:Number;
private var stroke_weight:Number;// = 1
private var fill_height:Number;
private var my_width:Number;
private var fill_color:Number;// = 0xFF0000
private var fill_alpha:Number;
private var draw_fill:Boolean;// = false
private var stroke_color:Number;// = 0
private var step_x:Number;
private var draw_array;
public function DrawSine(_arg1:MovieClip, _arg2:Number, _arg3:Number, _arg4:Number){
var _local5:*;
stroke_color = 0;
draw_fill = false;
stroke_weight = 1;
fill_color = 0xFF0000;
this.draw_array = new Array();
super();
this.target_mc = _arg1;
this.my_width = _arg2;
this.my_height = _arg3;
this.steps = _arg4;
this.step_x = (_arg2 / this.steps);
_local5 = 0;
while (_local5 < this.steps) {
this.draw_array.push({x:(this.step_x * _local5), y:0});
_local5++;
};
}
public function set_fill(_arg1:Boolean, _arg2:Number, _arg3:Number):void{
this.draw_fill = _arg1;
this.fill_color = (this.stroke_color = _arg2);
this.fill_alpha = _arg3;
}
public function set_stroke(_arg1:Number, _arg2:Number):void{
this.stroke_weight = _arg1;
this.stroke_color = _arg2;
}
public function draw_waves(_arg1:Array):void{
var _local2:*;
var _local3:*;
var _local4:*;
var _local5:*;
var _local6:*;
var _local7:*;
var _local8:*;
var _local9:*;
_local6 = this.draw_array.length;
_local7 = _arg1.length;
_local8 = 0;
while (_local8 < _local7) {
_local2 = (((_arg1[_local8].cycles * Math.PI) * 2) / this.steps);
_local3 = 0;
while (_local3 < _local6) {
if (_local8 == 0){
this.draw_array[_local3].y = (Math.sin((_arg1[_local8].phase + (_local2 * _local3))) * _arg1[_local8].radius);
} else {
this.draw_array[_local3].y = (this.draw_array[_local3].y + (Math.sin((_arg1[_local8].phase + (_local2 * _local3))) * _arg1[_local8].radius));
};
_local3++;
};
_local8++;
};
this.target_mc.graphics.clear();
if (this.stroke_weight > 0){
this.target_mc.graphics.lineStyle(this.stroke_weight, this.stroke_color);
};
if (this.draw_fill){
this.target_mc.graphics.beginFill(this.fill_color, this.fill_alpha);
};
this.target_mc.graphics.moveTo(this.draw_array[0].x, this.draw_array[0].y);
_local9 = 1;
while (_local9 < _local6) {
_local4 = this.draw_array[_local9].x;
_local5 = this.draw_array[_local9].y;
this.target_mc.graphics.lineTo(_local4, _local5);
_local9++;
};
if (this.draw_fill){
this.target_mc.graphics.lineTo(_local4, (this.my_height / 2));
this.target_mc.graphics.lineTo(0, (this.my_height / 2));
this.target_mc.graphics.lineTo(0, this.draw_array[0].y);
this.target_mc.graphics.endFill();
};
}
}
}//package com.midasplayer.extras
Section 120
//md5 (com.midasplayer.extras.md5)
package com.midasplayer.extras {
public class md5 {
public static const HEX_FORMAT_LOWERCASE:uint = 0;
public static const BASE64_PAD_CHARACTER_DEFAULT_COMPLIANCE:String = "";
public static const HEX_FORMAT_UPPERCASE:uint = 1;
public static const BASE64_PAD_CHARACTER_RFC_COMPLIANCE:String = "=";
public static var hexcase:uint = 0;
public static var b64pad:String = "";
public static function md5_gg(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg4) | (_arg3 & ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function md5_cmn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number):Number{
return (safe_add(bit_rol(safe_add(safe_add(_arg2, _arg1), safe_add(_arg4, _arg6)), _arg5), _arg3));
}
public static function binl_md5(_arg1:Array, _arg2:Number):Array{
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;
_arg1[(_arg2 >> 5)] = (_arg1[(_arg2 >> 5)] | (128 << (_arg2 % 32)));
_arg1[((((_arg2 + 64) >>> 9) << 4) + 14)] = _arg2;
_local7 = 1732584193;
_local8 = -271733879;
_local9 = -1732584194;
_local10 = 271733878;
_local11 = 0;
while (_local11 < _arg1.length) {
_local3 = _local7;
_local4 = _local8;
_local5 = _local9;
_local6 = _local10;
_local7 = md5_ff(_local7, _local8, _local9, _local10, _arg1[(_local11 + 0)], 7, -680876936);
_local10 = md5_ff(_local10, _local7, _local8, _local9, _arg1[(_local11 + 1)], 12, -389564586);
_local9 = md5_ff(_local9, _local10, _local7, _local8, _arg1[(_local11 + 2)], 17, 606105819);
_local8 = md5_ff(_local8, _local9, _local10, _local7, _arg1[(_local11 + 3)], 22, -1044525330);
_local7 = md5_ff(_local7, _local8, _local9, _local10, _arg1[(_local11 + 4)], 7, -176418897);
_local10 = md5_ff(_local10, _local7, _local8, _local9, _arg1[(_local11 + 5)], 12, 1200080426);
_local9 = md5_ff(_local9, _local10, _local7, _local8, _arg1[(_local11 + 6)], 17, -1473231341);
_local8 = md5_ff(_local8, _local9, _local10, _local7, _arg1[(_local11 + 7)], 22, -45705983);
_local7 = md5_ff(_local7, _local8, _local9, _local10, _arg1[(_local11 + 8)], 7, 1770035416);
_local10 = md5_ff(_local10, _local7, _local8, _local9, _arg1[(_local11 + 9)], 12, -1958414417);
_local9 = md5_ff(_local9, _local10, _local7, _local8, _arg1[(_local11 + 10)], 17, -42063);
_local8 = md5_ff(_local8, _local9, _local10, _local7, _arg1[(_local11 + 11)], 22, -1990404162);
_local7 = md5_ff(_local7, _local8, _local9, _local10, _arg1[(_local11 + 12)], 7, 1804603682);
_local10 = md5_ff(_local10, _local7, _local8, _local9, _arg1[(_local11 + 13)], 12, -40341101);
_local9 = md5_ff(_local9, _local10, _local7, _local8, _arg1[(_local11 + 14)], 17, -1502002290);
_local8 = md5_ff(_local8, _local9, _local10, _local7, _arg1[(_local11 + 15)], 22, 1236535329);
_local7 = md5_gg(_local7, _local8, _local9, _local10, _arg1[(_local11 + 1)], 5, -165796510);
_local10 = md5_gg(_local10, _local7, _local8, _local9, _arg1[(_local11 + 6)], 9, -1069501632);
_local9 = md5_gg(_local9, _local10, _local7, _local8, _arg1[(_local11 + 11)], 14, 643717713);
_local8 = md5_gg(_local8, _local9, _local10, _local7, _arg1[(_local11 + 0)], 20, -373897302);
_local7 = md5_gg(_local7, _local8, _local9, _local10, _arg1[(_local11 + 5)], 5, -701558691);
_local10 = md5_gg(_local10, _local7, _local8, _local9, _arg1[(_local11 + 10)], 9, 38016083);
_local9 = md5_gg(_local9, _local10, _local7, _local8, _arg1[(_local11 + 15)], 14, -660478335);
_local8 = md5_gg(_local8, _local9, _local10, _local7, _arg1[(_local11 + 4)], 20, -405537848);
_local7 = md5_gg(_local7, _local8, _local9, _local10, _arg1[(_local11 + 9)], 5, 568446438);
_local10 = md5_gg(_local10, _local7, _local8, _local9, _arg1[(_local11 + 14)], 9, -1019803690);
_local9 = md5_gg(_local9, _local10, _local7, _local8, _arg1[(_local11 + 3)], 14, -187363961);
_local8 = md5_gg(_local8, _local9, _local10, _local7, _arg1[(_local11 + 8)], 20, 1163531501);
_local7 = md5_gg(_local7, _local8, _local9, _local10, _arg1[(_local11 + 13)], 5, -1444681467);
_local10 = md5_gg(_local10, _local7, _local8, _local9, _arg1[(_local11 + 2)], 9, -51403784);
_local9 = md5_gg(_local9, _local10, _local7, _local8, _arg1[(_local11 + 7)], 14, 1735328473);
_local8 = md5_gg(_local8, _local9, _local10, _local7, _arg1[(_local11 + 12)], 20, -1926607734);
_local7 = md5_hh(_local7, _local8, _local9, _local10, _arg1[(_local11 + 5)], 4, -378558);
_local10 = md5_hh(_local10, _local7, _local8, _local9, _arg1[(_local11 + 8)], 11, -2022574463);
_local9 = md5_hh(_local9, _local10, _local7, _local8, _arg1[(_local11 + 11)], 16, 1839030562);
_local8 = md5_hh(_local8, _local9, _local10, _local7, _arg1[(_local11 + 14)], 23, -35309556);
_local7 = md5_hh(_local7, _local8, _local9, _local10, _arg1[(_local11 + 1)], 4, -1530992060);
_local10 = md5_hh(_local10, _local7, _local8, _local9, _arg1[(_local11 + 4)], 11, 1272893353);
_local9 = md5_hh(_local9, _local10, _local7, _local8, _arg1[(_local11 + 7)], 16, -155497632);
_local8 = md5_hh(_local8, _local9, _local10, _local7, _arg1[(_local11 + 10)], 23, -1094730640);
_local7 = md5_hh(_local7, _local8, _local9, _local10, _arg1[(_local11 + 13)], 4, 681279174);
_local10 = md5_hh(_local10, _local7, _local8, _local9, _arg1[(_local11 + 0)], 11, -358537222);
_local9 = md5_hh(_local9, _local10, _local7, _local8, _arg1[(_local11 + 3)], 16, -722521979);
_local8 = md5_hh(_local8, _local9, _local10, _local7, _arg1[(_local11 + 6)], 23, 76029189);
_local7 = md5_hh(_local7, _local8, _local9, _local10, _arg1[(_local11 + 9)], 4, -640364487);
_local10 = md5_hh(_local10, _local7, _local8, _local9, _arg1[(_local11 + 12)], 11, -421815835);
_local9 = md5_hh(_local9, _local10, _local7, _local8, _arg1[(_local11 + 15)], 16, 530742520);
_local8 = md5_hh(_local8, _local9, _local10, _local7, _arg1[(_local11 + 2)], 23, -995338651);
_local7 = md5_ii(_local7, _local8, _local9, _local10, _arg1[(_local11 + 0)], 6, -198630844);
_local10 = md5_ii(_local10, _local7, _local8, _local9, _arg1[(_local11 + 7)], 10, 1126891415);
_local9 = md5_ii(_local9, _local10, _local7, _local8, _arg1[(_local11 + 14)], 15, -1416354905);
_local8 = md5_ii(_local8, _local9, _local10, _local7, _arg1[(_local11 + 5)], 21, -57434055);
_local7 = md5_ii(_local7, _local8, _local9, _local10, _arg1[(_local11 + 12)], 6, 1700485571);
_local10 = md5_ii(_local10, _local7, _local8, _local9, _arg1[(_local11 + 3)], 10, -1894986606);
_local9 = md5_ii(_local9, _local10, _local7, _local8, _arg1[(_local11 + 10)], 15, -1051523);
_local8 = md5_ii(_local8, _local9, _local10, _local7, _arg1[(_local11 + 1)], 21, -2054922799);
_local7 = md5_ii(_local7, _local8, _local9, _local10, _arg1[(_local11 + 8)], 6, 1873313359);
_local10 = md5_ii(_local10, _local7, _local8, _local9, _arg1[(_local11 + 15)], 10, -30611744);
_local9 = md5_ii(_local9, _local10, _local7, _local8, _arg1[(_local11 + 6)], 15, -1560198380);
_local8 = md5_ii(_local8, _local9, _local10, _local7, _arg1[(_local11 + 13)], 21, 1309151649);
_local7 = md5_ii(_local7, _local8, _local9, _local10, _arg1[(_local11 + 4)], 6, -145523070);
_local10 = md5_ii(_local10, _local7, _local8, _local9, _arg1[(_local11 + 11)], 10, -1120210379);
_local9 = md5_ii(_local9, _local10, _local7, _local8, _arg1[(_local11 + 2)], 15, 718787259);
_local8 = md5_ii(_local8, _local9, _local10, _local7, _arg1[(_local11 + 9)], 21, -343485551);
_local7 = safe_add(_local7, _local3);
_local8 = safe_add(_local8, _local4);
_local9 = safe_add(_local9, _local5);
_local10 = safe_add(_local10, _local6);
_local11 = (_local11 + 16);
};
return ([_local7, _local8, _local9, _local10]);
}
public static function md5_ii(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn((_arg3 ^ (_arg2 | ~(_arg4))), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function hex_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2hex(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function binl2rstr(_arg1:Array):String{
var _local2:*;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < (_arg1.length * 32)) {
_local2 = (_local2 + String.fromCharCode(((_arg1[(_local3 >> 5)] >>> (_local3 % 32)) & 0xFF)));
_local3 = (_local3 + 8);
};
return (_local2);
}
public static function rstr2binl(_arg1:String):Array{
var _local2:Number;
var _local3:Array;
_local2 = 0;
_local3 = new Array((_arg1.length >> 2));
_local2 = 0;
while (_local2 < _local3.length) {
_local3[_local2] = 0;
_local2++;
};
_local2 = 0;
while (_local2 < (_arg1.length * 8)) {
_local3[(_local2 >> 5)] = (_local3[(_local2 >> 5)] | ((_arg1.charCodeAt((_local2 / 8)) & 0xFF) << (_local2 % 32)));
_local2 = (_local2 + 8);
};
return (_local3);
}
public static function md5_vm_test():Boolean{
return ((hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72"));
}
public static function b64_md5(_arg1:String):String{
return (rstr2b64(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function any_hmac_md5(_arg1:String, _arg2:String, _arg3:String):String{
return (rstr2any(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2)), _arg3));
}
public static function md5_ff(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 & _arg3) | (~(_arg2) & _arg4)), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function bit_rol(_arg1:Number, _arg2:Number):Number{
return (((_arg1 << _arg2) | (_arg1 >>> (32 - _arg2))));
}
public static function encrypt(_arg1:String):String{
return (hex_md5(_arg1));
}
public static function md5_hh(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
return (md5_cmn(((_arg2 ^ _arg3) ^ _arg4), _arg1, _arg2, _arg5, _arg6, _arg7));
}
public static function hex_md5(_arg1:String):String{
return (rstr2hex(rstr_md5(str2rstr_utf8(_arg1))));
}
public static function b64_hmac_md5(_arg1:String, _arg2:String):String{
return (rstr2b64(rstr_hmac_md5(str2rstr_utf8(_arg1), str2rstr_utf8(_arg2))));
}
public static function str2rstr_utf16le(_arg1:String):String{
var _local2:*;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode((_arg1.charCodeAt(_local3) & 0xFF), ((_arg1.charCodeAt(_local3) >>> 8) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2hex(_arg1:String):String{
var _local2:Number;
var _local3:String;
var _local4:*;
var _local5:Number;
_local3 = (hexcase) ? "0123456789ABCDEF" : "0123456789abcdef";
_local4 = "";
_local5 = 0;
while (_local5 < _arg1.length) {
_local2 = _arg1.charCodeAt(_local5);
_local4 = (_local4 + (_local3.charAt(((_local2 >>> 4) & 15)) + _local3.charAt((_local2 & 15))));
_local5++;
};
return (_local4);
}
public static function str2rstr_utf8(_arg1:String):String{
var _local2:Number;
var _local3:Number;
var _local4:*;
var _local5:Number;
_local4 = "";
_local5 = -1;
while (++_local5 < _arg1.length) {
_local2 = _arg1.charCodeAt(_local5);
_local3 = (((_local5 + 1) < _arg1.length)) ? _arg1.charCodeAt((_local5 + 1)) : 0;
if ((((((((0xD800 <= _local2)) && ((_local2 <= 56319)))) && ((0xDC00 <= _local3)))) && ((_local3 <= 57343)))){
_local2 = ((65536 + ((_local2 & 1023) << 10)) + (_local3 & 1023));
_local5++;
};
if (_local2 <= 127){
_local4 = (_local4 + String.fromCharCode(_local2));
} else {
if (_local2 <= 2047){
_local4 = (_local4 + String.fromCharCode((192 | ((_local2 >>> 6) & 31)), (128 | (_local2 & 63))));
} else {
if (_local2 <= 0xFFFF){
_local4 = (_local4 + String.fromCharCode((224 | ((_local2 >>> 12) & 15)), (128 | ((_local2 >>> 6) & 63)), (128 | (_local2 & 63))));
} else {
if (_local2 <= 2097151){
_local4 = (_local4 + String.fromCharCode((240 | ((_local2 >>> 18) & 7)), (128 | ((_local2 >>> 12) & 63)), (128 | ((_local2 >>> 6) & 63)), (128 | (_local2 & 63))));
};
};
};
};
};
return (_local4);
}
public static function any_md5(_arg1:String, _arg2:String):String{
return (rstr2any(rstr_md5(str2rstr_utf8(_arg1)), _arg2));
}
public static function rstr2b64(_arg1:String):String{
var _local2:Number;
var _local3:Number;
var _local4:*;
var _local5:*;
var _local6:Number;
var _local7:Number;
_local4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
_local5 = "";
_local6 = _arg1.length;
_local7 = 0;
while (_local7 < _local6) {
_local2 = (((((_arg1.charCodeAt(_local7) << 16) | ((_local7 + 1) < _local6))) ? (_arg1.charCodeAt((_local7 + 1)) << 8) : 0 | ((_local7 + 2) < _local6))) ? _arg1.charCodeAt((_local7 + 2)) : 0;
_local3 = 0;
while (_local3 < 4) {
if (((_local7 * 8) + (_local3 * 6)) > (_arg1.length * 8)){
_local5 = (_local5 + b64pad);
} else {
_local5 = (_local5 + _local4.charAt(((_local2 >>> (6 * (3 - _local3))) & 63)));
};
_local3++;
};
_local7 = (_local7 + 3);
};
return (_local5);
}
public static function rstr_hmac_md5(_arg1:String, _arg2:String):String{
var _local3:Array;
var _local4:Array;
var _local5:Array;
var _local6:Number;
var _local7:Array;
_local3 = rstr2binl(_arg1);
if (_local3.length > 16){
_local3 = binl_md5(_local3, (_arg1.length * 8));
};
_local4 = new Array(16);
_local5 = new Array(16);
_local6 = 0;
while (_local6 < 16) {
_local4[_local6] = (_local3[_local6] ^ 909522486);
_local5[_local6] = (_local3[_local6] ^ 1549556828);
_local6++;
};
_local7 = binl_md5(_local4.concat(rstr2binl(_arg2)), (0x0200 + (_arg2.length * 8)));
return (binl2rstr(binl_md5(_local5.concat(_local7), (0x0200 + 128))));
}
public static function safe_add(_arg1:Number, _arg2:Number):Number{
var _local3:Number;
var _local4:Number;
_local3 = ((_arg1 & 0xFFFF) + (_arg2 & 0xFFFF));
_local4 = (((_arg1 >> 16) + (_arg2 >> 16)) + (_local3 >> 16));
return (((_local4 << 16) | (_local3 & 0xFFFF)));
}
public static function str2rstr_utf16be(_arg1:String):String{
var _local2:*;
var _local3:Number;
_local2 = "";
_local3 = 0;
while (_local3 < _arg1.length) {
_local2 = (_local2 + String.fromCharCode(((_arg1.charCodeAt(_local3) >>> 8) & 0xFF), (_arg1.charCodeAt(_local3) & 0xFF)));
_local3++;
};
return (_local2);
}
public static function rstr2any(_arg1:String, _arg2:String):String{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Array;
var _local7:Number;
var _local8:Array;
var _local9:Array;
var _local10:*;
_local7 = _arg2.length;
_local8 = [];
_local9 = ((_arg1.length / 2) as Array);
_local3 = 0;
while (_local3 < _local9.length) {
_local9[_local3] = ((_arg1.charCodeAt((_local3 * 2)) << 8) | _arg1.charCodeAt(((_local3 * 2) + 1)));
_local3++;
};
while (_local9.length > 0) {
_local6 = [];
_local5 = 0;
_local3 = 0;
while (_local3 < _local9.length) {
_local5 = ((_local5 << 16) + _local9[_local3]);
_local4 = Math.floor((_local5 / _local7));
_local5 = (_local5 - (_local4 * _local7));
if ((((_local6.length > 0)) || ((_local4 > 0)))){
_local6[_local6.length] = _local4;
};
_local3++;
};
_local8[_local8.length] = _local5;
_local9 = _local6;
};
_local10 = "";
_local3 = (_local8.length - 1);
while (_local3 >= 0) {
_local10 = (_local10 + _arg2.charAt(_local8[_local3]));
_local3--;
};
return (_local10);
}
public static function rstr_md5(_arg1:String):String{
return (binl2rstr(binl_md5(rstr2binl(_arg1), (_arg1.length * 8))));
}
}
}//package com.midasplayer.extras
Section 121
//SimpleParticle (com.midasplayer.extras.SimpleParticle)
package com.midasplayer.extras {
import flash.display.*;
public dynamic class SimpleParticle extends Shape {
private var _color:Number;// = 0
private var _type:String;// = "rect"
private var _size:Number;// = 1
public static var RECT:String = "rect";
public static var CIRCLE:String = "circle";
public function SimpleParticle(){
_color = 0;
_size = 1;
_type = "rect";
super();
}
public function set size(_arg1:Number){
this._size = _arg1;
this.draw();
}
public function get size():Number{
return (this._size);
}
public function set type(_arg1:String){
this._type = _arg1;
this.draw();
}
public function get type():String{
return (this._type);
}
private function draw(){
this.clear();
graphics.beginFill(this._color, 1);
switch (this.type){
case RECT:
graphics.drawRect((-(this.size) / 2), (-(this.size) / 2), this.size, this.size);
break;
case CIRCLE:
graphics.drawCircle((-(this.size) / 2), (-(this.size) / 2), this.size);
break;
};
graphics.endFill();
}
public function get color():Number{
return (this._color);
}
public function clear(){
graphics.clear();
}
public function set color(_arg1:Number){
this._color = _arg1;
this.draw();
}
}
}//package com.midasplayer.extras
Section 122
//SineWave (com.midasplayer.extras.SineWave)
package com.midasplayer.extras {
public class SineWave {
private var my_cycles:Number;
private var my_radius:Number;
private var my_phase:Number;
private var my_inc:Number;
public function SineWave(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
this.my_phase = _arg1;
this.my_cycles = _arg2;
this.my_radius = _arg3;
this.my_inc = _arg4;
}
public function set radius(_arg1:Number):void{
this.my_radius = _arg1;
}
public function get cycles():Number{
return (this.my_cycles);
}
public function get radius():Number{
return (this.my_radius);
}
public function set cycles(_arg1:Number):void{
this.my_cycles = _arg1;
}
public function get phase():Number{
return (this.my_phase);
}
public function set inc(_arg1:Number):void{
this.my_inc = _arg1;
}
public function set phase(_arg1:Number):void{
this.my_phase = _arg1;
}
public function get inc():Number{
return (this.my_inc);
}
}
}//package com.midasplayer.extras
Section 123
//Water (com.midasplayer.extras.Water)
package com.midasplayer.extras {
import flash.display.*;
public class Water extends MovieClip {
private var m_lines:Array;
public function Water(){
this.m_lines = new Array();
super();
}
public function init(_arg1:Number, _arg2:Number){
var _local3:WaterLine;
var _local4:int;
var _local5:uint;
var _local6:*;
_local5 = 0xFF0000;
if (this.name == "RED"){
_local5 = 0xFF0000;
_local4 = 1;
};
if (this.name == "GREEN"){
_local5 = 0xFF00;
_local4 = 1;
};
if (this.name == "BLUE"){
_local5 = 2782939;
_local4 = 1;
};
_local6 = 0;
while (_local6 < _local4) {
_local3 = new WaterLine();
_local3.addParams(_local5, _arg1, _arg2);
_local3.x = (_local6 * 1.5);
addChild(_local3);
this.m_lines.push(_local3);
_local6++;
};
}
public function decrThickness(_arg1:Boolean):Boolean{
var _local2:int;
var _local3:Boolean;
var _local4:int;
var _local5:Boolean;
if (_arg1){
_local2 = 0;
while (_local2 < this.m_lines.length) {
_local3 = false;
if (this.m_lines[_local2].decrThickness()){
_local3 = true;
} else {
return (false);
};
_local2++;
};
return (_local3);
};
_local4 = 0;
while (_local4 < this.m_lines.length) {
_local5 = false;
if (this.m_lines[_local4].incrThickness()){
_local5 = true;
} else {
return (false);
};
_local4++;
};
return (_local5);
}
}
}//package com.midasplayer.extras
Section 124
//WaterLine (com.midasplayer.extras.WaterLine)
package com.midasplayer.extras {
import flash.display.*;
import flash.events.*;
public class WaterLine extends MovieClip {
private var _particles:Array;
private var _color:uint;
private var _lineSize:Number;
private var _bubbles:Array;
private var _height:Number;// = 400
private var _step:Number;
private var _line:Shape;
private var _particlesQuantity:Number;// = 20
public function WaterLine(){
_height = 400;
_particlesQuantity = 20;
super();
trace("WaterLine()");
}
public function get randomDirection():Number{
return (((Math.round((Math.random() * 1)) * 2) - 1));
}
private function createLine():void{
var _local1:SimpleParticle;
var _local2:*;
_local2 = 0;
while (_local2 < this._particlesQuantity) {
_local1 = new SimpleParticle();
_local1.elasticX = 0;
_local1.yIni = (_local1.y = (this._step * _local2));
addChild(_local1);
this._particles.push(_local1);
_local2++;
};
}
private function init(){
this._line = new Shape();
this._line.alpha = 0.8;
addChild(this._line);
this._bubbles = [];
this._particles = [];
this._step = (this._height / (this._particlesQuantity - 1));
this.createLine();
addEventListener(Event.ENTER_FRAME, this.animate);
}
public function incrThickness():Boolean{
this._lineSize = (this._lineSize + 0.5);
if (this._lineSize >= 5){
return (true);
};
return (false);
}
public function addParams(_arg1:uint, _arg2:Number, _arg3:Number):void{
this._color = _arg1;
this._height = _arg2;
this._lineSize = _arg3;
this.init();
}
public function decrThickness():Boolean{
this._lineSize--;
if (this._lineSize <= 0){
return (true);
};
return (false);
}
private function createBubbles():void{
var _local1:SimpleParticle;
var _local2:Number;
var _local3:Number;
var _local4:*;
var _local5:Array;
var _local6:*;
_local5 = [this._color, this._color];
_local6 = 0;
while (_local6 < 5) {
_local1 = new SimpleParticle();
_local1.type = SimpleParticle.CIRCLE;
_local1.size = 0.8;
_local1.color = _local5[Math.round((Math.random() * (_local5.length - 1)))];
_local1.alpha = 1;
addChild(_local1);
this._bubbles.push(_local1);
_local6++;
};
for (_local4 in this._bubbles) {
_local1 = this._bubbles[_local4];
if (!_local1.isOut){
_local1.y = (_local1.y + ((Math.random() * 5) + 10));
_local2 = Math.floor((_local1.y / this._step));
_local1.x = (_local1.x + (((this._particles[_local2].x + ((Math.random() * 1) * this.randomDirection)) - _local1.x) * 0.8));
_local3 = Math.sqrt((Math.pow((mouseX - _local1.x), 2) + Math.pow((mouseY - _local1.y), 2)));
if ((((_local3 < 4)) && (!(_local1.isOut)))){
};
} else {
_local1.y = (_local1.y + _local1.speedY);
_local1.speedY = (_local1.speedY + 3);
_local1.x = (_local1.x + _local1.speedX);
_local1.alpha = (_local1.alpha - 0.005);
};
if ((((_local1.y > this._height)) || ((_local1.alpha < 0)))){
this._bubbles.splice(_local4, 1);
_local1.parent.removeChild(_local1);
_local1 = null;
};
};
}
private function animate(_arg1:Event):void{
var _local2:SimpleParticle;
var _local3:SimpleParticle;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:*;
_local9 = 10;
_local10 = 3;
this._line.graphics.clear();
this._line.graphics.moveTo(this._particles[0].x, this._particles[0].y);
this._line.graphics.lineStyle(this._lineSize, this._color, 1);
_local11 = 0;
while (_local11 < this._particles.length) {
_local3 = this._particles[_local11];
if (_local11 == 0){
_local3.x = (_local3.x + ((((Math.random() * _local10) * this.randomDirection) - _local3.x) * 0.9));
};
_local2 = ((_local11)>0) ? this._particles[(_local11 - 1)] : _local3;
_local7 = Math.sqrt((Math.pow((mouseX - 0), 2) + Math.pow((mouseY - _local3.yIni), 2)));
if (_local7 < _local9){
} else {
_local5 = _local2.x;
_local3.elasticX = ((_local3.elasticX * 0.4) + ((_local5 - _local3.x) * 0.4));
_local3.x = (_local3.x + _local3.elasticX);
};
if (_local11 > 0){
this._line.graphics.curveTo(_local2.x, _local2.y, ((_local2.x + _local3.x) / 2), ((_local2.y + _local3.y) / 2));
};
_local11++;
};
}
private function spreadBubble(_arg1:SimpleParticle):void{
_arg1.isOut = true;
parent.parent.addChild(_arg1);
_arg1.size = 1.2;
_arg1.alpha = 0.35;
_arg1.x = (parent.x + _arg1.x);
_arg1.y = (parent.y + _arg1.y);
_arg1.speedY = (-5 - (Math.random() * 10));
_arg1.speedX = (((Math.random() * 15) + 1) * this.randomDirection);
}
}
}//package com.midasplayer.extras
Section 125
//WaveEngine (com.midasplayer.extras.WaveEngine)
package com.midasplayer.extras {
import flash.display.*;
import flash.events.*;
public class WaveEngine extends MovieClip {
private var m_waveHolder:MovieClip;
private var m_fillColor:uint;
private var m_num_waves:int;// = 3
private var m_sinArr:Array;
private var m_rootRef:MovieClip;
private var m_wave:DrawSine;
public function WaveEngine(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:uint, _arg5:uint, _arg6:MovieClip){
var _local7:*;
m_num_waves = 3;
this.m_waveHolder = new MovieClip();
this.m_sinArr = new Array();
super();
this.m_rootRef = _arg1;
this.m_waveHolder = _arg6;
this.m_wave = new DrawSine(this.m_waveHolder, _arg2, _arg3, 100);
_local7 = 0;
while (_local7 < this.m_num_waves) {
this.m_sinArr.push(new SineWave(((Math.random() * Math.PI) * 1.5), (Math.random() * 1.5), ((Math.random() * 1.5) + 1), (Math.random() - 0.5)));
_local7++;
};
this.m_wave.set_stroke(3, _arg5);
this.m_wave.set_fill(true, _arg4, 100);
this.m_fillColor = _arg4;
}
public function stopWave():void{
this.m_rootRef.removeEventListener(Event.ENTER_FRAME, this.update);
}
public function colorUpdate(_arg1:uint):void{
var _local2:String;
_local2 = ("0x" + _arg1.toString(16));
this.m_fillColor = uint(_local2);
}
public function getWave():MovieClip{
return (this.m_waveHolder);
}
public function startWave():void{
this.m_rootRef.addEventListener(Event.ENTER_FRAME, this.update);
}
private function update(_arg1:Event):void{
var _local2:*;
for (_local2 in this.m_sinArr) {
this.m_sinArr[_local2].phase = (this.m_sinArr[_local2].phase + this.m_sinArr[_local2].inc);
};
this.m_wave.set_fill(true, this.m_fillColor, 1);
this.m_wave.draw_waves(this.m_sinArr);
}
}
}//package com.midasplayer.extras
Section 126
//KingAPI (com.midasplayer.KingAPI)
package com.midasplayer {
import flash.events.*;
import com.midasplayer.extras.*;
import flash.net.*;
import flash.external.*;
public class KingAPI {
public static const LINK_TYPE_RIGHT_CLICK:String = "rightclick";
public static const USER_TYPE_SUBSCRIPTION:int = 3;
public static const LINK_TYPE_SIGN:String = "sign";
public static const LINK_TYPE_HIGHSCORES:String = "highscores";
public static const INITIALIZED_EVENT:String = "initialized";
public static const LINK_TYPE_OTHER_GAMES:String = "other_games";
public static const USER_TYPE_REGISTERED:int = 1;
private static const SAK:String = "ggfd7sday923mdsfd8csfds34";
private static const loadHomeParametersURL:String = "http://www.king.com/servlet/FreeGameServlet?action=load";
public static const LINK_TYPE_LOADER_MOVIE:String = "loader_movie";
private static const bounceURL:String = "http://www.mygame.com/king/bounce.jsp";
public static const USER_TYPE_UNREGISTERED:int = 0;
public static const LINK_TYPE_PROTECT:String = "protect";
public static const LINK_TYPE_ADD_GAME:String = "add_game";
public static const USER_TYPE_GOLD:int = 2;
public static const HOST_BANNED_EVENT:String = "hostBanned";
private static const SK:String = "vf78hxcsjak77cxzhjkwad87s";
private static const loadCountURL:String = "http://www.mygame.com/king/loadcount.jsp";
public static const LINK_TYPE_LOADER_PROGRESS:String = "loader_progress";
private static var check:String = null;
public static var gameName:String;
public static var banned:Boolean = false;
protected static var dispatcher:EventDispatcher;
private static var sessionID:String;
public static var isHome:Boolean = false;
private static var iscore:int = 123;
public static var fromURL:String;
private static var SSK:String = "ng43ui54hy35tdsnd6f54rews";
private static function loadUrlErrorHandler(_arg1:Event):void{
trace(("Unable to load url: " + _arg1));
}
public static function openOfflineProtectionLink():void{
openKingPage(LINK_TYPE_PROTECT);
}
public static function init(_arg1:String, _arg2:String):void{
var so:*;
var rnd1:*;
var rnd2:*;
var name:*;
var from:*;
var loadCounter:*;
var reqvars:*;
var request:*;
var _arg1 = _arg1;
var _arg2 = _arg2;
so = null;
rnd1 = NaN;
rnd2 = NaN;
name = _arg1;
from = _arg2;
gameName = name;
fromURL = from;
loadCounter = new URLLoader();
reqvars = new URLVariables();
reqvars.game = gameName;
reqvars.from = fromURL;
try {
so = SharedObject.getLocal("sessionId");
if (so.data.sessionID == null){
rnd1 = Math.abs(Math.floor((Math.random() * 4294967295)));
rnd2 = Math.abs(Math.floor((Math.random() * 4294967295)));
so.data.sessionID = (rnd1.toString(16) + rnd2.toString(16));
so.flush();
};
sessionID = so.data.sessionID;
} catch(e:Error) {
sessionID = "error";
};
reqvars.session = sessionID;
request = new URLRequest(((loadCountURL + "?") + reqvars.toString()));
loadCounter.addEventListener(Event.COMPLETE, loadCountHandler);
loadCounter.addEventListener(IOErrorEvent.IO_ERROR, loadUrlErrorHandler);
loadCounter.addEventListener(SecurityErrorEvent.SECURITY_ERROR, loadUrlErrorHandler);
try {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
} catch(error:Error) {
trace(("Unable to load loadcount url: " + loadCountURL));
trace(error.message);
};
}
public static function resetScore():void{
iscore = 123;
check = null;
}
private static function loadHomeParametersHandler(_arg1:Event):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
trace(("loadCounter.data" + _local2.data));
}
public static function submitInternalScore():void{
var _local1:int;
checkScore();
_local1 = ((iscore - 123) / 2);
submitScore(_local1);
}
public static function openOtherGamesLink():void{
openKingPage(LINK_TYPE_OTHER_GAMES);
}
public static function openKingPage(_arg1:String, _arg2:String=null):void{
var _local3:URLVariables;
var _local4:*;
_local3 = new URLVariables();
_local3.game = gameName;
_local3.from = fromURL;
_local3.type = _arg1;
_local3.session = sessionID;
if (_arg2 != null){
_local3.redirect = _arg2;
};
_local4 = "_blank";
if (isHome){
_local4 = "_top";
};
navigateToURL(new URLRequest(((bounceURL + "?") + _local3.toString())), _local4);
}
private static function loadCountHandler(_arg1:Event):void{
var vars:*;
var event:*;
var loadCounter:*;
var _arg1 = _arg1;
vars = null;
event = _arg1;
loadCounter = URLLoader(event.target);
trace(("loadCounter.data :" + loadCounter.data));
try {
vars = new URLVariables(loadCounter.data);
if (vars.h == "true"){
isHome = true;
};
if (vars.b == "true"){
banned = true;
dispatcher.dispatchEvent(new Event(HOST_BANNED_EVENT));
} else {
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
trace((("::" + vars.h) + "::"));
trace((("::" + vars.b) + "::"));
} catch(e:Error) {
trace(("Error reading data from loadcount url: " + e));
dispatcher.dispatchEvent(new Event(INITIALIZED_EVENT));
};
}
public static function addEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
dispatcher = new EventDispatcher();
};
dispatcher.addEventListener(_arg1, _arg2);
}
public static function openLoaderMovieLink():void{
openKingPage(LINK_TYPE_LOADER_MOVIE);
}
public static function removeEventListener(_arg1:String, _arg2:Function):void{
if (dispatcher == null){
return;
};
dispatcher.removeEventListener(_arg1, _arg2);
}
public static function submitScore(_arg1:int):void{
var score:*;
var hash:*;
var _arg1 = _arg1;
score = _arg1;
hash = md5.encrypt(((((score + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitScore", score, hash);
} else {
openKingPage(LINK_TYPE_HIGHSCORES, ((((("game/" + gameName) + "/submit/") + score) + ":") + hash));
};
} catch(e:Error) {
trace(e);
};
}
public static function submitLevel(_arg1:int):void{
var level:*;
var hash:*;
var _arg1 = _arg1;
level = _arg1;
hash = md5.encrypt(((((level + ":") + gameName) + ":") + SSK));
try {
if (isHome){
ExternalInterface.call("submitLevel", level, hash);
};
} catch(e:Error) {
trace(e);
};
}
public static function openHighscoresLink():void{
openKingPage(LINK_TYPE_HIGHSCORES, (("game/" + gameName) + "/highscores"));
}
public static function openSignLink():void{
if (!isHome){
openKingPage(LINK_TYPE_SIGN);
};
}
public static function openRightClickLink():void{
openKingPage(LINK_TYPE_RIGHT_CLICK);
}
private static function checkScore():void{
if (check != null){
if (check != md5.encrypt(((((iscore + ":") + gameName) + ":") + SK))){
SSK = "ng41ui54hy35tdsnd6f54rews";
};
};
}
public static function addScore(_arg1:int):int{
var _local2:int;
checkScore();
_local2 = ((iscore - 123) / 2);
_local2 = (_local2 + _arg1);
iscore = ((_local2 * 2) + 123);
check = md5.encrypt(((((iscore + ":") + gameName) + ":") + SK));
return (_local2);
}
public static function openLoaderProgressLink():void{
openKingPage(LINK_TYPE_LOADER_PROGRESS);
}
public static function openAddToWebsiteLink():void{
openKingPage(LINK_TYPE_ADD_GAME, "website_content.jsp");
}
public static function submitAchievement(_arg1:String):void{
var achievement:*;
var hash:*;
var _arg1 = _arg1;
achievement = _arg1;
hash = md5.encrypt(((((achievement + ":") + gameName) + ":") + SAK));
try {
if (isHome){
ExternalInterface.call("submitAchievement", achievement, hash);
};
} catch(e:Error) {
trace(e);
};
}
}
}//package com.midasplayer
Section 127
//Color (fl.motion.Color)
package fl.motion {
import flash.display.*;
import flash.geom.*;
public class Color extends ColorTransform {
private var _tintMultiplier:Number;// = 0
private var _tintColor:Number;// = 0
public function Color(_arg1:Number=1, _arg2:Number=1, _arg3:Number=1, _arg4:Number=1, _arg5:Number=0, _arg6:Number=0, _arg7:Number=0, _arg8:Number=0){
_tintColor = 0;
_tintMultiplier = 0;
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8);
}
public function setTint(_arg1:uint, _arg2:Number):void{
var _local3:uint;
var _local4:uint;
var _local5:uint;
this._tintColor = _arg1;
this._tintMultiplier = _arg2;
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - _arg2)));
_local3 = ((_arg1 >> 16) & 0xFF);
_local4 = ((_arg1 >> 8) & 0xFF);
_local5 = (_arg1 & 0xFF);
this.redOffset = Math.round((_local3 * _arg2));
this.greenOffset = Math.round((_local4 * _arg2));
this.blueOffset = Math.round((_local5 * _arg2));
}
public function set tintColor(_arg1:uint):void{
this.setTint(_arg1, this.tintMultiplier);
}
public function get brightness():Number{
return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1));
}
private function deriveTintColor():uint{
var _local1:Number;
var _local2:uint;
var _local3:uint;
var _local4:uint;
var _local5:uint;
_local1 = (1 / this.tintMultiplier);
_local2 = Math.round((this.redOffset * _local1));
_local3 = Math.round((this.greenOffset * _local1));
_local4 = Math.round((this.blueOffset * _local1));
_local5 = (((_local2 << 16) | (_local3 << 8)) | _local4);
return (_local5);
}
public function get tintMultiplier():Number{
return (this._tintMultiplier);
}
public function get tintColor():uint{
return (this._tintColor);
}
public function set brightness(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
if (_arg1 > 1){
_arg1 = 1;
} else {
if (_arg1 < -1){
_arg1 = -1;
};
};
_local2 = (1 - Math.abs(_arg1));
_local3 = 0;
if (_arg1 > 0){
_local3 = (_arg1 * 0xFF);
};
this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = _local2));
this.redOffset = (this.greenOffset = (this.blueOffset = _local3));
}
public function set tintMultiplier(_arg1:Number):void{
this.setTint(this.tintColor, _arg1);
}
private function parseXML(_arg1:XML=null):Color{
var _local2:XML;
var _local3:XML;
var _local4:String;
var _local5:uint;
if (!_arg1){
return (this);
};
_local2 = _arg1.elements()[0];
if (!_local2){
return (this);
};
for each (_local3 in _local2.attributes()) {
_local4 = _local3.localName();
if (_local4 == "tintColor"){
_local5 = (Number(_local3.toString()) as uint);
this.tintColor = _local5;
} else {
this[_local4] = Number(_local3.toString());
};
};
return (this);
}
public static function interpolateColor(_arg1:uint, _arg2:uint, _arg3:Number):uint{
var _local4:Number;
var _local5:uint;
var _local6:uint;
var _local7:uint;
var _local8:uint;
var _local9:uint;
var _local10:uint;
var _local11:uint;
var _local12:uint;
var _local13:uint;
var _local14:uint;
var _local15:uint;
var _local16:uint;
var _local17:uint;
_local4 = (1 - _arg3);
_local5 = ((_arg1 >> 24) & 0xFF);
_local6 = ((_arg1 >> 16) & 0xFF);
_local7 = ((_arg1 >> 8) & 0xFF);
_local8 = (_arg1 & 0xFF);
_local9 = ((_arg2 >> 24) & 0xFF);
_local10 = ((_arg2 >> 16) & 0xFF);
_local11 = ((_arg2 >> 8) & 0xFF);
_local12 = (_arg2 & 0xFF);
_local13 = ((_local5 * _local4) + (_local9 * _arg3));
_local14 = ((_local6 * _local4) + (_local10 * _arg3));
_local15 = ((_local7 * _local4) + (_local11 * _arg3));
_local16 = ((_local8 * _local4) + (_local12 * _arg3));
_local17 = ((((_local13 << 24) | (_local14 << 16)) | (_local15 << 8)) | _local16);
return (_local17);
}
public static function interpolateTransform(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:Number;
var _local5:ColorTransform;
_local4 = (1 - _arg3);
_local5 = new ColorTransform(((_arg1.redMultiplier * _local4) + (_arg2.redMultiplier * _arg3)), ((_arg1.greenMultiplier * _local4) + (_arg2.greenMultiplier * _arg3)), ((_arg1.blueMultiplier * _local4) + (_arg2.blueMultiplier * _arg3)), ((_arg1.alphaMultiplier * _local4) + (_arg2.alphaMultiplier * _arg3)), ((_arg1.redOffset * _local4) + (_arg2.redOffset * _arg3)), ((_arg1.greenOffset * _local4) + (_arg2.greenOffset * _arg3)), ((_arg1.blueOffset * _local4) + (_arg2.blueOffset * _arg3)), ((_arg1.alphaOffset * _local4) + (_arg2.alphaOffset * _arg3)));
return (_local5);
}
public static function fromXML(_arg1:XML):Color{
return (Color(new (Color).parseXML(_arg1)));
}
}
}//package fl.motion
Section 128
//None (fl.transitions.easing.None)
package fl.transitions.easing {
public class None {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
public static function easeNone(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
}
}
}//package fl.transitions.easing
Section 129
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
public var begin:Number;// = NAN
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var change:Number;// = NAN
private var _finish:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
isPlaying = false;
obj = null;
prop = "";
func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
begin = NaN;
change = NaN;
useSeconds = false;
prevTime = NaN;
prevPos = NaN;
looping = false;
_duration = NaN;
_time = NaN;
_fps = NaN;
_position = NaN;
_startTime = NaN;
_intervalID = 0;
_finish = NaN;
_timer = null;
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean;
_local2 = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 130
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var time:Number;// = NAN
public var position:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
time = NaN;
position = NaN;
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 131
//Back (gs.easing.Back)
package gs.easing {
public class Back {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / _arg4);
return (((((_arg3 * _arg1) * _arg1) * (((_arg5 + 1) * _arg1) - _arg5)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1.70158):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * ((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) - _arg5))) + _arg2));
};
_arg1 = (_arg1 - 2);
_arg5 = (_arg5 * 1.525);
return ((((_arg3 / 2) * (((_arg1 * _arg1) * (((_arg5 + 1) * _arg1) + _arg5)) + 2)) + _arg2));
}
}
}//package gs.easing
Section 132
//Circ (gs.easing.Circ)
package gs.easing {
public class Circ {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * Math.sqrt((1 - (_arg1 * _arg1)))) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((-(_arg3) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((-(_arg3) / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) - 1)) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (Math.sqrt((1 - (_arg1 * _arg1))) + 1)) + _arg2));
}
}
}//package gs.easing
Section 133
//Elastic (gs.easing.Elastic)
package gs.easing {
public class Elastic {
private static const _2PI:Number = 6.28318530717959;
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
--_arg1;
return ((-(((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 == 2){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * (0.3 * 1.5));
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
if (_arg1 < 1){
--_arg1;
return (((-0.5 * ((_arg5 * Math.pow(2, (10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6)))) + _arg2));
};
--_arg1;
return ((((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) * 0.5) + _arg3) + _arg2));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=0, _arg6:Number=0):Number{
var _local7:Number;
if (_arg1 == 0){
return (_arg2);
};
_arg1 = (_arg1 / _arg4);
if (_arg1 == 1){
return ((_arg2 + _arg3));
};
if (!_arg6){
_arg6 = (_arg4 * 0.3);
};
if (((!(_arg5)) || ((_arg5 < Math.abs(_arg3))))){
_arg5 = _arg3;
_local7 = (_arg6 / 4);
} else {
_local7 = ((_arg6 / _2PI) * Math.asin((_arg3 / _arg5)));
};
return (((((_arg5 * Math.pow(2, (-10 * _arg1))) * Math.sin(((((_arg1 * _arg4) - _local7) * _2PI) / _arg6))) + _arg3) + _arg2));
}
}
}//package gs.easing
Section 134
//TweenEvent (gs.events.TweenEvent)
package gs.events {
import flash.events.*;
public class TweenEvent extends Event {
public var info:Object;
public static const UPDATE:String = "update";
public static const START:String = "start";
public static const version:Number = 0.9;
public static const COMPLETE:String = "complete";
public function TweenEvent(_arg1:String, _arg2:Object=null, _arg3:Boolean=false, _arg4:Boolean=false){
super(_arg1, _arg3, _arg4);
this.info = _arg2;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.info, this.bubbles, this.cancelable));
}
}
}//package gs.events
Section 135
//AutoAlphaPlugin (gs.plugins.AutoAlphaPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class AutoAlphaPlugin extends TweenPlugin {
protected var _tweenVisible:Boolean;
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function AutoAlphaPlugin(){
this.propName = "autoAlpha";
this.overwriteProps = ["alpha", "visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
if (((!((_target.visible == true))) && (_tweenVisible))){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((((_tweenVisible) && (!((_tween.vars.runBackwards == true))))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(!((_arg2 == 0)));
_tweenVisible = true;
addTween(_arg1, "alpha", _arg1.alpha, _arg2, "alpha");
return (true);
}
override public function killProps(_arg1:Object):void{
super.killProps(_arg1);
_tweenVisible = !(Boolean(("visible" in _arg1)));
}
}
}//package gs.plugins
Section 136
//BevelFilterPlugin (gs.plugins.BevelFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BevelFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BevelFilterPlugin(){
this.propName = "bevelFilter";
this.overwriteProps = ["bevelFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BevelFilter;
initFilter(_arg2, new BevelFilter(0, 0, 0xFFFFFF, 0.5, 0, 0.5, 2, 2, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 137
//BezierPlugin (gs.plugins.BezierPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class BezierPlugin extends TweenPlugin {
protected var _future:Object;
protected var _orient:Boolean;
protected var _orientData:Array;
protected var _beziers:Object;
protected var _target:Object;
protected static const _RAD2DEG:Number = 57.2957795130823;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function BezierPlugin(){
_future = {};
super();
this.propName = "bezier";
this.overwriteProps = [];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:String;
var _local4:Object;
var _local5:Number;
var _local6:uint;
var _local7:Number;
var _local8:int;
var _local9:Object;
var _local10:Boolean;
var _local11:Number;
var _local12:Number;
var _local13:Array;
var _local14:Number;
if (_arg1 == 1){
for (_local3 in _beziers) {
_local2 = (_beziers[_local3].length - 1);
_target[_local3] = _beziers[_local3][_local2][2];
};
} else {
for (_local3 in _beziers) {
_local6 = _beziers[_local3].length;
if (_arg1 < 0){
_local2 = 0;
} else {
if (_arg1 >= 1){
_local2 = (_local6 - 1);
} else {
_local2 = int((_local6 * _arg1));
};
};
_local5 = ((_arg1 - (_local2 * (1 / _local6))) * _local6);
_local4 = _beziers[_local3][_local2];
if (this.round){
_local7 = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
_local8 = ((_local7)<0) ? -1 : 1;
_target[_local3] = ((((_local7 % 1) * _local8))>0.5) ? (int(_local7) + _local8) : int(_local7);
} else {
_target[_local3] = (_local4[0] + (_local5 * (((2 * (1 - _local5)) * (_local4[1] - _local4[0])) + (_local5 * (_local4[2] - _local4[0])))));
};
};
};
if (_orient){
_local9 = _target;
_local10 = this.round;
_target = _future;
this.round = false;
_orient = false;
this.changeFactor = (_arg1 + 0.01);
_target = _local9;
this.round = _local10;
_orient = true;
_local2 = 0;
while (_local2 < _orientData.length) {
_local13 = _orientData[_local2];
_local14 = ((_local13[3]) || (0));
_local11 = (_future[_local13[0]] - _target[_local13[0]]);
_local12 = (_future[_local13[1]] - _target[_local13[1]]);
_target[_local13[2]] = ((Math.atan2(_local12, _local11) * _RAD2DEG) + _local14);
_local2++;
};
};
}
protected function init(_arg1:TweenLite, _arg2:Array, _arg3:Boolean):void{
var _local4:Object;
var _local5:int;
var _local6:String;
_target = _arg1.target;
if (_arg1.exposedVars.orientToBezier == true){
_orientData = [["x", "y", "rotation", 0]];
_orient = true;
} else {
if ((_arg1.exposedVars.orientToBezier is Array)){
_orientData = _arg1.exposedVars.orientToBezier;
_orient = true;
};
};
_local4 = {};
_local5 = 0;
while (_local5 < _arg2.length) {
for (_local6 in _arg2[_local5]) {
if (_local4[_local6] == undefined){
_local4[_local6] = [_arg1.target[_local6]];
};
if (typeof(_arg2[_local5][_local6]) == "number"){
_local4[_local6].push(_arg2[_local5][_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg2[_local5][_local6])));
};
};
_local5++;
};
for (_local6 in _local4) {
this.overwriteProps[this.overwriteProps.length] = _local6;
if (_arg1.exposedVars[_local6] != undefined){
if (typeof(_arg1.exposedVars[_local6]) == "number"){
_local4[_local6].push(_arg1.exposedVars[_local6]);
} else {
_local4[_local6].push((_arg1.target[_local6] + Number(_arg1.exposedVars[_local6])));
};
delete _arg1.exposedVars[_local6];
_local5 = (_arg1.tweens.length - 1);
while (_local5 > -1) {
if (_arg1.tweens[_local5].name == _local6){
_arg1.tweens.splice(_local5, 1);
};
_local5--;
};
};
};
_beziers = parseBeziers(_local4, _arg3);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), false);
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:String;
for (_local2 in _beziers) {
if ((_local2 in _arg1)){
delete _beziers[_local2];
};
};
super.killProps(_arg1);
}
public static function parseBeziers(_arg1:Object, _arg2:Boolean=false):Object{
var _local3:int;
var _local4:Array;
var _local5:Object;
var _local6:String;
var _local7:Object;
_local7 = {};
if (_arg2){
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 2){
_local5[_local5.length] = [_local4[0], (_local4[1] - ((_local4[2] - _local4[0]) / 4)), _local4[1]];
_local3 = 1;
while (_local3 < (_local4.length - 1)) {
_local5[_local5.length] = [_local4[_local3], (_local4[_local3] + (_local4[_local3] - _local5[(_local3 - 1)][1])), _local4[(_local3 + 1)]];
_local3++;
};
} else {
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
} else {
for (_local6 in _arg1) {
_local4 = _arg1[_local6];
_local5 = [];
_local7[_local6] = _local5;
if (_local4.length > 3){
_local5[_local5.length] = [_local4[0], _local4[1], ((_local4[1] + _local4[2]) / 2)];
_local3 = 2;
while (_local3 < (_local4.length - 2)) {
_local5[_local5.length] = [_local5[(_local3 - 2)][2], _local4[_local3], ((_local4[_local3] + _local4[(_local3 + 1)]) / 2)];
_local3++;
};
_local5[_local5.length] = [_local5[(_local5.length - 1)][2], _local4[(_local4.length - 2)], _local4[(_local4.length - 1)]];
} else {
if (_local4.length == 3){
_local5[_local5.length] = [_local4[0], _local4[1], _local4[2]];
} else {
if (_local4.length == 2){
_local5[_local5.length] = [_local4[0], ((_local4[0] + _local4[1]) / 2), _local4[1]];
};
};
};
};
};
return (_local7);
}
}
}//package gs.plugins
Section 138
//BezierThroughPlugin (gs.plugins.BezierThroughPlugin)
package gs.plugins {
import gs.*;
public class BezierThroughPlugin extends BezierPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BezierThroughPlugin(){
this.propName = "bezierThrough";
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (!(_arg2 is Array)){
return (false);
};
init(_arg3, (_arg2 as Array), true);
return (true);
}
}
}//package gs.plugins
Section 139
//BlurFilterPlugin (gs.plugins.BlurFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class BlurFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function BlurFilterPlugin(){
this.propName = "blurFilter";
this.overwriteProps = ["blurFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = BlurFilter;
initFilter(_arg2, new BlurFilter(0, 0, ((_arg2.quality) || (2))));
return (true);
}
}
}//package gs.plugins
Section 140
//ColorMatrixFilterPlugin (gs.plugins.ColorMatrixFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class ColorMatrixFilterPlugin extends FilterPlugin {
protected var _matrix:Array;
protected var _matrixTween:EndArrayPlugin;
public static const API:Number = 1;
public static const VERSION:Number = 1.1;
protected static var _lumG:Number = 0.71516;
protected static var _lumR:Number = 0.212671;
protected static var _idMatrix:Array = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
protected static var _lumB:Number = 0.072169;
public function ColorMatrixFilterPlugin(){
this.propName = "colorMatrixFilter";
this.overwriteProps = ["colorMatrixFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:Object;
var _local5:Array;
_target = _arg1;
_type = ColorMatrixFilter;
_local4 = _arg2;
initFilter({remove:_arg2.remove, index:_arg2.index, addFilter:_arg2.addFilter}, new ColorMatrixFilter(_idMatrix.slice()));
_matrix = ColorMatrixFilter(_filter).matrix;
_local5 = [];
if (((!((_local4.matrix == null))) && ((_local4.matrix is Array)))){
_local5 = _local4.matrix;
} else {
if (_local4.relative == true){
_local5 = _matrix.slice();
} else {
_local5 = _idMatrix.slice();
};
_local5 = setBrightness(_local5, _local4.brightness);
_local5 = setContrast(_local5, _local4.contrast);
_local5 = setHue(_local5, _local4.hue);
_local5 = setSaturation(_local5, _local4.saturation);
_local5 = setThreshold(_local5, _local4.threshold);
if (!isNaN(_local4.colorize)){
_local5 = colorize(_local5, _local4.colorize, _local4.amount);
};
};
_matrixTween = new EndArrayPlugin();
_matrixTween.init(_matrix, _local5);
return (true);
}
override public function set changeFactor(_arg1:Number):void{
_matrixTween.changeFactor = _arg1;
ColorMatrixFilter(_filter).matrix = _matrix;
super.changeFactor = _arg1;
}
public static function setSaturation(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = (1 - _arg2);
_local4 = (_local3 * _lumR);
_local5 = (_local3 * _lumG);
_local6 = (_local3 * _lumB);
_local7 = [(_local4 + _arg2), _local5, _local6, 0, 0, _local4, (_local5 + _arg2), _local6, 0, 0, _local4, _local5, (_local6 + _arg2), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local7, _arg1));
}
public static function setHue(_arg1:Array, _arg2:Number):Array{
var _local3:Number;
var _local4:Number;
var _local5:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 * (Math.PI / 180));
_local3 = Math.cos(_arg2);
_local4 = Math.sin(_arg2);
_local5 = [((_lumR + (_local3 * (1 - _lumR))) + (_local4 * -(_lumR))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * -(_lumG))), ((_lumB + (_local3 * -(_lumB))) + (_local4 * (1 - _lumB))), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * 0.143)), ((_lumG + (_local3 * (1 - _lumG))) + (_local4 * 0.14)), ((_lumB + (_local3 * -(_lumB))) + (_local4 * -0.283)), 0, 0, ((_lumR + (_local3 * -(_lumR))) + (_local4 * -((1 - _lumR)))), ((_lumG + (_local3 * -(_lumG))) + (_local4 * _lumG)), ((_lumB + (_local3 * (1 - _lumB))) + (_local4 * _lumB)), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1];
return (applyMatrix(_local5, _arg1));
}
public static function setThreshold(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_local3 = [(_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), (_lumR * 0x0100), (_lumG * 0x0100), (_lumB * 0x0100), 0, (-256 * _arg2), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
public static function applyMatrix(_arg1:Array, _arg2:Array):Array{
var _local3:Array;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (_arg2);
};
_local3 = [];
_local4 = 0;
_local5 = 0;
_local6 = 0;
while (_local6 < 4) {
_local7 = 0;
while (_local7 < 5) {
if (_local7 == 4){
_local5 = _arg1[(_local4 + 4)];
} else {
_local5 = 0;
};
_local3[(_local4 + _local7)] = (((((_arg1[_local4] * _arg2[_local7]) + (_arg1[(_local4 + 1)] * _arg2[(_local7 + 5)])) + (_arg1[(_local4 + 2)] * _arg2[(_local7 + 10)])) + (_arg1[(_local4 + 3)] * _arg2[(_local7 + 15)])) + _local5);
_local7++;
};
_local4 = (_local4 + 5);
_local6++;
};
return (_local3);
}
public static function colorize(_arg1:Array, _arg2:Number, _arg3:Number=1):Array{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Array;
if (isNaN(_arg2)){
return (_arg1);
};
if (isNaN(_arg3)){
_arg3 = 1;
};
_local4 = (((_arg2 >> 16) & 0xFF) / 0xFF);
_local5 = (((_arg2 >> 8) & 0xFF) / 0xFF);
_local6 = ((_arg2 & 0xFF) / 0xFF);
_local7 = (1 - _arg3);
_local8 = [(_local7 + ((_arg3 * _local4) * _lumR)), ((_arg3 * _local4) * _lumG), ((_arg3 * _local4) * _lumB), 0, 0, ((_arg3 * _local5) * _lumR), (_local7 + ((_arg3 * _local5) * _lumG)), ((_arg3 * _local5) * _lumB), 0, 0, ((_arg3 * _local6) * _lumR), ((_arg3 * _local6) * _lumG), (_local7 + ((_arg3 * _local6) * _lumB)), 0, 0, 0, 0, 0, 1, 0];
return (applyMatrix(_local8, _arg1));
}
public static function setBrightness(_arg1:Array, _arg2:Number):Array{
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = ((_arg2 * 100) - 100);
return (applyMatrix([1, 0, 0, 0, _arg2, 0, 1, 0, 0, _arg2, 0, 0, 1, 0, _arg2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], _arg1));
}
public static function setContrast(_arg1:Array, _arg2:Number):Array{
var _local3:Array;
if (isNaN(_arg2)){
return (_arg1);
};
_arg2 = (_arg2 + 0.01);
_local3 = [_arg2, 0, 0, 0, (128 * (1 - _arg2)), 0, _arg2, 0, 0, (128 * (1 - _arg2)), 0, 0, _arg2, 0, (128 * (1 - _arg2)), 0, 0, 0, 1, 0];
return (applyMatrix(_local3, _arg1));
}
}
}//package gs.plugins
Section 141
//DropShadowFilterPlugin (gs.plugins.DropShadowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class DropShadowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function DropShadowFilterPlugin(){
this.propName = "dropShadowFilter";
this.overwriteProps = ["dropShadowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = DropShadowFilter;
initFilter(_arg2, new DropShadowFilter(0, 45, 0, 0, 0, 0, 1, ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout, _arg2.hideObject));
return (true);
}
}
}//package gs.plugins
Section 142
//EndArrayPlugin (gs.plugins.EndArrayPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import gs.utils.tween.*;
public class EndArrayPlugin extends TweenPlugin {
protected var _info:Array;
protected var _a:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function EndArrayPlugin(){
_info = [];
super();
this.propName = "endArray";
this.overwriteProps = ["endArray"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:ArrayTweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_a[_local3.index] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_info.length - 1);
while (_local2 > -1) {
_local3 = _info[_local2];
_a[_local3.index] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function init(_arg1:Array, _arg2:Array):void{
var _local3:int;
_a = _arg1;
_local3 = (_arg2.length - 1);
while (_local3 > -1) {
if (((!((_arg1[_local3] == _arg2[_local3]))) && (!((_arg1[_local3] == null))))){
_info[_info.length] = new ArrayTweenInfo(_local3, _a[_local3], (_arg2[_local3] - _a[_local3]));
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is Array))) || (!((_arg2 is Array))))){
return (false);
};
init((_arg1 as Array), _arg2);
return (true);
}
}
}//package gs.plugins
Section 143
//FilterPlugin (gs.plugins.FilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
import gs.utils.tween.*;
public class FilterPlugin extends TweenPlugin {
protected var _index:int;
protected var _filter:BitmapFilter;
protected var _type:Class;
protected var _remove:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Array;
_local4 = _target.filters;
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
if (!(_local4[_index] is _type)){
_index = (_local4.length - 1);
_local2 = (_local4.length - 1);
while (_local2 > -1) {
if ((_local4[_local2] is _type)){
_index = _local2;
break;
};
_local2--;
};
};
_local4[_index] = _filter;
_target.filters = _local4;
}
public function onCompleteTween():void{
var _local1:int;
var _local2:Array;
if (_remove){
_local2 = _target.filters;
if (!(_local2[_index] is _type)){
_local1 = (_local2.length - 1);
while (_local1 > -1) {
if ((_local2[_local1] is _type)){
_local2.splice(_local1, 1);
break;
};
_local1--;
};
} else {
_local2.splice(_index, 1);
};
_target.filters = _local2;
};
}
protected function initFilter(_arg1:Object, _arg2:BitmapFilter):void{
var _local3:Array;
var _local4:String;
var _local5:int;
var _local6:HexColorsPlugin;
var _local7:Object;
_local3 = _target.filters;
_index = -1;
if (_arg1.index != null){
_index = _arg1.index;
} else {
_local5 = (_local3.length - 1);
while (_local5 > -1) {
if ((_local3[_local5] is _type)){
_index = _local5;
break;
};
_local5--;
};
};
if ((((((_index == -1)) || ((_local3[_index] == null)))) || ((_arg1.addFilter == true)))){
_index = ((_arg1.index)!=null) ? _arg1.index : _local3.length;
_local3[_index] = _arg2;
_target.filters = _local3;
};
_filter = _local3[_index];
_remove = Boolean((_arg1.remove == true));
if (_remove){
this.onComplete = onCompleteTween;
};
_local7 = ((_arg1.isTV)==true) ? _arg1.exposedVars : _arg1;
for (_local4 in _local7) {
if (((((((((!((_local4 in _filter))) || ((_filter[_local4] == _local7[_local4])))) || ((_local4 == "remove")))) || ((_local4 == "index")))) || ((_local4 == "addFilter")))){
} else {
if ((((((_local4 == "color")) || ((_local4 == "highlightColor")))) || ((_local4 == "shadowColor")))){
_local6 = new HexColorsPlugin();
_local6.initColor(_filter, _local4, _filter[_local4], _local7[_local4]);
_tweens[_tweens.length] = new TweenInfo(_local6, "changeFactor", 0, 1, _local4, false);
} else {
if ((((((((_local4 == "quality")) || ((_local4 == "inner")))) || ((_local4 == "knockout")))) || ((_local4 == "hideObject")))){
_filter[_local4] = _local7[_local4];
} else {
addTween(_filter, _local4, _filter[_local4], _local7[_local4], _local4);
};
};
};
};
}
}
}//package gs.plugins
Section 144
//FramePlugin (gs.plugins.FramePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class FramePlugin extends TweenPlugin {
public var frame:int;
protected var _target:MovieClip;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function FramePlugin(){
this.propName = "frame";
this.overwriteProps = ["frame"];
this.round = true;
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.gotoAndStop(this.frame);
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((!((_arg1 is MovieClip))) || (isNaN(_arg2)))){
return (false);
};
_target = (_arg1 as MovieClip);
this.frame = _target.currentFrame;
addTween(this, "frame", this.frame, _arg2, "frame");
return (true);
}
}
}//package gs.plugins
Section 145
//GlowFilterPlugin (gs.plugins.GlowFilterPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.filters.*;
public class GlowFilterPlugin extends FilterPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function GlowFilterPlugin(){
this.propName = "glowFilter";
this.overwriteProps = ["glowFilter"];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_type = GlowFilter;
initFilter(_arg2, new GlowFilter(0xFFFFFF, 0, 0, 0, ((_arg2.strength) || (1)), ((_arg2.quality) || (2)), _arg2.inner, _arg2.knockout));
return (true);
}
}
}//package gs.plugins
Section 146
//HexColorsPlugin (gs.plugins.HexColorsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class HexColorsPlugin extends TweenPlugin {
protected var _colors:Array;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function HexColorsPlugin(){
this.propName = "hexColors";
this.overwriteProps = [];
_colors = [];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:int;
var _local3:Array;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
_local3 = _colors[_local2];
_local3[0][_local3[1]] = ((((_local3[2] + (_arg1 * _local3[3])) << 16) | ((_local3[4] + (_arg1 * _local3[5])) << 8)) | (_local3[6] + (_arg1 * _local3[7])));
_local2--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
for (_local4 in _arg2) {
initColor(_arg1, _local4, uint(_arg1[_local4]), uint(_arg2[_local4]));
};
return (true);
}
override public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (_colors.length - 1);
while (_local2 > -1) {
if (_arg1[_colors[_local2][1]] != undefined){
_colors.splice(_local2, 1);
};
_local2--;
};
super.killProps(_arg1);
}
public function initColor(_arg1:Object, _arg2:String, _arg3:uint, _arg4:uint):void{
var _local5:Number;
var _local6:Number;
var _local7:Number;
if (_arg3 != _arg4){
_local5 = (_arg3 >> 16);
_local6 = ((_arg3 >> 8) & 0xFF);
_local7 = (_arg3 & 0xFF);
_colors[_colors.length] = [_arg1, _arg2, _local5, ((_arg4 >> 16) - _local5), _local6, (((_arg4 >> 8) & 0xFF) - _local6), _local7, ((_arg4 & 0xFF) - _local7)];
this.overwriteProps[this.overwriteProps.length] = _arg2;
};
}
}
}//package gs.plugins
Section 147
//RemoveTintPlugin (gs.plugins.RemoveTintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RemoveTintPlugin extends TintPlugin {
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function RemoveTintPlugin(){
this.propName = "removeTint";
}
}
}//package gs.plugins
Section 148
//RoundPropsPlugin (gs.plugins.RoundPropsPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class RoundPropsPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function RoundPropsPlugin(){
this.propName = "roundProps";
this.overwriteProps = [];
this.round = true;
}
public function add(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
addTween(_arg1, _arg2, _arg3, (_arg3 + _arg4), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 149
//ShortRotationPlugin (gs.plugins.ShortRotationPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class ShortRotationPlugin extends TweenPlugin {
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function ShortRotationPlugin(){
this.propName = "shortRotation";
this.overwriteProps = [];
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:String;
if (typeof(_arg2) == "number"){
trace("WARNING: You appear to be using the old shortRotation syntax. Instead of passing a number, please pass an object with properties that correspond to the rotations values For example, TweenMax.to(mc, 2, {shortRotation:{rotationX:-170, rotationY:25}})");
return (false);
};
for (_local4 in _arg2) {
initRotation(_arg1, _local4, _arg1[_local4], _arg2[_local4]);
};
return (true);
}
public function initRotation(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number):void{
var _local5:Number;
_local5 = ((_arg4 - _arg3) % 360);
if (((_arg4 - _arg3) % 360) != (_local5 % 180)){
_local5 = ((_local5)<0) ? (_local5 + 360) : (_local5 - 360);
};
addTween(_arg1, _arg2, _arg3, (_arg3 + _local5), _arg2);
this.overwriteProps[this.overwriteProps.length] = _arg2;
}
}
}//package gs.plugins
Section 150
//TintPlugin (gs.plugins.TintPlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.geom.*;
import gs.utils.tween.*;
public class TintPlugin extends TweenPlugin {
protected var _ct:ColorTransform;
protected var _ignoreAlpha:Boolean;
protected var _target:DisplayObject;
public static const VERSION:Number = 1.1;
public static const API:Number = 1;
protected static var _props:Array = ["redMultiplier", "greenMultiplier", "blueMultiplier", "alphaMultiplier", "redOffset", "greenOffset", "blueOffset", "alphaOffset"];
public function TintPlugin(){
this.propName = "tint";
this.overwriteProps = ["tint"];
}
override public function set changeFactor(_arg1:Number):void{
var _local2:ColorTransform;
updateTweens(_arg1);
if (_ignoreAlpha){
_local2 = _target.transform.colorTransform;
_ct.alphaMultiplier = _local2.alphaMultiplier;
_ct.alphaOffset = _local2.alphaOffset;
};
_target.transform.colorTransform = _ct;
}
public function init(_arg1:DisplayObject, _arg2:ColorTransform):void{
var _local3:int;
var _local4:String;
_target = _arg1;
_ct = _target.transform.colorTransform;
_local3 = (_props.length - 1);
while (_local3 > -1) {
_local4 = _props[_local3];
if (_ct[_local4] != _arg2[_local4]){
_tweens[_tweens.length] = new TweenInfo(_ct, _local4, _ct[_local4], (_arg2[_local4] - _ct[_local4]), "tint", false);
};
_local3--;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
var _local4:ColorTransform;
if (!(_arg1 is DisplayObject)){
return (false);
};
_local4 = new ColorTransform();
if (((!((_arg2 == null))) && (!((_arg3.exposedVars.removeTint == true))))){
_local4.color = uint(_arg2);
};
_ignoreAlpha = true;
init((_arg1 as DisplayObject), _local4);
return (true);
}
}
}//package gs.plugins
Section 151
//TweenPlugin (gs.plugins.TweenPlugin)
package gs.plugins {
import gs.*;
import gs.utils.tween.*;
public class TweenPlugin {
public var overwriteProps:Array;
protected var _tweens:Array;
public var round:Boolean;
public var onComplete:Function;
public var propName:String;
protected var _changeFactor:Number;// = 0
public static const VERSION:Number = 1.03;
public static const API:Number = 1;
public function TweenPlugin(){
_tweens = [];
_changeFactor = 0;
super();
}
protected function updateTweens(_arg1:Number):void{
var _local2:int;
var _local3:TweenInfo;
var _local4:Number;
var _local5:int;
if (this.round){
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local4 = (_local3.start + (_local3.change * _arg1));
_local5 = ((_local4)<0) ? -1 : 1;
_local3.target[_local3.property] = ((((_local4 % 1) * _local5))>0.5) ? (int(_local4) + _local5) : int(_local4);
_local2--;
};
} else {
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
_local3 = _tweens[_local2];
_local3.target[_local3.property] = (_local3.start + (_local3.change * _arg1));
_local2--;
};
};
}
public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_changeFactor = _arg1;
}
protected function addTween(_arg1:Object, _arg2:String, _arg3:Number, _arg4, _arg5:String=null):void{
var _local6:Number;
if (_arg4 != null){
_local6 = ((typeof(_arg4))=="number") ? (_arg4 - _arg3) : Number(_arg4);
if (_local6 != 0){
_tweens[_tweens.length] = new TweenInfo(_arg1, _arg2, _arg3, _local6, ((_arg5) || (_arg2)), false);
};
};
}
public function killProps(_arg1:Object):void{
var _local2:int;
_local2 = (this.overwriteProps.length - 1);
while (_local2 > -1) {
if ((this.overwriteProps[_local2] in _arg1)){
this.overwriteProps.splice(_local2, 1);
};
_local2--;
};
_local2 = (_tweens.length - 1);
while (_local2 > -1) {
if ((_tweens[_local2].name in _arg1)){
_tweens.splice(_local2, 1);
};
_local2--;
};
}
public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
addTween(_arg1, this.propName, _arg1[this.propName], _arg2, this.propName);
return (true);
}
public function get changeFactor():Number{
return (_changeFactor);
}
public static function activate(_arg1:Array):Boolean{
var _local2:int;
var _local3:Object;
_local2 = (_arg1.length - 1);
while (_local2 > -1) {
_local3 = new (_arg1[_local2]);
TweenLite.plugins[_local3.propName] = _arg1[_local2];
_local2--;
};
return (true);
}
}
}//package gs.plugins
Section 152
//VisiblePlugin (gs.plugins.VisiblePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
public class VisiblePlugin extends TweenPlugin {
protected var _tween:TweenLite;
protected var _visible:Boolean;
protected var _target:Object;
public static const VERSION:Number = 1;
public static const API:Number = 1;
public function VisiblePlugin(){
this.propName = "visible";
this.overwriteProps = ["visible"];
this.onComplete = onCompleteTween;
}
override public function set changeFactor(_arg1:Number):void{
if (_target.visible != true){
_target.visible = true;
};
}
public function onCompleteTween():void{
if (((!((_tween.vars.runBackwards == true))) && ((_tween.ease == _tween.vars.ease)))){
_target.visible = _visible;
};
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
_target = _arg1;
_tween = _arg3;
_visible = Boolean(_arg2);
return (true);
}
}
}//package gs.plugins
Section 153
//VolumePlugin (gs.plugins.VolumePlugin)
package gs.plugins {
import flash.display.*;
import gs.*;
import flash.media.*;
public class VolumePlugin extends TweenPlugin {
protected var _st:SoundTransform;
protected var _target:Object;
public static const VERSION:Number = 1.01;
public static const API:Number = 1;
public function VolumePlugin(){
this.propName = "volume";
this.overwriteProps = ["volume"];
}
override public function set changeFactor(_arg1:Number):void{
updateTweens(_arg1);
_target.soundTransform = _st;
}
override public function onInitTween(_arg1:Object, _arg2, _arg3:TweenLite):Boolean{
if (((isNaN(_arg2)) || (!(_arg1.hasOwnProperty("soundTransform"))))){
return (false);
};
_target = _arg1;
_st = _target.soundTransform;
addTween(_st, "volume", _st.volume, _arg2, "volume");
return (true);
}
}
}//package gs.plugins
Section 154
//ArrayTweenInfo (gs.utils.tween.ArrayTweenInfo)
package gs.utils.tween {
public class ArrayTweenInfo {
public var change:Number;
public var index:uint;
public var start:Number;
public function ArrayTweenInfo(_arg1:uint, _arg2:Number, _arg3:Number){
this.index = _arg1;
this.start = _arg2;
this.change = _arg3;
}
}
}//package gs.utils.tween
Section 155
//TweenInfo (gs.utils.tween.TweenInfo)
package gs.utils.tween {
public class TweenInfo {
public var start:Number;
public var name:String;
public var change:Number;
public var target:Object;
public var property:String;
public var isPlugin:Boolean;
public function TweenInfo(_arg1:Object, _arg2:String, _arg3:Number, _arg4:Number, _arg5:String, _arg6:Boolean){
this.target = _arg1;
this.property = _arg2;
this.start = _arg3;
this.change = _arg4;
this.name = _arg5;
this.isPlugin = _arg6;
}
}
}//package gs.utils.tween
Section 156
//OverwriteManager (gs.OverwriteManager)
package gs {
import gs.utils.tween.*;
import flash.utils.*;
import flash.errors.*;
public class OverwriteManager {
public static const ALL:int = 1;
public static const NONE:int = 0;
public static const AUTO:int = 2;
public static const CONCURRENT:int = 3;
public static const version:Number = 3.12;
public static var mode:int;
public static var enabled:Boolean;
public static function killVars(_arg1:Object, _arg2:Object, _arg3:Array):void{
var _local4:int;
var _local5:String;
var _local6:TweenInfo;
_local4 = (_arg3.length - 1);
while (_local4 > -1) {
_local6 = _arg3[_local4];
if ((_local6.name in _arg1)){
_arg3.splice(_local4, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_arg1);
if (_local6.target.overwriteProps.length == 0){
_arg3.splice(_local4, 1);
};
};
};
_local4--;
};
for (_local5 in _arg1) {
delete _arg2[_local5];
};
}
public static function manageOverwrites(_arg1:TweenLite, _arg2:Array):void{
var _local3:Object;
var _local4:int;
var _local5:Number;
var _local6:Array;
var _local7:int;
var _local8:TweenLite;
var _local9:int;
var _local10:Array;
var _local11:Object;
var _local12:int;
var _local13:TweenInfo;
var _local14:Array;
_local3 = _arg1.vars;
_local4 = ((_local3.overwrite)==undefined) ? mode : int(_local3.overwrite);
if ((((_local4 < 2)) || ((_arg2 == null)))){
return;
};
_local5 = _arg1.startTime;
_local6 = [];
_local9 = -1;
_local7 = (_arg2.length - 1);
while (_local7 > -1) {
_local8 = _arg2[_local7];
if (_local8 == _arg1){
_local9 = _local7;
} else {
if ((((((_local7 < _local9)) && ((_local8.startTime <= _local5)))) && (((_local8.startTime + ((_local8.duration * 1000) / _local8.combinedTimeScale)) > _local5)))){
_local6[_local6.length] = _local8;
};
};
_local7--;
};
if ((((_local6.length == 0)) || ((_arg1.tweens.length == 0)))){
return;
};
if (_local4 == AUTO){
_local10 = _arg1.tweens;
_local11 = {};
_local7 = (_local10.length - 1);
while (_local7 > -1) {
_local13 = _local10[_local7];
if (_local13.isPlugin){
if (_local13.name == "_MULTIPLE_"){
_local14 = _local13.target.overwriteProps;
_local12 = (_local14.length - 1);
while (_local12 > -1) {
_local11[_local14[_local12]] = true;
_local12--;
};
} else {
_local11[_local13.name] = true;
};
_local11[_local13.target.propName] = true;
} else {
_local11[_local13.name] = true;
};
_local7--;
};
_local7 = (_local6.length - 1);
while (_local7 > -1) {
killVars(_local11, _local6[_local7].exposedVars, _local6[_local7].tweens);
_local7--;
};
} else {
_local7 = (_local6.length - 1);
while (_local7 > -1) {
_local6[_local7].enabled = false;
_local7--;
};
};
}
public static function init(_arg1:int=2):int{
if (TweenLite.version < 10.09){
trace("TweenLite warning: Your TweenLite class needs to be updated to work with OverwriteManager (or you may need to clear your ASO files). Please download and install the latest version from http://www.tweenlite.com.");
};
TweenLite.overwriteManager = OverwriteManager;
mode = _arg1;
enabled = true;
return (mode);
}
}
}//package gs
Section 157
//TweenLite (gs.TweenLite)
package gs {
import flash.display.*;
import flash.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
import flash.utils.*;
public class TweenLite {
public var delay:Number;
protected var _hasUpdate:Boolean;
protected var _hasPlugins:Boolean;
public var started:Boolean;
public var initted:Boolean;
public var active:Boolean;
public var startTime:Number;
public var target:Object;
public var duration:Number;
public var gc:Boolean;
public var vars:Object;
public var ease:Function;
public var tweens:Array;
public var exposedVars:Object;
public var combinedTimeScale:Number;
public var initTime:Number;
public static const version:Number = 10.092;
private static var _timer:Timer = new Timer(2000);
public static var defaultEase:Function = TweenLite.easeOut;
public static var plugins:Object = {};
public static var currentTime:uint;
public static var masterList:Dictionary = new Dictionary(false);
protected static var _reservedProps:Object = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, runBackwards:1, startAt:1, onUpdate:1, onUpdateParams:1, roundProps:1, onStart:1, onStartParams:1, persist:1, renderOnStart:1, proxiedEase:1, easeParams:1, yoyo:1, loop:1, onCompleteListener:1, onUpdateListener:1, onStartListener:1, orientToBezier:1, timeScale:1};
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
public static var timingSprite:Sprite = new Sprite();
public static var overwriteManager:Object;
private static var _tlInitted:Boolean;
public function TweenLite(_arg1:Object, _arg2:Number, _arg3:Object){
var _local4:int;
super();
if (_arg1 == null){
return;
};
if (!_tlInitted){
TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin]);
currentTime = getTimer();
timingSprite.addEventListener(Event.ENTER_FRAME, updateAll, false, 0, true);
if (overwriteManager == null){
overwriteManager = {mode:1, enabled:false};
};
_timer.addEventListener("timer", killGarbage, false, 0, true);
_timer.start();
_tlInitted = true;
};
this.vars = _arg3;
this.duration = ((_arg2) || (0.001));
this.delay = ((_arg3.delay) || (0));
this.combinedTimeScale = ((_arg3.timeScale) || (1));
this.active = Boolean((((_arg2 == 0)) && ((this.delay == 0))));
this.target = _arg1;
if (typeof(this.vars.ease) != "function"){
this.vars.ease = defaultEase;
};
if (this.vars.easeParams != null){
this.vars.proxiedEase = this.vars.ease;
this.vars.ease = easeProxy;
};
this.ease = this.vars.ease;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedVars : this.vars;
this.tweens = [];
this.initTime = currentTime;
this.startTime = (this.initTime + (this.delay * 1000));
_local4 = ((((_arg3.overwrite == undefined)) || (((!(overwriteManager.enabled)) && ((_arg3.overwrite > 1)))))) ? overwriteManager.mode : int(_arg3.overwrite);
if (((!((_arg1 in masterList))) || ((_local4 == 1)))){
masterList[_arg1] = [this];
} else {
masterList[_arg1].push(this);
};
if ((((((this.vars.runBackwards == true)) && (!((this.vars.renderOnStart == true))))) || (this.active))){
initTweenVals();
if (this.active){
render((this.startTime + 1));
} else {
render(this.startTime);
};
if (((((!((this.exposedVars.visible == null))) && ((this.vars.runBackwards == true)))) && ((this.target is DisplayObject)))){
this.target.visible = this.exposedVars.visible;
};
};
}
public function set enabled(_arg1:Boolean):void{
var _local2:Array;
var _local3:Boolean;
var _local4:int;
if (_arg1){
if (!(this.target in masterList)){
masterList[this.target] = [this];
} else {
_local2 = masterList[this.target];
_local4 = (_local2.length - 1);
while (_local4 > -1) {
if (_local2[_local4] == this){
_local3 = true;
break;
};
_local4--;
};
if (!_local3){
_local2[_local2.length] = this;
};
};
};
this.gc = (_arg1) ? false : true;
if (this.gc){
this.active = false;
} else {
this.active = this.started;
};
}
public function clear():void{
this.tweens = [];
this.vars = (this.exposedVars = {ease:this.vars.ease});
_hasUpdate = false;
}
public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = ((_arg1 - this.startTime) * 0.001);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
public function activate():void{
this.started = (this.active = true);
if (!this.initted){
initTweenVals();
};
if (this.vars.onStart != null){
this.vars.onStart.apply(null, this.vars.onStartParams);
};
if (this.duration == 0.001){
this.startTime = (this.startTime - 1);
};
}
public function get enabled():Boolean{
return ((this.gc) ? false : true);
}
public function initTweenVals():void{
var _local1:String;
var _local2:int;
var _local3:*;
var _local4:TweenInfo;
if (((!((this.exposedVars.timeScale == undefined))) && (this.target.hasOwnProperty("timeScale")))){
this.tweens[this.tweens.length] = new TweenInfo(this.target, "timeScale", this.target.timeScale, (this.exposedVars.timeScale - this.target.timeScale), "timeScale", false);
};
for (_local1 in this.exposedVars) {
if ((_local1 in _reservedProps)){
} else {
if ((_local1 in plugins)){
_local3 = new (plugins[_local1]);
if (_local3.onInitTween(this.target, this.exposedVars[_local1], this) == false){
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
} else {
this.tweens[this.tweens.length] = new TweenInfo(_local3, "changeFactor", 0, 1, ((_local3.overwriteProps.length)==1) ? _local3.overwriteProps[0] : "_MULTIPLE_", true);
_hasPlugins = true;
};
} else {
this.tweens[this.tweens.length] = new TweenInfo(this.target, _local1, this.target[_local1], ((typeof(this.exposedVars[_local1]))=="number") ? (this.exposedVars[_local1] - this.target[_local1]) : Number(this.exposedVars[_local1]), _local1, false);
};
};
};
if (this.vars.runBackwards == true){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local4 = this.tweens[_local2];
this.tweens[_local2].start = (_local4.start + _local4.change);
_local4.change = -(_local4.change);
_local2--;
};
};
if (this.vars.onUpdate != null){
_hasUpdate = true;
};
if (((TweenLite.overwriteManager.enabled) && ((this.target in masterList)))){
overwriteManager.manageOverwrites(this, masterList[this.target]);
};
this.initted = true;
}
protected function easeProxy(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.proxiedEase.apply(null, arguments.concat(this.vars.easeParams)));
}
public function killVars(_arg1:Object):void{
if (overwriteManager.enabled){
overwriteManager.killVars(_arg1, this.exposedVars, this.tweens);
};
}
public function complete(_arg1:Boolean=false):void{
var _local2:int;
if (!_arg1){
if (!this.initted){
initTweenVals();
};
this.startTime = (currentTime - ((this.duration * 1000) / this.combinedTimeScale));
render(currentTime);
return;
};
if (_hasPlugins){
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
if (((this.tweens[_local2].isPlugin) && (!((this.tweens[_local2].target.onComplete == null))))){
this.tweens[_local2].target.onComplete();
};
_local2--;
};
};
if (this.vars.persist != true){
this.enabled = false;
};
if (this.vars.onComplete != null){
this.vars.onComplete.apply(null, this.vars.onCompleteParams);
};
}
public static function updateAll(_arg1:Event=null):void{
var _local2:uint;
var _local3:Dictionary;
var _local4:Array;
var _local5:int;
var _local6:TweenLite;
_local2 = (currentTime = getTimer());
_local3 = masterList;
for each (_local4 in _local3) {
_local5 = (_local4.length - 1);
while (_local5 > -1) {
_local6 = _local4[_local5];
if (_local6.active){
_local6.render(_local2);
} else {
if (_local6.gc){
_local4.splice(_local5, 1);
} else {
if (_local2 >= _local6.startTime){
_local6.activate();
_local6.render(_local2);
};
};
};
_local5--;
};
};
}
public static function removeTween(_arg1:TweenLite, _arg2:Boolean=true):void{
if (_arg1 != null){
if (_arg2){
_arg1.clear();
};
_arg1.enabled = false;
};
}
public static function killTweensOf(_arg1:Object=null, _arg2:Boolean=false):void{
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
if (((!((_arg1 == null))) && ((_arg1 in masterList)))){
_local3 = masterList[_arg1];
_local4 = (_local3.length - 1);
while (_local4 > -1) {
_local5 = _local3[_local4];
if (((_arg2) && (!(_local5.gc)))){
_local5.complete(false);
};
_local5.clear();
_local4--;
};
delete masterList[_arg1];
};
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
_arg3.runBackwards = true;
return (new TweenLite(_arg1, _arg2, _arg3));
}
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return ((((-(_arg3) * _arg1) * (_arg1 - 2)) + _arg2));
}
protected static function killGarbage(_arg1:TimerEvent):void{
var _local2:Dictionary;
var _local3:Object;
_local2 = masterList;
for (_local3 in _local2) {
if (_local2[_local3].length == 0){
delete _local2[_local3];
};
};
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null):TweenLite{
return (new TweenLite(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, overwrite:0}));
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenLite{
return (new TweenLite(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 158
//TweenMax (gs.TweenMax)
package gs {
import flash.events.*;
import gs.events.*;
import gs.utils.tween.*;
import gs.plugins.*;
import flash.utils.*;
public class TweenMax extends TweenLite implements IEventDispatcher {
protected var _dispatcher:EventDispatcher;
protected var _callbacks:Object;
public var pauseTime:Number;
protected var _repeatCount:Number;
protected var _timeScale:Number;
public static const version:Number = 10.12;
public static var removeTween:Function = TweenLite.removeTween;
private static var _overwriteMode:int = (OverwriteManager.enabled) ? OverwriteManager.mode : OverwriteManager.init();
;
protected static var _pausedTweens:Dictionary = new Dictionary(false);
protected static var _globalTimeScale:Number = 1;
public static var killTweensOf:Function = TweenLite.killTweensOf;
public static var killDelayedCallsTo:Function = TweenLite.killTweensOf;
private static var _activatedPlugins:Boolean = TweenPlugin.activate([TintPlugin, RemoveTintPlugin, FramePlugin, AutoAlphaPlugin, VisiblePlugin, VolumePlugin, EndArrayPlugin, HexColorsPlugin, BlurFilterPlugin, ColorMatrixFilterPlugin, BevelFilterPlugin, DropShadowFilterPlugin, GlowFilterPlugin, RoundPropsPlugin, BezierPlugin, BezierThroughPlugin, ShortRotationPlugin]);
public function TweenMax(_arg1:Object, _arg2:Number, _arg3:Object){
super(_arg1, _arg2, _arg3);
if (TweenLite.version < 10.092){
trace("TweenMax error! Please update your TweenLite class or try deleting your ASO files. TweenMax requires a more recent version. Download updates at http://www.TweenMax.com.");
};
if (((!((this.combinedTimeScale == 1))) && ((this.target is TweenMax)))){
_timeScale = 1;
this.combinedTimeScale = _globalTimeScale;
} else {
_timeScale = this.combinedTimeScale;
this.combinedTimeScale = (this.combinedTimeScale * _globalTimeScale);
};
if (((!((this.combinedTimeScale == 1))) && (!((this.delay == 0))))){
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
initDispatcher();
if ((((_arg2 == 0)) && ((this.delay == 0)))){
onUpdateDispatcher();
onCompleteDispatcher();
};
};
_repeatCount = 0;
if (((!(isNaN(this.vars.yoyo))) || (!(isNaN(this.vars.loop))))){
this.vars.persist = true;
};
if ((((this.delay == 0)) && (!((this.vars.startAt == null))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
}
public function set repeatCount(_arg1:Number):void{
_repeatCount = _arg1;
}
override public function set enabled(_arg1:Boolean):void{
if (!_arg1){
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
super.enabled = _arg1;
if (_arg1){
this.combinedTimeScale = (_timeScale * _globalTimeScale);
};
}
public function set reversed(_arg1:Boolean):void{
if (this.reversed != _arg1){
reverse();
};
}
override public function render(_arg1:uint):void{
var _local2:Number;
var _local3:Number;
var _local4:TweenInfo;
var _local5:int;
_local2 = (((_arg1 - this.startTime) * 0.001) * this.combinedTimeScale);
if (_local2 >= this.duration){
_local2 = this.duration;
_local3 = ((((this.ease == this.vars.ease)) || ((this.duration == 0.001)))) ? 1 : 0;
} else {
_local3 = this.ease(_local2, 0, 1, this.duration);
};
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local4 = this.tweens[_local5];
_local4.target[_local4.property] = (_local4.start + (_local3 * _local4.change));
_local5--;
};
if (_hasUpdate){
this.vars.onUpdate.apply(null, this.vars.onUpdateParams);
};
if (_local2 == this.duration){
complete(true);
};
}
protected function adjustStartValues():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:TweenInfo;
var _local6:int;
_local1 = this.progress;
if (_local1 != 0){
_local2 = this.ease(_local1, 0, 1, 1);
_local3 = (1 / (1 - _local2));
_local6 = (this.tweens.length - 1);
while (_local6 > -1) {
_local5 = this.tweens[_local6];
_local4 = (_local5.start + _local5.change);
if (_local5.isPlugin){
_local5.change = ((_local4 - _local2) * _local3);
} else {
_local5.change = ((_local4 - _local5.target[_local5.property]) * _local3);
};
_local5.start = (_local4 - _local5.change);
_local6--;
};
};
}
public function get timeScale():Number{
return (_timeScale);
}
public function restart(_arg1:Boolean=false):void{
if (_arg1){
this.initTime = currentTime;
this.startTime = (currentTime + (this.delay * (1000 / this.combinedTimeScale)));
} else {
this.startTime = currentTime;
this.initTime = (currentTime - (this.delay * (1000 / this.combinedTimeScale)));
};
_repeatCount = 0;
if (this.target != this.vars.onComplete){
render(this.startTime);
};
this.pauseTime = NaN;
_pausedTweens[this] = null;
delete _pausedTweens[this];
this.enabled = true;
}
public function get paused():Boolean{
return (!(isNaN(this.pauseTime)));
}
public function killProperties(_arg1:Array):void{
var _local2:Object;
var _local3:int;
_local2 = {};
_local3 = (_arg1.length - 1);
while (_local3 > -1) {
_local2[_arg1[_local3]] = true;
_local3--;
};
killVars(_local2);
}
public function resume():void{
this.enabled = true;
if (!isNaN(this.pauseTime)){
this.initTime = (this.initTime + (currentTime - this.pauseTime));
this.startTime = (this.initTime + (this.delay * (1000 / this.combinedTimeScale)));
this.pauseTime = NaN;
if (((!(this.started)) && ((currentTime >= this.startTime)))){
activate();
} else {
this.active = this.started;
};
_pausedTweens[this] = null;
delete _pausedTweens[this];
};
}
override public function complete(_arg1:Boolean=false):void{
if (((((!(isNaN(this.vars.yoyo))) && ((((_repeatCount < this.vars.yoyo)) || ((this.vars.yoyo == 0)))))) || (((!(isNaN(this.vars.loop))) && ((((_repeatCount < this.vars.loop)) || ((this.vars.loop == 0)))))))){
_repeatCount++;
if (!isNaN(this.vars.yoyo)){
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
};
this.startTime = (_arg1) ? (this.startTime + (this.duration * (1000 / this.combinedTimeScale))) : currentTime;
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
} else {
if (this.vars.persist == true){
pause();
};
};
super.complete(_arg1);
}
public function invalidate(_arg1:Boolean=true):void{
var _local2:Number;
if (this.initted){
_local2 = this.progress;
if (((!(_arg1)) && (!((_local2 == 0))))){
this.progress = 0;
};
this.tweens = [];
_hasPlugins = false;
this.exposedVars = ((this.vars.isTV)==true) ? this.vars.exposedProps : this.vars;
initTweenVals();
_timeScale = ((this.vars.timeScale) || (1));
this.combinedTimeScale = (_timeScale * _globalTimeScale);
this.delay = ((this.vars.delay) || (0));
if (isNaN(this.pauseTime)){
this.startTime = (this.initTime + ((this.delay * 1000) / this.combinedTimeScale));
};
if (((((!((this.vars.onCompleteListener == null))) || (!((this.vars.onUpdateListener == null))))) || (!((this.vars.onStartListener == null))))){
if (_dispatcher != null){
this.vars.onStart = _callbacks.onStart;
this.vars.onUpdate = _callbacks.onUpdate;
this.vars.onComplete = _callbacks.onComplete;
_dispatcher = null;
};
initDispatcher();
};
if (_local2 != 0){
if (_arg1){
adjustStartValues();
} else {
this.progress = _local2;
};
};
};
}
public function get progress():Number{
var _local1:Number;
var _local2:Number;
_local1 = (isNaN(this.pauseTime)) ? currentTime : this.pauseTime;
_local2 = (((((_local1 - this.initTime) * 0.001) - (this.delay / this.combinedTimeScale)) / this.duration) * this.combinedTimeScale);
if (_local2 > 1){
return (1);
};
if (_local2 < 0){
return (0);
};
return (_local2);
}
public function willTrigger(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.willTrigger(_arg1));
}
public function dispatchEvent(_arg1:Event):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.dispatchEvent(_arg1));
}
public function get reversed():Boolean{
return ((this.ease == reverseEase));
}
public function get repeatCount():Number{
return (_repeatCount);
}
protected function onStartDispatcher(... _args):void{
if (_callbacks.onStart != null){
_callbacks.onStart.apply(null, this.vars.onStartParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.START));
}
public function setDestination(_arg1:String, _arg2, _arg3:Boolean=true):void{
var _local4:Number;
var _local5:int;
var _local6:TweenInfo;
var _local7:Object;
var _local8:Object;
var _local9:Array;
var _local10:Boolean;
var _local11:Array;
var _local12:Object;
_local4 = this.progress;
if (this.initted){
if (!_arg3){
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
_local6.target[_local6.property] = _local6.start;
};
_local5--;
};
};
_local7 = this.vars;
_local8 = this.exposedVars;
_local9 = this.tweens;
_local10 = _hasPlugins;
this.tweens = [];
this.vars = (this.exposedVars = {});
this.vars[_arg1] = _arg2;
initTweenVals();
if (((!((this.ease == reverseEase))) && ((_local7.ease is Function)))){
this.ease = _local7.ease;
};
if (((_arg3) && (!((_local4 == 0))))){
adjustStartValues();
};
_local11 = this.tweens;
this.vars = _local7;
this.exposedVars = _local8;
this.tweens = _local9;
_local12 = {};
_local12[_arg1] = true;
_local5 = (this.tweens.length - 1);
while (_local5 > -1) {
_local6 = this.tweens[_local5];
if (_local6.name == _arg1){
this.tweens.splice(_local5, 1);
} else {
if (((_local6.isPlugin) && ((_local6.name == "_MULTIPLE_")))){
_local6.target.killProps(_local12);
if (_local6.target.overwriteProps.length == 0){
this.tweens.splice(_local5, 1);
};
};
};
_local5--;
};
this.tweens = this.tweens.concat(_local11);
_hasPlugins = Boolean(((_local10) || (_hasPlugins)));
};
this.vars[_arg1] = (this.exposedVars[_arg1] = _arg2);
}
public function set timeScale(_arg1:Number):void{
if (_arg1 < 1E-5){
_arg1 = (_timeScale = 1E-5);
} else {
_timeScale = _arg1;
_arg1 = (_arg1 * _globalTimeScale);
};
this.initTime = ((currentTime - ((((currentTime - this.initTime) - (this.delay * (1000 / this.combinedTimeScale))) * this.combinedTimeScale) * (1 / _arg1))) - (this.delay * (1000 / _arg1)));
if (this.startTime != 999999999999999){
this.startTime = (this.initTime + (this.delay * (1000 / _arg1)));
};
this.combinedTimeScale = _arg1;
}
public function removeEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false):void{
if (_dispatcher != null){
_dispatcher.removeEventListener(_arg1, _arg2, _arg3);
};
}
override public function initTweenVals():void{
var _local1:int;
var _local2:int;
var _local3:String;
var _local4:String;
var _local5:Array;
var _local6:Object;
var _local7:TweenInfo;
if (((!((this.vars.startAt == null))) && (!((this.delay == 0))))){
this.vars.startAt.overwrite = 0;
new TweenMax(this.target, 0, this.vars.startAt);
};
super.initTweenVals();
if ((((this.exposedVars.roundProps is Array)) && (!((TweenLite.plugins.roundProps == null))))){
_local5 = this.exposedVars.roundProps;
_local1 = (_local5.length - 1);
while (_local1 > -1) {
_local3 = _local5[_local1];
_local2 = (this.tweens.length - 1);
while (_local2 > -1) {
_local7 = this.tweens[_local2];
if (_local7.name == _local3){
if (_local7.isPlugin){
_local7.target.round = true;
} else {
if (_local6 == null){
_local6 = new TweenLite.plugins.roundProps();
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
_hasPlugins = true;
this.tweens[_local2] = new TweenInfo(_local6, "changeFactor", 0, 1, _local3, true);
} else {
_local6.add(_local7.target, _local3, _local7.start, _local7.change);
this.tweens.splice(_local2, 1);
};
};
} else {
if (((((_local7.isPlugin) && ((_local7.name == "_MULTIPLE_")))) && (!(_local7.target.round)))){
_local4 = ((" " + _local7.target.overwriteProps.join(" ")) + " ");
if (_local4.indexOf(((" " + _local3) + " ")) != -1){
_local7.target.round = true;
};
};
};
_local2--;
};
_local1--;
};
};
}
protected function initDispatcher():void{
var _local1:Object;
var _local2:String;
if (_dispatcher == null){
_dispatcher = new EventDispatcher(this);
_callbacks = {onStart:this.vars.onStart, onUpdate:this.vars.onUpdate, onComplete:this.vars.onComplete};
if (this.vars.isTV == true){
this.vars = this.vars.clone();
} else {
_local1 = {};
for (_local2 in this.vars) {
_local1[_local2] = this.vars[_local2];
};
this.vars = _local1;
};
this.vars.onStart = onStartDispatcher;
this.vars.onComplete = onCompleteDispatcher;
if ((this.vars.onStartListener is Function)){
_dispatcher.addEventListener(TweenEvent.START, this.vars.onStartListener, false, 0, true);
};
if ((this.vars.onUpdateListener is Function)){
_dispatcher.addEventListener(TweenEvent.UPDATE, this.vars.onUpdateListener, false, 0, true);
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
if ((this.vars.onCompleteListener is Function)){
_dispatcher.addEventListener(TweenEvent.COMPLETE, this.vars.onCompleteListener, false, 0, true);
};
};
}
protected function onUpdateDispatcher(... _args):void{
if (_callbacks.onUpdate != null){
_callbacks.onUpdate.apply(null, this.vars.onUpdateParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.UPDATE));
}
public function set progress(_arg1:Number):void{
this.startTime = (currentTime - ((this.duration * _arg1) * 1000));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
if (!this.started){
activate();
};
render(currentTime);
if (!isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.active = false;
};
}
public function reverse(_arg1:Boolean=true, _arg2:Boolean=true):void{
var _local3:Number;
this.ease = ((this.vars.ease)==this.ease) ? reverseEase : this.vars.ease;
_local3 = this.progress;
if (((_arg1) && ((_local3 > 0)))){
this.startTime = (currentTime - ((((1 - _local3) * this.duration) * 1000) / this.combinedTimeScale));
this.initTime = (this.startTime - (this.delay * (1000 / this.combinedTimeScale)));
};
if (_arg2 != false){
if (_local3 < 1){
resume();
} else {
restart();
};
};
}
public function addEventListener(_arg1:String, _arg2:Function, _arg3:Boolean=false, _arg4:int=0, _arg5:Boolean=false):void{
if (_dispatcher == null){
initDispatcher();
};
if ((((_arg1 == TweenEvent.UPDATE)) && (!((this.vars.onUpdate == onUpdateDispatcher))))){
this.vars.onUpdate = onUpdateDispatcher;
_hasUpdate = true;
};
_dispatcher.addEventListener(_arg1, _arg2, _arg3, _arg4, _arg5);
}
public function set paused(_arg1:Boolean):void{
if (_arg1){
pause();
} else {
resume();
};
}
public function hasEventListener(_arg1:String):Boolean{
if (_dispatcher == null){
return (false);
};
return (_dispatcher.hasEventListener(_arg1));
}
public function pause():void{
if (isNaN(this.pauseTime)){
this.pauseTime = currentTime;
this.startTime = 999999999999999;
this.enabled = false;
_pausedTweens[this] = this;
};
}
public function reverseEase(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return (this.vars.ease((_arg4 - _arg1), _arg2, _arg3, _arg4));
}
protected function onCompleteDispatcher(... _args):void{
if (_callbacks.onComplete != null){
_callbacks.onComplete.apply(null, this.vars.onCompleteParams);
};
_dispatcher.dispatchEvent(new TweenEvent(TweenEvent.COMPLETE));
}
public static function set globalTimeScale(_arg1:Number):void{
setGlobalTimeScale(_arg1);
}
public static function pauseAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(true, _arg1, _arg2);
}
public static function killAllDelayedCalls(_arg1:Boolean=false):void{
killAll(_arg1, false, true);
}
public static function setGlobalTimeScale(_arg1:Number):void{
var _local2:Dictionary;
var _local3:int;
var _local4:Array;
if (_arg1 < 1E-5){
_arg1 = 1E-5;
};
_local2 = masterList;
_globalTimeScale = _arg1;
for each (_local4 in _local2) {
_local3 = (_local4.length - 1);
while (_local3 > -1) {
if ((_local4[_local3] is TweenMax)){
_local4[_local3].timeScale = (_local4[_local3].timeScale * 1);
};
_local3--;
};
};
}
public static function get globalTimeScale():Number{
return (_globalTimeScale);
}
public static function getTweensOf(_arg1:Object):Array{
var _local2:Array;
var _local3:Array;
var _local4:TweenLite;
var _local5:int;
_local2 = masterList[_arg1];
_local3 = [];
if (_local2 != null){
_local5 = (_local2.length - 1);
while (_local5 > -1) {
if (!_local2[_local5].gc){
_local3[_local3.length] = _local2[_local5];
};
_local5--;
};
};
for each (_local4 in _pausedTweens) {
if (_local4.target == _arg1){
_local3[_local3.length] = _local4;
};
};
return (_local3);
}
public static function delayedCall(_arg1:Number, _arg2:Function, _arg3:Array=null, _arg4:Boolean=false):TweenMax{
return (new TweenMax(_arg2, 0, {delay:_arg1, onComplete:_arg2, onCompleteParams:_arg3, persist:_arg4, overwrite:0}));
}
public static function isTweening(_arg1:Object):Boolean{
var _local2:Array;
var _local3:int;
_local2 = getTweensOf(_arg1);
_local3 = (_local2.length - 1);
while (_local3 > -1) {
if (((((_local2[_local3].active) || ((_local2[_local3].startTime == currentTime)))) && (!(_local2[_local3].gc)))){
return (true);
};
_local3--;
};
return (false);
}
public static function changePause(_arg1:Boolean, _arg2:Boolean=true, _arg3:Boolean=false):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local4[_local6] is TweenMax)) && ((((_local5 == _arg3)) || (!((_local5 == _arg2))))))){
_local4[_local6].paused = _arg1;
};
_local6--;
};
}
public static function killAllTweens(_arg1:Boolean=false):void{
killAll(_arg1, true, false);
}
public static function from(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
_arg3.runBackwards = true;
return (new TweenMax(_arg1, _arg2, _arg3));
}
public static function killAll(_arg1:Boolean=false, _arg2:Boolean=true, _arg3:Boolean=true):void{
var _local4:Array;
var _local5:Boolean;
var _local6:int;
_local4 = getAllTweens();
_local6 = (_local4.length - 1);
while (_local6 > -1) {
_local5 = (_local4[_local6].target == _local4[_local6].vars.onComplete);
if ((((_local5 == _arg3)) || (!((_local5 == _arg2))))){
if (_arg1){
_local4[_local6].complete(false);
_local4[_local6].clear();
} else {
TweenLite.removeTween(_local4[_local6], true);
};
};
_local6--;
};
}
public static function getAllTweens():Array{
var _local1:Dictionary;
var _local2:Array;
var _local3:Array;
var _local4:int;
var _local5:TweenLite;
_local1 = masterList;
_local2 = [];
for each (_local3 in _local1) {
_local4 = (_local3.length - 1);
while (_local4 > -1) {
if (!_local3[_local4].gc){
_local2[_local2.length] = _local3[_local4];
};
_local4--;
};
};
for each (_local5 in _pausedTweens) {
_local2[_local2.length] = _local5;
};
return (_local2);
}
public static function resumeAll(_arg1:Boolean=true, _arg2:Boolean=false):void{
changePause(false, _arg1, _arg2);
}
public static function to(_arg1:Object, _arg2:Number, _arg3:Object):TweenMax{
return (new TweenMax(_arg1, _arg2, _arg3));
}
}
}//package gs
Section 159
//achievementsInfo (achievementsInfo)
package {
public class achievementsInfo {
public var GotSMOOTHPLAYACHIEVEMENT:Boolean;// = false
public var GotBLINDMASTERACHIEVEMENT:Boolean;// = false
public var NOWEAPONSACHIEVEMENT:Boolean;// = false
public var BlindBonuses:int;// = 0
public var TimesPlayed:int;// = 0
public var BLINDMASTERACHIEVEMENT:Boolean;// = false
public var BLOCKSCRASHEDCOUNTACHIEVEMENT:Boolean;// = false
public var GotNOBALLSLOSTACHIEVEMENT:Boolean;// = false
public var GotNOWEAPONSACHIEVEMENT:Boolean;// = false
public var FIVEEXPLOBALLSACHIEVEMENT:Boolean;// = false
public var SMOOTHPLAYACHIEVEMENT:Boolean;// = false
public var BlocksCrashedCount:int;// = 0
public var GotBLOCKSCRASHEDCOUNTACHIEVEMENT:Boolean;// = false
public var NOBALLSLOSTACHIEVEMENT:Boolean;// = false
public var ExploBallsCount:int;// = 0
public var GotFIVEEXPLOBALLSACHIEVEMENT:Boolean;// = false
public static const BLOCKSCRASHEDCOUNTSCORE:int = 10000;
public static const BLINDMASTERSCORE:int = 15000;
public static const EXPLOBALLSNEEDED:int = 25;
public static const BLOCKSNEEDED:int = 400;
public static const FIVEEXPLOBALLSSCORE:int = 10000;
public static const SMOOTHPLAYSCORE:int = 50000;
public static const BLINDSNEEDED:int = 5;
public static const NOBALLSLOSTSCORE:int = 20000;
public static const NOWEAPONSSCORE:int = 30000;
public function achievementsInfo(){
GotSMOOTHPLAYACHIEVEMENT = false;
GotBLINDMASTERACHIEVEMENT = false;
NOWEAPONSACHIEVEMENT = false;
BlindBonuses = 0;
TimesPlayed = 0;
BLINDMASTERACHIEVEMENT = false;
BLOCKSCRASHEDCOUNTACHIEVEMENT = false;
GotNOBALLSLOSTACHIEVEMENT = false;
GotNOWEAPONSACHIEVEMENT = false;
FIVEEXPLOBALLSACHIEVEMENT = false;
SMOOTHPLAYACHIEVEMENT = false;
BlocksCrashedCount = 0;
GotBLOCKSCRASHEDCOUNTACHIEVEMENT = false;
NOBALLSLOSTACHIEVEMENT = false;
ExploBallsCount = 0;
GotFIVEEXPLOBALLSACHIEVEMENT = false;
super();
}
public function GetNoWeaponsUsedAchievement(){
if (!this.NOWEAPONSACHIEVEMENT){
this.GotNOWEAPONSACHIEVEMENT = true;
};
}
public function IncreaseBlinds(){
this.BlindBonuses++;
if (this.BlindBonuses == BLINDSNEEDED){
if (!this.BLINDMASTERACHIEVEMENT){
this.GotBLINDMASTERACHIEVEMENT = true;
};
};
}
public function IncreaseBlocksHit(){
this.BlocksCrashedCount++;
if (this.BlocksCrashedCount == BLOCKSNEEDED){
if (!this.BLOCKSCRASHEDCOUNTACHIEVEMENT){
this.GotBLOCKSCRASHEDCOUNTACHIEVEMENT = true;
};
};
}
public function ResetGets(){
this.GotBLINDMASTERACHIEVEMENT = false;
this.GotBLOCKSCRASHEDCOUNTACHIEVEMENT = false;
this.GotFIVEEXPLOBALLSACHIEVEMENT = false;
this.GotNOBALLSLOSTACHIEVEMENT = false;
this.GotNOWEAPONSACHIEVEMENT = false;
this.GotSMOOTHPLAYACHIEVEMENT = false;
}
public function GetNoBallsLostAchievement(){
if (!this.NOBALLSLOSTACHIEVEMENT){
this.GotNOBALLSLOSTACHIEVEMENT = true;
};
}
public function IncreaseExploBallsCount(){
this.ExploBallsCount++;
if (this.ExploBallsCount == EXPLOBALLSNEEDED){
if (!this.FIVEEXPLOBALLSACHIEVEMENT){
this.GotFIVEEXPLOBALLSACHIEVEMENT = true;
};
};
}
public function GetSmoothPlayAchievement(){
if (!this.SMOOTHPLAYACHIEVEMENT){
this.GotSMOOTHPLAYACHIEVEMENT = true;
};
}
}
}//package
Section 160
//achievementsInfoMC (achievementsInfoMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.filters.*;
import gs.events.*;
import flash.text.*;
public class achievementsInfoMC extends MovieClip {
public var smoothPlay:MovieClip;
private var _hintDesc:TextField;
public var blindMaster:MovieClip;
private var _noBallsLost:MovieClip;
public var blocksCrashed:MovieClip;
private var _blocksCrashed:MovieClip;
public var hintHeader:TextField;
private var _blindMaster:MovieClip;
private var _tween:TweenMax;
private var _parentLevelSelection:levelSelection;
private var _exploBalls:MovieClip;
private var _hintHeader:TextField;
private var _soundManager:soundManager;
private var _achInf:achievementsInfo;
private var _smoothPlay:MovieClip;
public var noWeaponsUsed:MovieClip;
private var _noWeaponsUsed:MovieClip;
public var hintDesc:TextField;
public var exploBalls:MovieClip;
public var noBallsLost:MovieClip;
public var okBtn:MovieClip;
private var _okBtn:MovieClip;
public function achievementsInfoMC(_arg1:levelSelection, _arg2:achievementsInfo, _arg3:soundManager){
this._achInf = _arg2;
this._soundManager = _arg3;
this._parentLevelSelection = _arg1;
this._tween = TweenMax.to(this, 0.5, {y:(300 - (width / 2))});
this._tween.addEventListener(TweenEvent.COMPLETE, this.shopOut);
this.initControls();
}
private function achOff(_arg1:TweenEvent):void{
this._tween.removeEventListener(TweenEvent.COMPLETE, this.achOff);
parent.removeChild(this);
}
private function okClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._tween = TweenMax.to(this, 0.5, {y:700});
this._tween.addEventListener(TweenEvent.COMPLETE, this.achOff);
this._parentLevelSelection.faderOut();
}
private function readStatus():void{
var _local1:GlowFilter;
_local1 = new GlowFilter();
_local1.color = 0xFFFFFF;
_local1.blurX = 10;
_local1.blurY = 10;
_local1.strength = 6;
if (!this._achInf.BLINDMASTERACHIEVEMENT){
this._blindMaster.alpha = 0.5;
} else {
this._blindMaster.filters = [_local1];
};
if (!this._achInf.BLOCKSCRASHEDCOUNTACHIEVEMENT){
this._blocksCrashed.alpha = 0.5;
} else {
this._blocksCrashed.filters = [_local1];
};
if (!this._achInf.FIVEEXPLOBALLSACHIEVEMENT){
this._exploBalls.alpha = 0.5;
} else {
this._exploBalls.filters = [_local1];
};
if (!this._achInf.NOBALLSLOSTACHIEVEMENT){
this._noBallsLost.alpha = 0.5;
} else {
this._noBallsLost.filters = [_local1];
};
if (!this._achInf.NOWEAPONSACHIEVEMENT){
this._noWeaponsUsed.alpha = 0.5;
} else {
this._noWeaponsUsed.filters = [_local1];
};
if (!this._achInf.SMOOTHPLAYACHIEVEMENT){
this._smoothPlay.alpha = 0.5;
} else {
this._smoothPlay.filters = [_local1];
};
}
private function shopOut(_arg1:TweenEvent):void{
var _local2:MovieClip;
var _local3:Array;
this._okBtn.buttonMode = true;
this._okBtn.addEventListener(MouseEvent.CLICK, this.okClick);
_local3 = [this._blindMaster, this._blocksCrashed, this._exploBalls, this._noBallsLost, this._noWeaponsUsed, this._smoothPlay];
for each (_local2 in _local3) {
_local2.buttonMode = true;
_local2.addEventListener(MouseEvent.ROLL_OVER, this.achOver);
_local2.addEventListener(MouseEvent.ROLL_OUT, this.achOut);
};
}
private function achOver(_arg1:MouseEvent):void{
var _local2:int;
_local2 = ((achievementsInfo.BLINDSNEEDED * customContactListener.BLINDAMOUNT) / 50);
if (_arg1.target == this._blindMaster){
this.SetHintText("BlindMaster achievement", (("Awarded when total blind bonus time exceeds " + _local2.toString()) + " seconds"));
};
if (_arg1.target == this._blocksCrashed){
this.SetHintText("BlockCrasher achievement", (("Awarded when player crashes " + achievementsInfo.BLOCKSNEEDED.toString()) + " bricks"));
};
if (_arg1.target == this._exploBalls){
this.SetHintText("ExploBallsMaster achievement", (("Awarded for " + achievementsInfo.EXPLOBALLSNEEDED.toString()) + " exploballs"));
};
if (_arg1.target == this._noBallsLost){
this.SetHintText("BallKeeper achievement", "Awarded when player completes level with single ball");
};
if (_arg1.target == this._noWeaponsUsed){
this.SetHintText("MartialArtist achievement", "Awarded when player completes level without weapons");
};
if (_arg1.target == this._smoothPlay){
this.SetHintText("SmoothPlayer achievement", "Awarded when player completes game without retrys");
};
}
private function SetHintText(_arg1:String, _arg2:String){
this._hintHeader.text = _arg1;
this._hintDesc.text = _arg2;
}
private function initControls():void{
this._blindMaster = this.blindMaster;
this._blocksCrashed = this.blocksCrashed;
this._exploBalls = this.exploBalls;
this._noBallsLost = this.noBallsLost;
this._noWeaponsUsed = this.noWeaponsUsed;
this._smoothPlay = this.smoothPlay;
this._okBtn = this.okBtn;
this._hintDesc = this.hintDesc;
this._hintHeader = this.hintHeader;
this.readStatus();
}
private function achOut(_arg1:MouseEvent):void{
this.SetHintText("Roll over", "For details");
}
}
}//package
Section 161
//Actor (Actor)
package {
import flash.display.*;
import flash.events.*;
import Box2D.Dynamics.*;
public class Actor extends EventDispatcher {
public var _body:b2Body;
public var DeleteFlag:Boolean;// = false
public var _costume:DisplayObject;
public var _parentGP:gameplay;
public function Actor(_arg1:gameplay, _arg2:b2Body, _arg3:DisplayObject){
DeleteFlag = false;
super();
this._body = _arg2;
this._costume = _arg3;
this._parentGP = _arg1;
this.updateMyLook();
}
protected function childSpecificUpdating():void{
}
private function updateMyLook():void{
this._costume.x = (this._body.GetPosition().x * PhysVals.RATIO);
this._costume.y = (this._body.GetPosition().y * PhysVals.RATIO);
this._costume.rotation = ((this._body.GetAngle() * (180 / Math.PI)) % 360);
}
public function UpdateNow():void{
this.updateMyLook();
this.childSpecificUpdating();
}
}
}//package
Section 162
//ActorWithMultipleBodies (ActorWithMultipleBodies)
package {
import flash.display.*;
import flash.events.*;
import Box2D.Dynamics.*;
public class ActorWithMultipleBodies extends EventDispatcher {
public var DeleteFlag:Boolean;// = false
public var _bodies:Array;
public var _parentGP:gameplay;
public var _costumes:Array;
public function ActorWithMultipleBodies(_arg1:gameplay, _arg2:Array, _arg3:Array){
DeleteFlag = false;
super();
this._bodies = _arg2;
this._costumes = _arg3;
this._parentGP = _arg1;
this.updateMyLook();
}
private function updateMyLook():void{
var _local1:DisplayObject;
var _local2:b2Body;
for each (_local1 in this._costumes) {
_local2 = this._bodies[this._costumes.indexOf(_local1)];
_local1.x = (_local2.GetPosition().x * PhysVals.RATIO);
_local1.y = (_local2.GetPosition().y * PhysVals.RATIO);
_local1.rotation = ((_local2.GetAngle() * (180 / Math.PI)) % 360);
};
}
protected function childSpecificUpdating():void{
}
public function UpdateNow():void{
this.updateMyLook();
this.childSpecificUpdating();
}
}
}//package
Section 163
//ammo_out (ammo_out)
package {
import flash.media.*;
public dynamic class ammo_out extends Sound {
}
}//package
Section 164
//AmmoBonus (AmmoBonus)
package {
import flash.display.*;
public dynamic class AmmoBonus extends MovieClip {
public function AmmoBonus(){
addFrameScript(0, this.frame1, 1, this.frame2, 2, this.frame3, 3, this.frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 165
//ammobonus_pick (ammobonus_pick)
package {
import flash.media.*;
public dynamic class ammobonus_pick extends Sound {
}
}//package
Section 166
//ammoBonusActor (ammoBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class ammoBonusActor extends Actor {
public var Type:int;
public static const RAPID_AMMO:int = 3;
public static const PISTOL_AMMO:int = 1;
public static const SPREAD_AMMO:int = 2;
public static const ROCKET_AMMO:int = 4;
public function ammoBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point, _arg4:int){
var _local5:MovieClip;
var _local6:b2CircleDef;
var _local7:b2BodyDef;
var _local8:b2Body;
this.Type = _arg4;
_local5 = new AmmoBonus();
_local5.x = _arg3.x;
_local5.y = _arg3.y;
this.setFrame(_local5);
_arg2.addChild(_local5);
_local6 = new b2CircleDef();
_local6.radius = ((_local5.width / 2) / PhysVals.RATIO);
_local6.density = 0.5;
_local6.friction = 0.5;
_local6.restitution = 0.5;
_local6.filter.categoryBits = collisionBits.BONUSES;
_local6.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local7 = new b2BodyDef();
_local7.position.Set((_local5.x / PhysVals.RATIO), (_local5.y / PhysVals.RATIO));
_local7.fixedRotation = true;
_local8 = PhysVals.world.CreateBody(_local7);
_local8.CreateShape(_local6);
_local8.SetMassFromShapes();
_local8.SetUserData(this);
super(_arg1, _local8, _local5);
}
private function setFrame(_arg1:MovieClip):void{
_arg1.gotoAndStop(this.Type);
}
}
}//package
Section 167
//ammoBonusMessage (ammoBonusMessage)
package {
import flash.display.*;
public dynamic class ammoBonusMessage extends MovieClip {
}
}//package
Section 168
//ball_lost (ball_lost)
package {
import flash.media.*;
public dynamic class ball_lost extends Sound {
}
}//package
Section 169
//ball_spawn (ball_spawn)
package {
import flash.media.*;
public dynamic class ball_spawn extends Sound {
}
}//package
Section 170
//ballActor (ballActor)
package {
import flash.display.*;
import gs.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import fl.motion.*;
import gs.easing.*;
public class ballActor extends Actor {
private const STUCK_TRESHHOLD:Number = 0.6;
private var lightUpFactor:int;// = 0
public var BlocksCrushed:int;// = 0
public var BlocksHit:int;// = 0
private var initialBallWidth:Number;
private var prevCoords:Point;
public var DamageLevel:int;// = 0
public var DamageFactor:Number;// = 0
private var stuckCounter:int;// = 0
private var bonusTimer:int;// = 0
public function ballActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point, _arg4:int){
var _local5:MovieClip;
var _local6:b2CircleDef;
var _local7:b2BodyDef;
var _local8:b2Body;
stuckCounter = 0;
BlocksHit = 0;
lightUpFactor = 0;
BlocksCrushed = 0;
bonusTimer = 0;
DamageLevel = 0;
DamageFactor = 0;
this.prevCoords = new Point(0, 0);
this.DamageLevel = _arg4;
this.initDamageFactor();
_local5 = new ballSimple();
_local5.x = _arg3.x;
_local5.y = _arg3.y;
_arg2.addChild(_local5);
_local6 = new b2CircleDef();
_local6.radius = ((_local5.width / 2) / PhysVals.RATIO);
this.initialBallWidth = _local5.width;
_local6.density = 1;
_local6.friction = 0;
_local6.restitution = 1;
_local6.filter.categoryBits = collisionBits.BALLS;
_local6.filter.maskBits = ((0xFFFF & ~(collisionBits.SHATTERS)) & ~(collisionBits.BONUSES));
_local7 = new b2BodyDef();
_local7.position.Set((_local5.x / PhysVals.RATIO), (_local5.y / PhysVals.RATIO));
_local7.isBullet = true;
_local8 = PhysVals.world.CreateBody(_local7);
_local8.CreateShape(_local6);
_local8.SetMassFromShapes();
_local8.SetUserData(this);
super(_arg1, _local8, _local5);
}
private function checkStuck():void{
var _local1:b2Vec2;
_local1 = _body.GetLinearVelocity();
_local1.Normalize();
_local1.Multiply(4);
_body.ApplyImpulse(_local1, _body.GetWorldCenter());
}
public function ModifySize(_arg1:Number, _arg2:int){
var _local3:Number;
var _local4:b2CircleDef;
TweenLite.to(_costume, 0.5, {scaleX:_arg1, scaleY:_arg1, ease:Elastic.easeOut});
_body.DestroyShape(_body.GetShapeList());
_local3 = (((2 / ((this.initialBallWidth * _arg1) / 2)) / ((this.initialBallWidth * _arg1) / 2)) * (((this.initialBallWidth / 2) * this.initialBallWidth) / 2));
_local4 = new b2CircleDef();
_local4.radius = (((this.initialBallWidth * _arg1) / 2) / PhysVals.RATIO);
_local4.density = _local3;
_local4.friction = 0.5;
_local4.restitution = 0.15;
_local4.filter.categoryBits = collisionBits.BALLS;
_local4.filter.maskBits = ((0xFFFF & ~(collisionBits.SHATTERS)) & ~(collisionBits.BONUSES));
_body.CreateShape(_local4);
_body.SetMassFromShapes();
this.bonusTimer = (this.bonusTimer + _arg2);
}
private function leaveTrail():void{
var _local1:MovieClip;
var _local2:ballTrail;
_local1 = (_costume.parent as MovieClip);
_local2 = new ballTrail();
_local2.x = _costume.x;
_local2.y = _costume.y;
_local2.rotation = _costume.rotation;
_local2.width = _costume.width;
_local2.height = _costume.height;
_local1.addChild(_local2);
_local1.setChildIndex(_local2, _local1.getChildIndex(_costume));
}
public function IsPowerupped():Boolean{
if (this.bonusTimer > 0){
return (true);
};
return (false);
}
private function initDamageFactor():void{
this.DamageFactor = (2 + (this.DamageLevel * 0.66));
this.DamageFactor = 5;
}
override protected function childSpecificUpdating():void{
this.checkStuck();
this.lightUp();
this.leaveTrail();
if (this.bonusTimer > 0){
this.bonusTimer--;
if (this.bonusTimer == 0){
this.ModifySize(1, 0);
};
};
this.prevCoords = new Point(_costume.x, _costume.y);
super.childSpecificUpdating();
}
private function lightUp():void{
var _local1:Number;
var _local2:Color;
var _local3:Number;
_local1 = ((this.lightUpFactor / 10) * 0.7);
_local2 = new Color();
_local3 = 0xFFFFFF;
_local2.setTint(_local3, _local1);
_costume.transform.colorTransform = _local2;
if (this.lightUpFactor > 10){
this.lightUpFactor = 10;
};
if (this.lightUpFactor > 0){
this.lightUpFactor--;
};
}
public function IncreaseBlocksHit(){
this.BlocksHit++;
}
public function IncreaseBlocksCrushed(){
this.BlocksCrushed++;
if (this.BlocksCrushed == 5){
_parentGP.IncreaseScore(scoreAchievementsController.FIVEBLOCKSCRASHEDSCORE);
_parentGP.IncreaseBonusMoney(scoreAchievementsController.FIVEBLOCKSCRASHEDMONEYBONUS);
_parentGP.PunchInMessage(ingameMessage.FIVESHATTERS);
};
if (this.BlocksCrushed == 10){
_parentGP.IncreaseScore(scoreAchievementsController.TENBLOCKSCRASHEDSCORE);
_parentGP.IncreaseBonusMoney(scoreAchievementsController.TENBLOCKSCRASHEDMONEYBONUS);
_parentGP.PunchInMessage(ingameMessage.TENSHATTERS);
};
if (this.BlocksCrushed == 20){
_parentGP.IncreaseScore(scoreAchievementsController.TWENTYBLOCKSCRASHEDSCORE);
_parentGP.IncreaseBonusMoney(scoreAchievementsController.TWENTYBLOCKSCRASHEDMONEYBONUS);
_parentGP.PunchInMessage(ingameMessage.TWENTYSHATTERS);
};
if (this.BlocksCrushed == 40){
_parentGP.IncreaseScore(scoreAchievementsController.FOURTYBLOCKSCRASHEDSCORE);
_parentGP.IncreaseBonusMoney(scoreAchievementsController.FOURTYBLOCKSCRASHEDMONEYBONUS);
_parentGP.PunchInMessage(ingameMessage.FOURTYSHATTERS);
};
_parentGP.SetLastTimeBlockCrushed();
if (((this.BlocksCrushed / 5) - Math.floor((this.BlocksCrushed / 5))) == 0){
_parentGP.GetGameProgress().AchievementsInfo.IncreaseExploBallsCount();
_parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, (35 * (1 + (_parentGP.GetGameProgress().BallsDamageLevel * 0.5))), (50 * (1 + (_parentGP.GetGameProgress().BallsDamageLevel * 0.33))), new Point(_costume.x, _costume.y), false));
_parentGP.PunchInMessage(ingameMessage.EXPLOBALL);
};
}
}
}//package
Section 171
//ballInfo (ballInfo)
package {
import flash.geom.*;
import Box2D.Common.Math.*;
public class ballInfo {
public var LinearVelocity:b2Vec2;
public var Coords:Point;
public var BallLink:ballActor;
public var AngularVelocity:Number;
public function ballInfo(_arg1:Point, _arg2:b2Vec2, _arg3:Number, _arg4:ballActor){
this.Coords = _arg1;
this.LinearVelocity = _arg2;
this.AngularVelocity = _arg3;
this.BallLink = _arg4;
}
}
}//package
Section 172
//ballsCountZone (ballsCountZone)
package {
import flash.display.*;
public dynamic class ballsCountZone extends MovieClip {
}
}//package
Section 173
//ballSimple (ballSimple)
package {
import flash.display.*;
public dynamic class ballSimple extends MovieClip {
}
}//package
Section 174
//ballSpawner (ballSpawner)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import Box2D.Common.Math.*;
import flash.filters.*;
public class ballSpawner extends MovieClip {
private var bf:BlurFilter;
private var _parentGP:gameplay;
private var countdownTimer:int;// = 0
private var countdownTimerInit:int;// = 60
private var ballMC:MovieClip;
private var _levelMC:MovieClip;
private var gf:GlowFilter;
public function ballSpawner(_arg1:MovieClip, _arg2:gameplay, _arg3:Point){
countdownTimerInit = 60;
countdownTimer = 0;
this.gf = new GlowFilter();
this.bf = new BlurFilter();
super();
this.countdownTimer = this.countdownTimerInit;
alpha = 0;
x = _arg3.x;
y = _arg3.y;
this._levelMC = _arg1;
this.ballMC = new ballSimple();
addChild(this.ballMC);
this._levelMC.addChild(this);
this._parentGP = _arg2;
addEventListener(Event.ENTER_FRAME, this.entFr);
this.gf.color = 0xFFFFFF;
this._parentGP.SoundManager.PlayBallSpawn();
}
private function entFr(_arg1:Event):void{
var _local2:Number;
var _local3:b2Vec2;
if (!this._parentGP.IsPaused()){
this.countdownTimer--;
};
_local2 = (50 * (this.countdownTimer / this.countdownTimerInit));
this.gf.blurX = _local2;
this.gf.blurY = _local2;
this.bf.blurY = 0;
this.bf.blurX = Math.abs((x - this._parentGP.getBouncerCoordinates().x));
alpha = (1 - (this.countdownTimer / this.countdownTimerInit));
filters = [this.gf, this.bf];
x = this._parentGP.getBouncerCoordinates().x;
if (this.countdownTimer <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
this._levelMC.removeChild(this);
_local3 = new b2Vec2(0, 18);
this._parentGP.GetSpawner().spawnSimpleBall(new Point(x, y), _local3, 0, true);
};
}
}
}//package
Section 175
//ballTrail (ballTrail)
package {
import flash.display.*;
import flash.events.*;
public class ballTrail extends MovieClip {
private const DOWNSCALEFACTOR:Number = 0.1;
public function ballTrail(){
addChild(new ballSimple());
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
scaleX = (scaleX - this.DOWNSCALEFACTOR);
scaleY = (scaleY - this.DOWNSCALEFACTOR);
if (scaleX <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
(parent as MovieClip).removeChild(this);
};
}
}
}//package
Section 176
//ballWall (ballWall)
package {
import flash.media.*;
public dynamic class ballWall extends Sound {
}
}//package
Section 177
//biggerBallsMessage (biggerBallsMessage)
package {
import flash.display.*;
public dynamic class biggerBallsMessage extends MovieClip {
}
}//package
Section 178
//biggerPaddleBonus (biggerPaddleBonus)
package {
import flash.display.*;
public dynamic class biggerPaddleBonus extends MovieClip {
}
}//package
Section 179
//BlindBonus (BlindBonus)
package {
import flash.display.*;
public dynamic class BlindBonus extends MovieClip {
}
}//package
Section 180
//blindBonusActor (blindBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class blindBonusActor extends Actor {
public function blindBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new BlindBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 181
//blindedMessage (blindedMessage)
package {
import flash.display.*;
public dynamic class blindedMessage extends MovieClip {
}
}//package
Section 182
//blinder (blinder)
package {
import flash.display.*;
public dynamic class blinder extends MovieClip {
}
}//package
Section 183
//blockCracks (blockCracks)
package {
import flash.display.*;
public dynamic class blockCracks extends MovieClip {
}
}//package
Section 184
//blockCracks2 (blockCracks2)
package {
import flash.display.*;
public dynamic class blockCracks2 extends MovieClip {
}
}//package
Section 185
//bombBonus (bombBonus)
package {
import flash.display.*;
public dynamic class bombBonus extends MovieClip {
}
}//package
Section 186
//bombBonusActor (bombBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class bombBonusActor extends Actor {
public function bombBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new bombBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 187
//bonus_pick (bonus_pick)
package {
import flash.media.*;
public dynamic class bonus_pick extends Sound {
}
}//package
Section 188
//bonusFader (bonusFader)
package {
import flash.display.*;
import flash.events.*;
public class bonusFader extends MovieClip {
public function bonusFader(){
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 189
//bonusSpawnInfo (bonusSpawnInfo)
package {
import flash.geom.*;
public class bonusSpawnInfo {
public var Type:int;// = 0
public var Coordinates:Point;
public static const MULTIBALL:int = 1;
public function bonusSpawnInfo(_arg1:int, _arg2:Point){
Type = 0;
super();
this.Type = _arg1;
this.Coordinates = _arg2;
}
}
}//package
Section 190
//boringammo_spawn (boringammo_spawn)
package {
import flash.media.*;
public dynamic class boringammo_spawn extends Sound {
}
}//package
Section 191
//bouncerActor (bouncerActor)
package {
import flash.display.*;
import gs.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
import fl.motion.*;
import flash.filters.*;
import gs.easing.*;
public class bouncerActor extends Actor {
private const GAP:Number = 10;
private var bf:BlurFilter;
private var scaleTween:TweenMax;
private var Y_tofollow:Number;
private var lightUpFactor:int;// = 0
private var bonusTimer:int;// = 0
private var initialBouncerWidth:Number;
public function bouncerActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2BodyDef;
var _local6:b2Body;
var _local7:b2PolygonDef;
var _local8:Rectangle;
var _local9:b2CircleDef;
bonusTimer = 0;
lightUpFactor = 0;
_local4 = new reflectBan();
this.bf = new BlurFilter(0, 0, 1);
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2BodyDef();
_local5.isBullet = true;
_local5.fixedRotation = true;
_local5.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6 = PhysVals.world.CreateBody(_local5);
_local7 = new b2PolygonDef();
_local8 = _local4._mc.getRect(_local4);
_local7.SetAsBox(((_local8.width / 2) / PhysVals.RATIO), ((_local8.height / 2) / PhysVals.RATIO));
_local7.density = 1.5;
_local7.friction = 0;
_local7.restitution = 1;
_local7.filter.categoryBits = collisionBits.BOUNCER;
this.initialBouncerWidth = _local8.width;
_local6.CreateShape(_local7);
_local9 = new b2CircleDef();
_local9.radius = (11 / PhysVals.RATIO);
_local9.density = 1.5;
_local9.friction = 0.5;
_local9.restitution = 0.5;
_local9.filter.categoryBits = collisionBits.BOUNCER;
_local9.localPosition.Set((_local8.x / PhysVals.RATIO), 0);
_local6.CreateShape(_local9);
_local9.localPosition.Set(((_local8.x + _local8.width) / PhysVals.RATIO), 0);
_local6.CreateShape(_local9);
_local6.SetMassFromShapes();
_local6.SetUserData(this);
super(_arg1, _local6, _local4);
this.Y_tofollow = _arg3.y;
}
public function ModifySize(_arg1:Number, _arg2:int){
var _local3:Number;
var _local4:b2PolygonDef;
var _local5:Rectangle;
var _local6:b2CircleDef;
_local3 = ((_arg1 == 1)) ? 60 : 90;
_costume._mc.width = _local3;
_body.DestroyShape(_body.GetShapeList());
_body.DestroyShape(_body.GetShapeList());
_body.DestroyShape(_body.GetShapeList());
_local4 = new b2PolygonDef();
_local5 = _costume._mc.getRect(_costume);
_local5.width = _local3;
_local4.SetAsBox(((_local5.width / 2) / PhysVals.RATIO), ((_local5.height / 2) / PhysVals.RATIO));
_local4.density = 0.5;
_local4.friction = 0.5;
_local4.restitution = 0.5;
_local4.filter.categoryBits = collisionBits.BOUNCER;
this.initialBouncerWidth = _local5.width;
_body.CreateShape(_local4);
_local6 = new b2CircleDef();
_local6.radius = (11 / PhysVals.RATIO);
_costume.c1.x = _local5.x;
_local6.density = 0.5;
_local6.friction = 0.5;
_local6.restitution = 0.5;
_local6.filter.categoryBits = collisionBits.BOUNCER;
_local6.localPosition.Set((_local5.x / PhysVals.RATIO), 0);
_body.CreateShape(_local6);
_local6.localPosition.Set(((_local5.x + _local5.width) / PhysVals.RATIO), 0);
_costume.c2.x = (_local5.x + _local5.width);
_body.CreateShape(_local6);
_body.SetMassFromShapes();
this.bonusTimer = (this.bonusTimer + _arg2);
}
override protected function childSpecificUpdating():void{
this.lightUp();
if (this.bonusTimer > 0){
this.bonusTimer--;
if (this.bonusTimer == 0){
this.ModifySize(1, 0);
};
};
super.childSpecificUpdating();
}
public function mouseUpdate(_arg1:Number){
var _local2:b2Vec2;
var _local3:b2Vec2;
if (_arg1 < (this.GAP + (_costume.width / 2))){
_arg1 = (this.GAP + (_costume.width / 2));
};
if (_arg1 > ((366 - this.GAP) - (_costume.width / 2))){
_arg1 = ((366 - this.GAP) - (_costume.width / 2));
};
this.bf.blurX = Math.abs((_arg1 - _costume.x));
_costume.filters = [this.bf];
_local2 = new b2Vec2(_arg1, this.Y_tofollow);
_local3 = new b2Vec2((_local2.x - _costume.x), (_local2.y - _costume.y));
_local3.Multiply(_parentGP.stage.frameRate);
_local3.Multiply((1 / PhysVals.RATIO));
_body.SetLinearVelocity(_local3);
}
private function lightUp():void{
var _local1:Number;
var _local2:Color;
var _local3:Number;
_local1 = ((this.lightUpFactor / 10) * 0.7);
_local2 = new Color();
_local3 = 0xFFFFFF;
_local2.setTint(_local3, _local1);
_costume.transform.colorTransform = _local2;
if (this.lightUpFactor > 10){
this.lightUpFactor = 10;
};
if (this.lightUpFactor > 0){
this.lightUpFactor--;
};
}
public function LightUpIncrement(){
this.lightUpFactor = (this.lightUpFactor + 11);
}
}
}//package
Section 192
//bouncerGun (bouncerGun)
package {
import flash.display.*;
import gs.*;
import gs.easing.*;
public class bouncerGun extends MovieClip {
private var _weaponMC:MovieClip;
private var _selectedWeapon:int;// = 1
public function bouncerGun(){
_selectedWeapon = 1;
super();
this._weaponMC = new AmmoBonus();
this._weaponMC.scaleX = 0.7;
this._weaponMC.scaleY = 0.7;
addChild(this._weaponMC);
}
public function Update(_arg1:int){
if (_arg1 != this._selectedWeapon){
this._selectedWeapon = _arg1;
this._weaponMC.gotoAndStop(this._selectedWeapon);
this._weaponMC.scaleX = 1.5;
this._weaponMC.scaleY = 1.5;
TweenLite.to(this._weaponMC, 0.5, {scaleX:0.7, scaleY:0.7, ease:Elastic.easeOut});
};
}
}
}//package
Section 193
//bouncerHit (bouncerHit)
package {
import flash.media.*;
public dynamic class bouncerHit extends Sound {
}
}//package
Section 194
//bullet (bullet)
package {
import flash.display.*;
public dynamic class bullet extends MovieClip {
}
}//package
Section 195
//bullet_hit (bullet_hit)
package {
import flash.media.*;
public dynamic class bullet_hit extends Sound {
}
}//package
Section 196
//bulletActor (bulletActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class bulletActor extends Actor {
public var Damage:Number;// = 4
private var initialFadePoints:int;// = 5
public var Collided:Boolean;// = false
private var fadePoints:int;// = 0
public static const CLICKSHOT:int = 1;
public static const RAPIDSHOT:int = 3;
public static const SPREADSHOT:int = 2;
public function bulletActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point, _arg4:Number, _arg5:int){
var _local6:MovieClip;
var _local7:b2PolygonDef;
var _local8:b2BodyDef;
var _local9:b2Body;
initialFadePoints = 5;
Damage = 4;
Collided = false;
fadePoints = 0;
this.Damage = _arg4;
this.fadePoints = this.initialFadePoints;
switch (_arg5){
case CLICKSHOT:
_local6 = new bullet();
break;
case SPREADSHOT:
_local6 = new spreadBullet();
break;
case RAPIDSHOT:
_local6 = new rapidBullet();
break;
};
_local6.x = _arg3.x;
_local6.y = _arg3.y;
_arg2.addChild(_local6);
_local7 = new b2PolygonDef();
_local7.SetAsBox(((_local6.width / 2) / PhysVals.RATIO), ((_local6.height / 2) / PhysVals.RATIO));
_local7.density = 1;
_local7.friction = 0.5;
_local7.restitution = 0.5;
_local7.filter.categoryBits = collisionBits.BULLETS;
_local7.filter.maskBits = ((((0xFFFF & ~(collisionBits.BALLS)) & ~(collisionBits.BULLETS)) & ~(collisionBits.SHATTERS)) & ~(collisionBits.BONUSES));
_local8 = new b2BodyDef();
_local8.position.Set((_local6.x / PhysVals.RATIO), (_local6.y / PhysVals.RATIO));
_local8.isBullet = true;
_local9 = PhysVals.world.CreateBody(_local8);
_local9.CreateShape(_local7);
_local9.SetMassFromShapes();
_local9.SetUserData(this);
super(_arg1, _local9, _local6);
}
override protected function childSpecificUpdating():void{
if (this.Collided){
this.fadePoints--;
_costume.alpha = (this.fadePoints / this.initialFadePoints);
if (this.fadePoints <= 0){
DeleteFlag = true;
};
};
this.checkBounds();
super.childSpecificUpdating();
}
private function checkBounds():void{
if ((((((_costume.x < 11)) || ((_costume.x > 439)))) || ((_costume.y < -11)))){
_parentGP.SoundManager.PlayBulletHit();
this.Collided = true;
DeleteFlag = true;
};
}
}
}//package
Section 197
//buttonClick (buttonClick)
package {
import flash.media.*;
public dynamic class buttonClick extends Sound {
}
}//package
Section 198
//buttonsZone (buttonsZone)
package {
import flash.display.*;
public dynamic class buttonsZone extends MovieClip {
}
}//package
Section 199
//clickshot_shot (clickshot_shot)
package {
import flash.media.*;
public dynamic class clickshot_shot extends Sound {
}
}//package
Section 200
//coin_get (coin_get)
package {
import flash.media.*;
public dynamic class coin_get extends Sound {
}
}//package
Section 201
//coinActor (coinActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class coinActor extends Actor {
private var _lifetimeCounter:int;// = 300
public var Value:int;// = 5
public var Collected:Boolean;// = false
public function coinActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
Value = 5;
_lifetimeCounter = 300;
Collected = false;
_local4 = new coinSimple();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
if (Math.random() > 0.7){
_local4.scaleX = 1.5;
_local4.scaleY = 1.5;
this.Value = 10;
};
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 2;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.SHATTERS;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
override protected function childSpecificUpdating():void{
this._lifetimeCounter--;
if (this._lifetimeCounter < 20){
_costume.alpha = (this._lifetimeCounter / 20);
};
if (this._lifetimeCounter <= 0){
DeleteFlag = true;
};
super.childSpecificUpdating();
}
}
}//package
Section 202
//coinFader (coinFader)
package {
import flash.display.*;
import flash.events.*;
public class coinFader extends MovieClip {
public function coinFader(){
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
alpha = (alpha - 0.1);
if (alpha <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 203
//coinShatter (coinShatter)
package {
import flash.display.*;
import flash.events.*;
public class coinShatter extends MovieClip {
private var gravity:Number;// = 1
private var lifetime:int;// = 30
private var speedX:Number;
private var speedY:Number;
public function coinShatter(){
lifetime = 30;
gravity = 1;
super();
this.speedX = ((Math.random() * 8) - 4);
this.speedY = ((Math.random() * -10) - 6);
mouseEnabled = false;
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
x = (x + this.speedX);
y = (y + this.speedY);
this.speedY = (this.speedY + this.gravity);
this.lifetime--;
if (this.lifetime < 11){
alpha = (this.lifetime / 10);
};
if (this.lifetime <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 204
//coinSimple (coinSimple)
package {
import flash.display.*;
public dynamic class coinSimple extends MovieClip {
}
}//package
Section 205
//collisionBits (collisionBits)
package {
public class collisionBits {
public static const SHATTERS = 10;
public static const BALLS = 8;
public static const THINGS_BONUSES_SHOULD_COLLIDE_WITH = 2;
public static const WALLS = 14;
public static const BOUNCER = 12;
public static const BONUSES = 32;
public static const BULLETS = 4;
}
}//package
Section 206
//controller (controller)
package {
public class controller {
public var bouncerSpeed:Number;// = 0
public var rightPressed:Boolean;// = false
public var MouseDown:Boolean;// = false
public var bouncerAcceleration:Number;// = 2
public var firePressed:Boolean;// = false
public var MouseActionCompleted:Boolean;// = false
public var leftPressed:Boolean;// = false
public var bouncerSpeedMax:Number;// = 15
public function controller(){
rightPressed = false;
MouseDown = false;
bouncerAcceleration = 2;
firePressed = false;
MouseActionCompleted = false;
leftPressed = false;
bouncerSpeed = 0;
bouncerSpeedMax = 15;
super();
}
}
}//package
Section 207
//countdown_beep (countdown_beep)
package {
import flash.media.*;
public dynamic class countdown_beep extends Sound {
}
}//package
Section 208
//countdown_final (countdown_final)
package {
import flash.media.*;
public dynamic class countdown_final extends Sound {
}
}//package
Section 209
//countDownTimer (countDownTimer)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
import gs.easing.*;
public class countDownTimer extends MovieClip {
private const TWEENTIME:Number = 0.8;
private const INITIALWAIT:int = 10;
private const COUNT_INCREMENT:int = 10;
private var blipThree:MovieClip;
private var _parentGP:gameplay;
var tm:TweenMax;
private var blipTwo:MovieClip;
private var blipOne:MovieClip;
private var blipFour:MovieClip;
private var _counter:int;// = 0
public function countDownTimer(_arg1:gameplay){
_counter = 0;
super();
this._parentGP = _arg1;
this.setupBlips();
TweenLite.to(this, this.TWEENTIME, {y:300, ease:Back.easeOut});
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
if (!this._parentGP.IsPaused()){
this._counter++;
};
if (this._counter == (this.INITIALWAIT + this.COUNT_INCREMENT)){
this.blipOne.gotoAndStop(2);
this._parentGP.SoundManager.PlayCountdownBeep();
TweenLite.to(this.blipOne, 0.4, {scaleX:1.2, scaleY:1.2, ease:Elastic.easeOut});
};
if (this._counter == (this.INITIALWAIT + (this.COUNT_INCREMENT * 2))){
this.blipTwo.gotoAndStop(2);
this._parentGP.SoundManager.PlayCountdownBeep();
TweenLite.to(this.blipTwo, 0.4, {scaleX:1.2, scaleY:1.2, ease:Elastic.easeOut});
};
if (this._counter == (this.INITIALWAIT + (this.COUNT_INCREMENT * 3))){
this.blipThree.gotoAndStop(2);
this._parentGP.SoundManager.PlayCountdownBeep();
TweenLite.to(this.blipThree, 0.4, {scaleX:1.2, scaleY:1.2, ease:Elastic.easeOut});
};
if (this._counter == (this.INITIALWAIT + (this.COUNT_INCREMENT * 4))){
this._parentGP.SoundManager.PlayCountdownFinal();
this.blipFour.gotoAndStop(2);
TweenLite.to(this.blipFour, 0.4, {scaleX:1.2, scaleY:1.2, ease:Elastic.easeOut});
removeEventListener(Event.ENTER_FRAME, this.entFr);
this.tm = TweenMax.to(this, this.TWEENTIME, {y:-100, ease:Back.easeIn});
this.tm.addEventListener(TweenEvent.COMPLETE, this.hidden);
this._parentGP.StartGame();
};
}
private function setupBlips():void{
this.blipOne = new countdownTimerBlip();
this.blipOne.x = -75;
addChild(this.blipOne);
this.blipTwo = new countdownTimerBlip();
this.blipTwo.x = -25;
addChild(this.blipTwo);
this.blipThree = new countdownTimerBlip();
this.blipThree.x = 25;
addChild(this.blipThree);
this.blipFour = new countdownTimerBlip();
this.blipFour.x = 75;
addChild(this.blipFour);
}
private function hidden(_arg1:TweenEvent):void{
this.tm.removeEventListener(TweenEvent.COMPLETE, this.hidden);
this._parentGP.removeChild(this);
}
}
}//package
Section 210
//countdownTimerBlip (countdownTimerBlip)
package {
import flash.display.*;
public dynamic class countdownTimerBlip extends MovieClip {
public function countdownTimerBlip(){
addFrameScript(0, this.frame1, 1, this.frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 211
//creditsMC (creditsMC)
package {
import flash.display.*;
import flash.events.*;
import com.midasplayer.*;
public class creditsMC extends MovieClip {
public var backBtn:MovieClip;
private var fflogoMC:MovieClip;
public var fflogo:MovieClip;
private var _soundManager:soundManager;
private var _backBtn:MovieClip;
public function creditsMC(_arg1:soundManager){
this._soundManager = _arg1;
this._backBtn = this.backBtn;
this._backBtn.buttonMode = true;
this._backBtn.addEventListener(MouseEvent.CLICK, this.backClick);
this.fflogoMC = this.fflogo;
this.fflogoMC.buttonMode = true;
this.fflogoMC.addEventListener(MouseEvent.CLICK, this.ffclick);
}
private function ffclick(_arg1:MouseEvent):void{
KingAPI.openOtherGamesLink();
}
private function backClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
(parent as dispatcherMC).GoToStage(dispatcherMC.MAIN_MENU, 0);
}
}
}//package
Section 212
//customContactListener (customContactListener)
package {
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import Box2D.Dynamics.Contacts.*;
public class customContactListener extends b2ContactListener {
private const BOUNCE:Number = 6.5;
private const HIT_TRESHHOLD:Number = 2;
private const PINBALL_BOUNCE:Number = 30;
var _parentGP:gameplay;
public static const BLINDAMOUNT:int = 300;
public function customContactListener(_arg1:gameplay){
this._parentGP = _arg1;
}
override public function Add(_arg1:b2ContactPoint):void{
var _local2:multipleBallsBonusActor;
var _local3:extraBallBonusActor;
var _local4:blindBonusActor;
var _local5:increaseBouncerSizeBonusActor;
var _local6:customDelayedAction;
var _local7:increaseBallsSizeBonusActor;
var _local8:customDelayedAction;
var _local9:ammoBonusActor;
var _local10:ballActor;
var _local11:bouncerActor;
var _local12:b2Vec2;
var _local13:coinActor;
var _local14:pinballBouncerActor;
var _local15:lifeBonusActor;
var _local16:lifeLineBonusActor;
var _local17:speedBonusActor;
var _local18:lifeLineActor;
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
if (_arg1.shape2.GetBody().GetUserData() == "wba"){
this._parentGP.SoundManager.PlayBallWall();
};
};
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
if (_arg1.shape1.GetBody().GetUserData() == "wba"){
this._parentGP.SoundManager.PlayBallWall();
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is multipleBallsBonusActor)){
_local2 = (_arg1.shape2.GetBody().GetUserData() as multipleBallsBonusActor);
_local2.DeleteFlag = true;
this._parentGP.PushActorToCreate(new bonusSpawnInfo(bonusSpawnInfo.MULTIBALL, null));
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local2._costume.x, _local2._costume.y));
this._parentGP.PunchInMessage(ingameMessage.DOUBLEBALLSBONUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is multipleBallsBonusActor)){
_local2 = (_arg1.shape1.GetBody().GetUserData() as multipleBallsBonusActor);
_local2.DeleteFlag = true;
this._parentGP.PushActorToCreate(new bonusSpawnInfo(bonusSpawnInfo.MULTIBALL, null));
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local2._costume.x, _local2._costume.y));
this._parentGP.PunchInMessage(ingameMessage.DOUBLEBALLSBONUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is extraBallBonusActor)){
_local3 = (_arg1.shape2.GetBody().GetUserData() as extraBallBonusActor);
_local3.DeleteFlag = true;
this._parentGP.IncreaseBallsCount();
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local3._costume.x, _local3._costume.y));
this._parentGP.PunchInMessage(ingameMessage.EXTRABALLBOBUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is extraBallBonusActor)){
_local3 = (_arg1.shape1.GetBody().GetUserData() as extraBallBonusActor);
_local3.DeleteFlag = true;
this._parentGP.IncreaseBallsCount();
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local3._costume.x, _local3._costume.y));
this._parentGP.PunchInMessage(ingameMessage.EXTRABALLBOBUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is blindBonusActor)){
_local4 = (_arg1.shape2.GetBody().GetUserData() as blindBonusActor);
_local4.DeleteFlag = true;
this._parentGP.BlindPlayer(BLINDAMOUNT);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local4._costume.x, _local4._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BLINDBONUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is blindBonusActor)){
_local4 = (_arg1.shape1.GetBody().GetUserData() as blindBonusActor);
_local4.DeleteFlag = true;
this._parentGP.BlindPlayer(BLINDAMOUNT);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local4._costume.x, _local4._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BLINDBONUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is increaseBouncerSizeBonusActor)){
_local5 = (_arg1.shape2.GetBody().GetUserData() as increaseBouncerSizeBonusActor);
_local5.DeleteFlag = true;
_local6 = new customDelayedAction(customDelayedAction.INCREASEBOUNCERSIZE, 2, 0, null, false);
this._parentGP.PunchInCustomDelayedAction(_local6);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local5._costume.x, _local5._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BOUNCERSIZEBONUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is increaseBouncerSizeBonusActor)){
_local5 = (_arg1.shape1.GetBody().GetUserData() as increaseBouncerSizeBonusActor);
_local5.DeleteFlag = true;
_local6 = new customDelayedAction(customDelayedAction.INCREASEBOUNCERSIZE, 2, 0, null, false);
this._parentGP.PunchInCustomDelayedAction(_local6);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local5._costume.x, _local5._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BOUNCERSIZEBONUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is lifeLineBonusActor)){
_local16 = (_arg1.shape2.GetBody().GetUserData() as lifeLineBonusActor);
_local6 = new customDelayedAction(customDelayedAction.LIFELINE, 0, 0, null, false);
_local16.DeleteFlag = true;
this._parentGP.PunchInCustomDelayedAction(_local6);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local16._costume.x, _local16._costume.y));
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is lifeLineBonusActor)){
_local16 = (_arg1.shape1.GetBody().GetUserData() as lifeLineBonusActor);
_local6 = new customDelayedAction(customDelayedAction.LIFELINE, 0, 0, null, false);
_local16.DeleteFlag = true;
this._parentGP.PunchInCustomDelayedAction(_local6);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local16._costume.x, _local16._costume.y));
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is speedBonusActor)){
_local17 = (_arg1.shape2.GetBody().GetUserData() as speedBonusActor);
if (!_local17.DeleteFlag){
_parentGP.speed_ball();
};
_local17.DeleteFlag = true;
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local17._costume.x, _local17._costume.y));
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is speedBonusActor)){
_local17 = (_arg1.shape1.GetBody().GetUserData() as speedBonusActor);
if (!_local17.DeleteFlag){
_parentGP.speed_ball();
};
_local17.DeleteFlag = true;
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local17._costume.x, _local17._costume.y));
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is lifeBonusActor)){
_local15 = (_arg1.shape2.GetBody().GetUserData() as lifeBonusActor);
if (!_local15.DeleteFlag){
_parentGP.addLife(1);
};
_local15.DeleteFlag = true;
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local15._costume.x, _local15._costume.y));
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is lifeBonusActor)){
_local15 = (_arg1.shape1.GetBody().GetUserData() as lifeBonusActor);
if (!_local15.DeleteFlag){
_parentGP.addLife(1);
};
_local15.DeleteFlag = true;
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local15._costume.x, _local15._costume.y));
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is increaseBallsSizeBonusActor)){
_local7 = (_arg1.shape2.GetBody().GetUserData() as increaseBallsSizeBonusActor);
_local7.DeleteFlag = true;
_local8 = new customDelayedAction(customDelayedAction.INCREASEBALLSSIZE, 0, 0, null, false);
this._parentGP.PunchInCustomDelayedAction(_local8);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local7._costume.x, _local7._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BALLSIZEBONUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is increaseBallsSizeBonusActor)){
_local7 = (_arg1.shape1.GetBody().GetUserData() as increaseBallsSizeBonusActor);
_local7.DeleteFlag = true;
_local8 = new customDelayedAction(customDelayedAction.INCREASEBALLSSIZE, 0, 0, null, false);
this._parentGP.PunchInCustomDelayedAction(_local8);
this._parentGP.SoundManager.PlayBonusPick();
this._parentGP.addPickup(new Point(_local7._costume.x, _local7._costume.y));
this._parentGP.PunchInMessage(ingameMessage.BALLSIZEBONUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is ammoBonusActor)){
_local9 = (_arg1.shape2.GetBody().GetUserData() as ammoBonusActor);
if (!_local9.DeleteFlag){
this._parentGP.IncreaseAmmo(_local9.Type);
};
_local9.DeleteFlag = true;
this._parentGP.SoundManager.PlayAmmoBonusPick();
this._parentGP.addPickup(new Point(_local9._costume.x, _local9._costume.y));
this._parentGP.PunchInMessage(ingameMessage.AMMOBONUS);
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is ammoBonusActor)){
_local9 = (_arg1.shape1.GetBody().GetUserData() as ammoBonusActor);
if (!_local9.DeleteFlag){
this._parentGP.IncreaseAmmo(_local9.Type);
};
_local9.DeleteFlag = true;
this._parentGP.SoundManager.PlayAmmoBonusPick();
this._parentGP.addPickup(new Point(_local9._costume.x, _local9._costume.y));
this._parentGP.PunchInMessage(ingameMessage.AMMOBONUS);
};
};
if ((_arg1.shape1.GetBody().GetUserData() is lifeLineActor)){
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local18 = (_arg1.shape1.GetBody().GetUserData() as lifeLineActor);
_local12 = new b2Vec2((_local10._costume.x - _local18._costume.x), (_local10._costume.y - _local18._costume.y));
_local12.Normalize();
_local12.Multiply(this.BOUNCE);
_local10._body.ApplyImpulse(_local12, _local10._body.GetWorldCenter());
_local18.DeleteFlag = true;
_parentGP.clear_lifeline();
this._parentGP.SoundManager.PlayBouncerHit();
};
};
if ((_arg1.shape2.GetBody().GetUserData() is lifeLineActor)){
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local18 = (_arg1.shape2.GetBody().GetUserData() as lifeLineActor);
_local12 = new b2Vec2((_local10._costume.x - _local18._costume.x), (_local10._costume.y - _local18._costume.y));
_local12.Normalize();
_local12.Multiply(this.BOUNCE);
_local10._body.ApplyImpulse(_local12, _local10._body.GetWorldCenter());
_local18.DeleteFlag = true;
_parentGP.clear_lifeline();
this._parentGP.SoundManager.PlayBouncerHit();
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local11 = (_arg1.shape1.GetBody().GetUserData() as bouncerActor);
_local12 = new b2Vec2((_local10._costume.x - _local11._costume.x), (_local10._costume.y - _local11._costume.y));
_local12.Normalize();
_local12.Multiply(this.BOUNCE);
_local11.LightUpIncrement();
this._parentGP.SoundManager.PlayBouncerHit();
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local11 = (_arg1.shape2.GetBody().GetUserData() as bouncerActor);
_local12 = new b2Vec2((_local10._costume.x - _local11._costume.x), (_local10._costume.y - _local11._costume.y));
_local12.Normalize();
_local12.Multiply(this.BOUNCE);
_local11.LightUpIncrement();
this._parentGP.SoundManager.PlayBouncerHit();
};
};
if ((_arg1.shape1.GetBody().GetUserData() is coinActor)){
if ((_arg1.shape2.GetBody().GetUserData() is bouncerActor)){
_local13 = (_arg1.shape1.GetBody().GetUserData() as coinActor);
if (!_local13.Collected){
this._parentGP.IncreaseMoneyCollected(_local13.Value);
_local13.DeleteFlag = true;
_local13.Collected = true;
this._parentGP.SoundManager.PlayCoinGet();
this._parentGP.AddCoinFader(new Point(_local13._costume.x, _local13._costume.y), _local13._costume.width);
};
};
};
if ((_arg1.shape2.GetBody().GetUserData() is coinActor)){
if ((_arg1.shape1.GetBody().GetUserData() is bouncerActor)){
_local13 = (_arg1.shape2.GetBody().GetUserData() as coinActor);
if (!_local13.Collected){
this._parentGP.IncreaseMoneyCollected(_local13.Value);
_local13.DeleteFlag = true;
_local13.Collected = true;
this._parentGP.SoundManager.PlayCoinGet();
this._parentGP.AddCoinFader(new Point(_local13._costume.x, _local13._costume.y), _local13._costume.width);
};
};
};
if ((_arg1.shape1.GetBody().GetUserData() is pinballBouncerActor)){
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local14 = (_arg1.shape1.GetBody().GetUserData() as pinballBouncerActor);
_local12 = new b2Vec2((_local10._costume.x - _local14._costume.x), (_local10._costume.y - _local14._costume.y));
_local12.Normalize();
_local12.Multiply(this.PINBALL_BOUNCE);
_local10._body.ApplyImpulse(_local12, _local10._body.GetWorldCenter());
};
};
if ((_arg1.shape2.GetBody().GetUserData() is pinballBouncerActor)){
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
_local10 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local14 = (_arg1.shape2.GetBody().GetUserData() as pinballBouncerActor);
_local12 = new b2Vec2((_local10._costume.x - _local14._costume.x), (_local10._costume.y - _local14._costume.y));
_local12.Normalize();
_local12.Multiply(this.PINBALL_BOUNCE);
_local10._body.ApplyImpulse(_local12, _local10._body.GetWorldCenter());
};
};
super.Add(_arg1);
}
override public function Result(_arg1:b2ContactResult):void{
var _local2:rocketActor;
var _local3:bulletActor;
var _local4:simpleBlockActor;
var _local5:squareBlockActor;
var _local6:moneyBlockActor;
var _local7:squareBlockActor;
var _local8:ballActor;
var _local9:simpleBlockActor;
var _local10:b2Vec2;
var _local11:moneyBlockActor;
var _local12:b2Vec2;
if ((_arg1.shape1.GetBody().GetUserData() is rocketActor)){
_local2 = (_arg1.shape1.GetBody().GetUserData() as rocketActor);
_local2.DeleteFlag = true;
if (!_local2.Exploded){
_local2.Exploded = true;
this._parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, 50, 100, new Point(_local2._costume.x, _local2._costume.y), true));
};
};
if ((_arg1.shape2.GetBody().GetUserData() is rocketActor)){
_local2 = (_arg1.shape2.GetBody().GetUserData() as rocketActor);
_local2.DeleteFlag = true;
if (!_local2.Exploded){
_local2.Exploded = true;
this._parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, 50, 100, new Point(_local2._costume.x, _local2._costume.y), true));
};
};
if ((_arg1.shape1.GetBody().GetUserData() is bulletActor)){
_local3 = (_arg1.shape1.GetBody().GetUserData() as bulletActor);
this._parentGP.SoundManager.PlayBulletHit();
if (!_local3.Collided){
if ((_arg1.shape2.GetBody().GetUserData() is simpleBlockActor)){
_local4 = (_arg1.shape2.GetBody().GetUserData() as simpleBlockActor);
_local4.Hit(_local3.Damage, new b2Vec2(0, 0), false);
} else {
if ((_arg1.shape2.GetBody().GetUserData() is squareBlockActor)){
_local5 = (_arg1.shape2.GetBody().GetUserData() as squareBlockActor);
_local5.Hit(_local3.Damage, new b2Vec2(0, 0), false, false, false);
} else {
if ((_arg1.shape2.GetBody().GetUserData() is moneyBlockActor)){
_local6 = (_arg1.shape2.GetBody().GetUserData() as moneyBlockActor);
_local6.Hit(_local3.Damage, new b2Vec2(0, 0), false, false, false);
};
};
};
_local3.Collided = true;
};
};
if ((_arg1.shape2.GetBody().GetUserData() is bulletActor)){
_local3 = (_arg1.shape2.GetBody().GetUserData() as bulletActor);
this._parentGP.SoundManager.PlayBulletHit();
if (!_local3.Collided){
if ((_arg1.shape1.GetBody().GetUserData() is simpleBlockActor)){
_local4 = (_arg1.shape1.GetBody().GetUserData() as simpleBlockActor);
_local4.Hit(_local3.Damage, new b2Vec2(0, 0), false);
} else {
if ((_arg1.shape1.GetBody().GetUserData() is squareBlockActor)){
_local5 = (_arg1.shape1.GetBody().GetUserData() as squareBlockActor);
_local5.Hit(_local3.Damage, new b2Vec2(0, 0), false, false, false);
} else {
if ((_arg1.shape1.GetBody().GetUserData() is moneyBlockActor)){
_local6 = (_arg1.shape1.GetBody().GetUserData() as moneyBlockActor);
_local6.Hit(_local3.Damage, new b2Vec2(0, 0), false, false, false);
};
};
};
_local3.Collided = true;
};
};
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape2.GetBody().GetUserData() is squareBlockActor)){
_local8 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local7 = (_arg1.shape2.GetBody().GetUserData() as squareBlockActor);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local7.Hit((_arg1.normalImpulse * _local8.DamageFactor), _arg1.normal, true, false, false)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local7.Hit(((_arg1.normalImpulse * 4) * _local8.DamageFactor), _arg1.normal, true, false, true)){
_local8.IncreaseBlocksCrushed();
};
};
this._parentGP.ParticlesManager.SpawnSparks(new Point((_arg1.position.x * PhysVals.RATIO), (_arg1.position.y * PhysVals.RATIO)), new Point((_arg1.normal.x * _arg1.normalImpulse), (_arg1.normal.y * _arg1.normalImpulse)));
_local8.IncreaseBlocksHit();
this._parentGP.SoundManager.PlaySimpleBlockHit();
};
};
};
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape1.GetBody().GetUserData() is squareBlockActor)){
_local8 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local7 = (_arg1.shape1.GetBody().GetUserData() as squareBlockActor);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local7.Hit((_arg1.normalImpulse * _local8.DamageFactor), _arg1.normal, true, false, false)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local7.Hit(((_arg1.normalImpulse * 4) * _local8.DamageFactor), _arg1.normal, true, false, true)){
_local8.IncreaseBlocksCrushed();
};
};
this._parentGP.ParticlesManager.SpawnSparks(new Point((_arg1.position.x * PhysVals.RATIO), (_arg1.position.y * PhysVals.RATIO)), new Point((_arg1.normal.x * _arg1.normalImpulse), (_arg1.normal.y * _arg1.normalImpulse)));
_local8.IncreaseBlocksHit();
this._parentGP.SoundManager.PlaySimpleBlockHit();
};
};
};
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape2.GetBody().GetUserData() is simpleBlockActor)){
_local8 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local9 = (_arg1.shape2.GetBody().GetUserData() as simpleBlockActor);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local9.Hit((_arg1.normalImpulse * _local8.DamageFactor), _arg1.normal, true)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local9.Hit(((_arg1.normalImpulse * 4) * _local8.DamageFactor), _arg1.normal, true)){
_local8.IncreaseBlocksCrushed();
};
};
this._parentGP.ParticlesManager.SpawnSparks(new Point((_arg1.position.x * PhysVals.RATIO), (_arg1.position.y * PhysVals.RATIO)), new Point((_arg1.normal.x * _arg1.normalImpulse), (_arg1.normal.y * _arg1.normalImpulse)));
_local8.IncreaseBlocksHit();
};
};
};
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape1.GetBody().GetUserData() is simpleBlockActor)){
_local8 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local9 = (_arg1.shape1.GetBody().GetUserData() as simpleBlockActor);
_local10 = _arg1.normal.Copy();
_local10.Multiply(-1);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local9.Hit((_arg1.normalImpulse * _local8.DamageFactor), _local10, true)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local9.Hit(((_arg1.normalImpulse * 4) * _local8.DamageFactor), _local10, true)){
_local8.IncreaseBlocksCrushed();
};
};
this._parentGP.ParticlesManager.SpawnSparks(new Point((_arg1.position.x * PhysVals.RATIO), (_arg1.position.y * PhysVals.RATIO)), new Point((_arg1.normal.x * _arg1.normalImpulse), (_arg1.normal.y * _arg1.normalImpulse)));
_local8.IncreaseBlocksHit();
};
};
};
if ((_arg1.shape1.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape2.GetBody().GetUserData() is moneyBlockActor)){
_local8 = (_arg1.shape1.GetBody().GetUserData() as ballActor);
_local11 = (_arg1.shape2.GetBody().GetUserData() as moneyBlockActor);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local11.Hit(((_arg1.normalImpulse * _local8.DamageFactor) * 1.5), _arg1.normal, true, false, false)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local11.Hit(((_arg1.normalImpulse * _local8.DamageFactor) * 1.5), _arg1.normal, true, false, true)){
_local8.IncreaseBlocksCrushed();
};
};
_local8.IncreaseBlocksHit();
this._parentGP.SoundManager.PlaySimpleBlockHit();
};
};
};
if ((_arg1.shape2.GetBody().GetUserData() is ballActor)){
if ((_arg1.shape1.GetBody().GetUserData() is moneyBlockActor)){
_local8 = (_arg1.shape2.GetBody().GetUserData() as ballActor);
_local11 = (_arg1.shape1.GetBody().GetUserData() as moneyBlockActor);
_local12 = _arg1.normal.Copy();
_local12.Multiply(-1);
if (_arg1.normalImpulse > this.HIT_TRESHHOLD){
if (!_local8.IsPowerupped()){
if (_local11.Hit(((_arg1.normalImpulse * _local8.DamageFactor) * 1.5), _local12, true, false, false)){
_local8.IncreaseBlocksCrushed();
};
} else {
if (_local11.Hit(((_arg1.normalImpulse * _local8.DamageFactor) * 1.5), _local12, true, false, true)){
_local8.IncreaseBlocksCrushed();
};
};
_local8.IncreaseBlocksHit();
this._parentGP.SoundManager.PlaySimpleBlockHit();
};
};
};
super.Result(_arg1);
}
}
}//package
Section 213
//customDelayedAction (customDelayedAction)
package {
import flash.geom.*;
public class customDelayedAction {
public var NumberTag2:Number;// = 0
public var NumberTag:Number;// = 0
public var BooleanTag:Boolean;// = false
public var Type:int;// = 0
public var Coords:Point;
public static const LIFELINE:int = 4;
public static const INCREASEBALLSSIZE:int = 2;
public static const EXPLOSION:int = 3;
public static const INCREASEBOUNCERSIZE:int = 1;
public function customDelayedAction(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Point, _arg5:Boolean){
NumberTag2 = 0;
NumberTag = 0;
Type = 0;
BooleanTag = false;
super();
this.Type = _arg1;
this.NumberTag = _arg2;
this.NumberTag2 = _arg3;
this.Coords = _arg4;
this.BooleanTag = _arg5;
}
}
}//package
Section 214
//dispatcherMC (dispatcherMC)
package {
import flash.display.*;
import gs.*;
import gs.events.*;
public class dispatcherMC extends MovieClip {
private const TRANSITIONTIME:Number = 0.3;
private var _mainMenu:mainMenuMC;
private var _parkanoidMain:parkanoidMain;
private var _gameComplete:MovieClip;
private var _faderTween:TweenMax;
private var _credits:creditsMC;
private var _stageToGo:int;
private var _gameplayLevelToGo:int;
private var _levelSelection:levelSelection;
private var _fader:MovieClip;
private var _gameplay:gameplay;
private var _currentState:int;// = 0
private var _tutorial:tutorialMC;
public static const MAIN_MENU:int = 4;
public static const GAMEPLAY:int = 1;
public static const GAME_COMPLETE:int = 3;
public static const LEVEL_SELECTION:int = 2;
public static const CREDITS:int = 6;
public static const TUTORIAL:int = 5;
public function dispatcherMC(){
_currentState = 0;
super();
this._parkanoidMain = (parent as parkanoidMain);
this.initFader();
if (this.UrlCheck()){
this.GoToStage(MAIN_MENU, 0);
};
}
public function GoToStage(_arg1:int, _arg2:int){
this._stageToGo = _arg1;
this._gameplayLevelToGo = _arg2;
this._faderTween = TweenMax.to(this._fader, this.TRANSITIONTIME, {alpha:1});
this._faderTween.addEventListener(TweenEvent.COMPLETE, this.faderInComplete);
}
private function initFader():void{
this._fader = new faderBlack();
this._fader.mouseEnabled = false;
this._fader.alpha = 0;
addChild(this._fader);
}
private function faderInComplete(_arg1:TweenEvent):void{
this._faderTween.removeEventListener(TweenEvent.COMPLETE, this.faderInComplete);
this.ActuallyGoToStage(this._stageToGo, this._gameplayLevelToGo);
this._faderTween = TweenMax.to(this._fader, this.TRANSITIONTIME, {alpha:0});
}
public function GetParkanoidMain():parkanoidMain{
return (this._parkanoidMain);
}
public function ActuallyGoToStage(_arg1:int, _arg2:int){
switch (this._currentState){
case 0:
break;
case LEVEL_SELECTION:
removeChild(this._levelSelection);
this._levelSelection = null;
break;
case GAMEPLAY:
removeChild(this._gameplay);
this._gameplay = null;
break;
case GAME_COMPLETE:
removeChild(this._gameComplete);
this._gameComplete = null;
break;
case MAIN_MENU:
removeChild(this._mainMenu);
this._mainMenu = null;
break;
case TUTORIAL:
removeChild(this._tutorial);
this._tutorial = null;
break;
case CREDITS:
removeChild(this._credits);
this._credits = null;
break;
};
switch (_arg1){
case LEVEL_SELECTION:
this._levelSelection = new levelSelection();
addChild(this._levelSelection);
this._currentState = LEVEL_SELECTION;
break;
case GAMEPLAY:
this._gameplay = new gameplay(_arg2, this._parkanoidMain.SoundManager);
addChild(this._gameplay);
this._currentState = GAMEPLAY;
break;
case GAME_COMPLETE:
this._parkanoidMain.SoundManager.PlayFinalFanfare();
this._gameComplete = new gameCompleteMC(this._parkanoidMain.SoundManager, this._parkanoidMain.GameProgress.Score, this);
addChild(this._gameComplete);
this._currentState = GAME_COMPLETE;
break;
case MAIN_MENU:
this._mainMenu = new mainMenuMC(this._parkanoidMain.SoundManager);
addChild(this._mainMenu);
this._currentState = MAIN_MENU;
break;
case TUTORIAL:
this._tutorial = new tutorialMC(this._parkanoidMain.SoundManager);
addChild(this._tutorial);
this._currentState = TUTORIAL;
break;
case CREDITS:
this._credits = new creditsMC(this._parkanoidMain.SoundManager);
addChild(this._credits);
this._currentState = CREDITS;
break;
};
setChildIndex(this._fader, (numChildren - 1));
}
function UrlCheck():Boolean{
var _local1:String;
var _local2:Number;
var _local3:Number;
var _local4:String;
var _local5:Number;
var _local6:Number;
_local1 = stage.loaderInfo.loaderURL;
_local2 = (_local1.indexOf("://") + 3);
_local3 = _local1.indexOf("/", _local2);
_local4 = _local1.substring(_local2, _local3);
_local5 = (_local4.lastIndexOf(".") - 1);
_local6 = (_local4.lastIndexOf(".", _local5) + 1);
_local4 = _local4.substring(_local6, _local4.length);
if (_local4 != "flashgamelicense.com"){
return (true);
};
return (true);
}
}
}//package
Section 215
//doubleBallsBonus (doubleBallsBonus)
package {
import flash.display.*;
public dynamic class doubleBallsBonus extends MovieClip {
}
}//package
Section 216
//dustSquare (dustSquare)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class dustSquare extends MovieClip {
private var gravity:Number;// = 1
private var lifetime:int;// = 10
private var speedX:Number;
private var speedY:Number;
public function dustSquare(_arg1:Point, _arg2:Boolean){
lifetime = 10;
gravity = 1;
super();
x = _arg1.x;
y = _arg1.y;
this.speedX = ((Math.random() * 8) - 4);
if (!_arg2){
this.speedY = ((Math.random() * -10) - 6);
} else {
this.speedY = 0;
};
mouseEnabled = false;
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
x = (x + this.speedX);
y = (y + this.speedY);
this.speedY = (this.speedY + this.gravity);
this.lifetime--;
if (this.lifetime < 11){
alpha = (this.lifetime / 10);
};
if (this.lifetime <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 217
//exploball_beep (exploball_beep)
package {
import flash.media.*;
public dynamic class exploball_beep extends Sound {
}
}//package
Section 218
//exploballMessage (exploballMessage)
package {
import flash.display.*;
public dynamic class exploballMessage extends MovieClip {
}
}//package
Section 219
//explosionEffect (explosionEffect)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
public class explosionEffect extends MovieClip {
private var initialLifetime:int;// = 15
private var growFactor:Number;
private var lifetime:int;// = 25
public function explosionEffect(_arg1:Number, _arg2:Point){
var _local3:BlurFilter;
lifetime = 25;
initialLifetime = 15;
super();
_local3 = new BlurFilter(5, 5, 1);
filters = [_local3];
width = (_arg1 * 2);
height = (_arg1 * 2);
x = _arg2.x;
y = _arg2.y;
this.growFactor = (_arg1 / 30);
this.lifetime = this.initialLifetime;
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
width = (width + this.growFactor);
height = (height + this.growFactor);
this.lifetime--;
alpha = (this.lifetime / this.initialLifetime);
if (this.lifetime == 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 220
//explosionSnd (explosionSnd)
package {
import flash.media.*;
public dynamic class explosionSnd extends Sound {
}
}//package
Section 221
//extraBallBonus (extraBallBonus)
package {
import flash.display.*;
public dynamic class extraBallBonus extends MovieClip {
}
}//package
Section 222
//extraBallBonusActor (extraBallBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class extraBallBonusActor extends Actor {
public function extraBallBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new extraBallBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 223
//extraBallMessage (extraBallMessage)
package {
import flash.display.*;
public dynamic class extraBallMessage extends MovieClip {
}
}//package
Section 224
//faderBlack (faderBlack)
package {
import flash.display.*;
public dynamic class faderBlack extends MovieClip {
}
}//package
Section 225
//ferryBlue (ferryBlue)
package {
import flash.display.*;
public dynamic class ferryBlue extends MovieClip {
public function ferryBlue(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 226
//ferryGreen (ferryGreen)
package {
import flash.display.*;
public dynamic class ferryGreen extends MovieClip {
public function ferryGreen(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 227
//ferryRed (ferryRed)
package {
import flash.display.*;
public dynamic class ferryRed extends MovieClip {
public function ferryRed(){
addFrameScript(0, this.frame1);
}
function frame1(){
stop();
}
}
}//package
Section 228
//finalStuff (finalStuff)
package {
import flash.media.*;
public dynamic class finalStuff extends Sound {
}
}//package
Section 229
//finishedSpark (finishedSpark)
package {
import flash.display.*;
import flash.events.*;
public class finishedSpark extends MovieClip {
private var gravity:Number;// = 1
private var lifetime:int;// = 30
private var speedX:Number;
private var speedY:Number;
public function finishedSpark(){
var _local1:int;
lifetime = 30;
gravity = 1;
super();
_local1 = (Math.floor((Math.random() * 4)) + 1);
gotoAndStop(_local1);
this.speedX = ((Math.random() * 8) - 4);
this.speedY = ((Math.random() * -10) - 6);
mouseEnabled = false;
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
x = (x + this.speedX);
y = (y + this.speedY);
this.speedY = (this.speedY + this.gravity);
this.lifetime--;
if (this.lifetime < 11){
alpha = (this.lifetime / 10);
};
if (this.lifetime <= 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 230
//fiveballsComboMessage (fiveballsComboMessage)
package {
import flash.display.*;
public dynamic class fiveballsComboMessage extends MovieClip {
}
}//package
Section 231
//flasher (flasher)
package {
import flash.display.*;
public dynamic class flasher extends MovieClip {
}
}//package
Section 232
//fourtyShattersComboMessage (fourtyShattersComboMessage)
package {
import flash.display.*;
public dynamic class fourtyShattersComboMessage extends MovieClip {
}
}//package
Section 233
//gameCompleteMC (gameCompleteMC)
package {
import flash.display.*;
import flash.events.*;
import com.midasplayer.*;
import flash.text.*;
import flash.net.*;
public class gameCompleteMC extends MovieClip {
public var backBtn:MovieClip;
public var submitBtn:MovieClip;
public var fflogo:MovieClip;
private var _soundManager:soundManager;
private var _fflogo:MovieClip;
private var _submitBtn:MovieClip;
public var scoreTxt:TextField;
private var _backBtn:MovieClip;
private var _scoreTxt:TextField;
public function gameCompleteMC(_arg1:soundManager, _arg2:int, _arg3:dispatcherMC){
this._soundManager = _arg1;
this.initControls();
this._scoreTxt.text = (_arg2.toString() + " Pts.");
if (KingAPI.isHome){
KingAPI.submitScore(_arg2);
};
_arg3.GetParkanoidMain().KongSubmitTotalScore(_arg2);
_arg3.GetParkanoidMain().MindjoltSubmitScore(_arg2);
}
private function submitClick(_arg1:MouseEvent):void{
KingAPI.openHighscoresLink();
}
private function logoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://apps.facebook.com/funflow"));
}
private function backClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
(parent as dispatcherMC).GoToStage(dispatcherMC.LEVEL_SELECTION, 0);
}
private function initControls():void{
this._backBtn = this.backBtn;
this._backBtn.buttonMode = true;
this._backBtn.addEventListener(MouseEvent.CLICK, this.backClick);
this._submitBtn = this.submitBtn;
this._submitBtn.buttonMode = true;
this._submitBtn.addEventListener(MouseEvent.CLICK, this.submitClick);
this._fflogo = this.fflogo;
this._fflogo.buttonMode = true;
this._fflogo.addEventListener(MouseEvent.CLICK, this.logoClick);
this._scoreTxt = this.scoreTxt;
}
}
}//package
Section 234
//gameplay (gameplay)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.*;
import gs.easing.*;
public class gameplay extends MovieClip {
private const INCOMEINCREASE:Number = 0.55;
private var _quitConfirmator:MovieClip;
private var _gamespeed:int;// = 40
private var _gameplayStats:gameplayStatsManager;
private var _controlsScheme:int;
private var _spawner:spawner;
private var _customContactListener:customContactListener;
private var isPassed:Boolean;
private var _isPaused:Boolean;
private var _weaponsController:weaponsController;
public var ParticlesManager:particlesManager;
private var _gameStarted:Boolean;// = false
private var _gameoverCountdown:int;// = 15
private var _shakeScreenFactor:Number;// = 0
private var _allActors:Array;
private var _confirmingQuit:Boolean;
private var _gameCompleted:Boolean;// = false
private var _textShowTween:TweenMax;
private var _actorsToCreate:Array;
private var _blindCounter:int;// = 0
private var _lifeLineActor:lifeLineActor;
private var _bouncerActor:bouncerActor;
private var UsedWeapons:Boolean;// = false
private var _controller:controller;
private var m_view:Sprite;
private var _scoreAchievementsController:scoreAchievementsController;
private var _messageInProgress:Boolean;// = false
private var _actorsToDelete:Array;
private var _flasher:MovieClip;
private var _dimmer:MovieClip;
private var _blinded;// = false
public var BallsLost:int;// = 0
private var _dimmerTween:TweenMax;
private var _blinder:MovieClip;
private var _pendingBallsCount:int;// = 0
private var _textHideTween:TweenMax;
public var CurrentLevel:MovieClip;
private var main:MovieClip;
private var _interface:interfaceMC;
public var SoundManager:soundManager;
private var _flashCounter:int;// = 0
private var _pendingMessages:Array;
private var _playingLevel:int;
public var _gunMC:bouncerGun;
private var _customDelayedActions:Array;
private var _gameprogress:gameProgressInfo;
public static const GRAVITY_IN_METERS:Number = 9.8;
private static const WORLD_HALFHEIGHT_PIX:int = 5000;
public function gameplay(_arg1:int, _arg2:soundManager, _arg3:MovieClip){
_gamespeed = 40;
UsedWeapons = false;
_messageInProgress = false;
_gameStarted = false;
_blinded = false;
BallsLost = 0;
_gameCompleted = false;
_shakeScreenFactor = 0;
_gameoverCountdown = 15;
_pendingBallsCount = 0;
_flashCounter = 0;
_blindCounter = 0;
isPassed = false;
main = _arg3;
this._customDelayedActions = [];
this._controller = new controller();
this._scoreAchievementsController = new scoreAchievementsController();
scoreAchievementsController.levelScore = 0;
this._pendingMessages = [];
super();
this._playingLevel = _arg1;
this.SoundManager = _arg2;
addEventListener(Event.ADDED_TO_STAGE, this.initGameplay);
}
public function showLevelFinishedStats(_arg1:Boolean):void{
var _local2:int;
var _local3:int;
if (((isPassed) && (!(_arg1)))){
return;
};
_local2 = this.calculateTimeBonus();
if (!_arg1){
_local2 = 0;
};
this._gameprogress.Score = (this._gameprogress.Score + _local2);
scoreAchievementsController.bonus = _local2;
scoreAchievementsController.scores = (this._scoreAchievementsController.Score + _local2);
scoreAchievementsController.levelScore = this._scoreAchievementsController.Score;
_local3 = (this._scoreAchievementsController.BonusMoney + this._scoreAchievementsController.MoneyCollected);
if (_arg1){
main.pass();
} else {
main.lost();
};
}
public function CancelQuit(){
this._confirmingQuit = false;
this._isPaused = false;
this.Undim();
}
private function processScreenShake():void{
if (this._shakeScreenFactor > 0){
if (this._shakeScreenFactor > 15){
this._shakeScreenFactor = 10;
};
this.CurrentLevel.x = (((this._shakeScreenFactor * 2) * Math.random()) - this._shakeScreenFactor);
this.CurrentLevel.y = (((this._shakeScreenFactor * 2) * Math.random()) - this._shakeScreenFactor);
this._shakeScreenFactor--;
} else {
if (this.CurrentLevel.x != 0){
this.CurrentLevel.x = 0;
};
if (this.CurrentLevel.y != 0){
this.CurrentLevel.y = 0;
};
};
}
private function mouseUpLstnr(_arg1:MouseEvent):void{
this._controller.MouseDown = false;
this._controller.MouseActionCompleted = false;
}
private function processCustomDelayedActions():void{
var _local1:customDelayedAction;
for each (_local1 in this._customDelayedActions) {
switch (_local1.Type){
case customDelayedAction.INCREASEBOUNCERSIZE:
this._bouncerActor.ModifySize(_local1.NumberTag, 300);
break;
case customDelayedAction.INCREASEBALLSSIZE:
this.IncreaseAllBallsSize();
break;
case customDelayedAction.LIFELINE:
this.update_lifeline();
break;
case customDelayedAction.EXPLOSION:
if (_local1.BooleanTag){
this.ProcessExplosion(this._weaponsController.GetRocketDamage(), this._weaponsController.GetRocketSpread(), _local1.Coords);
} else {
this.ProcessExplosion(_local1.NumberTag, _local1.NumberTag2, _local1.Coords);
};
break;
};
};
this._customDelayedActions = [];
}
private function initInterface():void{
this._interface = new interfaceMC(this);
this._interface.x = -142;
this._interface.y = 56;
addChild(this._interface);
}
public function Finalize(){
this.SoundManager.StopMusic();
if (!this._gameCompleted){
(parent as dispatcherMC).GoToStage(dispatcherMC.LEVEL_SELECTION, 1);
} else {
(parent as dispatcherMC).GoToStage(dispatcherMC.GAME_COMPLETE, 1);
};
}
private function processControls():void{
if (this._controller.MouseDown){
this.performShoot();
};
if (((this._controller.MouseDown) && (!(this._controller.MouseActionCompleted)))){
this._controller.MouseActionCompleted = true;
};
}
private function showMessage(_arg1:int){
addChild(new ingameMessage(_arg1, this));
this._messageInProgress = true;
}
public function IncreaseAmmo(_arg1:int){
this._weaponsController.IncreaseAmmo(_arg1);
}
public function pre_win():void{
isPassed = true;
}
private function initLevel():void{
var _local1:levelScrambler;
switch (this._playingLevel){
case 1:
this.CurrentLevel = new Level1();
break;
case 2:
this.CurrentLevel = new Level2();
break;
case 3:
this.CurrentLevel = new Level3();
break;
case 4:
this.CurrentLevel = new Level4();
break;
case 5:
this.CurrentLevel = new Level5();
break;
case 6:
this.CurrentLevel = new Level6();
break;
case 7:
this.CurrentLevel = new Level7();
break;
case 8:
this.CurrentLevel = new Level8();
break;
case 9:
this.CurrentLevel = new Level9();
break;
};
this.CurrentLevel.removeChild(this.CurrentLevel.shitfuck);
addChild(this.CurrentLevel);
_local1 = new levelScrambler(this.CurrentLevel);
_local1.Scramble();
}
private function Dim(){
main.pause_mc.showPause(true);
}
public function GetAllBallsInfos():Array{
var _local1:Actor;
var _local2:Point;
var _local3:ballInfo;
var _local4:Array;
_local4 = [];
for each (_local1 in this._allActors) {
if ((_local1 is ballActor)){
_local2 = new Point(_local1._costume.x, _local1._costume.y);
_local3 = new ballInfo(_local2, _local1._body.GetLinearVelocity(), _local1._body.GetAngularVelocity(), (_local1 as ballActor));
_local4.push(_local3);
};
};
return (_local4);
}
public function PunchInCustomDelayedAction(_arg1:customDelayedAction){
this._customDelayedActions.push(_arg1);
}
public function addPickup(_arg1:Point){
var _local2:finishedSpark;
var _local3:Number;
var _local4:Number;
var _local5:int;
while (_local5 < 15) {
_local2 = new finishedSpark();
_local3 = (Math.random() * 30);
_local4 = (Math.random() * 30);
_local2.x = ((_arg1.x - 15) + _local3);
_local2.y = ((_arg1.y - 15) + _local4);
this.CurrentLevel.addChild(_local2);
_local5++;
};
this.AddBonusFader(_arg1);
}
public function GetGameProgress():gameProgressInfo{
return (this._gameprogress);
}
public function BlindPlayer(_arg1:int){
this._blindCounter = (this._blindCounter + _arg1);
this._gameprogress.AchievementsInfo.IncreaseBlinds();
}
private function calculateTimeBonus():int{
var _local1:int;
var _local2:*;
_local2 = 5;
if ((this._interface.Timer / ((50 * 60) * _local2)) < 1){
_local1 = ((1 - (this._interface.Timer / ((50 * 60) * _local2))) * scoreAchievementsController.TIMEBONUS);
};
return (_local1);
}
public function CheckWeaponAvailability(_arg1:int):Boolean{
switch (_arg1){
case ammoBonusActor.PISTOL_AMMO:
if (this._weaponsController.PistolAvailable){
return (true);
};
break;
case ammoBonusActor.SPREAD_AMMO:
if (this._weaponsController.SpreadGunAvailable){
return (true);
};
break;
case ammoBonusActor.RAPID_AMMO:
if (this._weaponsController.RapidGunAvailable){
return (true);
};
break;
case ammoBonusActor.ROCKET_AMMO:
if (this._weaponsController.RocketGunAvailable){
return (true);
};
break;
};
return (false);
}
public function cleanup(_arg1:Boolean):void{
this._gameprogress.AchievementsInfo.TimesPlayed++;
removeEventListener(Event.ENTER_FRAME, this.mainLogic);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
stage.removeEventListener(KeyboardEvent.KEY_UP, this.keyUp);
stage.removeEventListener(Event.DEACTIVATE, this.GameNotActive);
this._dimmer.removeEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownLstnr);
this._dimmer.removeEventListener(MouseEvent.MOUSE_UP, this.mouseUpLstnr);
if (!_arg1){
this._gameprogress.Money = (this._gameprogress.Money + this._scoreAchievementsController.MoneyCollected);
this._gameprogress.Money = (this._gameprogress.Money + this._scoreAchievementsController.BonusMoney);
this._gameprogress.Score = (this._gameprogress.Score + this._scoreAchievementsController.Score);
};
}
public function clear_lifeline():void{
_lifeLineActor = null;
}
private function setupPhysicsWorld():void{
var _local1:b2AABB;
var _local2:b2Vec2;
var _local3:Boolean;
var _local4:b2DebugDraw;
_local1 = new b2AABB();
_local1.lowerBound.Set((-(WORLD_HALFHEIGHT_PIX) / PhysVals.RATIO), (-(WORLD_HALFHEIGHT_PIX) / PhysVals.RATIO));
_local1.upperBound.Set((WORLD_HALFHEIGHT_PIX / PhysVals.RATIO), (WORLD_HALFHEIGHT_PIX / PhysVals.RATIO));
_local2 = new b2Vec2(0, GRAVITY_IN_METERS);
PhysVals.world = new b2World(_local1, _local2, _local3);
PhysVals.world.SetContactListener(this._customContactListener);
_local4 = new b2DebugDraw();
_local4.m_sprite = m_view;
m_view.visible = false;
_local4.m_fillAlpha = 0.3;
_local4.m_lineThickness = 1;
_local4.m_drawScale = PhysVals.RATIO;
_local4.m_drawFlags = (b2DebugDraw.e_shapeBit | b2DebugDraw.e_centerOfMassBit);
PhysVals.world.SetDebugDraw(_local4);
}
public function addCoinPieces(_arg1:Point){
var _local2:coinShatter;
var _local3:int;
while (_local3 < 5) {
_local2 = new coinShatter();
_local2.x = _arg1.x;
_local2.y = _arg1.y;
this.CurrentLevel.addChild(_local2);
_local3++;
};
}
private function deleteActors():void{
var _local1:*;
var _local2:int;
for each (_local1 in this._actorsToDelete) {
PhysVals.world.DestroyBody(_local1._body);
if ((_local1._costume as MovieClip).hasOwnProperty("mkt")){
main.makeup((_local1._costume as MovieClip).mkt);
};
_local1._costume.parent.removeChild(_local1._costume);
_local2 = this._allActors.indexOf(_local1);
this._allActors.splice(_local2, 1);
};
this._actorsToDelete = [];
}
public function getBouncerCoordinates():Point{
return (new Point(this._bouncerActor._costume.x, this._bouncerActor._costume.y));
}
public function addSpark(_arg1:Point){
var _local2:finishedSpark;
var _local3:int;
while (_local3 < 15) {
_local2 = new finishedSpark();
_local2.x = _arg1.x;
_local2.y = _arg1.y;
this.CurrentLevel.addChild(_local2);
_local3++;
};
}
public function SetLastTimeBlockCrushed(){
this._interface.LastTimeBlockCrushed = this._interface.Timer;
}
private function processMessages():void{
var _local1:int;
if (!this._messageInProgress){
if (this._pendingMessages.length > 0){
_local1 = this._pendingMessages[0];
this._pendingMessages.splice(0, 1);
this.showMessage(_local1);
};
};
}
private function gameStatusCheck():void{
var _local1:*;
var _local2:int;
var _local3:int;
var _local4:int;
for each (_local1 in this._allActors) {
if ((((((_local1 is simpleBlockActor)) || ((_local1 is moneyBlockActor)))) || ((_local1 is squareBlockActor)))){
_local2++;
} else {
if ((((((((((((((((((_local1 is shatterPieceActor)) || ((_local1 is coinActor)))) || ((_local1 is shatterPieceSquareActor)))) || ((_local1 is ammoBonusActor)))) || ((_local1 is blindBonusActor)))) || ((_local1 is extraBallBonusActor)))) || ((_local1 is increaseBallsSizeBonusActor)))) || ((_local1 is increaseBouncerSizeBonusActor)))) || ((_local1 is multipleBallsBonusActor)))){
_local3++;
} else {
if ((_local1 is ballActor)){
_local4++;
};
};
};
};
if (_local2 == 0){
if (_local3 == 0){
if (this._gameoverCountdown > 0){
this._gameoverCountdown--;
} else {
this.cleanup(false);
this.IncreaseLevelCompletion();
if (this.BallsLost == 0){
this._gameprogress.AchievementsInfo.GetNoBallsLostAchievement();
};
if (!this.UsedWeapons){
this._gameprogress.AchievementsInfo.GetNoWeaponsUsedAchievement();
};
trace("level completed");
this.showLevelFinishedStats(true);
};
};
} else {
if ((((((_local4 == 0)) && ((this._gameplayStats.BallsCount == 0)))) && ((this._pendingBallsCount == 0)))){
if (this._gameoverCountdown > 0){
this._gameoverCountdown--;
} else {
this.cleanup(false);
trace("game over");
this.showLevelFinishedStats(false);
};
};
};
if ((((((_local4 == 0)) && ((this._gameplayStats.BallsCount > 0)))) && ((this._pendingBallsCount == 0)))){
this.SpawnBall();
};
}
private function initCountdown():void{
var _local1:countDownTimer;
_local1 = new countDownTimer(this);
_local1.y = -100;
_local1.x = 225;
addChild(_local1);
}
public function togglePause(){
if (this._confirmingQuit){
return;
};
if (this._isPaused){
this._isPaused = false;
this.Undim();
} else {
this._isPaused = true;
this.Dim();
};
}
public function addDust(_arg1:Point, _arg2:Boolean){
var _local3:dustSquare;
var _local4:int;
while (_local4 < 5) {
_local3 = new dustSquare(_arg1, _arg2);
this.CurrentLevel.addChild(_local3);
_local4++;
};
}
public function ConfirmQuit(){
if (this._confirmingQuit){
return;
};
this._confirmingQuit = true;
if (!this._isPaused){
this._isPaused = true;
this.Dim();
};
this._quitConfirmator = new quitConfirmator(new Point((225 - 125), -150), this);
addChild(this._quitConfirmator);
}
public function CheckBonusesCount():int{
var _local1:*;
var _local2:int;
for each (_local1 in this._allActors) {
if ((((((((((((_local1 is ammoBonusActor)) || ((_local1 is extraBallBonusActor)))) || ((_local1 is increaseBallsSizeBonusActor)))) || ((_local1 is increaseBouncerSizeBonusActor)))) || ((_local1 is multipleBallsBonusActor)))) || ((_local1 is blindBonusActor)))){
_local2++;
};
};
return (_local2);
}
private function mainLogic(_arg1:Event):void{
var _local2:int;
var _local3:MovieClip;
if (!_isPaused){
processBouncer();
};
if (!this._isPaused){
PhysVals.world.Step((1 / _gamespeed), 10);
};
if (!this._isPaused){
this.updateActors();
};
if (!this._isPaused){
this.deleteActors();
};
if (!this._isPaused){
this.createActors();
};
if (!this._isPaused){
this.processCustomDelayedActions();
};
if (!this._isPaused){
this.checkBoringBallBonus();
};
if (!this._isPaused){
this.processMessages();
};
this.processScreenShake();
if (((this._gameStarted) && (!(this._isPaused)))){
this.processControls();
};
this._interface.Update(this._gameStarted, 0, 0, 0, 0, this._gameplayStats.BallsCount, this._scoreAchievementsController.Score, this._isPaused);
this._interface.UpdateWeaponSectors(this._weaponsController.currentlySelectedWeapon);
this._weaponsController.Update();
if (((this._gameStarted) && (!(this._isPaused)))){
this.gameStatusCheck();
};
if (!this._isPaused){
_local2 = 0;
while (_local2 < this.CurrentLevel.numChildren) {
_local3 = (this.CurrentLevel.getChildAt(_local2) as MovieClip);
if ((_local3 is hitMC)){
this.CurrentLevel.setChildIndex(_local3, (this.CurrentLevel.numChildren - 1));
};
_local2++;
};
};
if (!this._isPaused){
this.processBlinder();
};
}
public function IncreaseBallsCount(){
this._gameplayStats.BallsCount++;
}
private function Undim(){
main.pause_mc.showPause(false);
}
public function speed_ball():void{
var _local1:*;
var _local2:b2Vec2;
for each (_local1 in this._allActors) {
if ((_local1 is ballActor)){
_local2 = (_local1 as ballActor)._body.GetLinearVelocity();
_local2.Multiply(1.5);
(_local1 as ballActor)._body.ApplyImpulse(_local2, (_local1 as ballActor)._body.GetWorldCenter());
};
};
}
public function addLife(_arg1:int):void{
this._gameplayStats.BallsCount++;
}
public function IsPaused():Boolean{
if (this._isPaused){
return (true);
};
return (false);
}
public function DecreasePendingBallsCount(){
this._pendingBallsCount--;
}
private function performShoot():void{
var _local1:Point;
if (this._weaponsController.Shoot(this._controller.MouseActionCompleted)){
_local1 = new Point(this._bouncerActor._costume.x, ((this._bouncerActor._costume.y - (this._bouncerActor._costume.height / 2)) - 8));
switch (this._weaponsController.currentlySelectedWeapon){
case weaponsController.PISTOL:
this._spawner.SpawnBullet(_local1, this._weaponsController.GetPistolDamage(), 0, bulletActor.CLICKSHOT);
this.SoundManager.PlayClickshot();
this.addDust(_local1, false);
break;
case weaponsController.SPREAD:
this._spawner.SpawnSpreadShot(_local1, this._weaponsController.GetSpreadNumBullets(), this._weaponsController.GetSpreadDamage());
this.SoundManager.PlayShotgunshot();
this.addDust(_local1, false);
break;
case weaponsController.RAPID:
this._spawner.SpawnBullet(_local1, this._weaponsController.GetRapidDamage(), 0.5, bulletActor.RAPIDSHOT);
this.SoundManager.PlayRapidshot();
this.addDust(_local1, false);
break;
case weaponsController.ROCKET:
this._spawner.SpawnRocket(_local1);
this.SoundManager.PlayRocketshot();
this.addDust(_local1, false);
break;
};
this.UsedWeapons = true;
} else {
if (!this._controller.MouseActionCompleted){
this.SoundManager.PlayAmmoOut();
};
};
}
private function updateActors():void{
var _local1:*;
for each (_local1 in this._allActors) {
if ((_local1 is Actor)){
_local1.UpdateNow();
if ((_local1 as Actor)._costume.y > 360){
if ((_local1 is ballActor)){
this.BallsLost++;
this.SoundManager.PlayBallLost();
};
_local1.DeleteFlag = true;
};
if (_local1.DeleteFlag){
if (this._actorsToDelete.indexOf(_local1) == -1){
this._actorsToDelete.push(_local1);
};
};
} else {
if ((_local1 is ActorWithMultipleBodies)){
_local1.UpdateNow();
} else {
trace("Some crap entered _allActors");
};
};
};
}
public function IncreaseScore(_arg1:int){
this._scoreAchievementsController.Score = (this._scoreAchievementsController.Score + _arg1);
}
private function createActors():void{
var _local1:*;
for each (_local1 in this._actorsToCreate) {
if ((_local1 is shatterBlockInfo)){
this._spawner.shatterBlock((_local1 as shatterBlockInfo));
} else {
if ((_local1 is shatterSquareBlockInfo)){
this._spawner.shatterSquareBlock((_local1 as shatterSquareBlockInfo));
} else {
if ((_local1 is shatterBlockMoneyInfo)){
this._spawner.shatterMoneyBlock((_local1 as shatterBlockMoneyInfo));
} else {
if ((_local1 is bonusSpawnInfo)){
this._spawner.SpawnBonus((_local1 as bonusSpawnInfo));
};
};
};
};
};
this._actorsToCreate = [];
}
public function StartGame(){
var _local1:levelParser;
_local1 = new levelParser(this.CurrentLevel, this, this._allActors, this._playingLevel);
_local1.Parse();
this._gameStarted = true;
this.SoundManager.StartMusic(soundManager.INGAME);
}
private function initGameplay(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, this.initGameplay);
this._gameprogress = (parent as MovieClip).GameProgress;
this._gameprogress.AchievementsInfo.ResetGets();
this._controlsScheme = this._gameprogress.controlsScheme;
if (this._controlsScheme == gameProgressInfo.CONTROL_KEYBOARD){
this._gamespeed = 45;
};
m_view = new Sprite();
stage.focus = this;
this.setupWeaponsController();
this._gameplayStats = new gameplayStatsManager(this._gameprogress.BallsCountLevel);
this._allActors = [];
this._actorsToDelete = [];
this._actorsToCreate = [];
this._customContactListener = new customContactListener(this);
this.setupPhysicsWorld();
this.initLevel();
this._spawner = new spawner(this.CurrentLevel, this, this._allActors);
this.initBouncer();
this.initInterface();
this.initCountdown();
addEventListener(Event.ENTER_FRAME, this.mainLogic);
stage.addEventListener(KeyboardEvent.KEY_DOWN, this.keyDown);
stage.addEventListener(KeyboardEvent.KEY_UP, this.keyUp);
this.initDimmer();
if (this._controlsScheme == gameProgressInfo.CONTROL_MOUSE){
this._dimmer.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownLstnr);
this._dimmer.addEventListener(MouseEvent.MOUSE_UP, this.mouseUpLstnr);
};
stage.addEventListener(Event.DEACTIVATE, this.GameNotActive);
this.ParticlesManager = new particlesManager(this.CurrentLevel, this);
this.initBlinder();
addChild(m_view);
}
private function processBlinder():void{
var _local1:Number;
if ((((this._blindCounter > 0)) && (!(this._blinded)))){
this._blinded = true;
TweenLite.to(this._blinder, 0.5, {scaleX:0.4, scaleY:0.4, ease:Circ.easeOut});
} else {
if ((((this._blindCounter == 0)) && (this._blinded))){
this._blinded = false;
TweenLite.to(this._blinder, 0.5, {scaleX:2, scaleY:2, ease:Circ.easeIn});
};
};
if (this._controlsScheme == gameProgressInfo.CONTROL_MOUSE){
this._blinder.x = mouseX;
this._blinder.y = mouseY;
} else {
this._blinder.x = this._bouncerActor._costume.x;
this._blinder.y = this._bouncerActor._costume.y;
};
this.CurrentLevel.setChildIndex(this._blinder, (this.CurrentLevel.numChildren - 1));
if (this._blindCounter > 0){
this._blindCounter--;
};
if (this._blindCounter > 300){
this._blindCounter = 300;
};
if (this._flashCounter > 0){
this._flashCounter--;
};
if (this._flashCounter > 10){
this._flashCounter = 10;
};
_local1 = (this._flashCounter / 10);
this._flasher.alpha = (_local1 * 0.7);
}
private function keyUp(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 37:
this._controller.leftPressed = false;
break;
case 39:
this._controller.rightPressed = false;
break;
case 17:
if (this._controlsScheme == gameProgressInfo.CONTROL_KEYBOARD){
this._controller.MouseDown = false;
this._controller.MouseActionCompleted = false;
};
break;
};
}
public function GetSpawner():spawner{
return (this._spawner);
}
public function IncreaseMoneyCollected(_arg1:int){
_arg1 = (_arg1 * (1 + ((this._playingLevel - 1) * this.INCOMEINCREASE)));
this._scoreAchievementsController.MoneyCollected = (this._scoreAchievementsController.MoneyCollected + _arg1);
}
private function IncreaseAllBallsSize(){
var _local1:*;
for each (_local1 in this._allActors) {
if ((_local1 is ballActor)){
(_local1 as ballActor).ModifySize(2, 300);
};
};
}
public function PushActorToCreate(_arg1){
this._actorsToCreate.push(_arg1);
}
private function initDimmer():void{
this._dimmer = new gameplayDimmer();
this._dimmer.alpha = 0;
addChild(this._dimmer);
}
private function processBouncer():void{
if (this._controlsScheme == gameProgressInfo.CONTROL_MOUSE){
this._bouncerActor.mouseUpdate(mouseX);
} else {
if (this._controller.leftPressed){
this._controller.bouncerSpeed = (this._controller.bouncerSpeed - this._controller.bouncerAcceleration);
if (this._controller.bouncerSpeed < -(this._controller.bouncerSpeedMax)){
this._controller.bouncerSpeed = -(this._controller.bouncerSpeedMax);
};
} else {
if (this._controller.rightPressed){
this._controller.bouncerSpeed = (this._controller.bouncerSpeed + this._controller.bouncerAcceleration);
if (this._controller.bouncerSpeed > this._controller.bouncerSpeedMax){
this._controller.bouncerSpeed = this._controller.bouncerSpeedMax;
};
} else {
if (this._controller.bouncerSpeed > 0){
this._controller.bouncerSpeed = (this._controller.bouncerSpeed - this._controller.bouncerAcceleration);
};
if (this._controller.bouncerSpeed < 0){
this._controller.bouncerSpeed = (this._controller.bouncerSpeed + this._controller.bouncerAcceleration);
};
if (Math.abs(this._controller.bouncerSpeed) <= this._controller.bouncerAcceleration){
this._controller.bouncerSpeed = 0;
};
};
};
this._bouncerActor.mouseUpdate((this._bouncerActor._costume.x + this._controller.bouncerSpeed));
};
}
private function initBlinder():void{
this._blinder = new blinder();
this._blinder.mouseEnabled = false;
this._blinder.scaleX = 2;
this._blinder.scaleY = 2;
this.CurrentLevel.addChild(this._blinder);
this._flasher = new flasher();
this._flasher.mouseEnabled = false;
this.CurrentLevel.addChild(this._flasher);
this._flasher.alpha = 0;
}
private function ProcessExplosion(_arg1:Number, _arg2:Number, _arg3:Point){
var _local4:*;
var _local5:Actor;
var _local6:Number;
var _local7:Number;
var _local8:b2Vec2;
var _local9:explosionEffect;
_local9 = new explosionEffect(_arg2, _arg3);
this.CurrentLevel.addChild(_local9);
this.SoundManager.PlayExplosion();
this._flashCounter = (this._flashCounter + 11);
this.increaseShake(_arg1);
for each (_local4 in this._allActors) {
_local5 = (_local4 as Actor);
_local6 = Math.sqrt((Math.pow((_local5._costume.x - _arg3.x), 2) + Math.pow((_local5._costume.y - _arg3.y), 2)));
if (_local6 < _arg2){
_local7 = (_arg1 * (1 - (_local6 / _arg2)));
_local8 = new b2Vec2((_local5._costume.x - _arg3.x), (_local5._costume.y - _arg3.y));
_local8.Normalize();
_local8.Multiply((_local7 / 5));
if ((_local5 is simpleBlockActor)){
(_local5 as simpleBlockActor).Hit(_local7, _local8, false);
} else {
if ((_local5 is squareBlockActor)){
(_local5 as squareBlockActor).Hit(_local7, _local8, false, true, false);
} else {
if ((_local5 is moneyBlockActor)){
(_local5 as moneyBlockActor).Hit(_local7, _local8, false, true, false);
} else {
if ((((((_local5 is shatterPieceActor)) || ((_local5 is shatterPieceSquareActor)))) || ((_local5 is coinActor)))){
_local5._body.ApplyImpulse(_local8, _local5._body.GetWorldCenter());
};
};
};
};
};
};
}
private function keyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case 32:
this._weaponsController.shitchWeapon();
this.SoundManager.PlayWeaponSelect();
break;
case 90:
break;
case 37:
this._controller.leftPressed = true;
break;
case 39:
this._controller.rightPressed = true;
break;
case 17:
if (this._controlsScheme == gameProgressInfo.CONTROL_KEYBOARD){
this._controller.MouseDown = true;
};
break;
};
}
public function update_lifeline():void{
if (!_lifeLineActor){
_lifeLineActor = this._spawner.createLifeLine();
_allActors.push(_lifeLineActor);
};
}
private function mouseDownLstnr(_arg1:MouseEvent):void{
this._controller.MouseDown = true;
}
public function PunchInMessage(_arg1:int){
}
private function checkBoringBallBonus():void{
if ((this._interface.Timer - this._interface.LastTimeBlockCrushed) > this._interface.BORINGBALL_TRESHHOLD){
if (!this.CheckAmmo()){
this.SetLastTimeBlockCrushed();
this._spawner.SpawnBoringBallBonus();
this.SoundManager.PlayBoringSpawn();
trace("boring ball!");
} else {
this.SetLastTimeBlockCrushed();
this.PunchInMessage(ingameMessage.SHOOT);
trace("shoot, asshole!");
};
};
}
public function ForceQuit(){
this._confirmingQuit = false;
this.cleanup(true);
trace("forcedQuit");
this.SoundManager.StopMusic();
(parent as dispatcherMC).GoToStage(dispatcherMC.LEVEL_SELECTION, 1);
}
private function initBouncer():void{
this._bouncerActor = this._spawner.spawnBouncer(new Point(181, 328));
}
private function IncreaseLevelCompletion():void{
if ((this._playingLevel - this._gameprogress.LevelsCompleted) == 1){
this._gameprogress.LevelsCompleted++;
if (this._gameprogress.LevelsCompleted == 9){
this._gameCompleted = true;
};
if (this._gameprogress.LevelsCompleted == 1){
this._gameprogress.showShopHint = true;
};
};
if ((((this._gameprogress.LevelsCompleted == 9)) && ((this._gameprogress.AchievementsInfo.TimesPlayed == 9)))){
this._gameprogress.AchievementsInfo.GetSmoothPlayAchievement();
};
}
private function GameNotActive(_arg1:Event):void{
if (((this._gameStarted) && (!(this._isPaused)))){
this.togglePause();
};
}
public function IncreaseBonusMoney(_arg1:int){
_arg1 = (_arg1 * (1 + ((this._playingLevel - 1) * this.INCOMEINCREASE)));
this._scoreAchievementsController.BonusMoney = (this._scoreAchievementsController.BonusMoney + _arg1);
}
public function increaseShake(_arg1:int){
this._shakeScreenFactor = (this._shakeScreenFactor + _arg1);
}
public function CheckAmmo():Boolean{
return (this._weaponsController.CheckAmmo());
}
public function SwuareCrushEffect(_arg1:Point, _arg2:int){
var _local3:shatterParticle;
var _local4:int;
var _local5:hitMC;
while (_local4 < 6) {
_local3 = new shatterParticle(_arg1, _arg2);
this.CurrentLevel.addChild(_local3);
_local4++;
};
_local5 = new hitMC();
_local5.x = _arg1.x;
_local5.y = _arg1.y;
this.CurrentLevel.addChild(_local5);
}
private function setupWeaponsController():void{
this._weaponsController = new weaponsController(this._gameprogress.PistolAvailable, this._gameprogress.SpreadGunAvailable, this._gameprogress.RapidGunAvailable, this._gameprogress.RocketGunAvailable, this._gameprogress.PistolDamageLevel, this._gameprogress.SpreadGunNumBulletsLevel, this._gameprogress.SpreadGunDamageLevel, this._gameprogress.RapidGunFrequencyLevel, this._gameprogress.RapidGunDamageLevel, this._gameprogress.ExploGunRadiusLevel, this._gameprogress.ExploGunDamageLevel, this._gameprogress.PistolAmmo, this._gameprogress.SpreadGunAmmo, this._gameprogress.RapidGunAmmo, this._gameprogress.RocketGunAmmo);
}
public function ResetMessageStatus(){
this._messageInProgress = false;
}
public function AddCoinFader(_arg1:Point, _arg2:Number){
var _local3:coinFader;
_local3 = new coinFader();
_local3.x = _arg1.x;
_local3.y = _arg1.y;
_local3.width = _arg2;
_local3.height = _arg2;
this.CurrentLevel.addChild(_local3);
this.addCoinPieces(_arg1);
}
public function AddBonusFader(_arg1:Point){
var _local2:bonusFader;
_local2 = new bonusFader();
_local2.x = _arg1.x;
_local2.y = _arg1.y;
this.CurrentLevel.addChild(_local2);
}
private function SpawnBall():void{
var _local1:ballSpawner;
if (this._gameplayStats.BallsCount > 0){
this._gameplayStats.BallsCount--;
_local1 = new ballSpawner(this.CurrentLevel, this, new Point(this._bouncerActor._costume.x, (this._bouncerActor._costume.y - 50)));
this._pendingBallsCount++;
};
}
public function get playingLevel():int{
return (_playingLevel);
}
}
}//package
Section 235
//gameplayDimmer (gameplayDimmer)
package {
import flash.display.*;
public dynamic class gameplayDimmer extends MovieClip {
}
}//package
Section 236
//gameplayStatsManager (gameplayStatsManager)
package {
public class gameplayStatsManager {
public var MoneyCollected:int;// = 0
public var BallsCount:int;// = 3
public function gameplayStatsManager(_arg1:int){
MoneyCollected = 0;
BallsCount = 3;
super();
this.BallsCount = _arg1;
}
}
}//package
Section 237
//gameProgressInfo (gameProgressInfo)
package {
public class gameProgressInfo {
public var BallsDamageLevel:int;// = 1
public var LevelsCompleted:int;// = 0
public var PistolAmmo:int;// = 15
public var BallsCountLevel:int;// = 3
public var SpreadGunNumBulletsLevel:int;// = 1
public var ExploGunRadiusLevel:int;// = 1
public var RocketGunAmmo:int;// = 0
public var SpreadGunAmmo:int;// = 0
public var SpreadGunAvailable:Boolean;// = false
public var Money:int;// = 0
public var AchievementsInfo:achievementsInfo;
public var RapidGunAmmo:int;// = 0
public var TutorialShown:Boolean;// = false
public var showShopHint:Boolean;// = false
public var PistolDamageLevel:int;// = 1
public var ExploGunDamageLevel:int;// = 1
public var RapidGunAvailable:Boolean;// = false
public var SpreadGunDamageLevel:int;// = 1
public var RapidGunFrequencyLevel:int;// = 1
public var RapidGunDamageLevel:int;// = 1
public var Score:int;// = 0
public var PistolAvailable:Boolean;// = true
public var controlsScheme:int;// = 1
public var RocketGunAvailable:Boolean;// = false
public static const SPREADCOST:int = 3000;
public static const CONTROL_MOUSE:int = 1;
public static const PISTOLCOST:int = 100;
public static const BALLSDAMAGEUPGRADECOSTS:Array = [500, 2000, 5000];
public static const SPREADAMMOCOST:int = 200;
public static const RAPIDGUNFREQUENCYUPGRADECOSTS:Array = [200, 500];
public static const PISTOLDAMAGEUPGRADECOSTS:Array = [500, 1000];
public static const PISTOLAMMOCOST:int = 100;
public static const EXPLOGUNRADIUSUPGRADECOSTS:Array = [1500, 3000];
public static const RAPIDGUNDAMAGEUPGRADECOSTS:Array = [1000, 2000];
public static const ROCKETCOST:int = 10000;
public static const BALLSCOUNTUPGRADECOSTS:Array = [500, 1500, 4000];
public static const SPREADGUNDAMAGEUPGRADECOSTS:Array = [750, 1500];
public static const RAPIDCOST:int = 5000;
public static const ROCKETAMMOCOST:int = 1000;
public static const CONTROL_KEYBOARD:int = 1;
public static const SPREADGUNNUMBULLETSUPGRADECOSTS:Array = [750, 1500];
public static const RAPIDAMMOCOST:int = 500;
public static const EXPLOGUNDAMAGEUPGRADECOSTS:Array = [1500, 3000];
public function gameProgressInfo(){
BallsDamageLevel = 1;
LevelsCompleted = 0;
PistolAmmo = 15;
BallsCountLevel = 3;
TutorialShown = false;
SpreadGunNumBulletsLevel = 1;
controlsScheme = 1;
Score = 0;
ExploGunDamageLevel = 1;
ExploGunRadiusLevel = 1;
RocketGunAmmo = 0;
SpreadGunAmmo = 0;
SpreadGunAvailable = false;
Money = 0;
RapidGunAvailable = false;
showShopHint = false;
SpreadGunDamageLevel = 1;
RapidGunFrequencyLevel = 1;
RapidGunDamageLevel = 1;
PistolAvailable = true;
RapidGunAmmo = 0;
RocketGunAvailable = false;
PistolDamageLevel = 1;
this.AchievementsInfo = new achievementsInfo();
super();
}
}
}//package
Section 238
//hardBlockShatterPiece (hardBlockShatterPiece)
package {
import flash.display.*;
public dynamic class hardBlockShatterPiece extends MovieClip {
}
}//package
Section 239
//hitMC (hitMC)
package {
import flash.display.*;
import flash.events.*;
public class hitMC extends MovieClip {
private var counter:int;// = 4
public function hitMC(){
counter = 4;
super();
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
this.counter--;
if (this.counter == 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 240
//increaseBallsSizeBonus (increaseBallsSizeBonus)
package {
import flash.display.*;
public dynamic class increaseBallsSizeBonus extends MovieClip {
}
}//package
Section 241
//increaseBallsSizeBonusActor (increaseBallsSizeBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class increaseBallsSizeBonusActor extends Actor {
public function increaseBallsSizeBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new increaseBallsSizeBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 242
//increaseBouncerSizeBonus (increaseBouncerSizeBonus)
package {
import flash.display.*;
public dynamic class increaseBouncerSizeBonus extends MovieClip {
public var 新建符号_5:MovieClip;
}
}//package
Section 243
//increaseBouncerSizeBonusActor (increaseBouncerSizeBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class increaseBouncerSizeBonusActor extends Actor {
public function increaseBouncerSizeBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new increaseBouncerSizeBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
override protected function childSpecificUpdating():void{
super.childSpecificUpdating();
}
}
}//package
Section 244
//ingame_mus (ingame_mus)
package {
import flash.media.*;
public dynamic class ingame_mus extends Sound {
}
}//package
Section 245
//ingameMessage (ingameMessage)
package {
import flash.display.*;
import gs.*;
import gs.events.*;
public class ingameMessage extends MovieClip {
private var _tm:TweenMax;
private var _parentGP:gameplay;
public static const SHOOT:int = 6;
public static const EXTRABALLBOBUS:int = 9;
public static const FOURTYSHATTERS:int = 5;
public static const BALLSIZEBONUS:int = 10;
public static const TWENTYSHATTERS:int = 4;
public static const FIVESHATTERS:int = 2;
public static const AMMOBONUS:int = 7;
public static const TENSHATTERS:int = 3;
public static const BLINDBONUS:int = 8;
public static const BOUNCERSIZEBONUS:int = 11;
public static const DOUBLEBALLSBONUS:int = 12;
public static const EXPLOBALL:int = 1;
public function ingameMessage(_arg1:int, _arg2:gameplay){
this._parentGP = _arg2;
switch (_arg1){
case DOUBLEBALLSBONUS:
addChild(new doubleBallsBonus());
break;
case BOUNCERSIZEBONUS:
addChild(new biggerPaddleBonus());
break;
case BALLSIZEBONUS:
addChild(new biggerBallsMessage());
break;
case EXTRABALLBOBUS:
addChild(new extraBallMessage());
break;
case BLINDBONUS:
addChild(new blindedMessage());
break;
case AMMOBONUS:
addChild(new ammoBonusMessage());
break;
case EXPLOBALL:
addChild(new exploballMessage());
break;
case FIVESHATTERS:
addChild(new fiveballsComboMessage());
break;
case TENSHATTERS:
addChild(new tenBallsComboMessage());
break;
case TWENTYSHATTERS:
addChild(new twentyBallsComboMessage());
break;
case FOURTYSHATTERS:
addChild(new fourtyShattersComboMessage());
break;
case SHOOT:
addChild(new shootMessage());
break;
};
x = 225;
y = 75;
scaleX = 3;
scaleY = 3;
alpha = 0;
this._tm = TweenMax.to(this, 0.3, {alpha:1, scaleX:1, scaleY:1});
this._tm.addEventListener(TweenEvent.COMPLETE, this.tweenComplete);
}
private function cleanup(_arg1:TweenEvent):void{
this._tm.removeEventListener(TweenEvent.COMPLETE, this.cleanup);
this._parentGP.ResetMessageStatus();
parent.removeChild(this);
}
private function tweenComplete(_arg1:TweenEvent):void{
this._tm.removeEventListener(TweenEvent.COMPLETE, this.tweenComplete);
this._tm = TweenMax.to(this, 0.3, {scaleX:0.1, scaleY:0.1, alpha:0, delay:1});
this._tm.addEventListener(TweenEvent.COMPLETE, this.cleanup);
}
}
}//package
Section 246
//ingameTutorialMC (ingameTutorialMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
public class ingameTutorialMC extends MovieClip {
public var keyboardBtn:MovieClip;
private var _gameprogress:gameProgressInfo;
private var _keyboardBtn:MovieClip;
private var _controlsSetup:Boolean;// = false
private var _soundManager:soundManager;
private var _parentLevelSelection:levelSelection;
public var mouseBtn:MovieClip;
var _twm:TweenMax;
private var _level:int;
private var _mouseBtn:MovieClip;
public function ingameTutorialMC(_arg1:levelSelection, _arg2:soundManager, _arg3:int, _arg4:gameProgressInfo, _arg5:Boolean){
_controlsSetup = false;
super();
this._controlsSetup = _arg5;
this._gameprogress = _arg4;
this._level = _arg3;
this._parentLevelSelection = _arg1;
this._soundManager = _arg2;
alpha = 0;
TweenLite.to(this, 0.3, {alpha:1});
this.initControls();
}
private function achOff(_arg1:Event):void{
this._twm.removeEventListener(TweenEvent.COMPLETE, this.achOff);
parent.removeChild(this);
if (!this._controlsSetup){
this._parentLevelSelection.BackFromTutorial(this._level);
};
}
private function mouseClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._gameprogress.controlsScheme = gameProgressInfo.CONTROL_MOUSE;
if (!this._controlsSetup){
this.ShowPowerups();
} else {
this.goBack();
};
}
private function okClick(_arg1:MouseEvent):void{
this.goBack();
}
private function ShowPowerups(){
var _local1:MovieClip;
_local1 = new ingameTutorialTwo();
_local1.alpha = 0;
addChild(_local1);
TweenLite.to(_local1, 0.3, {alpha:1});
_local1.okBtn.buttonMode = true;
_local1.okBtn.addEventListener(MouseEvent.CLICK, this.okClick);
}
private function keyboardClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._gameprogress.controlsScheme = gameProgressInfo.CONTROL_KEYBOARD;
if (!this._controlsSetup){
this.ShowPowerups();
} else {
this.goBack();
};
}
private function initControls():void{
this._mouseBtn = this.mouseBtn;
this._mouseBtn.buttonMode = true;
this._keyboardBtn = this.keyboardBtn;
this._keyboardBtn.buttonMode = true;
this._mouseBtn.addEventListener(MouseEvent.CLICK, this.mouseClick);
this._keyboardBtn.addEventListener(MouseEvent.CLICK, this.keyboardClick);
}
private function goBack():void{
if (!this._controlsSetup){
this._soundManager.PlayLevelPlay();
} else {
this._soundManager.PlayButtonClick();
};
this._twm = TweenMax.to(this, 0.3, {alpha:0});
this._twm.addEventListener(TweenEvent.COMPLETE, this.achOff);
this._parentLevelSelection.faderOut();
}
}
}//package
Section 247
//ingameTutorialTwo (ingameTutorialTwo)
package {
import flash.display.*;
public dynamic class ingameTutorialTwo extends MovieClip {
public var okBtn:MovieClip;
}
}//package
Section 248
//interfaceMC (interfaceMC)
package {
import flash.display.*;
import flash.events.*;
import flash.filters.*;
import flash.text.*;
import flash.net.*;
public class interfaceMC extends MovieClip {
public const BORINGBALL_TRESHHOLD:int = 400;
public var timerText:TextField;
public var Timer:int;// = 0
public var level_mc:MovieClip;
private var _spreadshotSector:MovieClip;
private var _clickshotSector:MovieClip;
public var score_mc:MovieClip;
private var _rocketshotSector:MovieClip;
public var muteSnd:MovieClip;
public var pauseBtn:MovieClip;
private var _muteSnd:MovieClip;
private var _timerText:TextField;
private var _parentGP:gameplay;
var gfSelected:GlowFilter;
public var LastTimeBlockCrushed:int;// = 0
var gfUnselected:GlowFilter;
private var scoreMC:MovieClip;
private var timerMC:MovieClip;
public var life_mc:MovieClip;
private var logoMC:MovieClip;
private var _rapidshotSector:MovieClip;
private var _muteMus:MovieClip;
private var splashesMC:MovieClip;
private var weaponStatsMC:MovieClip;
private var buttonsMC:MovieClip;
private var _pauseBtn:MovieClip;
private var ballsCountMC:MovieClip;
public var muteMus:MovieClip;
public function interfaceMC(_arg1:gameplay){
Timer = 0;
LastTimeBlockCrushed = 0;
super();
this._parentGP = _arg1;
this.setupGFs();
this.initControls();
}
public function Update(_arg1:Boolean, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:Boolean){
this.updateTimer(_arg1, _arg8);
this.updateWeaponsText(_arg2, _arg3, _arg4, _arg5);
UtilDigital.set_digital(life_mc, _arg6);
UtilDigital.set_digital(score_mc, _arg7);
UtilDigital.set_digital(level_mc, _parentGP.playingLevel);
}
private function updateTimer(_arg1:Boolean, _arg2:Boolean):void{
var _local3:String;
var _local4:String;
var _local5:int;
var _local6:int;
if (((_arg1) && (!(_arg2)))){
this.Timer++;
};
_local5 = Math.floor((this.Timer / 50));
_local6 = Math.floor((_local5 / 60));
_local5 = (_local5 - (_local6 * 60));
if (_local6 < 10){
_local3 = ("0" + _local6.toString());
} else {
_local3 = _local6.toString();
};
if (_local5 < 10){
_local4 = ("0" + _local5.toString());
} else {
_local4 = _local5.toString();
};
this._timerText.text = ((_local3 + ":") + _local4);
}
private function initButtons():void{
var _local1:MovieClip;
this._muteSnd = this.muteSnd;
this._muteSnd.cacheAsBitmap = true;
_muteSnd.gotoAndStop(1);
this._muteMus = this.muteMus;
this._muteMus.cacheAsBitmap = true;
_muteMus.gotoAndStop(1);
this._pauseBtn = this.pauseBtn;
this._pauseBtn.cacheAsBitmap = true;
this._pauseBtn.addEventListener(MouseEvent.CLICK, this.togglePause);
this._muteMus.addEventListener(MouseEvent.CLICK, this.muteMusClick);
this._muteSnd.addEventListener(MouseEvent.CLICK, this.muteSndClick);
}
private function togglePause(_arg1:MouseEvent):void{
this._parentGP.SoundManager.PlayButtonClick();
this._parentGP.togglePause();
}
private function muteSndClick(_arg1:MouseEvent):void{
if (this._parentGP.SoundManager.SFXMuted){
this._parentGP.SoundManager.SFXMuted = false;
this._muteSnd.gotoAndStop(1);
} else {
this._parentGP.SoundManager.SFXMuted = true;
this._muteSnd.gotoAndStop(2);
};
}
private function updateWeaponsText(_arg1:int, _arg2:int, _arg3:int, _arg4:int):void{
}
private function initTextFields():void{
this._timerText = this.timerText;
}
private function initSectors():void{
}
private function QuitClk(_arg1:MouseEvent):void{
this._parentGP.SoundManager.PlayButtonClick();
this._parentGP.ConfirmQuit();
}
public function InitWeaponSectors(_arg1:Boolean, _arg2:Boolean, _arg3:Boolean, _arg4:Boolean){
}
private function muteMusClick(_arg1:MouseEvent):void{
if (this._parentGP.SoundManager.MusicMuted){
this._parentGP.SoundManager.MusicMuted = false;
this._muteMus.gotoAndStop(1);
this._parentGP.SoundManager.StartMusic(soundManager.INGAME);
} else {
this._parentGP.SoundManager.MusicMuted = true;
this._muteMus.gotoAndStop(2);
this._parentGP.SoundManager.StopMusic();
};
}
private function setupGFs():void{
this.gfUnselected = new GlowFilter();
this.gfUnselected.color = 0;
this.gfUnselected.blurX = 10;
this.gfUnselected.blurY = 10;
this.gfUnselected.strength = 6;
this.gfSelected = new GlowFilter();
this.gfSelected.color = 16719909;
this.gfSelected.blurX = 10;
this.gfSelected.blurY = 10;
this.gfSelected.strength = 6;
}
public function UpdateWeaponSectors(_arg1:int){
}
private function initControls():void{
this.timerMC = new timerZone();
this.timerMC.y = 50;
addChild(this.timerMC);
this.ballsCountMC = new ballsCountZone();
this.ballsCountMC.y = 100;
addChild(this.ballsCountMC);
this.weaponStatsMC = new weaponsStatsZone();
this.weaponStatsMC.y = 150;
addChild(this.weaponStatsMC);
this.scoreMC = new scoreZone();
this.scoreMC.y = 350;
addChild(this.scoreMC);
this.buttonsMC = new buttonsZone();
this.buttonsMC.y = 400;
addChild(this.buttonsMC);
this.splashesMC = new splashesZone();
this.splashesMC.y = 500;
addChild(this.splashesMC);
this.initTextFields();
this.initButtons();
this.initSectors();
}
}
}//package
Section 249
//level_play (level_play)
package {
import flash.media.*;
public dynamic class level_play extends Sound {
}
}//package
Section 250
//Level1 (Level1)
package {
import flash.display.*;
public dynamic class Level1 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 251
//Level2 (Level2)
package {
import flash.display.*;
public dynamic class Level2 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 252
//Level3 (Level3)
package {
import flash.display.*;
public dynamic class Level3 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 253
//Level4 (Level4)
package {
import flash.display.*;
public dynamic class Level4 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 254
//Level5 (Level5)
package {
import flash.display.*;
public dynamic class Level5 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 255
//Level6 (Level6)
package {
import flash.display.*;
public dynamic class Level6 extends MovieClip {
public var s:WorldBlock;
public var shitfuck:shitFuck;
public var mk_1:mkt_1;
public var mk_2:mkt_2;
public var mk_3:mkt_3;
}
}//package
Section 256
//levelFinishedStatsMC (levelFinishedStatsMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import gs.events.*;
import flash.text.*;
import flash.net.*;
public class levelFinishedStatsMC extends MovieClip {
private const PHASE_STOP:int = 7;
private const PHASE_TOTALINCOME:int = 3;
private const PHASE_LEVELSCORE:int = 4;
private const PHASE_TOTALSCORE:int = 6;
private const PHASE_BONUSMONEY:int = 2;
private const PHASE_TIMEBONUS:int = 5;
private const PHASE_MONEYCOLLECTED:int = 1;
private const PHASE_COUNTER_INIT:int = 25;
private var BonusMoney:int;// = 0
public var exploAch:MovieClip;
public var achTxt:TextField;
public var totalIncome:TextField;
private var _totalIncomeInitialPoint:Point;
private var _timeBonusInitialPoint:Point;
private var _bonusMoneyInitialPoint:Point;
private var _levelScoreInitialPoint:Point;
private var _totalIncome:TextField;
public var moneyCollected:TextField;
public var fflogo:MovieClip;
private var _fbl:MovieClip;
private var _outCompleted:Boolean;// = false
private var _parentGP:gameplay;
private var _moneyCollected:TextField;
private var MoneyCollected:int;// = 0
private var _totalScoreInitialPoint:Point;
public var ballkAch:MovieClip;
public var headerTxt:TextField;
private var _mainTween:TweenMax;
public var blockAch:MovieClip;
private var sountInit:int;// = 10
private var _completed:Boolean;// = false
public var okBtn:MovieClip;
public var blindAch:MovieClip;
private var _levelScore:TextField;
private var _helperMC:MovieClip;
private var _achTxt:TextField;
public var smoothPlayAch:MovieClip;
public var fbl:MovieClip;
private var TimeBonus:int;// = 0
public var timeBonus:TextField;
private var _moneyCollectedInitialPoint:Point;
private var _shareBtn:MovieClip;
public var levelScore:TextField;
private var _totalScore:TextField;
private var _currentPhase:int;// = 0
private var _bonusMoney:TextField;
private var _fflogo:MovieClip;
private var LevelScore:int;// = 0
public var totalScore:TextField;
public var martAch:MovieClip;
private var _timeBonus:TextField;
private var _phaseCounter:int;// = 0
public var bonusMoney:TextField;
private var soundCounter:int;// = 0
private var _okBtn:MovieClip;
private var TotalIncome:int;// = 0
public var shareBtn:MovieClip;
public function levelFinishedStatsMC(_arg1:Boolean, _arg2:Point, _arg3:gameplay, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int){
BonusMoney = 0;
soundCounter = 0;
TimeBonus = 0;
_currentPhase = 0;
_outCompleted = false;
MoneyCollected = 0;
LevelScore = 0;
sountInit = 10;
_completed = false;
_phaseCounter = 0;
TotalIncome = 0;
this._helperMC = new MovieClip();
super();
this._parentGP = _arg3;
this.MoneyCollected = _arg4;
this.BonusMoney = _arg5;
this.TotalIncome = _arg6;
this.LevelScore = _arg7;
this.TimeBonus = _arg8;
x = _arg2.x;
y = _arg2.y;
this._completed = _arg1;
this.initControls();
this.checkAchievements();
this._mainTween = TweenMax.to(this, 0.5, {y:150});
this._mainTween.addEventListener(TweenEvent.COMPLETE, this.outComplete);
addEventListener(Event.ENTER_FRAME, this.entFr);
if (_arg1){
this.headerTxt.text = "Level complete!";
} else {
this.headerTxt.text = "Game over";
};
}
private function checkAchievements():void{
var _local1:achievementsInfo;
this.smoothPlayAch.visible = false;
this.martAch.visible = false;
this.ballkAch.visible = false;
this.exploAch.visible = false;
this.blockAch.visible = false;
this.blindAch.visible = false;
_local1 = this._parentGP.GetGameProgress().AchievementsInfo;
if (((((((((((_local1.GotBLINDMASTERACHIEVEMENT) || (_local1.GotBLOCKSCRASHEDCOUNTACHIEVEMENT))) || (_local1.GotFIVEEXPLOBALLSACHIEVEMENT))) || (_local1.GotNOBALLSLOSTACHIEVEMENT))) || (_local1.GotNOWEAPONSACHIEVEMENT))) || (_local1.GotSMOOTHPLAYACHIEVEMENT))){
this._achTxt.text = "new achievements!";
} else {
this._achTxt.text = "no new achievements";
};
if (_local1.GotBLINDMASTERACHIEVEMENT){
_local1.BLINDMASTERACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.BLINDMASTERSCORE);
this.blindAch.visible = true;
};
if (_local1.GotBLOCKSCRASHEDCOUNTACHIEVEMENT){
_local1.BLOCKSCRASHEDCOUNTACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.BLOCKSCRASHEDCOUNTSCORE);
this.blockAch.visible = true;
};
if (_local1.GotFIVEEXPLOBALLSACHIEVEMENT){
_local1.FIVEEXPLOBALLSACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.FIVEEXPLOBALLSSCORE);
this.exploAch.visible = true;
};
if (_local1.GotNOBALLSLOSTACHIEVEMENT){
_local1.NOBALLSLOSTACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.NOBALLSLOSTSCORE);
this.ballkAch.visible = true;
};
if (_local1.GotNOWEAPONSACHIEVEMENT){
_local1.NOWEAPONSACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.NOWEAPONSSCORE);
this.martAch.visible = true;
};
if (_local1.GotSMOOTHPLAYACHIEVEMENT){
_local1.SMOOTHPLAYACHIEVEMENT = true;
this._parentGP.GetGameProgress().Score = (this._parentGP.GetGameProgress().Score + achievementsInfo.SMOOTHPLAYSCORE);
this.smoothPlayAch.visible = true;
};
}
private function logoClick(_arg1:MouseEvent):void{
}
private function outComplete(_arg1:TweenEvent):void{
this._mainTween.removeEventListener(TweenEvent.COMPLETE, this.outComplete);
this._okBtn.addEventListener(MouseEvent.CLICK, this.okClick);
this._outCompleted = true;
}
private function addSpark(_arg1:Point){
var _local2:finishedSpark;
var _local3:int;
while (_local3 < 3) {
_local2 = new finishedSpark();
_local2.x = _arg1.x;
_local2.y = _arg1.y;
addChild(_local2);
_local3++;
};
}
private function shareClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://www.facebook.com/sharer.php?u=http%3A%2F%2Ffacebook.king.com%2Ffacebook%2Fkinggames%2Fgames%2Fshare.jsp%3FgameId%3D78"));
}
private function okClick(_arg1:MouseEvent):void{
this._parentGP.SoundManager.PlayButtonClick();
this._mainTween = TweenMax.to(this, 0.5, {y:610});
removeEventListener(Event.ENTER_FRAME, this.entFr);
this._parentGP.Finalize();
}
private function entFr(_arg1:Event):void{
var _local2:int;
var _local3:Number;
var _local4:Number;
if (!this._outCompleted){
return;
};
_local3 = ((Math.random() * 8) - 4);
_local4 = ((Math.random() * 8) - 4);
if (this.soundCounter <= 0){
this._parentGP.SoundManager.PlayScoreCount();
this.soundCounter = this.sountInit;
};
this.soundCounter--;
switch (this._currentPhase){
case 0:
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_MONEYCOLLECTED;
break;
case this.PHASE_MONEYCOLLECTED:
if ((((this._phaseCounter > 0)) && ((this.MoneyCollected > 0)))){
_local2 = (this.MoneyCollected * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._moneyCollected.text = (_local2.toString() + " $");
this._moneyCollected.x = (this._moneyCollectedInitialPoint.x + _local3);
this._moneyCollected.y = (this._moneyCollectedInitialPoint.y + _local4);
this.addSpark(new Point(((this._moneyCollected.x + (_local3 * 5)) + (this._moneyCollected.width / 2)), ((this._moneyCollected.y + (_local4 * 3)) + (this._moneyCollected.height / 2))));
this._phaseCounter--;
} else {
this._moneyCollected.text = (this.MoneyCollected.toString() + " $");
this._moneyCollected.x = this._moneyCollectedInitialPoint.x;
this._moneyCollected.y = this._moneyCollectedInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_BONUSMONEY;
};
break;
case this.PHASE_BONUSMONEY:
if ((((this._phaseCounter > 0)) && ((this.BonusMoney > 0)))){
_local2 = (this.BonusMoney * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._bonusMoney.text = (_local2.toString() + " $");
this._bonusMoney.x = (this._bonusMoneyInitialPoint.x + _local3);
this._bonusMoney.y = (this._bonusMoneyInitialPoint.y + _local4);
this.addSpark(new Point(((this._bonusMoney.x + (_local3 * 5)) + (this._bonusMoney.width / 2)), ((this._bonusMoney.y + (_local4 * 3)) + (this._bonusMoney.height / 2))));
this._phaseCounter--;
} else {
this._bonusMoney.text = (this.BonusMoney.toString() + " $");
this._bonusMoney.x = this._bonusMoneyInitialPoint.x;
this._bonusMoney.y = this._bonusMoneyInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_TOTALINCOME;
};
break;
case this.PHASE_TOTALINCOME:
if ((((this._phaseCounter > 0)) && ((this.TotalIncome > 0)))){
_local2 = (this.TotalIncome * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._totalIncome.text = (_local2.toString() + " $");
this._totalIncome.x = (this._totalIncomeInitialPoint.x + _local3);
this._totalIncome.y = (this._totalIncomeInitialPoint.y + _local4);
this.addSpark(new Point(((this._totalIncome.x + (_local3 * 5)) + (this._totalIncome.width / 2)), ((this._totalIncome.y + (_local4 * 3)) + (this._totalIncome.height / 2))));
this._phaseCounter--;
} else {
this._totalIncome.text = (this.TotalIncome.toString() + " $");
this._totalIncome.x = this._totalIncomeInitialPoint.x;
this._totalIncome.y = this._totalIncomeInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_LEVELSCORE;
};
break;
case this.PHASE_LEVELSCORE:
if ((((this._phaseCounter > 0)) && ((this.LevelScore > 0)))){
_local2 = (this.LevelScore * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._levelScore.text = (_local2.toString() + " Pts.");
this._levelScore.x = (this._levelScoreInitialPoint.x + _local3);
this._levelScore.y = (this._levelScoreInitialPoint.y + _local4);
this.addSpark(new Point(((this._levelScore.x + (_local3 * 5)) + (this._levelScore.width / 2)), ((this._levelScore.y + (_local4 * 3)) + (this._levelScore.height / 2))));
this._phaseCounter--;
} else {
this._levelScore.text = (this.LevelScore.toString() + " Pts.");
this._levelScore.x = this._levelScoreInitialPoint.x;
this._levelScore.y = this._levelScoreInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_TIMEBONUS;
};
break;
case this.PHASE_TIMEBONUS:
if ((((this._phaseCounter > 0)) && ((this.TimeBonus > 0)))){
_local2 = (this.TimeBonus * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._timeBonus.text = (_local2.toString() + " Pts.");
this._timeBonus.x = (this._timeBonusInitialPoint.x + _local3);
this._timeBonus.y = (this._timeBonusInitialPoint.y + _local4);
this.addSpark(new Point(((this._timeBonus.x + (_local3 * 5)) + (this._timeBonus.width / 2)), ((this._timeBonus.y + (_local4 * 3)) + (this._timeBonus.height / 2))));
this._phaseCounter--;
} else {
this._timeBonus.text = (this.TimeBonus.toString() + " Pts.");
this._timeBonus.x = this._timeBonusInitialPoint.x;
this._timeBonus.y = this._timeBonusInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_TOTALSCORE;
};
break;
case this.PHASE_TOTALSCORE:
if ((((this._phaseCounter > 0)) && ((this.LevelScore > 0)))){
_local2 = ((this.LevelScore + this.TimeBonus) * (1 - (this._phaseCounter / this.PHASE_COUNTER_INIT)));
this._totalScore.text = (_local2.toString() + " Pts.");
this._totalScore.x = (this._totalScoreInitialPoint.x + _local3);
this._totalScore.y = (this._totalScoreInitialPoint.y + _local4);
this.addSpark(new Point(((this._totalScore.x + (_local3 * 5)) + (this._totalScore.width / 2)), ((this._totalScore.y + (_local4 * 3)) + (this._totalScore.height / 2))));
this._phaseCounter--;
} else {
this._totalScore.text = ((this.LevelScore + this.TimeBonus).toString() + " Pts.");
this._totalScore.x = this._totalScoreInitialPoint.x;
this._totalScore.y = this._totalScoreInitialPoint.y;
this._phaseCounter = this.PHASE_COUNTER_INIT;
this._currentPhase = this.PHASE_STOP;
};
break;
case this.PHASE_STOP:
removeEventListener(Event.ENTER_FRAME, this.entFr);
break;
};
}
private function initControls():void{
this._okBtn = this.okBtn;
this._okBtn.buttonMode = true;
this._shareBtn = this.shareBtn;
this._shareBtn.buttonMode = true;
this._shareBtn.addEventListener(MouseEvent.CLICK, this.shareClick);
this._fbl = this.fbl;
this._fbl.buttonMode = true;
this._fbl.addEventListener(MouseEvent.CLICK, this.shareClick);
this._fflogo = this.fflogo;
this._fflogo.buttonMode = true;
this._fflogo.addEventListener(MouseEvent.CLICK, this.logoClick);
this._moneyCollected = this.moneyCollected;
this._bonusMoney = this.bonusMoney;
this._totalIncome = this.totalIncome;
this._levelScore = this.levelScore;
this._timeBonus = this.timeBonus;
this._totalScore = this.totalScore;
this._moneyCollectedInitialPoint = new Point(this._moneyCollected.x, this._moneyCollected.y);
this._bonusMoneyInitialPoint = new Point(this._bonusMoney.x, this._bonusMoney.y);
this._totalIncomeInitialPoint = new Point(this._totalIncome.x, this._totalIncome.y);
this._levelScoreInitialPoint = new Point(this._levelScore.x, this._levelScore.y);
this._timeBonusInitialPoint = new Point(this._timeBonus.x, this._timeBonus.y);
this._totalScoreInitialPoint = new Point(this._totalScore.x, this._totalScore.y);
this._achTxt = this.achTxt;
}
}
}//package
Section 257
//levelParser (levelParser)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class levelParser {
private var _levelNum:int;// = 0
private var _parentGP:gameplay;
private var _HPmultiplier:Number;// = 0
private var _levelMovieClip:MovieClip;
private var _actorsArray:Array;
public function levelParser(_arg1:MovieClip, _arg2:gameplay, _arg3:Array, _arg4:int){
_levelNum = 0;
_HPmultiplier = 0;
super();
this._actorsArray = _arg3;
this._parentGP = _arg2;
this._levelMovieClip = _arg1;
this._levelNum = _arg4;
this.initBlockHPMultiplier();
}
private function initBlockHPMultiplier():void{
trace(this._levelNum);
this._HPmultiplier = (1 + (this._levelNum * 0.2));
}
public function Parse(){
var _local1:String;
var _local2:DisplayObject;
var _local3:b2PolygonDef;
var _local4:b2BodyDef;
var _local5:b2Body;
var _local6:Actor;
var _local7:b2PolygonDef;
var _local8:b2BodyDef;
var _local9:b2Body;
var _local10:Actor;
var _local11:b2PolygonDef;
var _local12:b2BodyDef;
var _local13:b2Body;
var _local14:Actor;
var _local15:b2PolygonDef;
var _local16:b2BodyDef;
var _local17:b2Body;
var _local18:Actor;
var _local19:b2PolygonDef;
var _local20:b2BodyDef;
var _local21:b2Body;
var _local22:Actor;
var _local23:b2PolygonDef;
var _local24:b2BodyDef;
var _local25:b2Body;
var _local26:simpleBlockActor;
var _local27:b2PolygonDef;
var _local28:b2BodyDef;
var _local29:b2Body;
var _local30:squareBlockActor;
var _local31:b2PolygonDef;
var _local32:b2BodyDef;
var _local33:b2Body;
var _local34:squareBlockActor;
var _local35:b2PolygonDef;
var _local36:b2BodyDef;
var _local37:b2Body;
var _local38:squareBlockActor;
var _local39:b2PolygonDef;
var _local40:b2BodyDef;
var _local41:b2Body;
var _local42:squareBlockActor;
var _local43:b2PolygonDef;
var _local44:b2BodyDef;
var _local45:b2Body;
var _local46:squareBlockActor;
var _local47:b2PolygonDef;
var _local48:b2BodyDef;
var _local49:b2Body;
var _local50:squareBlockActor;
var _local51:b2PolygonDef;
var _local52:b2BodyDef;
var _local53:b2Body;
var _local54:squareBlockActor;
var _local55:b2PolygonDef;
var _local56:b2BodyDef;
var _local57:b2Body;
var _local58:squareBlockActor;
var _local59:b2PolygonDef;
var _local60:b2BodyDef;
var _local61:b2Body;
var _local62:squareBlockActor;
var _local63:b2PolygonDef;
var _local64:b2BodyDef;
var _local65:b2Body;
var _local66:squareBlockActor;
var _local67:b2PolygonDef;
var _local68:b2BodyDef;
var _local69:b2Body;
var _local70:simpleBlockActor;
var _local71:b2PolygonDef;
var _local72:b2BodyDef;
var _local73:b2Body;
var _local74:simpleBlockActor;
var _local75:b2PolygonDef;
var _local76:b2BodyDef;
var _local77:b2Body;
var _local78:moneyBlockActor;
var _local79:b2CircleDef;
var _local80:b2BodyDef;
var _local81:b2Body;
var _local82:pinballBouncerActor;
var _local83:int;
var _local84:int;
while (_local84 < this._levelMovieClip.numChildren) {
_local1 = this._levelMovieClip.getChildAt(_local84).toString();
_local2 = this._levelMovieClip.getChildAt(_local84);
switch (_local1){
case "[object mkt_1]":
case "[object mkt_2]":
case "[object mkt_3]":
relate_mkt(_local2);
break;
case "[object WorldBlock]":
_local3 = new b2PolygonDef();
_local3.SetAsBox(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local3.density = 0;
_local3.friction = 0.5;
_local3.restitution = 0.5;
_local3.filter.categoryBits = collisionBits.WALLS;
_local4 = new b2BodyDef();
_local4.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local5 = PhysVals.world.CreateBody(_local4);
_local5.CreateShape(_local3);
_local5.SetMassFromShapes();
_local6 = new Actor(this._parentGP, _local5, _local2);
_local6._body.SetUserData("wba");
this._actorsArray.push(_local6);
break;
case "[object WorldBlockUpperRight]":
_local7 = new b2PolygonDef();
_local7.vertexCount = 3;
b2Vec2(_local7.vertices[0]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local7.vertices[1]).Set(((_local2.width / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local7.vertices[2]).Set(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local7.density = 0;
_local7.friction = 0.5;
_local7.restitution = 0.5;
_local8 = new b2BodyDef();
_local8.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local9 = PhysVals.world.CreateBody(_local8);
_local9.CreateShape(_local7);
_local9.SetMassFromShapes();
_local10 = new Actor(this._parentGP, _local9, _local2);
this._actorsArray.push(_local10);
break;
case "[object WorldBlockUpperLeft]":
_local11 = new b2PolygonDef();
_local11.vertexCount = 3;
b2Vec2(_local11.vertices[0]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local11.vertices[1]).Set(((_local2.width / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local11.vertices[2]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local11.density = 0;
_local11.friction = 0.5;
_local11.restitution = 0.5;
_local12 = new b2BodyDef();
_local12.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local13 = PhysVals.world.CreateBody(_local12);
_local13.CreateShape(_local11);
_local13.SetMassFromShapes();
_local14 = new Actor(this._parentGP, _local13, _local2);
this._actorsArray.push(_local14);
break;
case "[object WorldBlockBottomRight]":
_local15 = new b2PolygonDef();
_local15.vertexCount = 3;
b2Vec2(_local15.vertices[0]).Set(((_local2.width / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local15.vertices[1]).Set(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
b2Vec2(_local15.vertices[2]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local15.density = 0;
_local15.friction = 0.5;
_local15.restitution = 0.5;
_local16 = new b2BodyDef();
_local16.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local17 = PhysVals.world.CreateBody(_local16);
_local17.CreateShape(_local15);
_local17.SetMassFromShapes();
_local18 = new Actor(this._parentGP, _local17, _local2);
this._actorsArray.push(_local18);
break;
case "[object WorldBlockBottomLeft]":
_local19 = new b2PolygonDef();
_local19.vertexCount = 3;
b2Vec2(_local19.vertices[0]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((-(_local2.height) / 2) / PhysVals.RATIO));
b2Vec2(_local19.vertices[1]).Set(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
b2Vec2(_local19.vertices[2]).Set(((-(_local2.width) / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local19.density = 0;
_local19.friction = 0.5;
_local19.restitution = 0.5;
_local20 = new b2BodyDef();
_local20.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local21 = PhysVals.world.CreateBody(_local20);
_local21.CreateShape(_local19);
_local21.SetMassFromShapes();
_local22 = new Actor(this._parentGP, _local21, _local2);
this._actorsArray.push(_local22);
break;
case "[object simpleBlock]":
_local23 = new b2PolygonDef();
_local23.SetAsBox(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local23.density = 0.5;
_local23.friction = 0.5;
_local23.restitution = 0.5;
_local23.filter.groupIndex = -1;
_local24 = new b2BodyDef();
_local24.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local24.fixedRotation = true;
_local25 = PhysVals.world.CreateBody(_local24);
_local25.CreateShape(_local23);
_local25.SetMassFromShapes();
_local26 = new simpleBlockActor(this._parentGP, _local25, _local2, simpleBlockActor.SIMPLE, this._HPmultiplier);
_local26._body.SetUserData(_local26);
this._actorsArray.push(_local26);
_local83++;
break;
case "[object squareBlockBrown]":
_local27 = new b2PolygonDef();
_local27.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local27.density = squareBlockActor.DENSITY;
_local27.friction = 0.5;
_local27.restitution = 0.5;
_local27.filter.groupIndex = -1;
_local28 = new b2BodyDef();
_local28.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local28.fixedRotation = true;
_local29 = PhysVals.world.CreateBody(_local28);
_local29.CreateShape(_local27);
_local29.SetMassFromShapes();
_local30 = new squareBlockActor(this._parentGP, _local29, _local2, squareBlockActor.BROWN, this._HPmultiplier);
_local30._body.SetUserData(_local30);
this._actorsArray.push(_local30);
_local83++;
break;
case "[object squareBlockOrange]":
_local31 = new b2PolygonDef();
_local31.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local31.density = squareBlockActor.DENSITY;
_local31.friction = 0.5;
_local31.restitution = 0.5;
_local31.filter.groupIndex = -1;
_local32 = new b2BodyDef();
_local32.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local32.fixedRotation = true;
_local33 = PhysVals.world.CreateBody(_local32);
_local33.CreateShape(_local31);
_local33.SetMassFromShapes();
_local34 = new squareBlockActor(this._parentGP, _local33, _local2, squareBlockActor.ORANGE, this._HPmultiplier);
_local34._body.SetUserData(_local34);
this._actorsArray.push(_local34);
_local83++;
break;
case "[object squareBlockBlue]":
_local35 = new b2PolygonDef();
_local35.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local35.density = squareBlockActor.DENSITY;
_local35.friction = 0.5;
_local35.restitution = 0.5;
_local35.filter.groupIndex = -1;
_local36 = new b2BodyDef();
_local36.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local36.fixedRotation = true;
_local37 = PhysVals.world.CreateBody(_local36);
_local37.CreateShape(_local35);
_local37.SetMassFromShapes();
_local38 = new squareBlockActor(this._parentGP, _local37, _local2, squareBlockActor.BLUE, this._HPmultiplier);
_local38._body.SetUserData(_local38);
this._actorsArray.push(_local38);
_local83++;
break;
case "[object squareBlockLightBlue]":
_local39 = new b2PolygonDef();
_local39.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local39.density = squareBlockActor.DENSITY;
_local39.friction = 0.5;
_local39.restitution = 0.5;
_local39.filter.groupIndex = -1;
_local40 = new b2BodyDef();
_local40.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local40.fixedRotation = true;
_local41 = PhysVals.world.CreateBody(_local40);
_local41.CreateShape(_local39);
_local41.SetMassFromShapes();
_local42 = new squareBlockActor(this._parentGP, _local41, _local2, squareBlockActor.LIGHTBLUE, this._HPmultiplier);
_local42._body.SetUserData(_local42);
this._actorsArray.push(_local42);
_local83++;
break;
case "[object squareBlockBlack]":
_local43 = new b2PolygonDef();
_local43.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local43.density = squareBlockActor.DENSITY;
_local43.friction = 0.5;
_local43.restitution = 0.5;
_local43.filter.groupIndex = -1;
_local44 = new b2BodyDef();
_local44.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local44.fixedRotation = true;
_local45 = PhysVals.world.CreateBody(_local44);
_local45.CreateShape(_local43);
_local45.SetMassFromShapes();
_local46 = new squareBlockActor(this._parentGP, _local45, _local2, squareBlockActor.BLACK, this._HPmultiplier);
_local46._body.SetUserData(_local46);
this._actorsArray.push(_local46);
_local83++;
break;
case "[object squareBlockWhite]":
_local47 = new b2PolygonDef();
_local47.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local47.density = squareBlockActor.DENSITY;
_local47.friction = 0.5;
_local47.restitution = 0.5;
_local47.filter.groupIndex = -1;
_local48 = new b2BodyDef();
_local48.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local48.fixedRotation = true;
_local49 = PhysVals.world.CreateBody(_local48);
_local49.CreateShape(_local47);
_local49.SetMassFromShapes();
_local50 = new squareBlockActor(this._parentGP, _local49, _local2, squareBlockActor.WHITE, this._HPmultiplier);
_local50._body.SetUserData(_local50);
this._actorsArray.push(_local50);
_local83++;
break;
case "[object squareBlockYellow]":
_local51 = new b2PolygonDef();
_local51.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local51.density = squareBlockActor.DENSITY;
_local51.friction = 0.5;
_local51.restitution = 0.5;
_local51.filter.groupIndex = -1;
_local52 = new b2BodyDef();
_local52.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local52.fixedRotation = true;
_local53 = PhysVals.world.CreateBody(_local52);
_local53.CreateShape(_local51);
_local53.SetMassFromShapes();
_local54 = new squareBlockActor(this._parentGP, _local53, _local2, squareBlockActor.YELLOW, this._HPmultiplier);
_local54._body.SetUserData(_local54);
this._actorsArray.push(_local54);
_local83++;
break;
case "[object squareBlockViolet]":
_local55 = new b2PolygonDef();
_local55.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local55.density = squareBlockActor.DENSITY;
_local55.friction = 0.5;
_local55.restitution = 0.5;
_local55.filter.groupIndex = -1;
_local56 = new b2BodyDef();
_local56.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local56.fixedRotation = true;
_local57 = PhysVals.world.CreateBody(_local56);
_local57.CreateShape(_local55);
_local57.SetMassFromShapes();
_local58 = new squareBlockActor(this._parentGP, _local57, _local2, squareBlockActor.VIOLET, this._HPmultiplier);
_local58._body.SetUserData(_local58);
this._actorsArray.push(_local58);
_local83++;
break;
case "[object squareBlockRed]":
_local59 = new b2PolygonDef();
_local59.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local59.density = squareBlockActor.DENSITY;
_local59.friction = 0.5;
_local59.restitution = 0.5;
_local59.filter.groupIndex = -1;
_local60 = new b2BodyDef();
_local60.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local60.fixedRotation = true;
_local61 = PhysVals.world.CreateBody(_local60);
_local61.CreateShape(_local59);
_local61.SetMassFromShapes();
_local62 = new squareBlockActor(this._parentGP, _local61, _local2, squareBlockActor.RED, this._HPmultiplier);
_local62._body.SetUserData(_local62);
this._actorsArray.push(_local62);
_local83++;
break;
case "[object squareBlockGreen]":
case "[object SQ_1]":
case "[object SQ_2]":
case "[object SQ_3]":
case "[object SQ_4]":
case "[object SQ_5]":
case "[object SQ_6]":
_local63 = new b2PolygonDef();
_local63.SetAsBox(((_local2.width / 2.1) / PhysVals.RATIO), ((_local2.height / 2.1) / PhysVals.RATIO));
_local63.density = squareBlockActor.DENSITY;
_local63.friction = 0;
_local63.restitution = 1;
_local63.filter.groupIndex = -1;
_local64 = new b2BodyDef();
_local64.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local64.fixedRotation = true;
_local65 = PhysVals.world.CreateBody(_local64);
_local65.CreateShape(_local63);
_local65.SetMassFromShapes();
_local66 = new squareBlockActor(this._parentGP, _local65, _local2, squareBlockActor.GREEN, this._HPmultiplier);
_local66._body.SetUserData(_local66);
this._actorsArray.push(_local66);
_local83++;
break;
case "[object hardBlock]":
_local67 = new b2PolygonDef();
_local67.SetAsBox(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local67.density = 0.5;
_local67.friction = 0.5;
_local67.restitution = 0.5;
_local67.filter.groupIndex = -1;
_local68 = new b2BodyDef();
_local68.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local68.fixedRotation = true;
_local69 = PhysVals.world.CreateBody(_local68);
_local69.CreateShape(_local67);
_local69.SetMassFromShapes();
_local70 = new simpleBlockActor(this._parentGP, _local69, _local2, simpleBlockActor.HARD, this._HPmultiplier);
_local70._body.SetUserData(_local70);
this._actorsArray.push(_local70);
_local83++;
break;
case "[object veryHardBlock]":
_local71 = new b2PolygonDef();
_local71.SetAsBox(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local71.density = 0.5;
_local71.friction = 0.5;
_local71.restitution = 0.5;
_local71.filter.groupIndex = -1;
_local72 = new b2BodyDef();
_local72.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local72.fixedRotation = true;
_local73 = PhysVals.world.CreateBody(_local72);
_local73.CreateShape(_local71);
_local73.SetMassFromShapes();
_local74 = new simpleBlockActor(this._parentGP, _local73, _local2, simpleBlockActor.VERYHARD, this._HPmultiplier);
_local74._body.SetUserData(_local74);
this._actorsArray.push(_local74);
_local83++;
break;
case "[object moneyBlock]":
_local75 = new b2PolygonDef();
_local75.SetAsBox(((_local2.width / 2) / PhysVals.RATIO), ((_local2.height / 2) / PhysVals.RATIO));
_local75.density = 0.5;
_local75.friction = 0.5;
_local75.restitution = 0.5;
_local75.filter.groupIndex = -1;
_local76 = new b2BodyDef();
_local76.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local76.fixedRotation = true;
_local77 = PhysVals.world.CreateBody(_local76);
_local77.CreateShape(_local75);
_local77.SetMassFromShapes();
_local78 = new moneyBlockActor(this._parentGP, _local77, _local2, this._HPmultiplier);
_local78._body.SetUserData(_local78);
this._actorsArray.push(_local78);
_local83++;
break;
case "[object pinballBouncer]":
_local79 = new b2CircleDef();
_local79.radius = ((_local2.width / 2) / PhysVals.RATIO);
_local79.density = 0.5;
_local79.friction = 0.5;
_local79.restitution = 0.5;
_local80 = new b2BodyDef();
_local80.position.Set((_local2.x / PhysVals.RATIO), (_local2.y / PhysVals.RATIO));
_local80.fixedRotation = true;
_local81 = PhysVals.world.CreateBody(_local80);
_local81.CreateShape(_local79);
_local81.SetMassFromShapes();
_local82 = new pinballBouncerActor(this._parentGP, _local81, _local2);
_local82._body.SetUserData(_local82);
this._actorsArray.push(_local82);
break;
};
_local84++;
};
trace(("total blocks: " + _local83));
}
private function relate_mkt(_arg1:DisplayObject):void{
var _local2:Point;
var _local3:DisplayObjectContainer;
var _local4:int;
var _local5:DisplayObject;
var _local6:int;
_local2 = new Point(_arg1.x, _arg1.y);
_local3 = _arg1.parent;
_local4 = _local3.numChildren;
_local6 = 0;
while (_local6 < _local4) {
_local5 = _local3.getChildAt(_local6);
if (_local5.toString().indexOf("[object SQ_") > -1){
if (Point.distance(new Point(_local5.x, _local5.y), _local2) < 15){
(_local5 as MovieClip).mkt = _arg1;
return;
};
};
_local6++;
};
}
}
}//package
Section 258
//levelScrambler (levelScrambler)
package {
import flash.display.*;
import gs.*;
import flash.geom.*;
public class levelScrambler {
private var _levelMC:MovieClip;
public function levelScrambler(_arg1:MovieClip){
this._levelMC = _arg1;
}
public function Scramble(){
var _local1:int;
var _local2:int;
var _local3:MovieClip;
var _local4:Point;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
_local1 = 0;
_local2 = 0;
while (_local2 < this._levelMC.numChildren) {
_local3 = (this._levelMC.getChildAt(_local2) as MovieClip);
if ((((((((((((_local3 is SQ_1)) || ((_local3 is SQ_2)))) || ((_local3 is SQ_3)))) || ((_local3 is SQ_4)))) || ((_local3 is SQ_5)))) || ((_local3 is SQ_6)))){
_local4 = new Point(_local3.x, _local3.y);
_local7 = _local3.scaleX;
_local8 = Math.random();
if (_local8 > 0.75){
_local5 = -50;
_local6 = (Math.random() * 600);
} else {
if (_local8 > 0.5){
_local5 = 500;
_local6 = (Math.random() * 600);
} else {
if (_local8 > 0.25){
_local5 = (Math.random() * 450);
_local6 = -50;
} else {
_local5 = (Math.random() * 450);
_local6 = 650;
};
};
};
_local3.x = _local5;
_local3.y = _local6;
_local3.scaleX = 6;
_local3.scaleY = 6;
_local3.alpha = 0;
TweenLite.to(_local3, 0.6, {delay:(_local2 * 0.007), x:_local4.x, y:_local4.y, alpha:1, scaleX:_local7, scaleY:_local7});
_local1 = (_local1 + 0.05);
};
_local2++;
};
}
}
}//package
Section 259
//levelSelection (levelSelection)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
import com.midasplayer.*;
import flash.net.*;
public class levelSelection extends MovieClip {
private var _shopMC:MovieClip;
private var _moreGamesBtn:MovieClip;
public var lvl2:MovieClip;
public var lvl4:MovieClip;
public var lvl9:MovieClip;
public var lvl3:MovieClip;
public var lvl6:MovieClip;
private var _shopBtn:MovieClip;
public var lvl5:MovieClip;
public var lvl1:MovieClip;
public var setupControls:MovieClip;
public var lvl7:MovieClip;
public var lvl8:MovieClip;
private var tm:TweenMax;
public var menuBtn:MovieClip;
public var fflogo:MovieClip;
public var resetGameBtn:MovieClip;
public var moreBtn:MovieClip;
private var _thumb:levelThumbnail;
private var _inShop:Boolean;// = false
private var _inAchievements:Boolean;// = false
private var _achBtn:MovieClip;
private var _parkanoidMain:parkanoidMain;
private var _menuBtn:MovieClip;
private var levelButtons:Array;
private var fader:MovieClip;
private var _soundManager:soundManager;
private var _fflogo:MovieClip;
public var shopBtn:MovieClip;
private var _achMC:MovieClip;
private var _resetButton:MovieClip;
private var _controlsButton:MovieClip;
public var thumb:levelThumbnail;
public var achBtn:MovieClip;
public function levelSelection(){
_inAchievements = false;
_inShop = false;
super();
addEventListener(Event.ADDED_TO_STAGE, this.initStuff);
}
private function shopClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this.faderIn();
this._inShop = true;
this._shopMC = new shopMC(this, this._soundManager);
this._shopMC.x = 75;
this._shopMC.y = 700;
addChild(this._shopMC);
}
private function initLvlButtons():void{
var _local1:MovieClip;
this._thumb = this.thumb;
this.initLevelButtonsFrames();
this.levelButtons = [];
this.levelButtons.push(this.lvl1);
this.levelButtons.push(this.lvl2);
this.levelButtons.push(this.lvl3);
this.levelButtons.push(this.lvl4);
this.levelButtons.push(this.lvl5);
this.levelButtons.push(this.lvl6);
this.levelButtons.push(this.lvl7);
this.levelButtons.push(this.lvl8);
this.levelButtons.push(this.lvl9);
for each (_local1 in this.levelButtons) {
if ((((_local1.currentFrame == 2)) || ((_local1.currentFrame == 3)))){
_local1.buttonMode = true;
};
_local1.addEventListener(MouseEvent.ROLL_OVER, this.lvlRollOver);
_local1.addEventListener(MouseEvent.ROLL_OUT, this.lvlRollOut);
};
if ((((this.lvl1.currentFrame == 2)) || ((this.lvl1.currentFrame == 3)))){
this.lvl1.addEventListener(MouseEvent.CLICK, this.lvl1Click);
};
if ((((this.lvl2.currentFrame == 2)) || ((this.lvl2.currentFrame == 3)))){
this.lvl2.addEventListener(MouseEvent.CLICK, this.lvl2Click);
};
if ((((this.lvl3.currentFrame == 2)) || ((this.lvl3.currentFrame == 3)))){
this.lvl3.addEventListener(MouseEvent.CLICK, this.lvl3Click);
};
if ((((this.lvl4.currentFrame == 2)) || ((this.lvl4.currentFrame == 3)))){
this.lvl4.addEventListener(MouseEvent.CLICK, this.lvl4Click);
};
if ((((this.lvl5.currentFrame == 2)) || ((this.lvl5.currentFrame == 3)))){
this.lvl5.addEventListener(MouseEvent.CLICK, this.lvl5Click);
};
if ((((this.lvl6.currentFrame == 2)) || ((this.lvl6.currentFrame == 3)))){
this.lvl6.addEventListener(MouseEvent.CLICK, this.lvl6Click);
};
if ((((this.lvl7.currentFrame == 2)) || ((this.lvl7.currentFrame == 3)))){
this.lvl7.addEventListener(MouseEvent.CLICK, this.lvl7Click);
};
if ((((this.lvl8.currentFrame == 2)) || ((this.lvl8.currentFrame == 3)))){
this.lvl8.addEventListener(MouseEvent.CLICK, this.lvl8Click);
};
if ((((this.lvl9.currentFrame == 2)) || ((this.lvl9.currentFrame == 3)))){
this.lvl9.addEventListener(MouseEvent.CLICK, this.lvl9Click);
};
}
private function lvl7Click(_arg1:MouseEvent):void{
this.gotoLevel(7);
}
public function ResetProgress(){
this._soundManager.PlayButtonClick();
this._parkanoidMain.GameProgress = new gameProgressInfo();
this._soundManager.StopMusic();
(parent as dispatcherMC).GoToStage(dispatcherMC.MAIN_MENU, 0);
}
private function controlsClick(_arg1:MouseEvent):void{
var _local2:ingameTutorialMC;
this._soundManager.PlayButtonClick();
this.faderIn();
_local2 = new ingameTutorialMC(this, this._soundManager, 0, this._parkanoidMain.GameProgress, true);
_local2.x = (300 - (_local2.width / 2));
_local2.y = (300 - (_local2.height / 2));
addChild(_local2);
}
private function lvl4Click(_arg1:MouseEvent):void{
this.gotoLevel(4);
}
private function lvl1Click(_arg1:MouseEvent):void{
this.gotoLevel(1);
}
private function moreGamesClick(_arg1:MouseEvent):void{
KingAPI.openOtherGamesLink();
}
private function showShopHint(){
var _local1:levelSelShopHint;
this.faderIn();
_local1 = new levelSelShopHint(this, this._soundManager);
_local1.x = (300 - (_local1.width / 2));
_local1.y = (300 - (_local1.height / 2));
addChild(_local1);
}
private function initStuff(_arg1:Event):void{
removeEventListener(Event.ADDED_TO_STAGE, this.initStuff);
this._parkanoidMain = (parent as dispatcherMC).GetParkanoidMain();
this._soundManager = this._parkanoidMain.SoundManager;
this._soundManager.StartMusic(soundManager.MENU);
this.initLvlButtons();
this.initShopButton();
this._parkanoidMain.SaveGame();
if (this._parkanoidMain.GameProgress.showShopHint){
this._parkanoidMain.GameProgress.showShopHint = false;
this.showShopHint();
};
}
private function achClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this.faderIn();
this._inAchievements = true;
this._achMC = new achievementsInfoMC(this, this._parkanoidMain.GameProgress.AchievementsInfo, this._soundManager);
this._achMC.x = (300 - (this._achMC.width / 2));
this._achMC.y = 700;
addChild(this._achMC);
}
private function lvl8Click(_arg1:MouseEvent):void{
this.gotoLevel(8);
}
private function faderComplete(_arg1:TweenEvent):void{
this.tm.removeEventListener(TweenEvent.COMPLETE, this.faderComplete);
removeChild(this.fader);
}
private function lvl5Click(_arg1:MouseEvent):void{
this.gotoLevel(5);
}
private function initShopButton():void{
this._fflogo = this.fflogo;
this._fflogo.buttonMode = true;
this._fflogo.addEventListener(MouseEvent.CLICK, this.fflogoClick);
this._shopBtn = this.shopBtn;
this._shopBtn.buttonMode = true;
this._shopBtn.addEventListener(MouseEvent.CLICK, this.shopClick);
this._moreGamesBtn = this.moreBtn;
this._moreGamesBtn.buttonMode = true;
this._moreGamesBtn.addEventListener(MouseEvent.CLICK, this.moreGamesClick);
this._achBtn = this.achBtn;
this._achBtn.buttonMode = true;
this._achBtn.addEventListener(MouseEvent.CLICK, this.achClick);
this._menuBtn = this.menuBtn;
this._menuBtn.buttonMode = true;
this._menuBtn.addEventListener(MouseEvent.CLICK, this.menuClick);
this._resetButton = this.resetGameBtn;
this._resetButton.buttonMode = true;
this._resetButton.addEventListener(MouseEvent.CLICK, this.resetClick);
this._controlsButton = this.setupControls;
this._controlsButton.buttonMode = true;
this._controlsButton.addEventListener(MouseEvent.CLICK, this.controlsClick);
}
private function lvlRollOut(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
TweenLite.to(_local2, 0.2, {scaleX:1, scaleY:1});
this._thumb.HideLevel();
}
private function lvl2Click(_arg1:MouseEvent):void{
this.gotoLevel(2);
}
private function lvlRollOver(_arg1:MouseEvent):void{
var _local2:MovieClip;
var _local3:int;
_local2 = (_arg1.target as MovieClip);
TweenLite.to(_local2, 0.2, {scaleX:1.2, scaleY:1.2});
_local3 = int(_local2.name.charAt(3));
this._thumb.showLevel(_local3, this._parkanoidMain.GameProgress.LevelsCompleted);
}
private function faderIn():void{
this.fader = new faderBlack();
this.fader.alpha = 0;
addChild(this.fader);
this.tm = TweenMax.to(this.fader, 0.5, {alpha:0.8});
}
private function menuClick(_arg1:MouseEvent):void{
this._soundManager.StopMusic();
(parent as dispatcherMC).GoToStage(dispatcherMC.MAIN_MENU, 0);
this._soundManager.PlayButtonClick();
}
private function lvl9Click(_arg1:MouseEvent):void{
this.gotoLevel(9);
}
private function resetClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
this._soundManager.PlayButtonClick();
this.faderIn();
_local2 = new resetConfirmatorMC(this, this._soundManager);
_local2.x = 185;
_local2.y = 250;
addChild(_local2);
}
private function initLevelButtonsFrames():void{
if (this._parkanoidMain.GameProgress.LevelsCompleted == 0){
this.lvl1.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 0){
this.lvl1.gotoAndStop("completed");
this.lvl2.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 1){
this.lvl2.gotoAndStop("completed");
this.lvl3.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 2){
this.lvl3.gotoAndStop("completed");
this.lvl4.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 3){
this.lvl4.gotoAndStop("completed");
this.lvl5.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 4){
this.lvl5.gotoAndStop("completed");
this.lvl6.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 5){
this.lvl6.gotoAndStop("completed");
this.lvl7.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 6){
this.lvl7.gotoAndStop("completed");
this.lvl8.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 7){
this.lvl8.gotoAndStop("completed");
this.lvl9.gotoAndStop("playable");
};
if (this._parkanoidMain.GameProgress.LevelsCompleted > 8){
this.lvl9.gotoAndStop("completed");
};
}
private function lvl6Click(_arg1:MouseEvent):void{
this.gotoLevel(6);
}
private function lvl3Click(_arg1:MouseEvent):void{
this.gotoLevel(3);
}
public function GetParkanoidMain():parkanoidMain{
return (this._parkanoidMain);
}
public function BackFromTutorial(_arg1:int){
this._soundManager.StopMusic();
(parent as dispatcherMC).GoToStage(dispatcherMC.GAMEPLAY, _arg1);
}
private function fflogoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://apps.facebook.com/funflow"));
}
private function gotoLevel(_arg1:int):void{
var _local2:ingameTutorialMC;
var _local3:int;
if (!this._parkanoidMain.GameProgress.TutorialShown){
this._soundManager.PlayButtonClick();
this._parkanoidMain.GameProgress.TutorialShown = true;
this.faderIn();
_local2 = new ingameTutorialMC(this, this._soundManager, _arg1, this._parkanoidMain.GameProgress, false);
_local2.x = (300 - (_local2.width / 2));
_local2.y = (300 - (_local2.height / 2));
addChild(_local2);
} else {
_local3 = _arg1;
this._soundManager.PlayLevelPlay();
this._soundManager.StopMusic();
(parent as dispatcherMC).GoToStage(dispatcherMC.GAMEPLAY, _local3);
};
}
public function faderOut():void{
this.tm = TweenMax.to(this.fader, 0.5, {alpha:0});
this.tm.addEventListener(TweenEvent.COMPLETE, this.faderComplete);
}
}
}//package
Section 260
//levelSelShopHint (levelSelShopHint)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
public class levelSelShopHint extends MovieClip {
private var _parentLevelSelection:levelSelection;
private var _soundController:soundManager;
public var okBtn:MovieClip;
private var _okBtn:MovieClip;
public function levelSelShopHint(_arg1:levelSelection, _arg2:soundManager){
this._soundController = _arg2;
this._parentLevelSelection = _arg1;
alpha = 0;
TweenLite.to(this, 0.3, {alpha:1});
this._okBtn = this.okBtn;
this._okBtn.buttonMode = true;
this._okBtn.addEventListener(MouseEvent.CLICK, this.okClick);
}
private function okClick(_arg1:MouseEvent):void{
var _local2:TweenMax;
this._soundController.PlayButtonClick();
_local2 = TweenMax.to(this, 0.3, {alpha:0});
_local2.addEventListener(TweenEvent.COMPLETE, this.outComplete);
}
private function outComplete(_arg1:TweenEvent):void{
parent.removeChild(this);
this._parentLevelSelection.faderOut();
}
}
}//package
Section 261
//levelThumbnail (levelThumbnail)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
public class levelThumbnail extends MovieClip {
private const TRANSITIONTIME:Number = 0.15;
private var levelToShowMC:MovieClip;
private var mclsToWatch:Array;
public function levelThumbnail(){
this.mclsToWatch = [];
super();
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function removeJunk():void{
removeChildAt[0];
}
private function entFr(_arg1:Event):void{
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:int;
var _local5:Array;
_local5 = [];
for each (_local2 in this.mclsToWatch) {
if (_local2.alpha == 0){
if (_local2.parent != null){
_local5.push(_local2);
};
};
};
for each (_local3 in _local5) {
_local3.parent.removeChild(_local3);
_local4 = this.mclsToWatch.indexOf(_local3);
this.mclsToWatch.splice(_local4, 1);
};
}
private function colorise():void{
TweenMax.to(this, 0, {colorMatrixFilter:{}});
}
public function HideLevel(){
var _local1:MovieClip;
if (this.levelToShowMC != null){
_local1 = this.levelToShowMC;
TweenLite.to(_local1, this.TRANSITIONTIME, {alpha:0});
if (this.mclsToWatch.indexOf(_local1) == -1){
this.mclsToWatch.push(_local1);
};
};
}
public function showLevel(_arg1:int, _arg2:int){
var _local3:MovieClip;
if (_arg1 > (_arg2 + 1)){
this.decolorise();
} else {
this.colorise();
};
if (this.levelToShowMC != null){
_local3 = this.levelToShowMC;
TweenLite.to(_local3, this.TRANSITIONTIME, {alpha:0});
if (this.mclsToWatch.indexOf(_local3) == -1){
this.mclsToWatch.push(_local3);
};
};
switch (_arg1){
case 1:
this.levelToShowMC = new Level1();
break;
case 2:
this.levelToShowMC = new Level2();
break;
case 3:
this.levelToShowMC = new Level3();
break;
case 4:
this.levelToShowMC = new Level4();
break;
case 5:
this.levelToShowMC = new Level5();
break;
case 6:
this.levelToShowMC = new Level6();
break;
case 7:
this.levelToShowMC = new Level7();
break;
case 8:
this.levelToShowMC = new Level8();
break;
case 9:
this.levelToShowMC = new Level9();
break;
};
this.levelToShowMC.scaleX = 0.2;
this.levelToShowMC.scaleY = 0.2;
this.levelToShowMC.alpha = 0;
TweenLite.to(this.levelToShowMC, this.TRANSITIONTIME, {alpha:1});
addChild(this.levelToShowMC);
}
private function decolorise():void{
TweenMax.to(this, 0, {colorMatrixFilter:{colorize:0xFFFFFF}});
}
}
}//package
Section 262
//lifeBonus (lifeBonus)
package {
import flash.display.*;
public dynamic class lifeBonus extends MovieClip {
}
}//package
Section 263
//lifeBonusActor (lifeBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class lifeBonusActor extends Actor {
public function lifeBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new lifeBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 264
//lifeLine (lifeLine)
package {
import flash.display.*;
public dynamic class lifeLine extends MovieClip {
}
}//package
Section 265
//lifeLineActor (lifeLineActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class lifeLineActor extends Actor {
public function lifeLineActor(_arg1:gameplay, _arg2:MovieClip){
var _local3:MovieClip;
var _local4:b2PolygonDef;
var _local5:Rectangle;
var _local6:b2BodyDef;
var _local7:b2Body;
_local3 = new lifeLine();
_local3.x = 183;
_local3.y = 336;
_arg2.addChild(_local3);
_local4 = new b2PolygonDef();
_local5 = new Rectangle();
_local5.width = _local3.width;
_local5.height = _local3.height;
_local4.SetAsBox(((_local5.width / 2) / PhysVals.RATIO), ((_local5.height / 2) / PhysVals.RATIO));
_local4.density = 0;
_local4.friction = 0.5;
_local4.restitution = 1.5;
_local4.filter.categoryBits = collisionBits.BOUNCER;
_local6 = new b2BodyDef();
_local6.position.Set((_local3.x / PhysVals.RATIO), (_local3.y / PhysVals.RATIO));
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local4);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local3);
}
}
}//package
Section 266
//lifeLineBonus (lifeLineBonus)
package {
import flash.display.*;
public dynamic class lifeLineBonus extends MovieClip {
}
}//package
Section 267
//lifeLineBonusActor (lifeLineBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class lifeLineBonusActor extends Actor {
public function lifeLineBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new lifeLineBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 268
//mainMenuMC (mainMenuMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import com.midasplayer.*;
import flash.net.*;
public class mainMenuMC extends MovieClip {
public var credBtn:MovieClip;
private var _selector:MovieClip;
private var _playBtn:MovieClip;
public var tutBtn:MovieClip;
private var _tutBtn:MovieClip;
public var fflogo:MovieClip;
private var _soundManager:soundManager;
private var _fflogo:MovieClip;
private var _moreBtn:MovieClip;
private var allButtons:Array;
public var playBtn:MovieClip;
public var moreBtn:MovieClip;
private var _credBtn:MovieClip;
public function mainMenuMC(_arg1:soundManager){
this.allButtons = [];
super();
this.initControls();
this._soundManager = _arg1;
}
private function btnRollOver(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
this._selector.y = (_local2.y + 5);
this._selector.x = 175.3;
TweenMax.to(this._selector, 0.2, {alpha:1});
}
private function logoClick(_arg1:MouseEvent):void{
navigateToURL(new URLRequest("http://apps.facebook.com/funflow"));
}
private function btnRollOut(_arg1:MouseEvent):void{
var _local2:MovieClip;
_local2 = (_arg1.target as MovieClip);
TweenMax.to(this._selector, 0.2, {alpha:0});
}
private function cleanup():void{
var _local1:MovieClip;
for each (_local1 in this.allButtons) {
_local1.removeEventListener(MouseEvent.ROLL_OVER, this.btnRollOver);
_local1.removeEventListener(MouseEvent.ROLL_OUT, this.btnRollOut);
_local1.removeEventListener(MouseEvent.CLICK, this.btnClick);
};
}
private function btnClick(_arg1:MouseEvent):void{
var _local2:MovieClip;
this._soundManager.PlayButtonClick();
_local2 = (_arg1.target as MovieClip);
if (_local2 == this._playBtn){
this.cleanup();
(parent as dispatcherMC).GoToStage(dispatcherMC.LEVEL_SELECTION, 0);
};
if (_local2 == this._tutBtn){
this.cleanup();
(parent as dispatcherMC).GoToStage(dispatcherMC.TUTORIAL, 0);
};
if (_local2 == this._credBtn){
this.cleanup();
(parent as dispatcherMC).GoToStage(dispatcherMC.CREDITS, 0);
};
if (_local2 == this._moreBtn){
KingAPI.openOtherGamesLink();
};
}
private function initControls():void{
var _local1:Number;
var _local2:MovieClip;
this._selector = new mainMenuSelector();
this._selector.alpha = 0;
this._selector.mouseEnabled = false;
addChild(this._selector);
this._fflogo = this.fflogo;
this._fflogo.buttonMode = true;
this._fflogo.addEventListener(MouseEvent.CLICK, this.logoClick);
this._playBtn = this.playBtn;
this._tutBtn = this.tutBtn;
this._moreBtn = this.moreBtn;
this._credBtn = this.credBtn;
this.allButtons = [this._playBtn, this._tutBtn, this._credBtn, this._moreBtn];
_local1 = 0;
for each (_local2 in this.allButtons) {
_local2.buttonMode = true;
_local2.addEventListener(MouseEvent.ROLL_OVER, this.btnRollOver);
_local2.addEventListener(MouseEvent.ROLL_OUT, this.btnRollOut);
_local2.addEventListener(MouseEvent.CLICK, this.btnClick);
_local2.alpha = 0;
_local1 = (_local1 + 0.15);
TweenLite.to(_local2, 0.15, {alpha:1, delay:_local1});
};
}
}
}//package
Section 269
//mainMenuSelector (mainMenuSelector)
package {
import flash.display.*;
public dynamic class mainMenuSelector extends MovieClip {
}
}//package
Section 270
//mcBannedSign (mcBannedSign)
package {
import flash.display.*;
public dynamic class mcBannedSign extends MovieClip {
public var bg:MovieClip;
}
}//package
Section 271
//mcCrownMask (mcCrownMask)
package {
import flash.display.*;
public dynamic class mcCrownMask extends MovieClip {
}
}//package
Section 272
//mcFerryLine (mcFerryLine)
package {
import flash.display.*;
public dynamic class mcFerryLine extends MovieClip {
}
}//package
Section 273
//mcLogoHolder (mcLogoHolder)
package {
import flash.display.*;
public dynamic class mcLogoHolder extends MovieClip {
}
}//package
Section 274
//mcLogoMask (mcLogoMask)
package {
import flash.display.*;
public dynamic class mcLogoMask extends MovieClip {
}
}//package
Section 275
//mcOtherGames (mcOtherGames)
package {
import flash.display.*;
public dynamic class mcOtherGames extends MovieClip {
}
}//package
Section 276
//mcPlay (mcPlay)
package {
import flash.display.*;
public dynamic class mcPlay extends MovieClip {
}
}//package
Section 277
//mcWaterRing (mcWaterRing)
package {
import flash.display.*;
public dynamic class mcWaterRing extends MovieClip {
public function mcWaterRing(){
addFrameScript(39, this.frame40);
}
function frame40(){
stop();
}
}
}//package
Section 278
//menu_mus (menu_mus)
package {
import flash.media.*;
public dynamic class menu_mus extends Sound {
}
}//package
Section 279
//mkt_1 (mkt_1)
package {
import flash.display.*;
public dynamic class mkt_1 extends MovieClip {
}
}//package
Section 280
//mkt_2 (mkt_2)
package {
import flash.display.*;
public dynamic class mkt_2 extends MovieClip {
}
}//package
Section 281
//mkt_3 (mkt_3)
package {
import flash.display.*;
public dynamic class mkt_3 extends MovieClip {
}
}//package
Section 282
//moneyBlockActor (moneyBlockActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import fl.motion.*;
public class moneyBlockActor extends Actor {
private var _health:Number;
private var lightUpFactor:int;// = 0
private var _maxHealth:Number;// = 50
private var cracksClip2:MovieClip;
private var cracksClip:MovieClip;
private var initialPoint:Point;
private var shattered:Boolean;// = false
public function moneyBlockActor(_arg1:gameplay, _arg2:b2Body, _arg3:DisplayObject, _arg4:Number){
lightUpFactor = 0;
_maxHealth = 50;
shattered = false;
this.initialPoint = new Point(_arg3.x, _arg3.y);
this._health = (this._maxHealth * _arg4);
super(_arg1, _arg2, _arg3);
this.initCracks();
_body.PutToSleep();
}
private function initCracks():void{
this.cracksClip = new blockCracks();
this.cracksClip2 = new blockCracks2();
(_costume as MovieClip).addChild(this.cracksClip);
(_costume as MovieClip).addChild(this.cracksClip2);
}
override protected function childSpecificUpdating():void{
var _local1:b2Vec2;
var _local2:b2Vec2;
this.setDamageGraphics();
this.lightUp();
if (!_body.IsSleeping()){
_local1 = new b2Vec2(this.initialPoint.x, this.initialPoint.y);
_local2 = new b2Vec2((_local1.x - _costume.x), (_local1.y - _costume.y));
_local2.Multiply(_parentGP.stage.frameRate);
_local2.Multiply((1 / PhysVals.RATIO));
_body.SetLinearVelocity(_local2);
};
super.childSpecificUpdating();
}
private function lightUp():void{
var _local1:Number;
var _local2:Color;
var _local3:Number;
_local1 = ((this.lightUpFactor / 10) * 0.7);
_local2 = new Color();
_local3 = 0xFFFFFF;
_local2.setTint(_local3, _local1);
_costume.transform.colorTransform = _local2;
if (this.lightUpFactor > 10){
this.lightUpFactor = 10;
};
if (this.lightUpFactor > 0){
this.lightUpFactor--;
};
}
private function setDamageGraphics():void{
if ((this._health / this._maxHealth) < 0.5){
this.cracksClip.alpha = 1;
} else {
this.cracksClip.alpha = (1 - (((this._health / this._maxHealth) - 0.5) * 2));
};
if ((this._health / this._maxHealth) > 0.5){
this.cracksClip2.alpha = 0;
} else {
this.cracksClip2.alpha = (1 - ((this._health / this._maxHealth) * 2));
};
}
public function Hit(_arg1:Number, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean):Boolean{
var _local6:Boolean;
var _local7:shatterBlockMoneyInfo;
if (_arg5){
_parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, 20, 40, new Point(_costume.x, _costume.y), false));
};
_local6 = false;
if (((_arg4) || (!(_arg3)))){
_local6 = true;
};
this._health = (this._health - _arg1);
this.lightUpFactor = (this.lightUpFactor + 10);
if ((((this._health <= 0)) && ((this.shattered == false)))){
this.shattered = true;
_parentGP.GetGameProgress().AchievementsInfo.IncreaseBlocksHit();
_local7 = new shatterBlockMoneyInfo((_costume as MovieClip), _arg2, _arg1);
if (_arg3){
_parentGP.increaseShake(Math.round((_arg1 / 1.5)));
};
_parentGP.PushActorToCreate(_local7);
if (!_arg4){
_parentGP.SoundManager.PlaySimpleBlockCrushed();
};
DeleteFlag = true;
if (((((_arg3) && (!(_arg5)))) || (((_local6) && (!(_arg4)))))){
_parentGP.SwuareCrushEffect(new Point(_costume.x, _costume.y), 111);
};
return (true);
};
return (false);
}
}
}//package
Section 283
//multipleBallsBonus (multipleBallsBonus)
package {
import flash.display.*;
public dynamic class multipleBallsBonus extends MovieClip {
}
}//package
Section 284
//multipleBallsBonusActor (multipleBallsBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class multipleBallsBonusActor extends Actor {
public function multipleBallsBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new multipleBallsBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
override protected function childSpecificUpdating():void{
super.childSpecificUpdating();
}
}
}//package
Section 285
//muteSoundButton (muteSoundButton)
package {
import flash.display.*;
public dynamic class muteSoundButton extends MovieClip {
}
}//package
Section 286
//parkanoidMain (parkanoidMain)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import fl.transitions.*;
import com.midasplayer.extras.*;
import flash.media.*;
import fl.transitions.easing.*;
import com.midasplayer.*;
import flash.net.*;
public class parkanoidMain extends MovieClip {
private var m_tween:Tween;
private var m_dist:Number;
private var m_yellowDest:Number;
private var m_logoHolder:Sprite;
private var sharedObj:SharedObject;
public var GameProgress:gameProgressInfo;
var MindJoltAPI:Object;
private var m_rootRef:MovieClip;
private var m_maskRown:MovieClip;
private var m_GREEN:MovieClip;
private var m_loaderContent:Array;
private var m_bounce:Boolean;// = false
private var m_otherGames:Sprite;
private var m_colorOff:Boolean;// = false
private var m_streamGreen:Boolean;// = true
private var m_pressBtn:Boolean;// = false
private var m_ferryRed:MovieClip;
private var GAME_NAME:String;// = "pixel-basher"
private var m_count;// = 0
private var m_sampleLoadPerc:Number;// = -1
private var m_clsBlue:Water;
private var m_endColor:ColorTransform;
private var m_BLUE:MovieClip;
private var m_waveEngineLogo:WaveEngine;
private var STAGE_WIDTH:Number;// = 600
private var m_streamBlue:Boolean;// = false
private var m_greenDest:Number;
private var m_waveEngineCrown:WaveEngine;
private var m_ferryGreen:MovieClip;
private var m_clsRed:Water;
private var m_overBtn:Boolean;// = false
private var paramObj:Object;
private var m_startColor:ColorTransform;
private var m_ferryBlue:MovieClip;
private var m_tweenBounceLogo:Tween;
private var m_prevPerc:Number;// = -1
private var m_bg:Sprite;
private var m_waveHolderLogo:MovieClip;
private var m_step:Number;
private var m_logoFill:Boolean;// = true
private var m_isLoaded:Boolean;// = false
private var m_streamHeight:Number;
private var m_sun:Sprite;
private var m_mask:MovieClip;
private var m_clsGreen:Water;
private var m_crownFill:Boolean;// = false
private var m_safari:Boolean;// = false
private var m_RED:MovieClip;
private var MOCHI:String;// = ""
private var m_streamRed:Boolean;// = false
private var STAGE_HEIGHT:Number;// = 600
public var SoundManager:soundManager;
private var m_gameFrameRate:int;
private var api_url:String;
private var m_play:Sprite;
private var kongregate;
private var m_waveHolderCrown:MovieClip;
public function parkanoidMain(){
STAGE_WIDTH = 600;
m_streamBlue = false;
m_overBtn = false;
m_prevPerc = -1;
m_logoFill = true;
m_isLoaded = false;
m_crownFill = false;
m_safari = false;
m_bounce = false;
m_colorOff = false;
m_streamGreen = true;
MOCHI = "";
m_streamRed = false;
STAGE_HEIGHT = 600;
m_pressBtn = false;
GAME_NAME = "pixel-basher";
m_count = 0;
m_sampleLoadPerc = -1;
this.m_loaderContent = new Array();
this.m_waveHolderLogo = new MovieClip();
this.m_waveHolderCrown = new MovieClip();
this.m_play = new Sprite();
this.m_otherGames = new Sprite();
this.m_mask = new MovieClip();
this.m_maskRown = new MovieClip();
this.m_RED = new WaterHolderR();
this.m_GREEN = new WaterHolderG();
this.m_BLUE = new WaterHolderB();
this.m_ferryGreen = new ferryGreen();
this.m_ferryRed = new ferryRed();
this.m_ferryBlue = new ferryBlue();
this.paramObj = LoaderInfo(root.loaderInfo).parameters;
this.api_url = ((this.paramObj.api_path) || ("http://www.kongregate.com/flash/API_AS3_Local.swf"));
super();
addFrameScript(0, this.frame1, 1, this.frame2);
this.SoundManager = new soundManager();
this.GameProgress = new gameProgressInfo();
this.loadSaveGame();
this.initKongApi();
this.initMindjolt();
trace("MainLoader()");
this.m_rootRef = this;
this.m_bg = new Sprite();
this.m_bg.graphics.beginFill(0x333333, 1);
this.m_bg.graphics.drawRect(0, 0, this.STAGE_WIDTH, this.STAGE_HEIGHT);
this.m_bg.addEventListener(MouseEvent.CLICK, this.openKingPage);
this.m_rootRef.addChild(this.m_bg);
this.m_loaderContent.push(this.m_bg);
stage.scaleMode = StageScaleMode.NO_SCALE;
}
private function initMindjolt():void{
}
private function onLoaderMovieFinished():void{
trace("onGameLoaded()");
this.m_tween.removeEventListener(TweenEvent.MOTION_CHANGE, this.tweenTransformCrown);
this.m_rootRef.removeEventListener(Event.ENTER_FRAME, this.update);
}
private function onPlayReleased(_arg1:MouseEvent):void{
this.cleanUp();
this.gotoGame();
}
private function loadSaveGame():void{
this.sharedObj = SharedObject.getLocal("pdata");
if (this.sharedObj.data.BallsCountLevel == undefined){
trace("no save data");
this.SaveGame();
} else {
trace("got save");
this.LoadGame();
};
}
public function LoadGame():void{
this.GameProgress.BallsCountLevel = this.sharedObj.data.BallsCountLevel;
this.GameProgress.BallsDamageLevel = this.sharedObj.data.BallsDamageLevel;
this.GameProgress.controlsScheme = this.sharedObj.data.controlsScheme;
this.GameProgress.ExploGunDamageLevel = this.sharedObj.data.ExploGunDamageLevel;
this.GameProgress.ExploGunRadiusLevel = this.sharedObj.data.ExploGunRadiusLevel;
this.GameProgress.LevelsCompleted = this.sharedObj.data.LevelsCompleted;
this.GameProgress.Money = this.sharedObj.data.Money;
this.GameProgress.PistolAmmo = this.sharedObj.data.PistolAmmo;
this.GameProgress.PistolAvailable = this.sharedObj.data.PistolAvailable;
this.GameProgress.PistolDamageLevel = this.sharedObj.data.PistolDamageLevel;
this.GameProgress.RapidGunAmmo = this.sharedObj.data.RapidGunAmmo;
this.GameProgress.RapidGunAvailable = this.sharedObj.data.RapidGunAvailable;
this.GameProgress.RapidGunDamageLevel = this.sharedObj.data.RapidGunDamageLevel;
this.GameProgress.RapidGunFrequencyLevel = this.sharedObj.data.RapidGunFrequencyLevel;
this.GameProgress.RocketGunAmmo = this.sharedObj.data.RocketGunAmmo;
this.GameProgress.RocketGunAvailable = this.sharedObj.data.RocketGunAvailable;
this.GameProgress.Score = this.sharedObj.data.Score;
this.GameProgress.SpreadGunAmmo = this.sharedObj.data.SpreadGunAmmo;
this.GameProgress.SpreadGunAvailable = this.sharedObj.data.SpreadGunAvailable;
this.GameProgress.SpreadGunDamageLevel = this.sharedObj.data.SpreadGunDamageLevel;
this.GameProgress.SpreadGunNumBulletsLevel = this.sharedObj.data.SpreadGunNumBulletsLevel;
this.GameProgress.TutorialShown = this.sharedObj.data.TutorialShown;
this.GameProgress.AchievementsInfo.BlindBonuses = this.sharedObj.data.BlindBonuses;
this.GameProgress.AchievementsInfo.BLINDMASTERACHIEVEMENT = this.sharedObj.data.BLINDMASTERACHIEVEMENT;
this.GameProgress.AchievementsInfo.BlocksCrashedCount = this.sharedObj.data.BlocksCrashedCount;
this.GameProgress.AchievementsInfo.BLOCKSCRASHEDCOUNTACHIEVEMENT = this.sharedObj.data.BLOCKSCRASHEDCOUNTACHIEVEMENT;
this.GameProgress.AchievementsInfo.ExploBallsCount = this.sharedObj.data.ExploBallsCount;
this.GameProgress.AchievementsInfo.FIVEEXPLOBALLSACHIEVEMENT = this.sharedObj.data.FIVEEXPLOBALLSACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotBLINDMASTERACHIEVEMENT = this.sharedObj.data.GotBLINDMASTERACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotBLOCKSCRASHEDCOUNTACHIEVEMENT = this.sharedObj.data.GotBLOCKSCRASHEDCOUNTACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotFIVEEXPLOBALLSACHIEVEMENT = this.sharedObj.data.GotFIVEEXPLOBALLSACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotNOBALLSLOSTACHIEVEMENT = this.sharedObj.data.GotNOBALLSLOSTACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotNOWEAPONSACHIEVEMENT = this.sharedObj.data.GotNOWEAPONSACHIEVEMENT;
this.GameProgress.AchievementsInfo.GotSMOOTHPLAYACHIEVEMENT = this.sharedObj.data.GotSMOOTHPLAYACHIEVEMENT;
this.GameProgress.AchievementsInfo.NOBALLSLOSTACHIEVEMENT = this.sharedObj.data.NOBALLSLOSTACHIEVEMENT;
this.GameProgress.AchievementsInfo.NOWEAPONSACHIEVEMENT = this.sharedObj.data.NOWEAPONSACHIEVEMENT;
this.GameProgress.AchievementsInfo.SMOOTHPLAYACHIEVEMENT = this.sharedObj.data.SMOOTHPLAYACHIEVEMENT;
this.GameProgress.AchievementsInfo.TimesPlayed = this.sharedObj.data.TimesPlayed;
}
private function onBtnOut(_arg1:MouseEvent):void{
_arg1.target.removeEventListener(MouseEvent.MOUSE_DOWN, this.onBtnPress);
if (this.m_pressBtn){
_arg1.target.x = (_arg1.target.x - 1);
_arg1.target.y = (_arg1.target.y - 2);
this.m_pressBtn = false;
};
}
public function KongSubmitLevelsCompleted(_arg1:int){
}
public function KongSubmitTotalScore(_arg1:int){
}
private function onBtnPress(_arg1:MouseEvent):void{
this.m_pressBtn = true;
_arg1.target.x = (_arg1.target.x + 1);
_arg1.target.y = (_arg1.target.y + 2);
}
function frame2(){
stop();
}
function frame1(){
stage.showDefaultContextMenu = false;
}
private function onBtnOver(_arg1:MouseEvent):void{
_arg1.target.addEventListener(MouseEvent.MOUSE_DOWN, this.onBtnPress);
}
private function tweenTransformLogo(_arg1:TweenEvent):void{
this.m_waveEngineLogo.colorUpdate(this.interpolateColor(this.m_startColor, this.m_endColor, this.m_tween.position).color);
}
public function postMindJoltAPIConnect(_arg1:Boolean){
}
private function update(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:MovieClip;
var _local5:Sound;
var _local6:Sound;
if (this.m_safari){
if (this.m_rootRef.framesLoaded == this.m_rootRef.totalFrames){
this.m_isLoaded = true;
};
} else {
if ((((stage.loaderInfo.bytesLoaded == stage.loaderInfo.bytesTotal)) && (!(this.m_isLoaded)))){
this.m_isLoaded = true;
};
};
this.m_isLoaded = true;
this.m_count++;
if (this.m_streamGreen){
if (this.m_count == 1){
this.m_GREEN.height = (this.m_GREEN.height - this.m_GREEN.height);
this.m_GREEN.alpha = 1;
this.m_ferryGreen.gotoAndStop("on");
};
this.m_GREEN.height = (this.m_GREEN.height + 20);
if (this.m_GREEN.height >= this.m_streamHeight){
this.m_GREEN.height = this.m_streamHeight;
if (this.m_clsGreen.decrThickness(false)){
this.m_streamGreen = false;
this.m_streamBlue = true;
this.m_count = 0;
};
};
};
if (this.m_streamBlue){
if (this.m_count >= 40){
if (this.m_count == 40){
this.m_BLUE.height = (this.m_BLUE.height - this.m_BLUE.height);
this.m_BLUE.alpha = 1;
this.m_ferryBlue.gotoAndStop("on");
this.m_tween = new Tween(this.m_waveHolderLogo, "", None.easeNone, 0, 1, 2, true);
this.m_tween.addEventListener(TweenEvent.MOTION_CHANGE, this.tweenTransformLogo);
};
this.m_BLUE.height = (this.m_BLUE.height + 20);
if (this.m_BLUE.height >= this.m_streamHeight){
this.m_BLUE.height = this.m_streamHeight;
if (this.m_clsBlue.decrThickness(false)){
this.m_streamBlue = false;
};
};
};
};
if (this.m_logoFill){
if (this.m_waveHolderLogo.y > this.m_greenDest){
this.m_waveHolderLogo.y = (this.m_waveHolderLogo.y - 0.3);
} else {
this.m_waveHolderLogo.y = this.m_greenDest;
if (!this.m_streamBlue){
this.m_colorOff = true;
this.m_waveEngineLogo.stopWave();
};
};
};
if (this.m_colorOff){
if (this.m_logoFill){
if (this.m_clsBlue.decrThickness(true)){
if (this.m_BLUE.rotation != 180){
this.m_BLUE.rotation = 180;
this.m_BLUE.y = (this.STAGE_HEIGHT / 2);
this.m_ferryBlue.gotoAndStop("off");
};
this.m_BLUE.scaleY = (this.m_BLUE.scaleY - 0.1);
if (this.m_BLUE.scaleY < 0){
this.m_BLUE.alpha = 0;
this.m_colorOff = false;
this.m_logoFill = false;
this.m_count = 0;
this.m_crownFill = true;
this.m_streamRed = true;
this.m_startColor = new ColorTransform();
this.m_startColor.color = 0xFF00;
this.m_endColor = new ColorTransform();
this.m_endColor.color = 0xFFAA00;
this.m_tween.removeEventListener(TweenEvent.MOTION_CHANGE, this.tweenTransformLogo);
this.m_tween = new Tween(this.m_waveHolderCrown, "", None.easeNone, 0, 1, 2, true);
this.m_tween.addEventListener(TweenEvent.MOTION_CHANGE, this.tweenTransformCrown);
};
};
};
if (this.m_crownFill){
if (((this.m_clsRed.decrThickness(true)) && (this.m_clsGreen.decrThickness(true)))){
if (this.m_GREEN.rotation != 180){
this.m_GREEN.rotation = 180;
this.m_RED.rotation = 180;
this.m_GREEN.y = (this.STAGE_HEIGHT / 2);
this.m_RED.y = (this.STAGE_HEIGHT / 2);
this.m_ferryGreen.gotoAndStop("off");
this.m_ferryRed.gotoAndStop("off");
};
this.m_GREEN.scaleY = (this.m_GREEN.scaleY - 0.1);
this.m_RED.scaleY = (this.m_RED.scaleY - 0.1);
if ((((this.m_GREEN.scaleY < 0)) && ((this.m_RED.scaleY < 0)))){
this.m_GREEN.alpha = 0;
this.m_RED.alpha = 0;
this.m_colorOff = false;
this.m_crownFill = false;
this.m_bounce = true;
this.m_count = 0;
};
};
};
};
if (this.m_crownFill){
if (this.m_sampleLoadPerc == -1){
this.m_sampleLoadPerc = (100 - (100 * (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal)));
this.m_step = (this.m_dist / 100);
};
_local2 = (100 - (100 * (stage.loaderInfo.bytesLoaded / stage.loaderInfo.bytesTotal)));
_local2 = ((100 * (this.m_sampleLoadPerc - _local2)) / this.m_sampleLoadPerc);
if (this.m_waveHolderCrown.y > this.m_yellowDest){
if ((this.m_waveHolderCrown.y - this.m_step) < this.m_yellowDest){
this.m_waveHolderCrown.y = this.m_yellowDest;
} else {
if (this.m_isLoaded){
this.m_waveHolderCrown.y = (this.m_waveHolderCrown.y - 0.5);
} else {
if (this.m_prevPerc != _local2){
_local3 = (_local2 - this.m_prevPerc);
this.m_waveHolderCrown.y = (this.m_waveHolderCrown.y - this.m_step);
this.m_prevPerc = _local2;
};
};
};
} else {
this.m_colorOff = true;
this.m_waveEngineCrown.stopWave();
};
};
if (this.m_streamRed){
if (this.m_count >= 20){
if (this.m_count == 20){
this.m_RED.height = (this.m_RED.height - this.m_RED.height);
this.m_RED.alpha = 1;
this.m_ferryRed.gotoAndStop("on");
};
this.m_RED.height = (this.m_RED.height + 20);
if (this.m_RED.height >= this.m_streamHeight){
this.m_RED.height = this.m_streamHeight;
if (this.m_clsRed.decrThickness(false)){
this.m_streamRed = false;
};
};
};
};
if (this.m_bounce){
if (this.m_count == 1){
_local4 = new mcWaterRing();
_local4.x = (this.STAGE_WIDTH / 2);
_local4.y = ((this.STAGE_HEIGHT / 2) + 30);
this.m_rootRef.addChild(_local4);
this.m_loaderContent.push(_local4);
};
if (this.m_count == 2){
_local5 = new sfxBounce();
_local5.play();
};
if (this.m_count < 3){
this.m_logoHolder.y = (this.m_logoHolder.y + 1);
this.m_waveHolderCrown.y = (this.m_waveHolderCrown.y + 1);
this.m_waveHolderLogo.y = (this.m_waveHolderLogo.y + 1);
this.m_maskRown.y = (this.m_maskRown.y + 1);
this.m_mask.y = (this.m_mask.y + 1);
};
if ((((this.m_count > 2)) && ((this.m_count < 4)))){
this.m_logoHolder.y = (this.m_logoHolder.y - 1);
this.m_waveHolderCrown.y = (this.m_waveHolderCrown.y - 1);
this.m_waveHolderLogo.y = (this.m_waveHolderLogo.y - 1);
this.m_maskRown.y = (this.m_maskRown.y - 1);
this.m_mask.y = (this.m_mask.y - 1);
};
if (this.m_count == 4){
_local6 = new sfxBell();
_local6.play();
};
if (this.m_count == 30){
this.m_play.visible = true;
this.m_otherGames.visible = true;
};
if (this.m_count > 30){
this.m_play.alpha = (this.m_play.alpha + 0.05);
if (this.m_count > 40){
this.m_otherGames.alpha = (this.m_otherGames.alpha + 0.05);
};
if ((((this.m_play.alpha >= 1)) && ((this.m_otherGames.alpha >= 1)))){
this.m_bounce = false;
this.onLoaderMovieFinished();
};
};
};
}
private function cleanUp():void{
var _local1:int;
this.m_otherGames.removeEventListener(MouseEvent.MOUSE_UP, this.onOtherReleased);
this.m_otherGames.removeEventListener(MouseEvent.MOUSE_DOWN, this.onBtnPress);
this.m_otherGames.removeEventListener(MouseEvent.MOUSE_OVER, this.onBtnOver);
this.m_otherGames.removeEventListener(MouseEvent.MOUSE_OUT, this.onBtnOut);
this.m_play.removeEventListener(MouseEvent.MOUSE_UP, this.onPlayReleased);
this.m_play.removeEventListener(MouseEvent.MOUSE_DOWN, this.onBtnPress);
this.m_play.removeEventListener(MouseEvent.MOUSE_OVER, this.onBtnOver);
this.m_play.removeEventListener(MouseEvent.MOUSE_OUT, this.onBtnOut);
while (_local1 < this.m_loaderContent.length) {
this.m_rootRef.removeChild(this.m_loaderContent[_local1]);
this.m_loaderContent[_local1] = null;
_local1++;
};
}
private function showBannedScreen():void{
var _local1:Sprite;
_local1 = new mcBannedSign();
_local1.buttonMode = true;
_local1.addEventListener(MouseEvent.CLICK, this.openKingPage);
this.m_rootRef.addChild(_local1);
}
private function onOtherReleased(_arg1:MouseEvent):void{
this.cleanUp();
KingAPI.openOtherGamesLink();
}
public function MindjoltSubmitScore(_arg1:int){
}
private function interpolateColor(_arg1:ColorTransform, _arg2:ColorTransform, _arg3:Number):ColorTransform{
var _local4:ColorTransform;
_local4 = new ColorTransform();
_local4.redMultiplier = (_arg1.redMultiplier + ((_arg2.redMultiplier - _arg1.redMultiplier) * _arg3));
_local4.greenMultiplier = (_arg1.greenMultiplier + ((_arg2.greenMultiplier - _arg1.greenMultiplier) * _arg3));
_local4.blueMultiplier = (_arg1.blueMultiplier + ((_arg2.blueMultiplier - _arg1.blueMultiplier) * _arg3));
_local4.alphaMultiplier = (_arg1.alphaMultiplier + ((_arg2.alphaMultiplier - _arg1.alphaMultiplier) * _arg3));
_local4.redOffset = (_arg1.redOffset + ((_arg2.redOffset - _arg1.redOffset) * _arg3));
_local4.greenOffset = (_arg1.greenOffset + ((_arg2.greenOffset - _arg1.greenOffset) * _arg3));
_local4.blueOffset = (_arg1.blueOffset + ((_arg2.blueOffset - _arg1.blueOffset) * _arg3));
_local4.alphaOffset = (_arg1.alphaOffset + ((_arg2.alphaOffset - _arg1.alphaOffset) * _arg3));
return (_local4);
}
private function playLoaderMovie():void{
var _local1:MovieClip;
_local1 = new mcFerryLine();
this.m_rootRef.addChild(this.m_ferryGreen);
this.m_rootRef.addChild(this.m_ferryRed);
this.m_rootRef.addChild(this.m_ferryBlue);
this.m_ferryGreen.x = ((this.STAGE_WIDTH / 2) - 2);
this.m_ferryRed.x = ((this.m_ferryGreen.x - (this.m_ferryGreen.width / 2)) + 15);
this.m_ferryBlue.x = ((this.m_ferryGreen.x + (this.m_ferryGreen.width / 2)) - 17);
this.m_ferryBlue.y = (this.m_ferryGreen.y = (this.m_ferryRed.y = (this.m_bg.y + 15)));
this.m_loaderContent.push(this.m_ferryGreen);
this.m_loaderContent.push(this.m_ferryRed);
this.m_loaderContent.push(this.m_ferryBlue);
_local1.x = (this.STAGE_WIDTH / 2);
_local1.y = ((this.m_ferryGreen.y + this.m_ferryGreen.height) - 9);
this.m_streamHeight = ((this.STAGE_HEIGHT / 2) - 40);
this.m_clsRed = this.m_RED.RED;
this.m_clsRed.init(this.m_streamHeight, 1);
this.m_clsGreen = this.m_GREEN.GREEN;
this.m_clsGreen.init(this.m_streamHeight, 1);
this.m_clsBlue = this.m_BLUE.BLUE;
this.m_clsBlue.init(this.m_streamHeight, 1);
this.m_RED.alpha = (this.m_GREEN.alpha = (this.m_BLUE.alpha = 0));
this.m_rootRef.addChild(this.m_RED);
this.m_rootRef.addChild(this.m_GREEN);
this.m_rootRef.addChild(this.m_BLUE);
this.m_loaderContent.push(this.m_RED);
this.m_loaderContent.push(this.m_GREEN);
this.m_loaderContent.push(this.m_BLUE);
this.m_RED.x = ((this.STAGE_WIDTH / 2) - 22);
this.m_GREEN.x = ((this.STAGE_WIDTH / 2) - 4);
this.m_BLUE.x = ((this.STAGE_WIDTH / 2) + 16);
this.m_RED.y = (this.m_GREEN.y = (this.m_BLUE.y = _local1.y));
this.m_waveEngineLogo = new WaveEngine(this.m_rootRef, 205.8, 120, 0xFF00, 0xFF00, this.m_waveHolderLogo);
this.m_waveHolderLogo = this.m_waveEngineLogo.getWave();
this.m_rootRef.addChild(this.m_waveHolderLogo);
this.m_loaderContent.push(this.m_waveHolderLogo);
this.m_waveEngineCrown = new WaveEngine(this.m_rootRef, 67.5, 100, 0xFFAA00, 0xFFAA00, this.m_waveHolderCrown);
this.m_waveHolderCrown = this.m_waveEngineCrown.getWave();
this.m_rootRef.addChild(this.m_waveHolderCrown);
this.m_loaderContent.push(this.m_waveHolderCrown);
this.m_logoHolder = new mcLogoHolder();
this.m_logoHolder.x = (this.STAGE_WIDTH / 2);
this.m_logoHolder.y = ((this.STAGE_HEIGHT / 2) - 2);
this.m_logoHolder.mouseEnabled = false;
this.m_rootRef.addChild(this.m_logoHolder);
this.m_loaderContent.push(this.m_logoHolder);
this.m_mask = new mcLogoMask();
this.m_mask.x = this.m_logoHolder.x;
this.m_mask.y = this.m_logoHolder.y;
this.m_rootRef.addChild(this.m_mask);
this.m_loaderContent.push(this.m_mask);
this.m_maskRown = new mcCrownMask();
this.m_maskRown.x = this.m_logoHolder.x;
this.m_maskRown.y = this.m_logoHolder.y;
this.m_rootRef.addChild(this.m_maskRown);
this.m_loaderContent.push(this.m_maskRown);
this.m_waveHolderLogo.mask = this.m_mask;
this.m_waveHolderLogo.x = ((this.STAGE_WIDTH / 2) - (this.m_mask.width / 2));
this.m_waveHolderLogo.y = (((this.STAGE_HEIGHT / 2) + (this.m_mask.height / 2)) + 15);
this.m_waveHolderCrown.mask = this.m_maskRown;
this.m_waveHolderCrown.x = (this.m_logoHolder.x - (this.m_maskRown.width / 2));
this.m_waveHolderCrown.y = (this.m_logoHolder.y + 4);
this.m_waveEngineLogo.startWave();
this.m_waveEngineCrown.startWave();
this.m_greenDest = ((this.m_waveHolderLogo.y - (120 / 2)) - 10);
this.m_yellowDest = (this.m_waveHolderCrown.y - (100 / 2));
this.m_dist = (this.m_waveHolderCrown.y - this.m_yellowDest);
this.m_startColor = new ColorTransform();
this.m_startColor.color = 0xFF00;
this.m_endColor = new ColorTransform();
this.m_endColor.color = 35886;
this.m_play = new mcPlay();
this.m_play.x = (this.STAGE_WIDTH / 2);
this.m_play.y = ((this.m_logoHolder.y + this.m_logoHolder.height) - 5);
this.m_play.buttonMode = true;
this.m_play.alpha = 0;
this.m_play.visible = false;
this.m_play.addEventListener(MouseEvent.MOUSE_UP, this.onPlayReleased);
this.m_play.addEventListener(MouseEvent.MOUSE_OVER, this.onBtnOver);
this.m_play.addEventListener(MouseEvent.MOUSE_OUT, this.onBtnOut);
this.m_rootRef.addChild(this.m_play);
this.m_loaderContent.push(this.m_play);
this.m_otherGames = new mcOtherGames();
this.m_otherGames.x = (this.STAGE_WIDTH / 2);
this.m_otherGames.y = ((this.m_play.y + this.m_play.height) + 15);
this.m_otherGames.buttonMode = true;
this.m_otherGames.alpha = 0;
this.m_otherGames.visible = false;
this.m_otherGames.addEventListener(MouseEvent.MOUSE_UP, this.onOtherReleased);
this.m_otherGames.addEventListener(MouseEvent.MOUSE_OVER, this.onBtnOver);
this.m_otherGames.addEventListener(MouseEvent.MOUSE_OUT, this.onBtnOut);
this.m_rootRef.addChild(this.m_otherGames);
this.m_loaderContent.push(this.m_otherGames);
this.m_rootRef.addEventListener(Event.ENTER_FRAME, this.update);
this.m_safari = ((stage.loaderInfo.bytesTotal == 0)) ? true : false;
}
private function openKingPage(_arg1:Event):void{
trace(("openKingPage() " + _arg1));
KingAPI.openLoaderMovieLink();
}
public function SaveGame():void{
this.sharedObj.data.BallsCountLevel = this.GameProgress.BallsCountLevel;
this.sharedObj.data.BallsDamageLevel = this.GameProgress.BallsDamageLevel;
this.sharedObj.data.controlsScheme = this.GameProgress.controlsScheme;
this.sharedObj.data.ExploGunDamageLevel = this.GameProgress.ExploGunDamageLevel;
this.sharedObj.data.ExploGunRadiusLevel = this.GameProgress.ExploGunRadiusLevel;
this.sharedObj.data.LevelsCompleted = this.GameProgress.LevelsCompleted;
this.sharedObj.data.Money = this.GameProgress.Money;
this.sharedObj.data.PistolAmmo = this.GameProgress.PistolAmmo;
this.sharedObj.data.PistolAvailable = this.GameProgress.PistolAvailable;
this.sharedObj.data.PistolDamageLevel = this.GameProgress.PistolDamageLevel;
this.sharedObj.data.RapidGunAmmo = this.GameProgress.RapidGunAmmo;
this.sharedObj.data.RapidGunAvailable = this.GameProgress.RapidGunAvailable;
this.sharedObj.data.RapidGunDamageLevel = this.GameProgress.RapidGunDamageLevel;
this.sharedObj.data.RapidGunFrequencyLevel = this.GameProgress.RapidGunFrequencyLevel;
this.sharedObj.data.RocketGunAmmo = this.GameProgress.RocketGunAmmo;
this.sharedObj.data.RocketGunAvailable = this.GameProgress.RocketGunAvailable;
this.sharedObj.data.Score = this.GameProgress.Score;
this.sharedObj.data.SpreadGunAmmo = this.GameProgress.SpreadGunAmmo;
this.sharedObj.data.SpreadGunAvailable = this.GameProgress.SpreadGunAvailable;
this.sharedObj.data.SpreadGunDamageLevel = this.GameProgress.SpreadGunDamageLevel;
this.sharedObj.data.SpreadGunNumBulletsLevel = this.GameProgress.SpreadGunNumBulletsLevel;
this.sharedObj.data.TutorialShown = this.GameProgress.TutorialShown;
this.sharedObj.data.BlindBonuses = this.GameProgress.AchievementsInfo.BlindBonuses;
this.sharedObj.data.BLINDMASTERACHIEVEMENT = this.GameProgress.AchievementsInfo.BLINDMASTERACHIEVEMENT;
this.sharedObj.data.BlocksCrashedCount = this.GameProgress.AchievementsInfo.BlocksCrashedCount;
this.sharedObj.data.BLOCKSCRASHEDCOUNTACHIEVEMENT = this.GameProgress.AchievementsInfo.BLOCKSCRASHEDCOUNTACHIEVEMENT;
this.sharedObj.data.ExploBallsCount = this.GameProgress.AchievementsInfo.ExploBallsCount;
this.sharedObj.data.FIVEEXPLOBALLSACHIEVEMENT = this.GameProgress.AchievementsInfo.FIVEEXPLOBALLSACHIEVEMENT;
this.sharedObj.data.GotBLINDMASTERACHIEVEMENT = this.GameProgress.AchievementsInfo.GotBLINDMASTERACHIEVEMENT;
this.sharedObj.data.GotBLOCKSCRASHEDCOUNTACHIEVEMENT = this.GameProgress.AchievementsInfo.GotBLOCKSCRASHEDCOUNTACHIEVEMENT;
this.sharedObj.data.GotFIVEEXPLOBALLSACHIEVEMENT = this.GameProgress.AchievementsInfo.GotFIVEEXPLOBALLSACHIEVEMENT;
this.sharedObj.data.GotNOBALLSLOSTACHIEVEMENT = this.GameProgress.AchievementsInfo.GotNOBALLSLOSTACHIEVEMENT;
this.sharedObj.data.GotNOWEAPONSACHIEVEMENT = this.GameProgress.AchievementsInfo.GotNOWEAPONSACHIEVEMENT;
this.sharedObj.data.GotSMOOTHPLAYACHIEVEMENT = this.GameProgress.AchievementsInfo.GotSMOOTHPLAYACHIEVEMENT;
this.sharedObj.data.NOBALLSLOSTACHIEVEMENT = this.GameProgress.AchievementsInfo.NOBALLSLOSTACHIEVEMENT;
this.sharedObj.data.NOWEAPONSACHIEVEMENT = this.GameProgress.AchievementsInfo.NOWEAPONSACHIEVEMENT;
this.sharedObj.data.SMOOTHPLAYACHIEVEMENT = this.GameProgress.AchievementsInfo.SMOOTHPLAYACHIEVEMENT;
this.sharedObj.data.TimesPlayed = this.GameProgress.AchievementsInfo.TimesPlayed;
this.sharedObj.flush();
trace("game saved");
}
private function onKingApiInit(_arg1:Event):void{
trace(("onKingApiInit() :" + _arg1.type));
this.m_gameFrameRate = root.stage.frameRate;
root.stage.frameRate = 30;
this.playLoaderMovie();
}
private function initKongApi():void{
}
private function kongInitLoadComplete(_arg1:Event):void{
}
private function gotoGame():void{
root.stage.frameRate = this.m_gameFrameRate;
this.m_rootRef.gotoAndStop(2);
}
private function tweenTransformCrown(_arg1:TweenEvent):void{
this.m_waveEngineCrown.colorUpdate(this.interpolateColor(this.m_startColor, this.m_endColor, this.m_tween.position).color);
}
}
}//package
Section 287
//particlesManager (particlesManager)
package {
import flash.display.*;
import flash.geom.*;
public class particlesManager {
private var _parentGP:gameplay;
private var _levelMC:MovieClip;
public function particlesManager(_arg1:MovieClip, _arg2:gameplay){
this._levelMC = _arg1;
this._parentGP = _arg2;
}
public function SpawnSparks(_arg1:Point, _arg2:Point){
}
}
}//package
Section 288
//PhysVals (PhysVals)
package {
import Box2D.Dynamics.*;
public class PhysVals {
public static const RATIO:Number = 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
Section 289
//pinballBouncerActor (pinballBouncerActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class pinballBouncerActor extends Actor {
private var initialPoint:Point;
public function pinballBouncerActor(_arg1:gameplay, _arg2:b2Body, _arg3:DisplayObject){
this.initialPoint = new Point(_arg3.x, _arg3.y);
super(_arg1, _arg2, _arg3);
}
override protected function childSpecificUpdating():void{
var _local1:b2Vec2;
var _local2:b2Vec2;
_local1 = new b2Vec2(this.initialPoint.x, this.initialPoint.y);
_local2 = new b2Vec2((_local1.x - _costume.x), (_local1.y - _costume.y));
_local2.Multiply(_parentGP.stage.frameRate);
_local2.Multiply((1 / PhysVals.RATIO));
_body.SetLinearVelocity(_local2);
super.childSpecificUpdating();
}
}
}//package
Section 290
//quitConfirmator (quitConfirmator)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import flash.geom.*;
import gs.events.*;
public class quitConfirmator extends MovieClip {
public var yesBtn:MovieClip;
private var _noBtn:MovieClip;
private var _yesBtn:MovieClip;
private var _parentGP:gameplay;
private var _mainTween:TweenMax;
public var noBtn:MovieClip;
public function quitConfirmator(_arg1:Point, _arg2:gameplay){
this._parentGP = _arg2;
x = _arg1.x;
y = _arg1.y;
this._mainTween = TweenMax.to(this, 0.5, {y:225});
this._mainTween.addEventListener(TweenEvent.COMPLETE, this.OutComplete);
}
private function noClick(_arg1:MouseEvent):void{
this._parentGP.SoundManager.PlayButtonClick();
this._parentGP.CancelQuit();
this.cleanup();
}
private function OutComplete(_arg1:TweenEvent):void{
this._mainTween.removeEventListener(TweenEvent.COMPLETE, this.OutComplete);
this._yesBtn = this.yesBtn;
this._yesBtn.buttonMode = true;
this._noBtn = this.noBtn;
this._noBtn.buttonMode = true;
this._yesBtn.addEventListener(MouseEvent.CLICK, this.yesClick);
this._noBtn.addEventListener(MouseEvent.CLICK, this.noClick);
}
private function OffComplete(_arg1:TweenEvent):void{
this._mainTween.removeEventListener(TweenEvent.COMPLETE, this.OffComplete);
this._parentGP.removeChild(this);
}
private function cleanup():void{
this._mainTween = TweenMax.to(this, 0.5, {y:-150});
this._mainTween.addEventListener(TweenEvent.COMPLETE, this.OffComplete);
}
private function yesClick(_arg1:MouseEvent):void{
this._parentGP.SoundManager.PlayButtonClick();
this._parentGP.ForceQuit();
this.cleanup();
}
}
}//package
Section 291
//rapidBullet (rapidBullet)
package {
import flash.display.*;
public dynamic class rapidBullet extends MovieClip {
}
}//package
Section 292
//rapidshot_shot (rapidshot_shot)
package {
import flash.media.*;
public dynamic class rapidshot_shot extends Sound {
}
}//package
Section 293
//reflectBan (reflectBan)
package {
import flash.display.*;
public dynamic class reflectBan extends MovieClip {
public var c1:MovieClip;
public var _mc:MovieClip;
public var c2:MovieClip;
}
}//package
Section 294
//resetConfirmatorMC (resetConfirmatorMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
public class resetConfirmatorMC extends MovieClip {
public var yesBtn:MovieClip;
private var _noBtn:MovieClip;
private var _yesBtn:MovieClip;
private var _soundManager:soundManager;
private var _parentLevelSelection:levelSelection;
var _twm:TweenMax;
public var noBtn:MovieClip;
public function resetConfirmatorMC(_arg1:levelSelection, _arg2:soundManager){
this._parentLevelSelection = _arg1;
this._soundManager = _arg2;
alpha = 0;
TweenLite.to(this, 0.3, {alpha:1});
this.initControls();
}
private function achOff(_arg1:Event):void{
this._twm.removeEventListener(TweenEvent.COMPLETE, this.achOff);
parent.removeChild(this);
}
private function noClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._twm = TweenMax.to(this, 0.3, {alpha:0});
this._twm.addEventListener(TweenEvent.COMPLETE, this.achOff);
this._parentLevelSelection.faderOut();
}
private function yesClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._twm = TweenMax.to(this, 0.3, {alpha:0});
this._twm.addEventListener(TweenEvent.COMPLETE, this.achOff);
this._parentLevelSelection.ResetProgress();
this._parentLevelSelection.faderOut();
}
private function initControls():void{
this._yesBtn = this.yesBtn;
this._yesBtn.buttonMode = true;
this._noBtn = this.noBtn;
this._noBtn.buttonMode = true;
this._yesBtn.addEventListener(MouseEvent.CLICK, this.yesClick);
this._noBtn.addEventListener(MouseEvent.CLICK, this.noClick);
}
}
}//package
Section 295
//rocket (rocket)
package {
import flash.display.*;
public dynamic class rocket extends MovieClip {
}
}//package
Section 296
//rocket_shot (rocket_shot)
package {
import flash.media.*;
public dynamic class rocket_shot extends Sound {
}
}//package
Section 297
//rocketActor (rocketActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import Box2D.Collision.Shapes.*;
public class rocketActor extends Actor {
public var Exploded:Boolean;// = false
public function rocketActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2PolygonDef;
var _local6:b2BodyDef;
var _local7:b2Body;
Exploded = false;
_local4 = new rocket();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2PolygonDef();
_local5.SetAsBox(((_local4.width / 2) / PhysVals.RATIO), ((_local4.height / 2) / PhysVals.RATIO));
_local5.density = 1;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BULLETS;
_local5.filter.maskBits = (((((0xFFFF & ~(collisionBits.THINGS_BONUSES_SHOULD_COLLIDE_WITH)) & ~(collisionBits.BULLETS)) & ~(collisionBits.BALLS)) & ~(collisionBits.SHATTERS)) & ~(collisionBits.BONUSES));
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.isBullet = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
override protected function childSpecificUpdating():void{
_parentGP.addDust(new Point(_costume.x, _costume.y), true);
_body.ApplyForce(new b2Vec2(0, -3.4), _body.GetWorldCenter());
this.checkBounds();
super.childSpecificUpdating();
}
private function checkBounds():void{
if ((((((_costume.x < 11)) || ((_costume.x > 439)))) || ((_costume.y < -11)))){
DeleteFlag = true;
this.Exploded = true;
_parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, 50, 100, new Point(_costume.x, _costume.y), true));
};
}
}
}//package
Section 298
//score_count (score_count)
package {
import flash.media.*;
public dynamic class score_count extends Sound {
}
}//package
Section 299
//scoreAchievementsController (scoreAchievementsController)
package {
public class scoreAchievementsController {
public var MoneyCollected:int;// = 0
public var BonusMoney:int;// = 0
public var Score:int;// = 0
public static const HARDBLOCKMONEYBONUS:int = 15;
public static const SQUAREBLOCKSCORE:int = 200;
public static const TWENTYBLOCKSCRASHEDSCORE:int = 9000;
public static const MONEYBLOCKSCORE:int = 200;
public static const FIVEBLOCKSCRASHEDSCORE:int = 1000;
public static const FOURTYBLOCKSCRASHEDSCORE:int = 25000;
public static const FIVEBLOCKSCRASHEDMONEYBONUS:int = 40;
public static const TENBLOCKSCRASHEDSCORE:int = 3000;
public static const HARDBLOCKSCORE:int = 1000;
public static const TIMEBONUS:int = 10000;
public static const SQUAREBLOCKMONEYBONUS:int = 8;
public static const LIGHTBLOCKSCORE:int = 300;
public static const LIGHTBLOCKMONEYBONUS:int = 5;
public static const MEDIUMBLOCKSCORE:int = 600;
public static const EXPLOBALLSCORE:int = 2000;
public static const TENBLOCKSCRASHEDMONEYBONUS:int = 75;
public static const MONEYBLOCKMONEYBONUS:int = 5;
public static const TWENTYBLOCKSCRASHEDMONEYBONUS:int = 150;
public static const MEDIUMBLOCKMONEYBONUS:int = 10;
public static const FOURTYBLOCKSCRASHEDMONEYBONUS:int = 300;
public static var bonus:int = 0;
public static var scores:int = 0;
public static var levelScore:int = 0;
public function scoreAchievementsController(){
BonusMoney = 0;
Score = 0;
MoneyCollected = 0;
super();
}
}
}//package
Section 300
//scoreZone (scoreZone)
package {
import flash.display.*;
public dynamic class scoreZone extends MovieClip {
}
}//package
Section 301
//sfxBell (sfxBell)
package {
import flash.media.*;
public dynamic class sfxBell extends Sound {
}
}//package
Section 302
//sfxBounce (sfxBounce)
package {
import flash.media.*;
public dynamic class sfxBounce extends Sound {
}
}//package
Section 303
//shatterBlockInfo (shatterBlockInfo)
package {
import Box2D.Common.Math.*;
public class shatterBlockInfo {
public var width:Number;
public var height:Number;
public var ForceHit:Number;
public var x:Number;
public var y:Number;
public var Type:int;// = 0
public var DirectionHit:b2Vec2;
public static const VERYHARD:int = 3;
public static const SIMPLE:int = 1;
public static const HARD:int = 2;
public function shatterBlockInfo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:b2Vec2, _arg7:Number){
Type = 0;
super();
this.x = _arg1;
this.y = _arg2;
this.width = _arg3;
this.height = _arg4;
this.Type = _arg5;
this.DirectionHit = _arg6;
this.ForceHit = _arg7;
}
}
}//package
Section 304
//shatterBlockMoneyInfo (shatterBlockMoneyInfo)
package {
import flash.display.*;
import Box2D.Common.Math.*;
public class shatterBlockMoneyInfo {
public var width:Number;
public var height:Number;
public var ForceHit:Number;
public var DirectionHit:b2Vec2;
public var x:Number;
public var y:Number;
public function shatterBlockMoneyInfo(_arg1:MovieClip, _arg2:b2Vec2, _arg3:Number){
this.x = _arg1.x;
this.y = _arg1.y;
this.width = _arg1.width;
this.height = _arg1.height;
this.DirectionHit = _arg2;
this.ForceHit = _arg3;
}
}
}//package
Section 305
//shatterParticle (shatterParticle)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class shatterParticle extends MovieClip {
private var disapperaCounter:int;// = 30
private var speedX:Number;
private var speedY:Number;
public function shatterParticle(_arg1:Point, _arg2:int){
var _local3:MovieClip;
var _local4:Number;
var _local5:Number;
disapperaCounter = 30;
super();
x = _arg1.x;
y = _arg1.y;
switch (_arg2){
case squareBlockActor.RED:
_local3 = new squareBlockRedShatterPiece();
break;
case squareBlockActor.BROWN:
_local3 = new squareBlockBrownShatterPiece();
break;
case squareBlockActor.ORANGE:
_local3 = new squareBlockOrangeShatterPiece();
break;
case squareBlockActor.GREEN:
_local3 = new squareBlockGreenShatterPiece();
break;
case squareBlockActor.BLUE:
_local3 = new squareBlockBlueShatterPiece();
break;
case squareBlockActor.YELLOW:
_local3 = new squareBlockYellowShatterPiece();
break;
case squareBlockActor.VIOLET:
_local3 = new squareBlockVioletShatterPiece();
break;
case squareBlockActor.LIGHTBLUE:
_local3 = new squareBlockLightBlueShatterPiece();
break;
case squareBlockActor.BLACK:
_local3 = new squareBlockBlackShatterPiece();
break;
case squareBlockActor.WHITE:
_local3 = new squareBlockWhiteShatterPiece();
break;
case 111:
_local3 = new squareBlockMoneyShatterPiece();
break;
};
addChild(_local3);
scaleX = 0.7;
scaleY = 0.7;
_local4 = (((Math.random() * 360) * Math.PI) / 180);
_local5 = ((Math.random() * 2) + 1);
this.speedX = (Math.sin(_local4) * _local5);
this.speedY = (Math.cos(_local4) * _local5);
addEventListener(Event.ENTER_FRAME, this.entFr);
}
private function entFr(_arg1:Event):void{
x = (x + this.speedX);
y = (y + this.speedY);
this.disapperaCounter--;
alpha = (this.disapperaCounter / 30);
if (this.disapperaCounter == 0){
removeEventListener(Event.ENTER_FRAME, this.entFr);
parent.removeChild(this);
};
}
}
}//package
Section 306
//shatterPieceActor (shatterPieceActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class shatterPieceActor extends Actor {
private var _lifetimeCounter:int;// = 50
public static const HARD_SHATTER:int = 2;
public static const VERYHARD_SHATTER:int = 3;
public static const SIMPLE_SHATTER:int = 1;
public function shatterPieceActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point, _arg4:int){
var _local5:MovieClip;
var _local6:b2PolygonDef;
var _local7:b2BodyDef;
var _local8:b2Body;
_lifetimeCounter = 50;
switch (_arg4){
case SIMPLE_SHATTER:
_local5 = new simpleBlockShatterPiece();
break;
case HARD_SHATTER:
_local5 = new hardBlockShatterPiece();
break;
case VERYHARD_SHATTER:
_local5 = new veryHardBlockShatterPiece();
break;
};
_local5.x = _arg3.x;
_local5.y = _arg3.y;
_arg2.addChild(_local5);
_local6 = new b2PolygonDef();
_local6.SetAsBox(((_local5.width / 2) / PhysVals.RATIO), ((_local5.height / 2) / PhysVals.RATIO));
_local6.density = 0.5;
_local6.friction = 0.5;
_local6.restitution = 0.5;
_local6.filter.categoryBits = collisionBits.SHATTERS;
_local6.filter.maskBits = (0xFFFF & ~(collisionBits.SHATTERS));
_local7 = new b2BodyDef();
_local7.position.Set((_local5.x / PhysVals.RATIO), (_local5.y / PhysVals.RATIO));
_local8 = PhysVals.world.CreateBody(_local7);
_local8.CreateShape(_local6);
_local8.SetMassFromShapes();
super(_arg1, _local8, _local5);
}
override protected function childSpecificUpdating():void{
this._lifetimeCounter--;
if (this._lifetimeCounter < 20){
_costume.alpha = (this._lifetimeCounter / 20);
};
if (this._lifetimeCounter <= 0){
DeleteFlag = true;
};
super.childSpecificUpdating();
}
}
}//package
Section 307
//shatterPieceSquareActor (shatterPieceSquareActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class shatterPieceSquareActor extends Actor {
private var _lifetimeCounter:int;// = 50
public function shatterPieceSquareActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point, _arg4:int, _arg5:Number){
var _local6:MovieClip;
var _local7:b2PolygonDef;
var _local8:b2BodyDef;
var _local9:b2Body;
_lifetimeCounter = 50;
switch (_arg4){
case squareBlockActor.RED:
_local6 = new squareBlockRedShatterPiece();
break;
case squareBlockActor.BROWN:
_local6 = new squareBlockBrownShatterPiece();
break;
case squareBlockActor.ORANGE:
_local6 = new squareBlockOrangeShatterPiece();
break;
case squareBlockActor.GREEN:
_local6 = new squareBlockGreenShatterPiece();
break;
case squareBlockActor.BLUE:
_local6 = new squareBlockBlueShatterPiece();
break;
case squareBlockActor.YELLOW:
_local6 = new squareBlockYellowShatterPiece();
break;
case squareBlockActor.VIOLET:
_local6 = new squareBlockVioletShatterPiece();
break;
case squareBlockActor.LIGHTBLUE:
_local6 = new squareBlockLightBlueShatterPiece();
break;
case squareBlockActor.BLACK:
_local6 = new squareBlockBlackShatterPiece();
break;
case squareBlockActor.WHITE:
_local6 = new squareBlockWhiteShatterPiece();
break;
};
_local6.x = _arg3.x;
_local6.y = _arg3.y;
_local6.height = _arg5;
_local6.width = _arg5;
_arg2.addChild(_local6);
_local7 = new b2PolygonDef();
_local7.SetAsBox(((_local6.width / 2) / PhysVals.RATIO), ((_local6.height / 2) / PhysVals.RATIO));
_local7.density = 0.5;
_local7.friction = 0.5;
_local7.restitution = 0.5;
_local7.filter.categoryBits = collisionBits.SHATTERS;
_local7.filter.maskBits = collisionBits.WALLS;
_local8 = new b2BodyDef();
_local8.position.Set((_local6.x / PhysVals.RATIO), (_local6.y / PhysVals.RATIO));
_local9 = PhysVals.world.CreateBody(_local8);
_local9.CreateShape(_local7);
_local9.SetMassFromShapes();
super(_arg1, _local9, _local6);
}
override protected function childSpecificUpdating():void{
this._lifetimeCounter--;
if (this._lifetimeCounter < 20){
_costume.alpha = (this._lifetimeCounter / 20);
};
if (this._lifetimeCounter <= 0){
DeleteFlag = true;
};
super.childSpecificUpdating();
}
}
}//package
Section 308
//shatterSquareBlockInfo (shatterSquareBlockInfo)
package {
import Box2D.Common.Math.*;
public class shatterSquareBlockInfo {
public var width:Number;
public var height:Number;
public var ForceHit:Number;
public var HitByExplosion:Boolean;// = false
public var HitByWeapon:Boolean;// = false
public var x:Number;
public var y:Number;
public var Type:int;// = 0
public var DirectionHit:b2Vec2;
public function shatterSquareBlockInfo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:int, _arg6:b2Vec2, _arg7:Number, _arg8:Boolean, _arg9:Boolean){
HitByExplosion = false;
HitByWeapon = false;
Type = 0;
super();
this.HitByExplosion = _arg9;
this.x = _arg1;
this.y = _arg2;
this.width = _arg3;
this.height = _arg4;
this.Type = _arg5;
this.DirectionHit = _arg6;
this.ForceHit = _arg7;
this.HitByWeapon = _arg8;
}
}
}//package
Section 309
//shitFuck (shitFuck)
package {
import flash.display.*;
public dynamic class shitFuck extends MovieClip {
}
}//package
Section 310
//shootMessage (shootMessage)
package {
import flash.display.*;
public dynamic class shootMessage extends MovieClip {
}
}//package
Section 311
//shop_buy (shop_buy)
package {
import flash.media.*;
public dynamic class shop_buy extends Sound {
}
}//package
Section 312
//shop_cantbuy (shop_cantbuy)
package {
import flash.media.*;
public dynamic class shop_cantbuy extends Sound {
}
}//package
Section 313
//shopMC (shopMC)
package {
import flash.display.*;
import gs.*;
import flash.events.*;
import gs.events.*;
import gs.easing.*;
import flash.text.*;
public class shopMC extends MovieClip {
private var _speedShotAmmoTxt:TextField;
public var spreadshotBullets:MovieClip;
public var buySpreadshot:MovieClip;
private var _buySpreadshot:MovieClip;
private var _BallCountUpgrade:MovieClip;
private var _clickShotAmmoTxt:TextField;
private var gameProgress:gameProgressInfo;
private var _speedShotAmmo:MovieClip;
private var _clickshotDamage:MovieClip;
private var _speedshotDamage:MovieClip;
private var _exploShotAmmoTxt:TextField;
private var _exploshotRadius:MovieClip;
public var speedShotAmmo:MovieClip;
public var hintTxt:TextField;
private var _spreadShotAmmoTxt:TextField;
private var _buyClickshot:MovieClip;
public var speedShotFrequency:MovieClip;
public var exploshotRadius:MovieClip;
public var speedshotDamage:MovieClip;
public var clickshotDamage:MovieClip;
public var clickShotAmmo:MovieClip;
private var _parentLevelSelection:levelSelection;
public var buyClickshot:MovieClip;
private var _clickShotAmmo:MovieClip;
private var _backBtn:MovieClip;
public var spreadshotDamage:MovieClip;
private var _moneyTxt:TextField;
public var spreadShotAmmoTxt:TextField;
private var _speedShotFrequency:MovieClip;
private var _spreadshotDamage:MovieClip;
private var _exploshotDamage:MovieClip;
private var _hintTxt:TextField;
private var _BallDamageUpgrade:MovieClip;
private var _buyExploshot:MovieClip;
private var _exploShotAmmo:MovieClip;
public var exploShotAmmo:MovieClip;
public var exploshotDamage:MovieClip;
private var _tween:TweenMax;
public var buyExploshot:MovieClip;
private var _soundManager:soundManager;
public var spreadShotAmmo:MovieClip;
private var _spreadshotBullets:MovieClip;
public var moneyTxt:TextField;
private var _spreadShotAmmo:MovieClip;
public var speedShotAmmoTxt:TextField;
private var _buySpeedshot:MovieClip;
public var clickShotAmmoTxt:TextField;
public var BallCountUpgrade:MovieClip;
public var BallDamageUpgrade:MovieClip;
public var buySpeedshot:MovieClip;
public var exploShotAmmoTxt:TextField;
public var backBtn:MovieClip;
public static const SPREADBULLETSINCREASE:int = 10;
public static const EXPLOBULLETSINCREASE:int = 2;
public static const RAPIDBULLETSINCREASE:int = 50;
public static const PISTOLBULLETSINCREASE:int = 15;
public function shopMC(_arg1:levelSelection, _arg2:soundManager){
this._parentLevelSelection = _arg1;
this._soundManager = _arg2;
this._tween = TweenMax.to(this, 0.5, {y:75});
this._tween.addEventListener(TweenEvent.COMPLETE, this.shopOut);
this.initControls();
this.readCurrentStats();
}
private function buyWeaponClick(_arg1:MouseEvent):void{
if (_arg1.target == this._buyClickshot){
this._soundManager.PlayShopCantBuy();
};
if (_arg1.target == this._buySpreadshot){
if (this._buySpreadshot.currentFrame == 1){
if (this.gameProgress.Money >= gameProgressInfo.SPREADCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADCOST);
this.gameProgress.SpreadGunAvailable = true;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Spreadshot already available.");
} else {
this._soundManager.PlayShopCantBuy();
};
};
};
if (_arg1.target == this._buySpeedshot){
if (this._buySpeedshot.currentFrame == 1){
if (this.gameProgress.Money >= gameProgressInfo.RAPIDCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDCOST);
this.gameProgress.RapidGunAvailable = true;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Rapidshot already available.");
} else {
this._soundManager.PlayShopCantBuy();
};
};
};
if (_arg1.target == this._buyExploshot){
if (this._buyExploshot.currentFrame == 1){
if (this.gameProgress.Money >= gameProgressInfo.ROCKETCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.ROCKETCOST);
this.gameProgress.RocketGunAvailable = true;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Exploshot already available.");
} else {
this._soundManager.PlayShopCantBuy();
};
};
};
}
private function shopOut(_arg1:TweenEvent):void{
this._tween.removeEventListener(TweenEvent.COMPLETE, this.shopOut);
this.setupControlsListeners();
}
private function bduRollOver(_arg1:MouseEvent):void{
switch (this.gameProgress.BallsDamageLevel){
case 1:
this.SetHintText((("Ball damage upgrade. " + gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[0].toString()) + "$"));
break;
case 2:
this.SetHintText((("Ball damage upgrade. " + gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[1].toString()) + "$"));
break;
case 3:
this.SetHintText((("Ball damage upgrade. " + gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[2].toString()) + "$"));
break;
case 4:
this.SetHintText("Ball damage upgrade. MAXIMUM");
break;
};
}
private function buyUpgradeClick(_arg1:MouseEvent):void{
if (_arg1.target == this._clickshotDamage){
switch (this.gameProgress.PistolDamageLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[0]);
this.gameProgress.PistolDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Clickshot damage upgrade. " + gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[1]);
this.gameProgress.PistolDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Clickshot damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
if ((((_arg1.target == this._spreadshotDamage)) || ((_arg1.target == this._spreadshotBullets)))){
if (this.gameProgress.SpreadGunAvailable){
if (_arg1.target == this._spreadshotDamage){
switch (this.gameProgress.SpreadGunDamageLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[0]);
this.gameProgress.SpreadGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Spreadshot damage upgrade. " + gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[1]);
this.gameProgress.SpreadGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Spreadshot damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
if (_arg1.target == this._spreadshotBullets){
switch (this.gameProgress.SpreadGunNumBulletsLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[0]);
this.gameProgress.SpreadGunNumBulletsLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Spreadshot bullet count upgrade. " + gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[1]);
this.gameProgress.SpreadGunNumBulletsLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Spreadshot bullet count upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
};
};
if ((((_arg1.target == this._speedshotDamage)) || ((_arg1.target == this._speedShotFrequency)))){
if (this.gameProgress.RapidGunAvailable){
if (_arg1.target == this._speedshotDamage){
switch (this.gameProgress.RapidGunDamageLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[0]);
this.gameProgress.RapidGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Rapidshot damage upgrade. " + gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[1]);
this.gameProgress.RapidGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Rapidhot damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
if (_arg1.target == this._speedShotFrequency){
switch (this.gameProgress.RapidGunFrequencyLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[0]);
this.gameProgress.RapidGunFrequencyLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Rapidhot rate upgrade. " + gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[1]);
this.gameProgress.RapidGunFrequencyLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Rapidshot rate upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
};
};
if ((((_arg1.target == this._exploshotDamage)) || ((_arg1.target == this._exploshotRadius)))){
if (this.gameProgress.RocketGunAvailable){
if (_arg1.target == this._exploshotDamage){
switch (this.gameProgress.ExploGunDamageLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[0]);
this.gameProgress.ExploGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Exploshot damage upgrade. " + gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[1]);
this.gameProgress.ExploGunDamageLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Exploshot damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
if (_arg1.target == this._exploshotRadius){
switch (this.gameProgress.ExploGunRadiusLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[0]);
this.gameProgress.ExploGunRadiusLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText((("Exploshot damage upgrade. " + gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[1]);
this.gameProgress.ExploGunRadiusLevel++;
this.readCurrentStats();
this._soundManager.PlayShopBuy();
this.SetHintText("Exploshot damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
this._soundManager.PlayShopCantBuy();
break;
};
};
};
};
}
private function shopOff(_arg1:TweenEvent):void{
this._tween.removeEventListener(TweenEvent.COMPLETE, this.shopOff);
parent.removeChild(this);
}
private function bcuRollOut(_arg1:MouseEvent):void{
this.SetHintText("");
}
private function buyAmmoRollOut(_arg1:MouseEvent):void{
this.SetHintText("");
}
public function SetHintText(_arg1:String){
this._hintTxt.text = _arg1;
}
private function backClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
this._tween = TweenMax.to(this, 0.5, {y:700});
this._tween.addEventListener(TweenEvent.COMPLETE, this.shopOff);
this._parentLevelSelection.faderOut();
}
private function buyWeaponRollOut(_arg1:MouseEvent):void{
this.SetHintText("");
}
private function setupControlsListeners():void{
var _local1:MovieClip;
var _local2:MovieClip;
var _local3:MovieClip;
var _local4:Array;
var _local5:Array;
var _local6:Array;
this._backBtn.addEventListener(MouseEvent.CLICK, this.backClick);
_local4 = [this._buyClickshot, this._buySpreadshot, this._buySpeedshot, this._buyExploshot];
_local5 = [this._clickshotDamage, this._spreadshotBullets, this._spreadshotDamage, this._speedShotFrequency, this._speedshotDamage, this._exploshotRadius, this._exploshotDamage];
_local6 = [this._clickShotAmmo, this._spreadShotAmmo, this._speedShotAmmo, this._exploShotAmmo];
for each (_local1 in _local4) {
_local1.buttonMode = true;
_local1.addEventListener(MouseEvent.CLICK, this.buyWeaponClick);
_local1.addEventListener(MouseEvent.ROLL_OVER, this.buyWeaponRollOver);
_local1.addEventListener(MouseEvent.ROLL_OUT, this.buyWeaponRollOut);
};
for each (_local2 in _local5) {
_local2.buttonMode = true;
_local2.addEventListener(MouseEvent.ROLL_OVER, this.upgradeRollOver);
_local2.addEventListener(MouseEvent.ROLL_OUT, this.upgradeRollOut);
_local2.addEventListener(MouseEvent.CLICK, this.buyUpgradeClick);
};
for each (_local3 in _local6) {
_local3.buttonMode = true;
_local3.addEventListener(MouseEvent.CLICK, this.buyAmmoClick);
_local3.addEventListener(MouseEvent.ROLL_OVER, this.buyAmmoRollOver);
_local3.addEventListener(MouseEvent.ROLL_OUT, this.buyAmmoRollOut);
};
this._BallCountUpgrade.buttonMode = true;
this._BallCountUpgrade.addEventListener(MouseEvent.CLICK, this.ballsCountUpgradeClick);
this._BallCountUpgrade.addEventListener(MouseEvent.ROLL_OVER, this.bcuRollOver);
this._BallCountUpgrade.addEventListener(MouseEvent.ROLL_OUT, this.bcuRollOut);
this._BallDamageUpgrade.buttonMode = true;
this._BallDamageUpgrade.addEventListener(MouseEvent.CLICK, this.ballsDamageUpgradeClick);
this._BallDamageUpgrade.addEventListener(MouseEvent.ROLL_OVER, this.bduRollOver);
this._BallDamageUpgrade.addEventListener(MouseEvent.ROLL_OUT, this.bduRollOut);
}
private function upgradeRollOver(_arg1:MouseEvent):void{
if (_arg1.target == this._clickshotDamage){
if (this.gameProgress.PistolDamageLevel == 1){
this.SetHintText((("Clickshot damage upgrade. " + gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.PistolDamageLevel == 2){
this.SetHintText((("Clickshot damage upgrade. " + gameProgressInfo.PISTOLDAMAGEUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.PistolDamageLevel == 3){
this.SetHintText("Clickshot damage upgrade. MAXIMUM");
};
};
if (_arg1.target == this._spreadshotDamage){
if (!this.gameProgress.SpreadGunAvailable){
this.SetHintText("Buy spreadshot first.");
return;
};
if (this.gameProgress.SpreadGunDamageLevel == 1){
this.SetHintText((("Spreadshot damage upgrade." + gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.SpreadGunDamageLevel == 2){
this.SetHintText((("Spreadshot damage upgrade." + gameProgressInfo.SPREADGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.SpreadGunDamageLevel == 3){
this.SetHintText("Spreadshot damage upgrade. MAXIMUM");
};
};
if (_arg1.target == this._spreadshotBullets){
if (!this.gameProgress.SpreadGunAvailable){
this.SetHintText("Buy spreadshot first.");
return;
};
if (this.gameProgress.SpreadGunNumBulletsLevel == 1){
this.SetHintText((("Spreadshot bullet count upgrade. " + gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.SpreadGunNumBulletsLevel == 2){
this.SetHintText((("Spreadshot bullet count upgrade. " + gameProgressInfo.SPREADGUNNUMBULLETSUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.SpreadGunNumBulletsLevel == 3){
this.SetHintText("Spreadshot bullet count upgrade. MAXIMUM");
};
};
if (_arg1.target == this._speedshotDamage){
if (!this.gameProgress.RapidGunAvailable){
this.SetHintText("Buy rapidshot first.");
return;
};
if (this.gameProgress.RapidGunDamageLevel == 1){
this.SetHintText((("Rapidshot damage upgrade. " + gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.RapidGunDamageLevel == 2){
this.SetHintText((("Rapidshot damage upgrade. " + gameProgressInfo.RAPIDGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.RapidGunDamageLevel == 3){
this.SetHintText("Rapidshot damage upgrade. MAXIMUM");
};
};
if (_arg1.target == this._speedShotFrequency){
if (!this.gameProgress.RapidGunAvailable){
this.SetHintText("Buy rapidshot first.");
return;
};
if (this.gameProgress.RapidGunFrequencyLevel == 1){
this.SetHintText((("Rapidshot rate upgrade. " + gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.RapidGunFrequencyLevel == 2){
this.SetHintText((("Rapidshot rate upgrade. " + gameProgressInfo.RAPIDGUNFREQUENCYUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.RapidGunFrequencyLevel == 3){
this.SetHintText("Rapidshot rate upgrade. MAXIMUM");
};
};
if (_arg1.target == this._exploshotDamage){
if (!this.gameProgress.RocketGunAvailable){
this.SetHintText("Buy exploshot first.");
return;
};
if (this.gameProgress.ExploGunDamageLevel == 1){
this.SetHintText((("Exploshot damage upgrade. " + gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.ExploGunDamageLevel == 2){
this.SetHintText((("Exploshot damage upgrade. " + gameProgressInfo.EXPLOGUNDAMAGEUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.ExploGunDamageLevel == 3){
this.SetHintText("Exploshot damage upgrade. MAXIMUM");
};
};
if (_arg1.target == this._exploshotRadius){
if (!this.gameProgress.RocketGunAvailable){
this.SetHintText("Buy exploshot first.");
return;
};
if (this.gameProgress.ExploGunRadiusLevel == 1){
this.SetHintText((("Exploshot radius upgrade. " + gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[0].toString()) + "$"));
};
if (this.gameProgress.ExploGunRadiusLevel == 2){
this.SetHintText((("Exploshot radius upgrade. " + gameProgressInfo.EXPLOGUNRADIUSUPGRADECOSTS[1].toString()) + "$"));
};
if (this.gameProgress.ExploGunRadiusLevel == 3){
this.SetHintText("Exploshot radius upgrade. MAXIMUM");
};
};
}
private function ballsDamageUpgradeClick(_arg1:MouseEvent):void{
switch (this.gameProgress.BallsDamageLevel){
case 1:
if (this.gameProgress.Money >= gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[0]);
this.gameProgress.BallsDamageLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText((("Ball damage upgrade. " + gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 2:
if (this.gameProgress.Money >= gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[1]);
this.gameProgress.BallsDamageLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText((("Ball damage upgrade. " + gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[2].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 3:
if (this.gameProgress.Money >= gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[2]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSDAMAGEUPGRADECOSTS[2]);
this.gameProgress.BallsDamageLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText("Ball damage upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 4:
this._soundManager.PlayShopCantBuy();
break;
};
this.readCurrentStats();
}
private function buyWeaponRollOver(_arg1:MouseEvent):void{
if (_arg1.target == this._buyClickshot){
this.SetHintText("Clickshot available already.");
};
if (_arg1.target == this._buySpreadshot){
if (this.gameProgress.SpreadGunAvailable){
this.SetHintText("Spreadshot already available.");
} else {
this.SetHintText((("Buy spreadshot. " + gameProgressInfo.SPREADCOST.toString()) + "$"));
};
};
if (_arg1.target == this._buySpeedshot){
if (this.gameProgress.RapidGunAvailable){
this.SetHintText("Speedshot already available.");
} else {
this.SetHintText((("Buy speedshot. " + gameProgressInfo.RAPIDCOST.toString()) + "$"));
};
};
if (_arg1.target == this._buyExploshot){
if (this.gameProgress.RocketGunAvailable){
this.SetHintText("Exploshot already available.");
} else {
this.SetHintText((("Buy exploshot. " + gameProgressInfo.ROCKETCOST.toString()) + "$"));
};
};
}
private function readCurrentStats():void{
this.gameProgress = this._parentLevelSelection.GetParkanoidMain().GameProgress;
this._moneyTxt.text = (this.gameProgress.Money.toString() + "$");
this._buyClickshot.visible = false;
this._buyClickshot.mouseEnabled = false;
this._clickshotDamage.gotoAndStop(this.gameProgress.PistolDamageLevel);
if (this.gameProgress.SpreadGunAvailable){
this._buySpreadshot.visible = false;
this._buySpreadshot.mouseEnabled = false;
} else {
if (this.gameProgress.Money < gameProgressInfo.SPREADCOST){
this._buySpreadshot.gotoAndStop(2);
};
};
this._spreadshotDamage.gotoAndStop(this.gameProgress.SpreadGunDamageLevel);
this._spreadshotBullets.gotoAndStop(this.gameProgress.SpreadGunNumBulletsLevel);
if (this.gameProgress.RapidGunAvailable){
this._buySpeedshot.visible = false;
this._buySpeedshot.mouseEnabled = false;
} else {
if (this.gameProgress.Money < gameProgressInfo.RAPIDCOST){
this._buySpeedshot.gotoAndStop(2);
};
};
this._speedshotDamage.gotoAndStop(this.gameProgress.RapidGunDamageLevel);
this._speedShotFrequency.gotoAndStop(this.gameProgress.RapidGunFrequencyLevel);
if (this.gameProgress.RocketGunAvailable){
this._buyExploshot.visible = false;
this._buyExploshot.mouseEnabled = false;
} else {
if (this.gameProgress.Money < gameProgressInfo.ROCKETCOST){
this._buyExploshot.gotoAndStop(2);
};
};
this._exploshotDamage.gotoAndStop(this.gameProgress.ExploGunDamageLevel);
this._exploshotRadius.gotoAndStop(this.gameProgress.ExploGunRadiusLevel);
this._clickShotAmmoTxt.text = this.gameProgress.PistolAmmo.toString();
this._spreadShotAmmoTxt.text = this.gameProgress.SpreadGunAmmo.toString();
this._speedShotAmmoTxt.text = this.gameProgress.RapidGunAmmo.toString();
this._exploShotAmmoTxt.text = this.gameProgress.RocketGunAmmo.toString();
this._BallDamageUpgrade.gotoAndStop(this.gameProgress.BallsDamageLevel);
this._BallCountUpgrade.gotoAndStop((this.gameProgress.BallsCountLevel - 2));
}
private function bcuRollOver(_arg1:MouseEvent):void{
switch (this.gameProgress.BallsCountLevel){
case 3:
this.SetHintText((("Ball count upgrade. " + gameProgressInfo.BALLSCOUNTUPGRADECOSTS[0].toString()) + "$"));
break;
case 4:
this.SetHintText((("Ball count upgrade. " + gameProgressInfo.BALLSCOUNTUPGRADECOSTS[1].toString()) + "$"));
break;
case 5:
this.SetHintText((("Ball count upgrade. " + gameProgressInfo.BALLSCOUNTUPGRADECOSTS[2].toString()) + "$"));
break;
case 6:
this.SetHintText("Ball count upgrade. MAXIMUM");
break;
};
}
private function ballsCountUpgradeClick(_arg1:MouseEvent):void{
switch (this.gameProgress.BallsCountLevel){
case 3:
if (this.gameProgress.Money >= gameProgressInfo.BALLSCOUNTUPGRADECOSTS[0]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSCOUNTUPGRADECOSTS[0]);
this.gameProgress.BallsCountLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText((("Ball count upgrade. " + gameProgressInfo.BALLSCOUNTUPGRADECOSTS[1].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 4:
if (this.gameProgress.Money >= gameProgressInfo.BALLSCOUNTUPGRADECOSTS[1]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSCOUNTUPGRADECOSTS[1]);
this.gameProgress.BallsCountLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText((("Ball count upgrade. " + gameProgressInfo.BALLSCOUNTUPGRADECOSTS[2].toString()) + "$"));
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 5:
if (this.gameProgress.Money >= gameProgressInfo.BALLSCOUNTUPGRADECOSTS[2]){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.BALLSCOUNTUPGRADECOSTS[2]);
this.gameProgress.BallsCountLevel++;
this._soundManager.PlayShopBuy();
this.SetHintText("Ball count upgrade. MAXIMUM");
} else {
this._soundManager.PlayShopCantBuy();
};
break;
case 6:
this._soundManager.PlayShopCantBuy();
break;
};
this.readCurrentStats();
}
private function buyAmmoRollOver(_arg1:MouseEvent):void{
if (_arg1.target == this._clickShotAmmo){
this.SetHintText((("Buy clickshot ammo. " + gameProgressInfo.PISTOLAMMOCOST.toString()) + "$"));
};
if (_arg1.target == this._spreadShotAmmo){
if (this.gameProgress.SpreadGunAvailable){
this.SetHintText((("Buy spreadxhot ammo. " + gameProgressInfo.SPREADAMMOCOST.toString()) + "$"));
} else {
this.SetHintText("Buy spreadshot first.");
};
};
if (_arg1.target == this._speedShotAmmo){
if (this.gameProgress.RapidGunAvailable){
this.SetHintText((("Buy rapidshot ammo. " + gameProgressInfo.RAPIDAMMOCOST.toString()) + "$"));
} else {
this.SetHintText("Buy rapidshot first.");
};
};
if (_arg1.target == this._exploShotAmmo){
if (this.gameProgress.RocketGunAvailable){
this.SetHintText((("Buy exploshot ammo. " + gameProgressInfo.ROCKETAMMOCOST.toString()) + "$"));
} else {
this.SetHintText("Buy exploshot first.");
};
};
}
private function bduRollOut(_arg1:MouseEvent):void{
this.SetHintText("");
}
private function buyAmmoClick(_arg1:MouseEvent):void{
if (_arg1.target == this._clickShotAmmo){
if (this.gameProgress.PistolAvailable){
if (this.gameProgress.Money >= gameProgressInfo.PISTOLAMMOCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.PISTOLAMMOCOST);
this.gameProgress.PistolAmmo = (this.gameProgress.PistolAmmo + PISTOLBULLETSINCREASE);
this.readCurrentStats();
this._soundManager.PlayShopBuy();
} else {
this._soundManager.PlayShopCantBuy();
};
};
} else {
if (_arg1.target == this._spreadShotAmmo){
if (this.gameProgress.SpreadGunAvailable){
if (this.gameProgress.Money >= gameProgressInfo.SPREADAMMOCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.SPREADAMMOCOST);
this.gameProgress.SpreadGunAmmo = (this.gameProgress.SpreadGunAmmo + SPREADBULLETSINCREASE);
this.readCurrentStats();
this._soundManager.PlayShopBuy();
} else {
this._soundManager.PlayShopCantBuy();
};
};
} else {
if (_arg1.target == this._speedShotAmmo){
if (this.gameProgress.RapidGunAvailable){
if (this.gameProgress.Money >= gameProgressInfo.RAPIDAMMOCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.RAPIDAMMOCOST);
this.gameProgress.RapidGunAmmo = (this.gameProgress.RapidGunAmmo + RAPIDBULLETSINCREASE);
this.readCurrentStats();
this._soundManager.PlayShopBuy();
} else {
this._soundManager.PlayShopCantBuy();
};
};
} else {
if (_arg1.target == this._exploShotAmmo){
if (this.gameProgress.RocketGunAvailable){
if (this.gameProgress.Money >= gameProgressInfo.ROCKETAMMOCOST){
this.gameProgress.Money = (this.gameProgress.Money - gameProgressInfo.ROCKETAMMOCOST);
this.gameProgress.RocketGunAmmo = (this.gameProgress.RocketGunAmmo + EXPLOBULLETSINCREASE);
this.readCurrentStats();
this._soundManager.PlayShopBuy();
} else {
this._soundManager.PlayShopCantBuy();
};
};
};
};
};
};
}
private function upgradeRollOut(_arg1:MouseEvent):void{
this.SetHintText("");
this.readCurrentStats();
}
private function initControls():void{
this._backBtn = this.backBtn;
this._backBtn.buttonMode = true;
this._buyClickshot = this.buyClickshot;
this._buySpreadshot = this.buySpreadshot;
this._buySpeedshot = this.buySpeedshot;
this._buyExploshot = this.buyExploshot;
this._clickshotDamage = this.clickshotDamage;
this._spreadshotBullets = this.spreadshotBullets;
this._spreadshotDamage = this.spreadshotDamage;
this._speedShotFrequency = this.speedShotFrequency;
this._speedshotDamage = this.speedshotDamage;
this._exploshotRadius = this.exploshotRadius;
this._exploshotDamage = this.exploshotDamage;
this._clickShotAmmo = this.clickShotAmmo;
this._spreadShotAmmo = this.spreadShotAmmo;
this._speedShotAmmo = this.speedShotAmmo;
this._exploShotAmmo = this.exploShotAmmo;
this._clickShotAmmoTxt = this.clickShotAmmoTxt;
this._spreadShotAmmoTxt = this.spreadShotAmmoTxt;
this._speedShotAmmoTxt = this.speedShotAmmoTxt;
this._exploShotAmmoTxt = this.exploShotAmmoTxt;
this._moneyTxt = this.moneyTxt;
this._hintTxt = this.hintTxt;
this._BallCountUpgrade = this.BallCountUpgrade;
this._BallDamageUpgrade = this.BallDamageUpgrade;
}
}
}//package
Section 314
//shotgun_shot (shotgun_shot)
package {
import flash.media.*;
public dynamic class shotgun_shot extends Sound {
}
}//package
Section 315
//simpleblock_crushed (simpleblock_crushed)
package {
import flash.media.*;
public dynamic class simpleblock_crushed extends Sound {
}
}//package
Section 316
//simpleblock_hit (simpleblock_hit)
package {
import flash.media.*;
public dynamic class simpleblock_hit extends Sound {
}
}//package
Section 317
//simpleBlockActor (simpleBlockActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import fl.motion.*;
public class simpleBlockActor extends Actor {
private var _health:Number;
private var lightUpFactor:int;// = 0
private var _maxHealth:Number;// = 45
private var cracksClip2:MovieClip;
private var cracksClip:MovieClip;
private var initialPoint:Point;
private var shattered:Boolean;// = false
public var Type:int;// = 0
public static const VERYHARD:int = 3;
public static const SIMPLE:int = 1;
public static const HARD:int = 2;
public function simpleBlockActor(_arg1:gameplay, _arg2:b2Body, _arg3:DisplayObject, _arg4:int, _arg5:Number){
lightUpFactor = 0;
_maxHealth = 45;
Type = 0;
shattered = false;
this.Type = _arg4;
this.initHealth(_arg5);
this.initialPoint = new Point(_arg3.x, _arg3.y);
this._health = this._maxHealth;
super(_arg1, _arg2, _arg3);
this.initCracks();
_body.PutToSleep();
}
private function initCracks():void{
this.cracksClip = new blockCracks();
this.cracksClip2 = new blockCracks2();
(_costume as MovieClip).addChild(this.cracksClip);
(_costume as MovieClip).addChild(this.cracksClip2);
}
private function initHealth(_arg1:Number):void{
switch (this.Type){
case SIMPLE:
this._maxHealth = (80 * _arg1);
break;
case HARD:
this._maxHealth = (80 * _arg1);
break;
case VERYHARD:
this._maxHealth = (80 * _arg1);
break;
};
}
override protected function childSpecificUpdating():void{
var _local1:b2Vec2;
var _local2:b2Vec2;
this.setDamageGraphics();
this.lightUp();
if (!_body.IsSleeping()){
_local1 = new b2Vec2(this.initialPoint.x, this.initialPoint.y);
_local2 = new b2Vec2((_local1.x - _costume.x), (_local1.y - _costume.y));
_local2.Multiply(_parentGP.stage.frameRate);
_local2.Multiply((1 / PhysVals.RATIO));
_body.SetLinearVelocity(_local2);
};
super.childSpecificUpdating();
}
private function lightUp():void{
var _local1:Number;
var _local2:Color;
var _local3:Number;
_local1 = ((this.lightUpFactor / 10) * 0.7);
_local2 = new Color();
_local3 = 0xFFFFFF;
_local2.setTint(_local3, _local1);
_costume.transform.colorTransform = _local2;
if (this.lightUpFactor > 10){
this.lightUpFactor = 10;
};
if (this.lightUpFactor > 0){
this.lightUpFactor--;
};
}
private function setDamageGraphics():void{
if ((this._health / this._maxHealth) < 0.5){
this.cracksClip.alpha = 1;
} else {
this.cracksClip.alpha = (1 - (((this._health / this._maxHealth) - 0.5) * 2));
};
if ((this._health / this._maxHealth) > 0.5){
this.cracksClip2.alpha = 0;
} else {
this.cracksClip2.alpha = (1 - ((this._health / this._maxHealth) * 2));
};
}
public function Hit(_arg1:Number, _arg2:b2Vec2, _arg3:Boolean):Boolean{
var _local4:shatterBlockInfo;
this.lightUpFactor = (this.lightUpFactor + 10);
this._health = (this._health - _arg1);
if ((((this._health <= 0)) && ((this.shattered == false)))){
this.shattered = true;
_parentGP.GetGameProgress().AchievementsInfo.IncreaseBlocksHit();
switch (this.Type){
case simpleBlockActor.SIMPLE:
_local4 = new shatterBlockInfo(_costume.x, _costume.y, _costume.width, _costume.height, shatterBlockInfo.SIMPLE, _arg2, _arg1);
break;
case simpleBlockActor.HARD:
_local4 = new shatterBlockInfo(_costume.x, _costume.y, _costume.width, _costume.height, shatterBlockInfo.HARD, _arg2, _arg1);
break;
case simpleBlockActor.VERYHARD:
_local4 = new shatterBlockInfo(_costume.x, _costume.y, _costume.width, _costume.height, shatterBlockInfo.VERYHARD, _arg2, _arg1);
break;
};
if (_arg3){
_parentGP.increaseShake(Math.round((_arg1 / 1.5)));
};
_parentGP.PushActorToCreate(_local4);
DeleteFlag = true;
return (true);
};
return (false);
}
}
}//package
Section 318
//simpleBlockShatterPiece (simpleBlockShatterPiece)
package {
import flash.display.*;
public dynamic class simpleBlockShatterPiece extends MovieClip {
}
}//package
Section 319
//soundManager (soundManager)
package {
import flash.media.*;
public class soundManager {
private var MusicChannel:SoundChannel;
public var SFXMuted:Boolean;// = false
public var ingameMusicStatus:Boolean;// = true
public var MusicMuted:Boolean;// = false
public static const INGAME:int = 1;
public static const MENU:int = 2;
public function soundManager(){
SFXMuted = false;
ingameMusicStatus = true;
MusicMuted = false;
super();
}
public function PlayRapidshot(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new rapidshot_shot();
_local1.play();
}
public function StartMusic(_arg1:int){
var _local2:Sound;
this.StopMusic();
if (this.MusicMuted){
return;
};
switch (_arg1){
case INGAME:
_local2 = new ingame_mus();
break;
case MENU:
_local2 = new menu_mus();
break;
};
this.MusicChannel = _local2.play(0, int.MAX_VALUE);
}
public function PlayBouncerHit(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new bouncerHit();
_local1.play();
}
public function PlayBallSpawn(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new ball_spawn();
_local1.play();
}
public function PlayRocketshot(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new rocket_shot();
_local1.play();
}
public function PlayBoringSpawn(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new boringammo_spawn();
_local1.play();
}
public function PlayCountdownBeep(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new countdown_beep();
_local1.play();
}
public function PlayClickshot(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new clickshot_shot();
_local1.play();
}
public function PlayCoinGet(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new coin_get();
_local1.play();
}
public function PlayScoreCount(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new score_count();
_local1.play();
}
public function PlaySimpleBlockCrushed(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new simpleblock_crushed();
_local1.play();
}
public function PlaySimpleBlockHit(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new simpleblock_hit();
_local1.play();
}
public function PlayBallWall(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new ballWall();
_local1.play();
}
public function PlayFinalFanfare(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new finalStuff();
_local1.play();
}
public function PlayExplosion(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new explosionSnd();
_local1.play();
}
public function StopMusic(){
if (this.MusicChannel != null){
this.MusicChannel.stop();
};
}
public function PlayShotgunshot(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new shotgun_shot();
_local1.play();
}
public function PlayLevelPlay(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new level_play();
_local1.play();
}
public function PlayAmmoOut(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new ammo_out();
_local1.play();
}
public function PlayButtonClick(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new buttonClick();
_local1.play();
}
public function PlayCountdownFinal(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new countdown_final();
_local1.play();
}
public function PlayBonusPick(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new bonus_pick();
_local1.play();
}
public function PlayBallLost(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new ball_lost();
_local1.play();
}
public function PlayShopCantBuy(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new shop_cantbuy();
_local1.play();
}
public function PlayExploballBeep(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new exploball_beep();
_local1.play();
}
public function PlayWeaponSelect(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new weapon_select();
_local1.play();
}
public function PlayShopBuy(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new shop_buy();
_local1.play();
}
public function PlayBulletHit(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new bullet_hit();
_local1.play();
}
public function PlayAmmoBonusPick(){
var _local1:Sound;
if (this.SFXMuted){
return;
};
_local1 = new ammobonus_pick();
_local1.play();
}
}
}//package
Section 320
//spawner (spawner)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
public class spawner {
private var _levelMovieClip:MovieClip;
private var _actorsArray:Array;
private var _parentGP:gameplay;
public function spawner(_arg1:MovieClip, _arg2:gameplay, _arg3:Array){
this._actorsArray = _arg3;
this._parentGP = _arg2;
this._levelMovieClip = _arg1;
}
public function SpawnBombBonus(_arg1:Point){
var _local2:bombBonusActor;
_local2 = new bombBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnBonus(_arg1:bonusSpawnInfo){
var _local2:Number;
var _local3:Array;
var _local4:ballInfo;
switch (_arg1.Type){
case bonusSpawnInfo.MULTIBALL:
_local2 = 6;
_local3 = this._parentGP.GetAllBallsInfos();
for each (_local4 in _local3) {
if (Math.random() > 0.5){
_local4.BallLink._body.SetLinearVelocity(new b2Vec2((_local2 / 2), (-(_local2) / 2)));
_local4.BallLink._body.SetAngularVelocity(0);
this.spawnSimpleBall(_local4.Coords, new b2Vec2((-(_local2) / 2), -(_local2)), 0, false);
} else {
_local4.BallLink._body.SetLinearVelocity(new b2Vec2((_local2 / 2), -(_local2)));
_local4.BallLink._body.SetAngularVelocity(0);
this.spawnSimpleBall(_local4.Coords, new b2Vec2((-(_local2) / 2), (-(_local2) / 2)), 0, false);
};
};
break;
};
}
public function SpawnBlindBonus(_arg1:Point){
var _local2:blindBonusActor;
_local2 = new blindBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnSpreadShot(_arg1:Point, _arg2:int, _arg3:Number){
var _local4:bulletActor;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:int;
while (_local8 < _arg2) {
_local4 = new bulletActor(this._parentGP, this._levelMovieClip, _arg1, _arg3, bulletActor.SPREADSHOT);
this._actorsArray.push(_local4);
_local5 = 1;
_local6 = (((Math.random() * _local5) * 2) - _local5);
_local7 = (Math.random() * 2);
_local4._body.ApplyImpulse(new b2Vec2(_local6, (-4 - _local7)), _local4._body.GetWorldCenter());
_local8++;
};
}
public function SpawnIncreaseBallsSizeBonus(_arg1:Point){
var _local2:increaseBallsSizeBonusActor;
_local2 = new increaseBallsSizeBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnSpeedBonus(_arg1:Point){
var _local2:speedBonusActor;
_local2 = new speedBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnLifeLineBonus(_arg1:Point){
var _local2:lifeLineBonusActor;
_local2 = new lifeLineBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnAmmoBonus(_arg1:Point){
var _local2:int;
var _local3:int;
var _local4:ammoBonusActor;
while (_local3 == 0) {
_local2 = Math.floor(((Math.random() * 4) + 1));
if (this._parentGP.CheckWeaponAvailability(_local2)){
_local3 = _local2;
};
};
_local4 = new ammoBonusActor(this._parentGP, this._levelMovieClip, _arg1, _local3);
this._actorsArray.push(_local4);
this.KickBonusBody(_local4._body);
}
public function SpawnBoringBallBonus(){
var _local1:Number;
var _local2:Number;
}
public function shatterSquareBlock(_arg1:shatterSquareBlockInfo){
var _local2:int;
var _local3:Point;
var _local4:shatterPieceSquareActor;
var _local5:b2Vec2;
var _local6:b2Vec2;
var _local7:Number;
var _local8:Number;
var _local9:int;
_arg1.DirectionHit.Normalize();
_arg1.DirectionHit.Multiply((_arg1.ForceHit / 120));
_local8 = 0.5;
this._parentGP.IncreaseScore(scoreAchievementsController.SQUAREBLOCKSCORE);
this._parentGP.IncreaseMoneyCollected(scoreAchievementsController.SQUAREBLOCKMONEYBONUS);
while (_local9 < 2) {
_local2 = 0;
while (_local2 < 1) {
_local3 = new Point(((_arg1.x - (_arg1.width / 4)) + ((_arg1.width / 2) * _local9)), ((_arg1.y - (_arg1.height / 4)) + ((_arg1.height / 2) * _local2)));
_local4 = new shatterPieceSquareActor(this._parentGP, this._levelMovieClip, _local3, _arg1.Type, (_arg1.width / 2));
_local5 = _arg1.DirectionHit.Copy();
_local6 = new b2Vec2(((Math.random() * _local8) - (_local8 / 2)), ((Math.random() * _local8) - (_local8 / 2)));
_local5.Add(_local6);
_local4._body.ApplyImpulse(_local5, _local4._body.GetWorldCenter());
_local7 = (Math.random() * 5);
if (Math.random() > 0.5){
_local7 = (_local7 * -1);
};
_local4._body.ApplyTorque(_local7);
this._actorsArray.push(_local4);
_local2++;
};
_local9++;
};
if (!_arg1.HitByWeapon){
this.SpawnSomeBonus(new Point(_arg1.x, _arg1.y));
};
}
public function KickBonusBody(_arg1:b2Body){
var _local2:Number;
var _local3:Number;
_local2 = (Math.random() * 1.5);
if (Math.random() > 0.5){
_local2 = (_local2 * -1);
};
_local3 = ((Math.random() * -1.5) - 0.5);
_arg1.ApplyImpulse(new b2Vec2(_local2, _local3), _arg1.GetWorldCenter());
}
public function shatterMoneyBlock(_arg1:shatterBlockMoneyInfo){
var _local2:int;
var _local3:Point;
var _local4:coinActor;
var _local5:b2Vec2;
var _local6:Number;
var _local7:b2Vec2;
var _local8:int;
this._parentGP.IncreaseScore(scoreAchievementsController.MONEYBLOCKSCORE);
_arg1.DirectionHit.Normalize();
_arg1.DirectionHit.Multiply((_arg1.ForceHit / 150));
while (_local8 < 3) {
_local2 = 0;
while (_local2 < 2) {
_local3 = new Point(((_arg1.x - (_arg1.width / 3)) + ((_arg1.width / 3) * _local8)), ((_arg1.y - (_arg1.height / 4)) + ((_arg1.height / 2) * _local2)));
_local4 = new coinActor(this._parentGP, this._levelMovieClip, _local3);
_local5 = _arg1.DirectionHit.Copy();
_local6 = 2;
_local7 = new b2Vec2(((Math.random() * _local6) - (_local6 / 2)), ((Math.random() * _local6) - (_local6 / 2)));
_local5.Add(_local7);
_local4._body.ApplyImpulse(_local5, _local4._body.GetWorldCenter());
this._actorsArray.push(_local4);
_local2++;
};
_local8++;
};
}
public function SpawnRocket(_arg1:Point){
var _local2:rocketActor;
_local2 = new rocketActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
}
public function SpawnLifeBonus(_arg1:Point){
var _local2:lifeBonusActor;
_local2 = new lifeBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnMultiBallsBonus(_arg1:Point){
var _local2:multipleBallsBonusActor;
_local2 = new multipleBallsBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function SpawnExtraBallBonus(_arg1:Point){
var _local2:extraBallBonusActor;
_local2 = new extraBallBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function spawnSimpleBall(_arg1:Point, _arg2:b2Vec2, _arg3:Number, _arg4:Boolean){
var _local5:ballActor;
_local5 = new ballActor(this._parentGP, this._levelMovieClip, _arg1, this._parentGP.GetGameProgress().BallsDamageLevel);
if (_arg2 != null){
_local5._body.SetLinearVelocity(_arg2);
};
_local5._body.SetAngularVelocity(_arg3);
this._actorsArray.push(_local5);
if (_arg4){
this._parentGP.DecreasePendingBallsCount();
};
}
public function spawnBouncer(_arg1:Point):bouncerActor{
var _local2:bouncerActor;
_local2 = new bouncerActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
return (_local2);
}
public function SpawnSomeBonus(_arg1:Point){
var _local2:Number;
if (this._parentGP.CheckBonusesCount() > 2){
return;
};
if (Math.random() > 0.75){
_local2 = Math.random();
if (_local2 > 0.83){
this.SpawnIncreaseBouncerSizeBonus(_arg1);
} else {
if (_local2 > 0.66){
this.SpawnMultiBallsBonus(_arg1);
} else {
if (_local2 > 0.4){
this.SpawnLifeBonus(_arg1);
} else {
if (_local2 > 0.33){
this.SpawnSpeedBonus(_arg1);
} else {
if (_local2 > 0.16){
this.SpawnIncreaseBallsSizeBonus(_arg1);
} else {
this.SpawnLifeLineBonus(_arg1);
};
};
};
};
};
};
}
public function SpawnIncreaseBouncerSizeBonus(_arg1:Point){
var _local2:increaseBouncerSizeBonusActor;
_local2 = new increaseBouncerSizeBonusActor(this._parentGP, this._levelMovieClip, _arg1);
this._actorsArray.push(_local2);
this.KickBonusBody(_local2._body);
}
public function shatterBlock(_arg1:shatterBlockInfo){
var _local2:int;
var _local3:Point;
var _local4:int;
var _local5:shatterPieceActor;
var _local6:b2Vec2;
var _local7:b2Vec2;
var _local8:Number;
var _local9:Number;
var _local10:int;
_arg1.DirectionHit.Normalize();
_arg1.DirectionHit.Multiply((_arg1.ForceHit / 30));
_local9 = 0.5;
switch (_arg1.Type){
case shatterBlockInfo.SIMPLE:
this._parentGP.IncreaseScore(scoreAchievementsController.LIGHTBLOCKSCORE);
this._parentGP.IncreaseMoneyCollected(scoreAchievementsController.LIGHTBLOCKMONEYBONUS);
break;
case shatterBlockInfo.HARD:
this._parentGP.IncreaseScore(scoreAchievementsController.MEDIUMBLOCKSCORE);
this._parentGP.IncreaseMoneyCollected(scoreAchievementsController.MEDIUMBLOCKMONEYBONUS);
break;
case shatterBlockInfo.VERYHARD:
this._parentGP.IncreaseScore(scoreAchievementsController.HARDBLOCKSCORE);
this._parentGP.IncreaseMoneyCollected(scoreAchievementsController.HARDBLOCKMONEYBONUS);
break;
};
while (_local10 < 4) {
_local2 = 0;
while (_local2 < 2) {
_local3 = new Point((((_arg1.x - (_arg1.width / 2)) + (_arg1.width / 8)) + ((_arg1.width / 4) * _local10)), ((_arg1.y - (_arg1.height / 4)) + ((_arg1.height / 2) * _local2)));
switch (_arg1.Type){
case shatterBlockInfo.SIMPLE:
_local4 = shatterPieceActor.SIMPLE_SHATTER;
break;
case shatterBlockInfo.HARD:
_local4 = shatterPieceActor.HARD_SHATTER;
break;
case shatterBlockInfo.VERYHARD:
_local4 = shatterPieceActor.VERYHARD_SHATTER;
break;
};
_local5 = new shatterPieceActor(this._parentGP, this._levelMovieClip, _local3, _local4);
_local6 = _arg1.DirectionHit.Copy();
_local7 = new b2Vec2(((Math.random() * _local9) - (_local9 / 2)), ((Math.random() * _local9) - (_local9 / 2)));
_local6.Add(_local7);
_local5._body.ApplyImpulse(_local6, _local5._body.GetWorldCenter());
_local8 = (Math.random() * 5);
if (Math.random() > 0.5){
_local8 = (_local8 * -1);
};
_local5._body.ApplyTorque(_local8);
this._actorsArray.push(_local5);
_local2++;
};
_local10++;
};
this.SpawnSomeBonus(new Point(_arg1.x, _arg1.y));
}
public function createLifeLine():lifeLineActor{
var _local1:lifeLineActor;
_local1 = new lifeLineActor(this._parentGP, this._levelMovieClip);
return (_local1);
}
public function SpawnBullet(_arg1:Point, _arg2:Number, _arg3:Number, _arg4:int){
var _local5:bulletActor;
var _local6:Number;
_local5 = new bulletActor(this._parentGP, this._levelMovieClip, _arg1, _arg2, _arg4);
this._actorsArray.push(_local5);
_local6 = (Math.random() * _arg3);
if (Math.random() > 0.5){
_local6 = (_local6 * -1);
};
_local5._body.ApplyImpulse(new b2Vec2(_local6, -6), _local5._body.GetWorldCenter());
}
}
}//package
Section 321
//speedBonus (speedBonus)
package {
import flash.display.*;
public dynamic class speedBonus extends MovieClip {
}
}//package
Section 322
//speedBonusActor (speedBonusActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Collision.Shapes.*;
public class speedBonusActor extends Actor {
public function speedBonusActor(_arg1:gameplay, _arg2:MovieClip, _arg3:Point){
var _local4:MovieClip;
var _local5:b2CircleDef;
var _local6:b2BodyDef;
var _local7:b2Body;
_local4 = new speedBonus();
_local4.x = _arg3.x;
_local4.y = _arg3.y;
_arg2.addChild(_local4);
_local5 = new b2CircleDef();
_local5.radius = ((_local4.width / 2) / PhysVals.RATIO);
_local5.density = 0.5;
_local5.friction = 0.5;
_local5.restitution = 0.5;
_local5.filter.categoryBits = collisionBits.BONUSES;
_local5.filter.maskBits = (collisionBits.WALLS & collisionBits.BOUNCER);
_local6 = new b2BodyDef();
_local6.position.Set((_local4.x / PhysVals.RATIO), (_local4.y / PhysVals.RATIO));
_local6.fixedRotation = true;
_local7 = PhysVals.world.CreateBody(_local6);
_local7.CreateShape(_local5);
_local7.SetMassFromShapes();
_local7.SetUserData(this);
super(_arg1, _local7, _local4);
}
}
}//package
Section 323
//splashesZone (splashesZone)
package {
import flash.display.*;
public dynamic class splashesZone extends MovieClip {
}
}//package
Section 324
//spreadBullet (spreadBullet)
package {
import flash.display.*;
public dynamic class spreadBullet extends MovieClip {
}
}//package
Section 325
//SQ_1 (SQ_1)
package {
import flash.display.*;
public dynamic class SQ_1 extends MovieClip {
}
}//package
Section 326
//SQ_2 (SQ_2)
package {
import flash.display.*;
public dynamic class SQ_2 extends MovieClip {
}
}//package
Section 327
//SQ_3 (SQ_3)
package {
import flash.display.*;
public dynamic class SQ_3 extends MovieClip {
}
}//package
Section 328
//SQ_4 (SQ_4)
package {
import flash.display.*;
public dynamic class SQ_4 extends MovieClip {
}
}//package
Section 329
//SQ_5 (SQ_5)
package {
import flash.display.*;
public dynamic class SQ_5 extends MovieClip {
}
}//package
Section 330
//SQ_6 (SQ_6)
package {
import flash.display.*;
public dynamic class SQ_6 extends MovieClip {
}
}//package
Section 331
//squareBlockActor (squareBlockActor)
package {
import flash.display.*;
import flash.geom.*;
import Box2D.Dynamics.*;
import Box2D.Common.Math.*;
import fl.motion.*;
public class squareBlockActor extends Actor {
private var _health:Number;
private var lightUpFactor:int;// = 0
private var _maxHealth:Number;// = 45
private var cracksClip2:MovieClip;
private var cracksClip:MovieClip;
private var initialPoint:Point;
private var shattered:Boolean;// = false
public var Type:int;// = 0
public static const VIOLET:int = 7;
public static const GREEN:int = 3;
public static const DENSITY:Number = 1.5;
public static const ORANGE:int = 2;
public static const RED:int = 1;
public static const BROWN:int = 4;
public static const LIGHTBLUE:int = 8;
public static const WHITE:int = 10;
public static const BLUE:int = 5;
public static const YELLOW:int = 6;
public static const BLACK:int = 9;
public function squareBlockActor(_arg1:gameplay, _arg2:b2Body, _arg3:DisplayObject, _arg4:int, _arg5:Number){
lightUpFactor = 0;
_maxHealth = 45;
Type = 0;
shattered = false;
this.Type = _arg4;
this.initHealth(_arg5);
this.initialPoint = new Point(_arg3.x, _arg3.y);
this._health = this._maxHealth;
super(_arg1, _arg2, _arg3);
this.initCracks();
_body.PutToSleep();
_costume.cacheAsBitmap = true;
}
private function initCracks():void{
this.cracksClip = new squareBlockCracks();
this.cracksClip.cacheAsBitmap = true;
this.cracksClip2 = new squareBlockCracks2();
this.cracksClip2.cacheAsBitmap = true;
(_costume as MovieClip).addChild(this.cracksClip);
(_costume as MovieClip).addChild(this.cracksClip2);
}
private function initHealth(_arg1:Number):void{
this._maxHealth = (20 * _arg1);
}
override protected function childSpecificUpdating():void{
var _local1:b2Vec2;
var _local2:b2Vec2;
this.setDamageGraphics();
this.lightUp();
if (!_body.IsSleeping()){
_local1 = new b2Vec2(this.initialPoint.x, this.initialPoint.y);
_local2 = new b2Vec2((_local1.x - _costume.x), (_local1.y - _costume.y));
_local2.Multiply(_parentGP.stage.frameRate);
_local2.Multiply((1 / PhysVals.RATIO));
_body.SetLinearVelocity(_local2);
};
super.childSpecificUpdating();
}
private function lightUp():void{
var _local1:Number;
var _local2:Color;
var _local3:Number;
_local1 = ((this.lightUpFactor / 15) * 0.7);
_local2 = new Color();
_local3 = 0xFFFFFF;
_local2.setTint(_local3, _local1);
_costume.transform.colorTransform = _local2;
if (this.lightUpFactor > 15){
this.lightUpFactor = 15;
};
if (this.lightUpFactor > 0){
this.lightUpFactor--;
};
}
private function setDamageGraphics():void{
if ((this._health / this._maxHealth) < 0.5){
this.cracksClip.alpha = 1;
} else {
this.cracksClip.alpha = (1 - (((this._health / this._maxHealth) - 0.5) * 2));
};
if ((this._health / this._maxHealth) > 0.5){
this.cracksClip2.alpha = 0;
} else {
this.cracksClip2.alpha = (1 - ((this._health / this._maxHealth) * 2));
};
}
public function Hit(_arg1:Number, _arg2:b2Vec2, _arg3:Boolean, _arg4:Boolean, _arg5:Boolean):Boolean{
var _local6:shatterSquareBlockInfo;
var _local7:Boolean;
if (_arg5){
_parentGP.PunchInCustomDelayedAction(new customDelayedAction(customDelayedAction.EXPLOSION, 20, 40, new Point(_costume.x, _costume.y), false));
};
this.lightUpFactor = (this.lightUpFactor + 15);
this._health = (this._health - _arg1);
if ((((this._health <= 0)) && ((this.shattered == false)))){
this.shattered = true;
_parentGP.GetGameProgress().AchievementsInfo.IncreaseBlocksHit();
_local7 = false;
if (((_arg4) || (!(_arg3)))){
_local7 = true;
};
_local6 = new shatterSquareBlockInfo(_costume.x, _costume.y, _costume.width, _costume.height, this.Type, _arg2, _arg1, _local7, _arg4);
if (_arg3){
_parentGP.increaseShake(Math.round((_arg1 / 1.5)));
};
_parentGP.PushActorToCreate(_local6);
if (!_arg4){
_parentGP.SoundManager.PlaySimpleBlockCrushed();
};
DeleteFlag = true;
if (((((_arg3) && (!(_arg5)))) || (((_local7) && (!(_arg4)))))){
_parentGP.SwuareCrushEffect(new Point(_costume.x, _costume.y), this.Type);
};
return (true);
};
return (false);
}
}
}//package
Section 332
//squareBlockBlackShatterPiece (squareBlockBlackShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockBlackShatterPiece extends MovieClip {
}
}//package
Section 333
//squareBlockBlueShatterPiece (squareBlockBlueShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockBlueShatterPiece extends MovieClip {
}
}//package
Section 334
//squareBlockBrownShatterPiece (squareBlockBrownShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockBrownShatterPiece extends MovieClip {
}
}//package
Section 335
//squareBlockCracks (squareBlockCracks)
package {
import flash.display.*;
public dynamic class squareBlockCracks extends MovieClip {
}
}//package
Section 336
//squareBlockCracks2 (squareBlockCracks2)
package {
import flash.display.*;
public dynamic class squareBlockCracks2 extends MovieClip {
}
}//package
Section 337
//squareBlockGreenShatterPiece (squareBlockGreenShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockGreenShatterPiece extends MovieClip {
}
}//package
Section 338
//squareBlockLightBlueShatterPiece (squareBlockLightBlueShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockLightBlueShatterPiece extends MovieClip {
}
}//package
Section 339
//squareBlockMoneyShatterPiece (squareBlockMoneyShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockMoneyShatterPiece extends MovieClip {
}
}//package
Section 340
//squareBlockOrangeShatterPiece (squareBlockOrangeShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockOrangeShatterPiece extends MovieClip {
}
}//package
Section 341
//squareBlockRedShatterPiece (squareBlockRedShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockRedShatterPiece extends MovieClip {
}
}//package
Section 342
//squareBlockWhiteShatterPiece (squareBlockWhiteShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockWhiteShatterPiece extends MovieClip {
}
}//package
Section 343
//squareBlockVioletShatterPiece (squareBlockVioletShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockVioletShatterPiece extends MovieClip {
}
}//package
Section 344
//squareBlockYellowShatterPiece (squareBlockYellowShatterPiece)
package {
import flash.display.*;
public dynamic class squareBlockYellowShatterPiece extends MovieClip {
}
}//package
Section 345
//tenBallsComboMessage (tenBallsComboMessage)
package {
import flash.display.*;
public dynamic class tenBallsComboMessage extends MovieClip {
}
}//package
Section 346
//timerZone (timerZone)
package {
import flash.display.*;
public dynamic class timerZone extends MovieClip {
}
}//package
Section 347
//tutorialMC (tutorialMC)
package {
import flash.display.*;
import flash.events.*;
public class tutorialMC extends MovieClip {
public var backBtn:MovieClip;
private var _soundManager:soundManager;
private var _backBtn:MovieClip;
public function tutorialMC(_arg1:soundManager){
this._soundManager = _arg1;
this._backBtn = this.backBtn;
this._backBtn.buttonMode = true;
this._backBtn.addEventListener(MouseEvent.CLICK, this.backClick);
}
private function backClick(_arg1:MouseEvent):void{
this._soundManager.PlayButtonClick();
(parent as dispatcherMC).GoToStage(dispatcherMC.MAIN_MENU, 0);
}
}
}//package
Section 348
//twentyBallsComboMessage (twentyBallsComboMessage)
package {
import flash.display.*;
public dynamic class twentyBallsComboMessage extends MovieClip {
}
}//package
Section 349
//UtilDigital (UtilDigital)
package {
import flash.display.*;
public class UtilDigital {
public static function set_digital(_arg1:MovieClip, _arg2:int):void{
var _local3:int;
var _local4:String;
var _local5:int;
var _local6:int;
var _local7:int;
if (!_arg1.hasOwnProperty("bits")){
_arg1.bits = get_bits(_arg1);
};
_local3 = _arg1.bits;
_local4 = _arg2.toString();
_local5 = (_local3 - _local4.length);
_local6 = 1;
while (_local6 <= _local5) {
_arg1[("bit_" + _local6)].visible = false;
_arg1[("bit_" + _local6)].gotoAndStop(1);
_local6++;
};
_local7 = 0;
while (_local6 <= _local3) {
_arg1[("bit_" + _local6)].visible = true;
_arg1[("bit_" + _local6)].gotoAndStop((int(_local4.charAt(_local7)) + 1));
_local6++;
_local7++;
};
}
public static function get_bits(_arg1:MovieClip):int{
var _local2:int;
_local2 = 1;
while (_arg1[("bit_" + _local2)]) {
_local2++;
};
return ((_local2 - 1));
}
}
}//package
Section 350
//WaterHolderB (WaterHolderB)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderB extends MovieClip {
public var BLUE:Water;
}
}//package
Section 351
//WaterHolderG (WaterHolderG)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderG extends MovieClip {
public var GREEN:Water;
}
}//package
Section 352
//WaterHolderR (WaterHolderR)
package {
import flash.display.*;
import com.midasplayer.extras.*;
public dynamic class WaterHolderR extends MovieClip {
public var RED:Water;
}
}//package
Section 353
//weapon_select (weapon_select)
package {
import flash.media.*;
public dynamic class weapon_select extends Sound {
}
}//package
Section 354
//weaponsController (weaponsController)
package {
public class weaponsController {
private const SPREADDAMAGELVL1:Number = 5;
private const SPREADDAMAGELVL2:Number = 9;
private const SPREADDAMAGELVL3:Number = 15;
private const PISTOLDAMAGELVL1:Number = 9;
private const PISTOLDAMAGELVL2:Number = 12;
private const PISTOLDAMAGELVL3:Number = 16;
private const EXPLODAMAGELVL1:Number = 40;
private const EXPLODAMAGELVL2:Number = 60;
private const EXPLODAMAGELVL3:Number = 90;
private const EXPLOSPREADLVL2:Number = 110;
private const EXPLOSPREADLVL1:Number = 70;
private const EXPLOSPREADLVL3:Number = 160;
private const RAPIDDAMAGELVL1:Number = 10;
private const RAPIDDAMAGELVL2:Number = 14;
private const RAPIDDAMAGELVL3:Number = 23;
private const SHOTGUNRATE:int = 30;
private const RAPIDFREQUENCY1:int = 5;
private const RAPIDFREQUENCY2:int = 3;
private const RAPIDFREQUENCY3:int = 2;
private const SPREADNUMBULLETS2:Number = 8;
private const SPREADNUMBULLETS3:Number = 12;
private const PISTOLRATE:int = 10;
private const SPREADNUMBULLETS1:Number = 5;
public var currentlySelectedWeapon:int;// = 1
public var PistolAmmo:int;// = 100
public var ExploGunRadiusLevel:int;// = 1
public var RocketGunAmmo:int;// = 100
public var SpreadGunNumBulletsLevel:int;// = 1
public var SpreadGunAvailable:Boolean;// = true
public var Timer:int;// = 0
public var RapidGunAmmo:int;// = 100
public var PistolDamageLevel:int;// = 1
public var RapidGunRate:int;// = 5
public var LastTimeShot:int;// = -2147483648
public var RocketGunRate:int;// = 50
public var ExploGunDamageLevel:int;// = 1
public var SpreadGunAmmo:int;// = 100
public var RapidGunAvailable:Boolean;// = true
public var SpreadGunDamageLevel:int;// = 1
public var RapidGunFrequencyLevel:int;// = 1
public var RapidGunDamageLevel:int;// = 1
public var PistolAvailable:Boolean;// = true
public var RocketGunAvailable:Boolean;// = true
public static const SPREAD:int = 2;
public static const ROCKET:int = 4;
public static const PISTOL:int = 1;
public static const RAPID:int = 3;
public function weaponsController(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7, _arg8, _arg9, _arg10, _arg11, _arg12, _arg13, _arg14, _arg15){
RocketGunAvailable = true;
PistolAmmo = 100;
SpreadGunNumBulletsLevel = 1;
ExploGunRadiusLevel = 1;
RocketGunAmmo = 100;
SpreadGunAmmo = 100;
SpreadGunAvailable = true;
Timer = 0;
RapidGunAmmo = 100;
RocketGunRate = 50;
LastTimeShot = -2147483648;
PistolDamageLevel = 1;
RapidGunRate = 5;
ExploGunDamageLevel = 1;
RapidGunAvailable = true;
SpreadGunDamageLevel = 1;
RapidGunFrequencyLevel = 1;
RapidGunDamageLevel = 1;
PistolAvailable = true;
currentlySelectedWeapon = 1;
super();
this.PistolAmmo = _arg12;
this.SpreadGunAmmo = _arg13;
this.RapidGunAmmo = _arg14;
this.RocketGunAmmo = _arg15;
this.PistolAvailable = _arg1;
this.SpreadGunAvailable = _arg2;
this.RapidGunAvailable = _arg3;
this.RocketGunAvailable = _arg4;
this.PistolDamageLevel = _arg5;
this.SpreadGunDamageLevel = _arg7;
this.SpreadGunNumBulletsLevel = _arg6;
this.RapidGunFrequencyLevel = _arg8;
this.RapidGunDamageLevel = _arg9;
this.ExploGunDamageLevel = _arg11;
this.ExploGunRadiusLevel = _arg10;
this.setRapidGunRate();
}
public function shitchWeapon(){
switch (this.currentlySelectedWeapon){
case 0:
this.currentlySelectedWeapon = PISTOL;
break;
case PISTOL:
if (this.SpreadGunAvailable){
this.currentlySelectedWeapon = SPREAD;
} else {
if (this.RapidGunAvailable){
this.currentlySelectedWeapon = RAPID;
} else {
if (this.RocketGunAvailable){
this.currentlySelectedWeapon = ROCKET;
};
};
};
break;
case SPREAD:
if (this.RapidGunAvailable){
this.currentlySelectedWeapon = RAPID;
} else {
if (this.RocketGunAvailable){
this.currentlySelectedWeapon = ROCKET;
} else {
this.currentlySelectedWeapon = PISTOL;
};
};
break;
case RAPID:
if (this.RocketGunAvailable){
this.currentlySelectedWeapon = ROCKET;
} else {
this.currentlySelectedWeapon = PISTOL;
};
break;
case ROCKET:
this.currentlySelectedWeapon = PISTOL;
break;
};
trace(("weapon selected = " + this.currentlySelectedWeapon));
}
public function GetSpreadDamage():Number{
switch (this.SpreadGunDamageLevel){
case 1:
return (this.SPREADDAMAGELVL1);
case 2:
return (this.SPREADDAMAGELVL2);
case 3:
return (this.SPREADDAMAGELVL3);
};
return (0);
}
public function GetPistolDamage():Number{
switch (this.PistolDamageLevel){
case 1:
return (this.PISTOLDAMAGELVL1);
case 2:
return (this.PISTOLDAMAGELVL2);
case 3:
return (this.PISTOLDAMAGELVL3);
};
return (0);
}
private function setRapidGunRate():void{
switch (this.RapidGunFrequencyLevel){
case 1:
this.RapidGunRate = this.RAPIDFREQUENCY1;
return;
case 2:
this.RapidGunRate = this.RAPIDFREQUENCY2;
return;
case 3:
this.RapidGunRate = this.RAPIDFREQUENCY3;
return;
};
this.RapidGunRate = 15;
}
public function CheckAmmo():Boolean{
var _local1:Boolean;
if (this.PistolAmmo > 0){
_local1 = true;
};
if (((this.SpreadGunAvailable) && ((this.SpreadGunAmmo > 0)))){
_local1 = true;
};
if (((this.RapidGunAvailable) && ((this.RapidGunAmmo > 0)))){
_local1 = true;
};
if (((this.RocketGunAvailable) && ((this.RocketGunAmmo > 0)))){
_local1 = true;
};
return (_local1);
}
public function GetRocketDamage():Number{
switch (this.ExploGunDamageLevel){
case 1:
return (this.EXPLODAMAGELVL1);
case 2:
return (this.EXPLODAMAGELVL2);
case 3:
return (this.EXPLODAMAGELVL3);
};
return (0);
}
public function IncreaseAmmo(_arg1:int){
switch (_arg1){
case ammoBonusActor.PISTOL_AMMO:
this.PistolAmmo = (this.PistolAmmo + shopMC.PISTOLBULLETSINCREASE);
break;
case ammoBonusActor.SPREAD_AMMO:
this.SpreadGunAmmo = (this.SpreadGunAmmo + shopMC.SPREADBULLETSINCREASE);
break;
case ammoBonusActor.RAPID_AMMO:
this.RapidGunAmmo = (this.RapidGunAmmo + shopMC.RAPIDBULLETSINCREASE);
break;
case ammoBonusActor.ROCKET_AMMO:
this.RocketGunAmmo = (this.RocketGunAmmo + shopMC.EXPLOBULLETSINCREASE);
break;
};
}
public function Update(){
this.Timer++;
}
public function GetRocketSpread():Number{
switch (this.ExploGunRadiusLevel){
case 1:
return (this.EXPLOSPREADLVL1);
case 2:
return (this.EXPLOSPREADLVL2);
case 3:
return (this.EXPLOSPREADLVL3);
};
return (0);
}
public function GetRapidDamage():Number{
switch (this.RapidGunDamageLevel){
case 1:
return (this.RAPIDDAMAGELVL1);
case 2:
return (this.RAPIDDAMAGELVL2);
case 3:
return (this.RAPIDDAMAGELVL3);
};
return (0);
}
public function GetSpreadNumBullets():int{
switch (this.SpreadGunNumBulletsLevel){
case 1:
return (this.SPREADNUMBULLETS1);
case 2:
return (this.SPREADNUMBULLETS2);
case 3:
return (this.SPREADNUMBULLETS3);
};
return (0);
}
public function Shoot(_arg1:Boolean):Boolean{
switch (this.currentlySelectedWeapon){
case PISTOL:
if (((this.PistolAvailable) && ((this.PistolAmmo > 0)))){
if (((((this.Timer - this.LastTimeShot) > this.PISTOLRATE)) || (!(_arg1)))){
this.LastTimeShot = this.Timer;
this.PistolAmmo--;
return (true);
};
};
break;
case SPREAD:
if (((this.SpreadGunAvailable) && ((this.SpreadGunAmmo > 0)))){
if ((this.Timer - this.LastTimeShot) > this.SHOTGUNRATE){
this.LastTimeShot = this.Timer;
this.SpreadGunAmmo--;
return (true);
};
};
break;
case RAPID:
if (((this.RapidGunAvailable) && ((this.RapidGunAmmo > 0)))){
if ((this.Timer - this.LastTimeShot) > this.RapidGunRate){
this.LastTimeShot = this.Timer;
this.RapidGunAmmo--;
return (true);
};
};
break;
case ROCKET:
if (((this.RocketGunAvailable) && ((this.RocketGunAmmo > 0)))){
if ((this.Timer - this.LastTimeShot) > this.RocketGunRate){
this.LastTimeShot = this.Timer;
this.RocketGunAmmo--;
return (true);
};
};
break;
case 0:
trace("no weapon selected");
break;
};
return (false);
}
}
}//package
Section 355
//weaponsStatsZone (weaponsStatsZone)
package {
import flash.display.*;
public dynamic class weaponsStatsZone extends MovieClip {
}
}//package
Section 356
//veryHardBlockShatterPiece (veryHardBlockShatterPiece)
package {
import flash.display.*;
public dynamic class veryHardBlockShatterPiece extends MovieClip {
}
}//package
Section 357
//WorldBlock (WorldBlock)
package {
import flash.display.*;
public dynamic class WorldBlock extends MovieClip {
}
}//package