2014-02-28 09:30:53 +00:00
/* Phaser (no libs) v2.0.0 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */
2014-03-04 01:29:04 +00:00
( function ( ) { var a = this , b = b || { VERSION : "<%= version %>" , DEV _VERSION : "2.0" , GAMES : [ ] , AUTO : 0 , CANVAS : 1 , WEBGL : 2 , HEADLESS : 3 , SPRITE : 0 , BUTTON : 1 , IMAGE : 2 , GRAPHICS : 3 , TEXT : 4 , TILESPRITE : 5 , BITMAPTEXT : 6 , GROUP : 7 , RENDERTEXTURE : 8 , TILEMAP : 9 , TILEMAPLAYER : 10 , EMITTER : 11 , POLYGON : 12 , BITMAPDATA : 13 , CANVAS _FILTER : 14 , WEBGL _FILTER : 15 , ELLIPSE : 16 , SPRITEBATCH : 17 , BITMAPFONT : 18 , NONE : 0 , LEFT : 1 , RIGHT : 2 , UP : 3 , DOWN : 4 , DYNAMIC : 1 , STATIC : 2 , KINEMATIC : 4 , blendModes : { NORMAL : 0 , ADD : 1 , MULTIPLY : 2 , SCREEN : 3 , OVERLAY : 4 , DARKEN : 5 , LIGHTEN : 6 , COLOR _DODGE : 7 , COLOR _BURN : 8 , HARD _LIGHT : 9 , SOFT _LIGHT : 10 , DIFFERENCE : 11 , EXCLUSION : 12 , HUE : 13 , SATURATION : 14 , COLOR : 15 , LUMINOSITY : 16 } , scaleModes : { DEFAULT : 0 , LINEAR : 0 , NEAREST : 1 } } ; PIXI . InteractionManager = function ( ) { } , b . Utils = { parseDimension : function ( a , b ) { var c = 0 , d = 0 ; return "string" == typeof a ? "%" === a . substr ( - 1 ) ? ( c = parseInt ( a , 10 ) / 100 , d = 0 === b ? window . innerWidth * c : window . innerHeight * c ) : d = parseInt ( a , 10 ) : d = a , d } , shuffle : function ( a ) { for ( var b = a . length - 1 ; b > 0 ; b -- ) { var c = Math . floor ( Math . random ( ) * ( b + 1 ) ) , d = a [ b ] ; a [ b ] = a [ c ] , a [ c ] = d } return a } , pad : function ( a , b , c , d ) { if ( "undefined" == typeof b ) var b = 0 ; if ( "undefined" == typeof c ) var c = " " ; if ( "undefined" == typeof d ) var d = 3 ; var e = 0 ; if ( b + 1 >= a . length ) switch ( d ) { case 1 : a = Array ( b + 1 - a . length ) . join ( c ) + a ; break ; case 3 : var f = Math . ceil ( ( e = b - a . length ) / 2 ) , g = e - f ; a = Array ( g + 1 ) . join ( c ) + a + Array ( f + 1 ) . join ( c ) ; break ; default : a += Array ( b + 1 - a . length ) . join ( c ) } return a } , isPlainObject : function ( a ) { if ( "object" != typeof a || a . nodeType || a === a . window ) return ! 1 ; try { if ( a . constructor && ! hasOwn . call ( a . constructor . prototype , "isPrototypeOf" ) ) return ! 1 } catch ( b ) { return ! 1 } return ! 0 } , extend : function ( ) { var a , c , d , e , f , g , h = arguments [ 0 ] || { } , i = 1 , j = arguments . length , k = ! 1 ; for ( "boolean" == typeof h && ( k = h , h = arguments [ 1 ] || { } , i = 2 ) , j === i && ( h = this , -- i ) ; j > i ; i ++ ) if ( null != ( a = arguments [ i ] ) ) for ( c in a ) d = h [ c ] , e = a [ c ] , h !== e && ( k && e && ( b . Utils . isPlainObject ( e ) || ( f = Array . isArray ( e ) ) ) ? ( f ? ( f = ! 1 , g = d && Array . isArray ( d ) ? d : [ ] ) : g = d && b . Utils . isPlainObject ( d ) ? d : { } , h [ c ] = b . Utils . extend ( k , g , e ) ) : void 0 !== e && ( h [ c ] = e ) ) ; return h } } , "function" != typeof Function . prototype . bind && ( Function . prototype . bind = function ( ) { var a = Array . prototype . slice ; return function ( b ) { function c ( ) { var f = e . concat ( a . call ( arguments ) ) ; d . apply ( this instanceof c ? this : b , f ) } var d = this , e = a . call ( arguments , 1 ) ; if ( "function" != typeof d ) throw new TypeError ; return c . prototype = function f ( a ) { return a && ( f . prototype = a ) , this instanceof f ? void 0 : new f } ( d . prototype ) , c } } ( ) ) , Array . isArray || ( Array . isArray = function ( a ) { return "[object Array]" == Object . prototype . toString . call ( a ) } ) , b . Circle = function ( a , b , c ) { a = a || 0 , b = b || 0 , c = c || 0 , this . x = a , this . y = b , this . _diameter = c , this . _radius = c > 0 ? . 5 * c : 0 } , b . Circle . prototype = { circumference : function ( ) { return 2 * Math . PI * this . _radius } , setTo : function ( a , b , c ) { return this . x = a , this . y = b , this . _diameter = c , this . _radius = . 5 * c , this } , copyFrom : function ( a ) { return this . setTo ( a . x , a . y , a . diameter ) } , copyTo : function ( a ) { return a . x = this . x , a . y = this . y , a . diameter = this . _diameter , a } , distance : function ( a , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? b . Math . distanceRound ( this . x , this . y , a . x , a . y ) : b . Math . distance ( this . x , this . y , a . x , a . y ) } , clone : function ( a ) { return "undefined" == typeof a ? a = new b . Circle ( this . x , this . y , this . diameter ) : a . setTo ( this . x , this . y , this . diameter ) , a } , contains : function ( a , c ) { return b . Circle . contains ( this , a , c ) } , circumferencePoint : function ( a , c , d ) { return b . Circle . circumferencePoint ( this , a , c , d ) } , offset : function ( a , b ) { return this . x += a , this . y += b , this } , offsetPoint : function ( a ) { return this . offset ( a . x , a . y ) } , toString : function ( ) { return "[{Phaser.Circle (x=" + this . x + " y=" + this . y + " diameter=" + this . diameter + " radius=" + this . radius + ")}]" } } , b . Circle . prototype . constructor = b . Circle , Object . defineProperty ( b . Circle . prototype , "diameter" , { get : function ( ) { return this . _diameter } , set : function ( a ) { a > 0 && ( this . _diameter = a , this . _radius = . 5 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "radius" , { get : function ( ) { return this . _radius } , set : function ( a ) { a > 0 && ( this . _radius = a , this . _diameter = 2 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "left" , { get : function ( ) { return this . x - this . _radius } , set : function ( a ) { a > this . x ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = this . x - a } } ) , Object . defineProperty ( b . Circle . prototype , "right" , { get : function ( ) { re
} , remove : function ( a ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) if ( this . plugins [ this . _p ] === a ) return a . destroy ( ) , this . plugins . splice ( this . _p , 1 ) , void this . _pluginsLength -- } , removeAll : function ( ) { for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . destroy ( ) ; this . plugins . length = 0 , this . _pluginsLength = 0 } , preUpdate : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasPreUpdate && this . plugins [ this . _p ] . preUpdate ( ) } , update : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasUpdate && this . plugins [ this . _p ] . update ( ) } , postUpdate : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasPostUpdate && this . plugins [ this . _p ] . postUpdate ( ) } , render : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . visible && this . plugins [ this . _p ] . hasRender && this . plugins [ this . _p ] . render ( ) } , postRender : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . visible && this . plugins [ this . _p ] . hasPostRender && this . plugins [ this . _p ] . postRender ( ) } , destroy : function ( ) { this . plugins . length = 0 , this . _pluginsLength = 0 , this . game = null , this . _parent = null } } , b . PluginManager . prototype . constructor = b . PluginManager , b . Stage = function ( a , c , d ) { this . game = a , this . offset = new b . Point , PIXI . Stage . call ( this , 0 , ! 1 ) , this . name = "_stage_root" , this . interactive = ! 1 , this . disableVisibilityChange = ! 1 , this . checkOffsetInterval = 2500 , this . exists = ! 0 , this . currentRenderOrderID = 0 , this . _hiddenVar = "hidden" , this . _nextOffsetCheck = 0 , this . _backgroundColor , a . config ? this . parseConfig ( a . config ) : ( this . game . canvas = b . Canvas . create ( c , d ) , this . game . canvas . style [ "-webkit-full-screen" ] = "width: 100%; height: 100%" ) } , b . Stage . prototype = Object . create ( PIXI . Stage . prototype ) , b . Stage . prototype . constructor = b . Stage , b . Stage . prototype . preUpdate = function ( ) { this . currentRenderOrderID = 0 ; for ( var a = this . children . length , b = 0 ; a > b ; b ++ ) this . children [ b ] . preUpdate ( ) } , b . Stage . prototype . update = function ( ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . update ( ) } , b . Stage . prototype . postUpdate = function ( ) { if ( this . game . world . camera . target ) { this . game . world . camera . target . postUpdate ( ) , this . game . world . camera . update ( ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] !== this . game . world . camera . target && this . children [ a ] . postUpdate ( ) } else { this . game . world . camera . update ( ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] . postUpdate ( ) } this . checkOffsetInterval !== ! 1 && this . game . time . now > this . _nextOffsetCheck && ( b . Canvas . getOffset ( this . game . canvas , this . offset ) , this . _nextOffsetCheck = this . game . time . now + this . checkOffsetInterval ) } , b . Stage . prototype . parseConfig = function ( a ) { this . game . canvas = a . canvasID ? b . Canvas . create ( this . game . width , this . game . height , a . canvasID ) : b . Canvas . create ( this . game . width , this . game . height ) , a . canvasStyle ? this . game . canvas . stlye = a . canvasStyle : this . game . canvas . style [ "-webkit-full-screen" ] = "width: 100%; height: 100%" , a . checkOffsetInterval && ( this . checkOffsetInterval = a . checkOffsetInterval ) , a . disableVisibilityChange && ( this . disableVisibilityChange = a . disableVisibilityChange ) , a . fullScreenScaleMode && ( this . fullScreenScaleMode = a . fullScreenScaleMode ) , a . scaleMode && ( this . scaleMode = a . scaleMode ) , a . backgroundColor && ( this . backgroundColor = a . backgroundColor ) } , b . Stage . prototype . boot = function ( ) { b . Canvas . getOffset ( this . game . canvas , this . offset ) , this . bounds = new b . Rectangle ( this . offset . x , this . offset . y , this . game . width , this . game . height ) ; var a = this ; this . _onChange = function ( b ) { return a . visibilityChange ( b ) } , b . Canvas . setUserSelect ( this . game . canvas , "none" ) , b . Canvas . setTouchAction ( this . game . canvas , "none" ) , this . checkVisibility ( ) } , b . Stage . prototype . checkVisibility = function ( ) { this . _hiddenVar = void 0 != document . webkitHidden ? "webkitvisibilitychange" : void 0 != document . mozHidden ? "mozvisibilitychange" : void 0 != document . msHidden ? "msvisibilitychange" : void 0 != document . hidden ? " visibil
} , b . Input . MOUSE _OVERRIDES _TOUCH = 0 , b . Input . TOUCH _OVERRIDES _MOUSE = 1 , b . Input . MOUSE _TOUCH _COMBINE = 2 , b . Input . prototype = { boot : function ( ) { this . mousePointer = new b . Pointer ( this . game , 0 ) , this . pointer1 = new b . Pointer ( this . game , 1 ) , this . pointer2 = new b . Pointer ( this . game , 2 ) , this . mouse = new b . Mouse ( this . game ) , this . keyboard = new b . Keyboard ( this . game ) , this . touch = new b . Touch ( this . game ) , this . mspointer = new b . MSPointer ( this . game ) , this . gamepad = new b . Gamepad ( this . game ) , this . gestures = new b . Gestures ( this . game ) , this . onDown = new b . Signal , this . onUp = new b . Signal , this . onTap = new b . Signal , this . onHold = new b . Signal , this . scale = new b . Point ( 1 , 1 ) , this . speed = new b . Point , this . position = new b . Point , this . _oldPosition = new b . Point , this . circle = new b . Circle ( 0 , 0 , 44 ) , this . activePointer = this . mousePointer , this . currentPointers = 0 , this . hitCanvas = document . createElement ( "canvas" ) , this . hitCanvas . width = 1 , this . hitCanvas . height = 1 , this . hitContext = this . hitCanvas . getContext ( "2d" ) , this . mouse . start ( ) , this . keyboard . start ( ) , this . touch . start ( ) , this . mspointer . start ( ) , this . mousePointer . active = ! 0 } , destroy : function ( ) { this . mouse . stop ( ) , this . keyboard . stop ( ) , this . touch . stop ( ) , this . mspointer . stop ( ) , this . gamepad . stop ( ) , this . gestures . stop ( ) , this . moveCallback = null } , setMoveCallback : function ( a , b ) { this . moveCallback = a , this . moveCallbackContext = b } , addPointer : function ( ) { for ( var a = 0 , c = 10 ; c > 0 ; c -- ) null === this [ "pointer" + c ] && ( a = c ) ; return 0 === a ? ( console . warn ( "You can only have 10 Pointer objects" ) , null ) : ( this [ "pointer" + a ] = new b . Pointer ( this . game , a ) , this [ "pointer" + a ] ) } , update : function ( ) { return this . keyboard . update ( ) , this . pollRate > 0 && this . _pollCounter < this . pollRate ? void this . _pollCounter ++ : ( this . speed . x = this . position . x - this . _oldPosition . x , this . speed . y = this . position . y - this . _oldPosition . y , this . _oldPosition . copyFrom ( this . position ) , this . mousePointer . update ( ) , this . gamepad . active && this . gamepad . update ( ) , this . pointer1 . update ( ) , this . pointer2 . update ( ) , this . pointer3 && this . pointer3 . update ( ) , this . pointer4 && this . pointer4 . update ( ) , this . pointer5 && this . pointer5 . update ( ) , this . pointer6 && this . pointer6 . update ( ) , this . pointer7 && this . pointer7 . update ( ) , this . pointer8 && this . pointer8 . update ( ) , this . pointer9 && this . pointer9 . update ( ) , this . pointer10 && this . pointer10 . update ( ) , this . _pollCounter = 0 , void ( this . gestures . active && this . gestures . update ( ) ) ) } , reset : function ( a ) { if ( this . game . isBooted !== ! 1 ) { "undefined" == typeof a && ( a = ! 1 ) , this . keyboard . reset ( ) , this . mousePointer . reset ( ) , this . gamepad . reset ( ) ; for ( var c = 1 ; 10 >= c ; c ++ ) this [ "pointer" + c ] && this [ "pointer" + c ] . reset ( ) ; this . currentPointers = 0 , "none" !== this . game . canvas . style . cursor && ( this . game . canvas . style . cursor = "inherit" ) , a === ! 0 && ( this . onDown . dispose ( ) , this . onUp . dispose ( ) , this . onTap . dispose ( ) , this . onHold . dispose ( ) , this . onDown = new b . Signal , this . onUp = new b . Signal , this . onTap = new b . Signal , this . onHold = new b . Signal , this . interactiveItems . callAll ( "reset" ) ) , this . _pollCounter = 0 } } , resetSpeed : function ( a , b ) { this . _oldPosition . setTo ( a , b ) , this . speed . setTo ( 0 , 0 ) } , startPointer : function ( a ) { if ( this . maxPointers < 10 && this . totalActivePointers == this . maxPointers ) return null ; if ( this . pointer1 . active === ! 1 ) return this . pointer1 . start ( a ) ; if ( this . pointer2 . active === ! 1 ) return this . pointer2 . start ( a ) ; for ( var b = 3 ; 10 >= b ; b ++ ) if ( this [ "pointer" + b ] && this [ "pointer" + b ] . active === ! 1 ) return this [ "pointer" + b ] . start ( a ) ; return null } , updatePointer : function ( a ) { if ( this . pointer1 . active && this . pointer1 . identifier == a . identifier ) return this . pointer1 . move ( a ) ; if ( this . pointer2 . active && this . pointer2 . identifier == a . identifier ) return this . pointer2 . move ( a ) ; for ( var b = 3 ; 10 >= b ; b ++ ) if ( this [ "pointer" + b ] && this [ "pointer" + b ] . active && this [ "pointer" + b ] . identifier == a . identifier ) return this [ "pointer" + b ] . move ( a ) ; return null } , stopPointer : function ( a ) { if ( this . pointer1 . active && this . pointer1 . identifier == a . identifier ) return this . pointer1 . stop ( a ) ; if ( this . pointer2 . active && this . pointer2 . identifier == a . identifier ) return this . pointer2 . stop ( a ) ; for ( var b = 3 ; 10 >= b ; b ++ ) if ( this [ "pointer" + b ] && this [ "pointer" + b ] . active && this [ "pointer" + b ] . identifier == a . identifier ) return this [ "pointer" + b ] . stop ( a ) ; return null } , getPointer : function ( a ) { if ( a = a || ! 1 , this . pointer1 . active == a ) return this . pointer1 ; if ( this . pointer2 . active == a ) retu
} , b . SinglePad . prototype = { addCallbacks : function ( a , b ) { "undefined" != typeof b && ( this . onConnectCallback = "function" == typeof b . onConnect ? b . onConnect : this . onConnectCallback , this . onDisconnectCallback = "function" == typeof b . onDisconnect ? b . onDisconnect : this . onDisconnectCallback , this . onDownCallback = "function" == typeof b . onDown ? b . onDown : this . onDownCallback , this . onUpCallback = "function" == typeof b . onUp ? b . onUp : this . onUpCallback , this . onAxisCallback = "function" == typeof b . onAxis ? b . onAxis : this . onAxisCallback , this . onFloatCallback = "function" == typeof b . onFloat ? b . onFloat : this . onFloatCallback ) } , addButton : function ( a ) { return this . _hotkeys [ a ] = new b . GamepadButton ( this . game , a ) , this . _hotkeys [ a ] } , pollStatus : function ( ) { if ( ! this . _rawPad . timestamp || this . _rawPad . timestamp != this . _prevTimestamp ) { for ( var a = 0 ; a < this . _rawPad . buttons . length ; a += 1 ) { var b = this . _rawPad . buttons [ a ] ; this . _rawButtons [ a ] !== b && ( 1 === b ? this . processButtonDown ( a , b ) : 0 === b ? this . processButtonUp ( a , b ) : this . processButtonFloat ( a , b ) , this . _rawButtons [ a ] = b ) } for ( var c = this . _rawPad . axes , d = 0 ; d < c . length ; d += 1 ) { var e = c [ d ] ; this . processAxisChange ( e > 0 && e > this . deadZone || 0 > e && e < - this . deadZone ? { axis : d , value : e } : { axis : d , value : 0 } ) } this . _prevTimestamp = this . _rawPad . timestamp } } , connect : function ( a ) { var b = ! this . _connected ; this . _index = a . index , this . _connected = ! 0 , this . _rawPad = a , this . _rawButtons = a . buttons , this . _axes = a . axes , b && this . _padParent . onConnectCallback && this . _padParent . onConnectCallback . call ( this . _padParent . callbackContext , this . _index ) , b && this . onConnectCallback && this . onConnectCallback . call ( this . callbackContext ) } , disconnect : function ( ) { var a = this . _connected ; this . _connected = ! 1 , this . _rawPad = void 0 , this . _rawButtons = [ ] , this . _buttons = [ ] ; var b = this . _index ; this . _index = null , a && this . _padParent . onDisconnectCallback && this . _padParent . onDisconnectCallback . call ( this . _padParent . callbackContext , b ) , a && this . onDisconnectCallback && this . onDisconnectCallback . call ( this . callbackContext ) } , processAxisChange : function ( a ) { this . game . input . disabled || this . game . input . gamepad . disabled || this . _axes [ a . axis ] !== a . value && ( this . _axes [ a . axis ] = a . value , this . _padParent . onAxisCallback && this . _padParent . onAxisCallback . call ( this . _padParent . callbackContext , a , this . _index ) , this . onAxisCallback && this . onAxisCallback . call ( this . callbackContext , a ) ) } , processButtonDown : function ( a , b ) { this . game . input . disabled || this . game . input . gamepad . disabled || ( this . _padParent . onDownCallback && this . _padParent . onDownCallback . call ( this . _padParent . callbackContext , a , b , this . _index ) , this . onDownCallback && this . onDownCallback . call ( this . callbackContext , a , b ) , this . _buttons [ a ] && this . _buttons [ a ] . isDown ? this . _buttons [ a ] . duration = this . game . time . now - this . _buttons [ a ] . timeDown : this . _buttons [ a ] ? ( this . _buttons [ a ] . isDown = ! 0 , this . _buttons [ a ] . timeDown = this . game . time . now , this . _buttons [ a ] . duration = 0 , this . _buttons [ a ] . value = b ) : this . _buttons [ a ] = { isDown : ! 0 , timeDown : this . game . time . now , timeUp : 0 , duration : 0 , value : b } , this . _hotkeys [ a ] && this . _hotkeys [ a ] . processButtonDown ( b ) ) } , processButtonUp : function ( a , b ) { this . game . input . disabled || this . game . input . gamepad . disabled || ( this . _padParent . onUpCallback && this . _padParent . onUpCallback . call ( this . _padParent . callbackContext , a , b , this . _index ) , this . onUpCallback && this . onUpCallback . call ( this . callbackContext , a , b ) , this . _hotkeys [ a ] && this . _hotkeys [ a ] . processButtonUp ( b ) , this . _buttons [ a ] ? ( this . _buttons [ a ] . isDown = ! 1 , this . _buttons [ a ] . timeUp = this . game . time . now , this . _buttons [ a ] . value = b ) : this . _buttons [ a ] = { isDown : ! 1 , timeDown : this . game . time . now , timeUp : this . game . time . now , duration : 0 , value : b } ) } , processButtonFloat : function ( a , b ) { this . game . input . disabled || this . game . input . gamepad . disabled || ( this . _padParent . onFloatCallback && this . _padParent . onFloatCallback . call ( this . _padParent . callbackContext , a , b , this . _index ) , this . onFloatCallback && this . onFloatCallback . call ( this . callbackContext , a , b ) , this . _buttons [ a ] ? this . _buttons [ a ] . value = b : this . _buttons [ a ] = { value : b } , this . _hotkeys [ a ] && this . _hotkeys [ a ] . processButtonFloat ( b ) ) } , axis : function ( a ) { return this . _axes [ a ] ? this . _axes [ a ] : ! 1 } , isDown : function ( a ) { return this . _buttons [ a ] ? this . _buttons [ a ] . isDown : ! 1 } , justReleased : function ( a , b ) { return "undefined" == typeof b && ( b = 250 ) , this . _buttons [ a ] && this . _buttons [ a ] . i
if ( this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , ! this . exists || ! this . parent . exists ) return this . _cache [ 3 ] = - 1 , ! 1 ; if ( this . lifespan > 0 && ( this . lifespan -= this . game . time . elapsed , this . lifespan <= 0 ) ) return this . kill ( ) , ! 1 ; if ( ( this . autoCull || this . checkWorldBounds ) && this . _bounds . copyFrom ( this . getBounds ( ) ) , this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . _bounds ) ) , this . checkWorldBounds ) if ( 1 === this . _cache [ 5 ] && this . game . world . bounds . intersects ( this . _bounds ) ) this . _cache [ 5 ] = 0 ; else if ( 0 === this . _cache [ 5 ] && ! this . game . world . bounds . intersects ( this . _bounds ) && ( this . _cache [ 5 ] = 1 , this . events . onOutOfBounds . dispatch ( this ) , this . outOfBoundsKill ) ) return this . kill ( ) , ! 1 ; this . world . setTo ( this . game . camera . x + this . worldTransform . tx , this . game . camera . y + this . worldTransform . ty ) , this . visible && ( this . _cache [ 3 ] = this . game . stage . currentRenderOrderID ++ ) , this . animations . update ( ) ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , b . Sprite . prototype . update = function ( ) { } , b . Sprite . prototype . postUpdate = function ( ) { this . key instanceof b . BitmapData && this . key . _dirty && this . key . render ( ) , this . exists && this . body && this . body . postUpdate ( ) , 1 === this . _cache [ 7 ] && ( this . position . x = this . game . camera . view . x + this . cameraOffset . x , this . position . y = this . game . camera . view . y + this . cameraOffset . y ) ; for ( var a = 0 , c = this . children . length ; c > a ; a ++ ) this . children [ a ] . postUpdate ( ) } , b . Sprite . prototype . loadTexture = function ( a , c ) { return c = c || 0 , a instanceof b . RenderTexture ? ( this . key = a . key , void this . setTexture ( a ) ) : a instanceof b . BitmapData ? ( this . key = a . key , void this . setTexture ( a . texture ) ) : a instanceof PIXI . Texture ? ( this . key = a , void this . setTexture ( a ) ) : null === a || "undefined" == typeof a ? ( this . key = "__default" , void this . setTexture ( PIXI . TextureCache [ this . key ] ) ) : "string" != typeof a || this . game . cache . checkImageKey ( a ) ? this . game . cache . isSpriteSheet ( a ) ? ( this . key = a , this . animations . loadFrameData ( this . game . cache . getFrameData ( a ) ) , "string" == typeof c ? this . frameName = c : this . frame = c , void 0 ) : ( this . key = a , void this . setTexture ( PIXI . TextureCache [ a ] ) ) : ( this . key = "__missing" , void this . setTexture ( PIXI . TextureCache [ this . key ] ) ) } , b . Sprite . prototype . crop = function ( a ) { if ( "undefined" == typeof a || null === a ) this . texture . hasOwnProperty ( "sourceWidth" ) && this . texture . setFrame ( new b . Rectangle ( 0 , 0 , this . texture . sourceWidth , this . texture . sourceHeight ) ) ; else if ( this . texture instanceof PIXI . Texture ) { var c = { } ; b . Utils . extend ( ! 0 , c , this . texture ) , c . sourceWidth = c . width , c . sourceHeight = c . height , c . frame = a , c . width = a . width , c . height = a . height , this . texture = c , this . texture . updateFrame = ! 0 , PIXI . Texture . frameUpdates . push ( this . texture ) } else this . texture . setFrame ( a ) } , b . Sprite . prototype . revive = function ( a ) { return "undefined" == typeof a && ( a = 1 ) , this . alive = ! 0 , this . exists = ! 0 , this . visible = ! 0 , this . health = a , this . events && this . events . onRevived . dispatch ( this ) , this } , b . Sprite . prototype . kill = function ( ) { return this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . events && this . events . onKilled . dispatch ( this ) , this } , b . Sprite . prototype . destroy = function ( a ) { if ( null !== this . game ) { "undefined" == typeof a && ( a = ! 0 ) , this . parent && ( this . parent instanceof b . Group ? this . parent . remove ( this ) : this . parent . removeChild ( this ) ) , this . input && this . input . destroy ( ) , this . animations && this . animations . destroy ( ) , this . body && this . body . destroy ( ) , this . events && this . events . destroy ( ) ; var c = this . children . length ; if ( a ) for ( ; c -- ; ) this . children [ c ] . destroy ( a ) ; else for ( ; c -- ; ) this . removeChild ( this . children [ c ] ) ; this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . filters = null , this . mask = null , this . game = null } } , b . Sprite . prototype . damage = function ( a ) { return this . alive && ( this . health -= a , this . health < 0 && this . kill ( ) ) , this } , b . Sprite . prototype . reset = function ( a , b , c ) { return "undefined" == typeof c && ( c = 1 ) , this . world . setTo ( a , b ) , this . position . x = a , this . position . y = b , this . alive = ! 0 , this . exists = ! 0 , this . visible = ! 0 , this . renderable = ! 0 , this . _outOfBoundsFired = ! 1 , this . health = c , this . body && this . body . reset ( a , b , ! 1 , ! 1 ) , this } , b . Sprite . prototype . bringToTop = function ( a ) { return "undefined" == typeof a && this . parent && this . parent . bringToTop ( this ) , this } , b . Sprite . prototype . play = function ( a , b , c , d ) { return this . animations ? this . anima
} , b . Graphics . prototype = Object . create ( PIXI . Graphics . prototype ) , b . Graphics . prototype . constructor = b . Graphics , b . Graphics . prototype . preUpdate = function ( ) { return this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , this . exists && this . parent . exists ? ( this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . getBounds ( ) ) ) , this . world . setTo ( this . game . camera . x + this . worldTransform [ 2 ] , this . game . camera . y + this . worldTransform [ 5 ] ) , this . visible && ( this . _cache [ 3 ] = this . game . stage . currentRenderOrderID ++ ) , ! 0 ) : ( this . renderOrderID = - 1 , ! 1 ) } , b . Graphics . prototype . update = function ( ) { } , b . Graphics . prototype . postUpdate = function ( ) { 1 === this . _cache [ 7 ] && ( this . position . x = this . game . camera . view . x + this . cameraOffset . x , this . position . y = this . game . camera . view . y + this . cameraOffset . y ) } , b . Graphics . prototype . destroy = function ( a ) { "undefined" == typeof a && ( a = ! 0 ) , this . clear ( ) , this . parent && ( this . parent instanceof b . Group ? this . parent . remove ( this ) : this . parent . removeChild ( this ) ) ; var c = this . children . length ; if ( a ) for ( ; c -- ; ) this . children [ c ] . destroy ( a ) ; else for ( ; c -- ; ) this . removeChild ( this . children [ c ] ) ; this . exists = ! 1 , this . visible = ! 1 , this . game = null } , b . Graphics . prototype . drawPolygon = function ( a ) { this . moveTo ( a . points [ 0 ] . x , a . points [ 0 ] . y ) ; for ( var b = 1 ; b < a . points . length ; b += 1 ) this . lineTo ( a . points [ b ] . x , a . points [ b ] . y ) ; this . lineTo ( a . points [ 0 ] . x , a . points [ 0 ] . y ) } , Object . defineProperty ( b . Graphics . prototype , "angle" , { get : function ( ) { return b . Math . radToDeg ( this . rotation ) } , set : function ( a ) { this . rotation = b . Math . degToRad ( a ) } } ) , Object . defineProperty ( b . Graphics . prototype , "fixedToCamera" , { get : function ( ) { return ! ! this . _cache [ 7 ] } , set : function ( a ) { a ? ( this . _cache [ 7 ] = 1 , this . cameraOffset . set ( this . x , this . y ) ) : this . _cache [ 7 ] = 0 } } ) , b . RenderTexture = function ( a , c , d , e ) { this . game = a , this . key = e , this . type = b . RENDERTEXTURE , this . _temp = new b . Point , PIXI . RenderTexture . call ( this , c , d ) } , b . RenderTexture . prototype = Object . create ( PIXI . RenderTexture . prototype ) , b . RenderTexture . prototype . constructor = b . RenderTexture , b . RenderTexture . prototype . renderXY = function ( a , b , c , d ) { this . _temp . set ( b , c ) , this . render ( a , this . _temp , d ) } , b . SpriteBatch = function ( a , c , d , e ) { PIXI . SpriteBatch . call ( this ) , b . Group . call ( this , a , c , d , e ) , this . type = b . SPRITEBATCH } , b . SpriteBatch . prototype = b . Utils . extend ( ! 0 , b . SpriteBatch . prototype , b . Group . prototype , PIXI . SpriteBatch . prototype ) , b . SpriteBatch . prototype . constructor = b . SpriteBatch , b . RetroFont = function ( a , c , d , e , f , g , h , i , j , k ) { this . characterWidth = d , this . characterHeight = e , this . characterSpacingX = h || 0 , this . characterSpacingY = i || 0 , this . characterPerRow = g , this . offsetX = j || 0 , this . offsetY = k || 0 , this . align = "left" , this . multiLine = ! 1 , this . autoUpperCase = ! 0 , this . customSpacingX = 0 , this . customSpacingY = 0 , this . fixedWidth = 0 , this . fontSet = a . cache . getImage ( c ) , this . _text = "" , this . grabData = [ ] ; for ( var l = this . offsetX , m = this . offsetY , n = 0 , o = new b . FrameData , p = 0 ; p < f . length ; p ++ ) { var q = a . rnd . uuid ( ) , r = o . addFrame ( new b . Frame ( p , l , m , this . characterWidth , this . characterHeight , "" , q ) ) ; this . grabData [ f . charCodeAt ( p ) ] = r . index , PIXI . TextureCache [ q ] = new PIXI . Texture ( PIXI . BaseTextureCache [ c ] , { x : l , y : m , width : this . characterWidth , height : this . characterHeight } ) , n ++ , n == this . characterPerRow ? ( n = 0 , l = this . offsetX , m += this . characterHeight + this . characterSpacingY ) : l += this . characterWidth + this . characterSpacingX } a . cache . updateFrameData ( c , o ) , this . stamp = new b . Image ( a , 0 , 0 , c , 0 ) , b . RenderTexture . call ( this , a ) , this . type = b . BITMAPFONT } , b . RetroFont . prototype = Object . create ( b . RenderTexture . prototype ) , b . RetroFont . prototype . constructor = b . RetroFont , b . RetroFont . ALIGN _LEFT = "left" , b . RetroFont . ALIGN _RIGHT = "right" , b . RetroFont . ALIGN _CENTER = "center" , b . RetroFont . TEXT _SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" , b . RetroFont . TEXT _SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ" , b . RetroFont . TEXT _SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 " , b . RetroFont . TEXT _SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789" , b . RetroFont . TEXT _SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789" , b . RetroFont . TEXT _SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' " , b . RetroFont . TEXT _SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39" , b
this . _valuesStartRepeat [ b ] = this . _valuesEnd [ b ] , this . _valuesEnd [ b ] = g , this . _reversed = ! this . _reversed } this . _valuesStart [ b ] = this . _valuesStartRepeat [ b ] } return this . _startTime = a + this . _delayTime , this . onLoop . dispatch ( this . _object ) , ! 0 } this . isRunning = ! 1 , this . onComplete . dispatch ( this . _object ) ; for ( var h = 0 , i = this . _chainedTweens . length ; i > h ; h ++ ) this . _chainedTweens [ h ] . start ( a ) ; return ! 1 } return ! 0 } } , b . Tween . prototype . constructor = b . Tween , b . Easing = { Linear : { None : function ( a ) { return a } } , Quadratic : { In : function ( a ) { return a * a } , Out : function ( a ) { return a * ( 2 - a ) } , InOut : function ( a ) { return ( a *= 2 ) < 1 ? . 5 * a * a : - . 5 * ( -- a * ( a - 2 ) - 1 ) } } , Cubic : { In : function ( a ) { return a * a * a } , Out : function ( a ) { return -- a * a * a + 1 } , InOut : function ( a ) { return ( a *= 2 ) < 1 ? . 5 * a * a * a : . 5 * ( ( a -= 2 ) * a * a + 2 ) } } , Quartic : { In : function ( a ) { return a * a * a * a } , Out : function ( a ) { return 1 - -- a * a * a * a } , InOut : function ( a ) { return ( a *= 2 ) < 1 ? . 5 * a * a * a * a : - . 5 * ( ( a -= 2 ) * a * a * a - 2 ) } } , Quintic : { In : function ( a ) { return a * a * a * a * a } , Out : function ( a ) { return -- a * a * a * a * a + 1 } , InOut : function ( a ) { return ( a *= 2 ) < 1 ? . 5 * a * a * a * a * a : . 5 * ( ( a -= 2 ) * a * a * a * a + 2 ) } } , Sinusoidal : { In : function ( a ) { return 1 - Math . cos ( a * Math . PI / 2 ) } , Out : function ( a ) { return Math . sin ( a * Math . PI / 2 ) } , InOut : function ( a ) { return . 5 * ( 1 - Math . cos ( Math . PI * a ) ) } } , Exponential : { In : function ( a ) { return 0 === a ? 0 : Math . pow ( 1024 , a - 1 ) } , Out : function ( a ) { return 1 === a ? 1 : 1 - Math . pow ( 2 , - 10 * a ) } , InOut : function ( a ) { return 0 === a ? 0 : 1 === a ? 1 : ( a *= 2 ) < 1 ? . 5 * Math . pow ( 1024 , a - 1 ) : . 5 * ( - Math . pow ( 2 , - 10 * ( a - 1 ) ) + 2 ) } } , Circular : { In : function ( a ) { return 1 - Math . sqrt ( 1 - a * a ) } , Out : function ( a ) { return Math . sqrt ( 1 - -- a * a ) } , InOut : function ( a ) { return ( a *= 2 ) < 1 ? - . 5 * ( Math . sqrt ( 1 - a * a ) - 1 ) : . 5 * ( Math . sqrt ( 1 - ( a -= 2 ) * a ) + 1 ) } } , Elastic : { In : function ( a ) { var b , c = . 1 , d = . 4 ; return 0 === a ? 0 : 1 === a ? 1 : ( ! c || 1 > c ? ( c = 1 , b = d / 4 ) : b = d * Math . asin ( 1 / c ) / ( 2 * Math . PI ) , - ( c * Math . pow ( 2 , 10 * ( a -= 1 ) ) * Math . sin ( 2 * ( a - b ) * Math . PI / d ) ) ) } , Out : function ( a ) { var b , c = . 1 , d = . 4 ; return 0 === a ? 0 : 1 === a ? 1 : ( ! c || 1 > c ? ( c = 1 , b = d / 4 ) : b = d * Math . asin ( 1 / c ) / ( 2 * Math . PI ) , c * Math . pow ( 2 , - 10 * a ) * Math . sin ( 2 * ( a - b ) * Math . PI / d ) + 1 ) } , InOut : function ( a ) { var b , c = . 1 , d = . 4 ; return 0 === a ? 0 : 1 === a ? 1 : ( ! c || 1 > c ? ( c = 1 , b = d / 4 ) : b = d * Math . asin ( 1 / c ) / ( 2 * Math . PI ) , ( a *= 2 ) < 1 ? - . 5 * c * Math . pow ( 2 , 10 * ( a -= 1 ) ) * Math . sin ( 2 * ( a - b ) * Math . PI / d ) : c * Math . pow ( 2 , - 10 * ( a -= 1 ) ) * Math . sin ( 2 * ( a - b ) * Math . PI / d ) * . 5 + 1 ) } } , Back : { In : function ( a ) { var b = 1.70158 ; return a * a * ( ( b + 1 ) * a - b ) } , Out : function ( a ) { var b = 1.70158 ; return -- a * a * ( ( b + 1 ) * a + b ) + 1 } , InOut : function ( a ) { var b = 2.5949095 ; return ( a *= 2 ) < 1 ? . 5 * a * a * ( ( b + 1 ) * a - b ) : . 5 * ( ( a -= 2 ) * a * ( ( b + 1 ) * a + b ) + 2 ) } } , Bounce : { In : function ( a ) { return 1 - b . Easing . Bounce . Out ( 1 - a ) } , Out : function ( a ) { return 1 / 2.75 > a ? 7.5625 * a * a : 2 / 2.75 > a ? 7.5625 * ( a -= 1.5 / 2.75 ) * a + . 75 : 2.5 / 2.75 > a ? 7.5625 * ( a -= 2.25 / 2.75 ) * a + . 9375 : 7.5625 * ( a -= 2.625 / 2.75 ) * a + . 984375 } , InOut : function ( a ) { return . 5 > a ? . 5 * b . Easing . Bounce . In ( 2 * a ) : . 5 * b . Easing . Bounce . Out ( 2 * a - 1 ) + . 5 } } } , b . Time = function ( a ) { this . game = a , this . time = 0 , this . now = 0 , this . elapsed = 0 , this . pausedTime = 0 , this . advancedTiming = ! 1 , this . fps = 0 , this . fpsMin = 1e3 , this . fpsMax = 0 , this . msMin = 1e3 , this . msMax = 0 , this . physicsElapsed = 0 , this . frames = 0 , this . pauseDuration = 0 , this . timeToCall = 0 , this . lastTime = 0 , this . events = new b . Timer ( this . game , ! 1 ) , this . _started = 0 , this . _timeLastSecond = 0 , this . _pauseStarted = 0 , this . _justResumed = ! 1 , this . _timers = [ ] , this . _len = 0 , this . _i = 0 } , b . Time . prototype = { boot : function ( ) { this . _started = Date . now ( ) , this . events . start ( ) } , create : function ( a ) { "undefined" == typeof a && ( a = ! 0 ) ; var c = new b . Timer ( this . game , a ) ; return this . _timers . push ( c ) , c } , removeAll : function ( ) { for ( var a = 0 ; a < this . _timers . length ; a ++ ) this . _timers [ a ] . destroy ( ) ; this . _timers = [ ] } , update : function ( a ) { if ( this . now = a , this . _justResumed ) { this . time = this . now , this . _justResumed = ! 1 , this . events . resume ( ) ; for ( var b = 0 ; b < this . _timers . length ; b ++ ) this . _timers [ b ] . _resume ( ) } if ( this . timeToCall = this . game . math . max ( 0 , 16 - ( a - this . lastTime ) ) , this . elapsed = this . now - this . time , this . advancedTiming && ( this . msMin = this . game . math . min ( this . msMin , this . elapsed ) , this . msMax = this . game . math . max ( this . msMax , this . elapsed ) , this . frames ++ , this . now > this . _timeLastSecond + 1e3 && ( this . fps = Math . round ( 1e3 * this . frames / ( this . now - this . _timeLastSecond ) ) , this . fpsMin = this . game . math . min ( this . fpsMin , this . fps ) , this . fpsMax = this . game . math . max ( this . fpsMax , this . fps ) , this . _timeLastSecond = this . now , this . frames = 0 ) ) , this . time = this . now , this . lastTime =
} , b . Loader . TEXTURE _ATLAS _JSON _ARRAY = 0 , b . Loader . TEXTURE _ATLAS _JSON _HASH = 1 , b . Loader . TEXTURE _ATLAS _XML _STARLING = 2 , b . Loader . PHYSICS _LIME _CORONA = 3 , b . Loader . prototype = { setPreloadSprite : function ( a , c ) { c = c || 0 , this . preloadSprite = { sprite : a , direction : c , width : a . width , height : a . height , crop : null } , this . preloadSprite . crop = 0 === c ? new b . Rectangle ( 0 , 0 , 1 , a . height ) : new b . Rectangle ( 0 , 0 , a . width , 1 ) , a . crop ( this . preloadSprite . crop ) , a . visible = ! 0 } , checkKeyExists : function ( a , b ) { if ( this . _fileList . length > 0 ) for ( var c = 0 ; c < this . _fileList . length ; c ++ ) if ( this . _fileList [ c ] . type === a && this . _fileList [ c ] . key === b ) return ! 0 ; return ! 1 } , getAssetIndex : function ( a , b ) { if ( this . _fileList . length > 0 ) for ( var c = 0 ; c < this . _fileList . length ; c ++ ) if ( this . _fileList [ c ] . type === a && this . _fileList [ c ] . key === b ) return c ; return - 1 } , getAsset : function ( a , b ) { if ( this . _fileList . length > 0 ) for ( var c = 0 ; c < this . _fileList . length ; c ++ ) if ( this . _fileList [ c ] . type === a && this . _fileList [ c ] . key === b ) return { index : c , file : this . _fileList [ c ] } ; return ! 1 } , reset : function ( ) { this . preloadSprite = null , this . isLoading = ! 1 , this . _fileList . length = 0 , this . _fileIndex = 0 } , addToFileList : function ( a , b , c , d ) { var e = { type : a , key : b , url : c , data : null , error : ! 1 , loaded : ! 1 } ; if ( "undefined" != typeof d ) for ( var f in d ) e [ f ] = d [ f ] ; this . checkKeyExists ( a , b ) === ! 1 && this . _fileList . push ( e ) } , replaceInFileList : function ( a , b , c , d ) { var e = { type : a , key : b , url : c , data : null , error : ! 1 , loaded : ! 1 } ; if ( "undefined" != typeof d ) for ( var f in d ) e [ f ] = d [ f ] ; var g = this . getAssetIndex ( a , b ) ; - 1 === g ? this . _fileList . push ( e ) : this . _fileList [ g ] = e } , image : function ( a , b , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? this . replaceInFileList ( "image" , a , b ) : this . addToFileList ( "image" , a , b ) , this } , text : function ( a , b , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? this . replaceInFileList ( "text" , a , b ) : this . addToFileList ( "text" , a , b ) , this } , json : function ( a , b , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? this . replaceInFileList ( "json" , a , b ) : this . addToFileList ( "json" , a , b ) , this } , script : function ( a , b , c , d ) { return "undefined" == typeof c && ( c = ! 1 ) , c !== ! 1 && "undefined" == typeof d && ( d = c ) , this . addToFileList ( "script" , a , b , { callback : c , callbackContext : d } ) , this } , binary : function ( a , b , c , d ) { return "undefined" == typeof c && ( c = ! 1 ) , c !== ! 1 && "undefined" == typeof d && ( d = c ) , this . addToFileList ( "binary" , a , b , { callback : c , callbackContext : d } ) , this } , spritesheet : function ( a , b , c , d , e , f , g ) { return "undefined" == typeof e && ( e = - 1 ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = 0 ) , this . addToFileList ( "spritesheet" , a , b , { frameWidth : c , frameHeight : d , frameMax : e , margin : f , spacing : g } ) , this } , audio : function ( a , b , c ) { return "undefined" == typeof c && ( c = ! 0 ) , this . addToFileList ( "audio" , a , b , { buffer : null , autoDecode : c } ) , this } , tilemap : function ( a , c , d , e ) { if ( "undefined" == typeof c && ( c = null ) , "undefined" == typeof d && ( d = null ) , "undefined" == typeof e && ( e = b . Tilemap . CSV ) , null == c && null == d ) return console . warn ( "Phaser.Loader.tilemap - Both mapDataURL and mapData are null. One must be set." ) , this ; if ( d ) { switch ( e ) { case b . Tilemap . CSV : break ; case b . Tilemap . TILED _JSON : "string" == typeof d && ( d = JSON . parse ( d ) ) } this . game . cache . addTilemap ( a , null , d , e ) } else this . addToFileList ( "tilemap" , a , c , { format : e } ) ; return this } , physics : function ( a , c , d , e ) { return "undefined" == typeof c && ( c = null ) , "undefined" == typeof d && ( d = null ) , "undefined" == typeof e && ( e = b . Physics . LIME _CORONA _JSON ) , null == c && null == d ? ( console . warn ( "Phaser.Loader.physics - Both dataURL and jsonData are null. One must be set." ) , this ) : ( d ? ( "string" == typeof d && ( d = JSON . parse ( d ) ) , this . game . cache . addPhysicsData ( a , null , d , e ) ) : this . addToFileList ( "physics" , a , c , { format : e } ) , this ) } , bitmapFont : function ( a , b , c , d , e , f ) { if ( "undefined" == typeof c && ( c = null ) , "undefined" == typeof d && ( d = null ) , "undefined" == typeof e && ( e = 0 ) , "undefined" == typeof f && ( f = 0 ) , c ) this . addToFileList ( "bitmapfont" , a , b , { xmlURL : c , xSpacing : e , ySpacing : f } ) ; else if ( "string" == typeof d ) { var g ; try { if ( window . DOMParser ) { var h = new DOMParser ; g = h . parseFromString ( d , "text/xml" ) } else g = new ActiveXObject ( "Microsoft.XMLDOM" ) , g . async = "false" , g . loadXML ( d ) } catch ( i ) { g = void 0 } if ( ! g || ! g . documentElement || g . getElementsByTagName ( "parsererror" ) . length ) throw new Error ( "Phaser.Loader. Invalid Bitmap Font XML given" ) ; this . addToFileList ( "bitmapfont" , a , b , { xmlURL : null , xmlData : g , xSpacing : e , ySpacing : f } ) } retur
} , pixel : function ( a , b , c , d ) { d = d || 2 , this . start ( ) , this . context . fillStyle = c , this . context . fillRect ( a , b , d , d ) , this . stop ( ) } , geom : function ( a , c , d ) { "undefined" == typeof d && ( d = ! 0 ) , c = c || "rgba(0,255,0,0.3)" , this . start ( ) , this . context . fillStyle = c , this . context . strokeStyle = c , a instanceof b . Rectangle ? d ? this . context . fillRect ( a . x , a . y , a . width , a . height ) : this . context . strokeRect ( a . x , a . y , a . width , a . height ) : a instanceof b . Circle ? ( this . context . beginPath ( ) , this . context . arc ( a . x , a . y , a . radius , 0 , 2 * Math . PI , ! 1 ) , this . context . closePath ( ) , d ? this . context . fill ( ) : this . context . stroke ( ) ) : a instanceof b . Point ? this . context . fillRect ( a . x , a . y , 4 , 4 ) : a instanceof b . Line && ( this . context . lineWidth = 1 , this . context . beginPath ( ) , this . context . moveTo ( a . start . x + . 5 , a . start . y + . 5 ) , this . context . lineTo ( a . end . x + . 5 , a . end . y + . 5 ) , this . context . closePath ( ) , this . context . stroke ( ) ) , this . stop ( ) } , text : function ( a , b , c , d , e ) { d = d || "rgb(255,255,255)" , e = e || "16px Courier" , this . start ( ) , this . context . font = e , this . renderShadow && ( this . context . fillStyle = "rgb(0,0,0)" , this . context . fillText ( a , b + 1 , c + 1 ) ) , this . context . fillStyle = d , this . context . fillText ( a , b , c ) , this . stop ( ) } , bodyInfo : function ( a , b , c , d ) { this . start ( b , c , d , 210 ) , this . line ( "x: " + a . body . x . toFixed ( 2 ) , "y: " + a . body . y . toFixed ( 2 ) , "width: " + a . width , "height: " + a . height ) , this . stop ( ) } , physicsBody : function ( a , b ) { this . start ( 0 , 0 , b ) ; for ( var c = a . data . shapes , d = a . data . shapeOffsets , e = a . data . shapeAngles , f = c . length , g = this . game . math . p2pxi ( a . data . position [ 0 ] ) - this . game . camera . view . x , h = this . game . math . p2pxi ( a . data . position [ 1 ] ) - this . game . camera . view . y , i = a . data . angle ; f -- ; ) c [ f ] instanceof p2 . Rectangle ? this . shapeRectangle ( g , h , i , c [ f ] , d [ f ] , e [ f ] ) : c [ f ] instanceof p2 . Line ? this . shapeLine ( g , h , i , c [ f ] , d [ f ] , e [ f ] ) : c [ f ] instanceof p2 . Convex ? this . shapeConvex ( g , h , i , c [ f ] , d [ f ] , e [ f ] ) : c [ f ] instanceof p2 . Circle && this . shapeCircle ( g , h , i , c [ f ] , d [ f ] , e [ f ] ) ; this . stop ( ) } , shapeRectangle : function ( a , b , c , d , e , f ) { var g = ( this . game . math . p2px ( d . width ) , this . game . math . p2px ( d . height ) , d . vertices ) ; this . context . beginPath ( ) , this . context . save ( ) , this . context . translate ( a + this . game . math . p2pxi ( e [ 0 ] ) , b + this . game . math . p2pxi ( e [ 1 ] ) ) , this . context . rotate ( c + f ) , this . context . moveTo ( this . game . math . p2pxi ( g [ 0 ] [ 0 ] ) , this . game . math . p2pxi ( g [ 0 ] [ 1 ] ) ) ; for ( var h = 1 ; h < g . length ; h ++ ) this . context . lineTo ( this . game . math . p2pxi ( g [ h ] [ 0 ] ) , this . game . math . p2pxi ( g [ h ] [ 1 ] ) ) ; this . context . closePath ( ) , this . context . stroke ( ) , this . context . restore ( ) } , shapeLine : function ( a , b , c , d , e , f ) { this . context . beginPath ( ) , this . context . save ( ) , this . context . translate ( a , b ) , this . context . rotate ( c + f ) , this . context . lineWidth = . 5 , this . context . moveTo ( 0 , 0 ) , this . context . lineTo ( this . game . math . p2px ( d . length ) , 0 ) , this . context . closePath ( ) , this . context . stroke ( ) , this . context . restore ( ) } , shapeConvex : function ( a , b , c , d , e , f ) { var g = d . vertices ; this . context . beginPath ( ) , this . context . save ( ) , this . context . translate ( a + this . game . math . p2pxi ( e [ 0 ] ) , b + this . game . math . p2pxi ( e [ 1 ] ) ) , this . context . rotate ( c + f ) , this . context . moveTo ( this . game . math . p2pxi ( g [ 0 ] [ 0 ] ) , this . game . math . p2pxi ( g [ 0 ] [ 1 ] ) ) ; for ( var h = 1 ; h < g . length ; h ++ ) this . context . lineTo ( this . game . math . p2pxi ( g [ h ] [ 0 ] ) , this . game . math . p2pxi ( g [ h ] [ 1 ] ) ) ; this . context . closePath ( ) , this . context . stroke ( ) , this . context . restore ( ) } , shapeCircle : function ( a , b , c , d , e ) { this . context . beginPath ( ) , this . context . save ( ) , this . context . translate ( a + this . game . math . p2pxi ( e [ 0 ] ) , b + this . game . math . p2pxi ( e [ 1 ] ) ) , this . context . arc ( 0 , 0 , this . game . math . p2px ( d . radius ) , 0 , 2 * Math . PI ) , this . context . closePath ( ) , this . context . stroke ( ) , this . context . restore ( ) } } , b . Utils . Debug . prototype . constructor = b . Utils . Debug , b . Color = { getColor32 : function ( a , b , c , d ) { return a << 24 | b << 16 | c << 8 | d } , getColor : function ( a , b , c ) { return a << 16 | b << 8 | c } , hexToRGB : function ( a ) { var b = "#" == a . charAt ( 0 ) ? a . substring ( 1 , 7 ) : a ; 3 == b . length && ( b = b . charAt ( 0 ) + b . charAt ( 0 ) + b . charAt ( 1 ) + b . charAt ( 1 ) + b . charAt ( 2 ) + b . charAt ( 2 ) ) ; var c = parseInt ( b . substring ( 0 , 2 ) , 16 ) , d = parseInt ( b . substring ( 2 , 4 ) , 16 ) , e = parseInt ( b . substring ( 4 , 6 ) , 16 ) ; return c << 16 | d << 8 | e } , getColorInfo : function ( a ) { var c = b . Color . getRGB ( a ) , d = b . Color . RGBtoHSV ( a ) , e = b . Color . RGBtoHexstring ( a ) + "\n" ; return e = e . concat ( "Alpha: " + c . alpha + " Red: " + c . red + " Green: " + c . green + " Blue: " + c . blue ) + "\n" , e = e . concat ( "Hue: " + d . hue + " Saturation: " + d . saturation + " Lightnes: " + d . lightn
} , b . Tile . prototype = { setCollisionCallback : function ( a , b ) { this . collisionCallback = a , this . collisionCallbackContext = b } , destroy : function ( ) { this . collisionCallback = null , this . collisionCallbackContext = null , this . properties = null } , setCollision : function ( a , b , c , d ) { this . collideLeft = a , this . collideRight = b , this . collideUp = c , this . collideDown = d , this . collideNone = a || b || c || d ? ! 1 : ! 0 } , resetCollision : function ( ) { this . collideNone = ! 0 , this . collideLeft = ! 1 , this . collideRight = ! 1 , this . collideUp = ! 1 , this . collideDown = ! 1 } , copy : function ( a ) { this . index = a . index , this . alpha = a . alpha , this . properties = a . properties , this . collides = a . collides , this . collideNone = a . collideNone , this . collideUp = a . collideUp , this . collideDown = a . collideDown , this . collideLeft = a . collideLeft , this . collideRight = a . collideRight , this . collisionCallback = a . collisionCallback , this . collisionCallbackContext = a . collisionCallbackContext } } , b . Tile . prototype . constructor = b . Tile , Object . defineProperty ( b . Tile . prototype , "canCollide" , { get : function ( ) { return this . collides || this . collisionCallback || this . layer . callbacks [ this . index ] } } ) , Object . defineProperty ( b . Tile . prototype , "left" , { get : function ( ) { return this . x } } ) , Object . defineProperty ( b . Tile . prototype , "right" , { get : function ( ) { return this . x + this . width } } ) , Object . defineProperty ( b . Tile . prototype , "top" , { get : function ( ) { return this . y } } ) , Object . defineProperty ( b . Tile . prototype , "bottom" , { get : function ( ) { return this . y + this . height } } ) , b . Tilemap = function ( a , c , d , e , f , g ) { this . game = a , this . key = c ; var h = b . TilemapParser . parse ( this . game , c , d , e , f , g ) ; null !== h && ( this . width = h . width , this . height = h . height , this . tileWidth = h . tileWidth , this . tileHeight = h . tileHeight , this . orientation = h . orientation , this . version = h . version , this . properties = h . properties , this . widthInPixels = h . widthInPixels , this . heightInPixels = h . heightInPixels , this . layers = h . layers , this . tilesets = h . tilesets , this . tiles = h . tiles , this . objects = h . objects , this . collision = h . collision , this . images = h . images , this . currentLayer = 0 , this . debugMap = [ ] , this . _results = [ ] , this . _tempA = 0 , this . _tempB = 0 ) } , b . Tilemap . CSV = 0 , b . Tilemap . TILED _JSON = 1 , b . Tilemap . prototype = { create : function ( a , b , c , d , e ) { this . width = b , this . height = c , this . setTileSize ( d , e ) ; for ( var f , g = [ ] , h = 0 ; c > h ; h ++ ) { f = [ ] ; for ( var i = 0 ; b > i ; i ++ ) f . push ( null ) ; g . push ( f ) } this . layers . push ( { name : a , x : 0 , y : 0 , width : b , height : c , widthInPixels : this . widthInPixels , heightInPixels : this . heightInPixels , alpha : 1 , visible : ! 0 , properties : { } , indexes : [ ] , callbacks : [ ] , bodies : [ ] , data : g } ) , this . currentLayer = this . layers . length - 1 } , setTileSize : function ( a , b ) { this . tileWidth = a , this . tileHeight = b , this . widthInPixels = this . width * a , this . heightInPixels = this . height * b } , addTilesetImage : function ( a , c , d , e , f , g ) { if ( "undefined" == typeof d && ( d = this . tileWidth ) , "undefined" == typeof e && ( e = this . tileHeight ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = 0 ) , "undefined" == typeof c ) { if ( "string" != typeof a ) return ! 1 ; c = a } if ( "string" == typeof a && ( a = this . getTilesetIndex ( a ) ) , this . tilesets [ a ] ) return this . tilesets [ a ] . setImage ( this . game . cache . getImage ( c ) ) , ! 0 ; var h = new b . Tileset ( c , 0 , d , e , f , g , { } ) ; return h . setImage ( this . game . cache . getImage ( c ) ) , this . tilesets . push ( h ) , ! 1 } , createFromObjects : function ( a , b , c , d , e , f , g ) { if ( "undefined" == typeof e && ( e = ! 0 ) , "undefined" == typeof f && ( f = ! 0 ) , "undefined" == typeof g && ( g = this . game . world ) , ! this . objects [ a ] ) return void console . warn ( "Tilemap.createFromObjects: Invalid objectgroup name given: " + a ) ; for ( var h , i = 0 , j = this . objects [ a ] . length ; j > i ; i ++ ) if ( this . objects [ a ] [ i ] . gid === b ) { h = g . create ( this . objects [ a ] [ i ] . x , this . objects [ a ] [ i ] . y , c , d , e ) , h . anchor . setTo ( 0 , 1 ) , h . name = this . objects [ a ] [ i ] . name , h . visible = this . objects [ a ] [ i ] . visible , h . autoCull = f ; for ( property in this . objects [ a ] [ i ] . properties ) g . set ( h , property , this . objects [ a ] [ i ] . properties [ property ] , ! 1 , ! 1 , 0 ) } } , clearPhysicsBodies : function ( a ) { a = this . getLayer ( a ) ; for ( var b = this . layers [ a ] . bodies . length ; b -- ; ) this . layers [ a ] . bodies [ b ] . destroy ( ) } , generateCollisionData : function ( a , b ) { a = this . getLayer ( a ) , "undefined" == typeof b && ( b = ! 0 ) , this . layers [ a ] . bodies . length > 0 && this . clearPhysicsBodies ( a ) , this . layers [ a ] . bodies . length = [ ] ; for ( var c = 0 , d = 0 , e = 0 , f = 0 , g = this . layers [ a ] . height ; g > f ; f ++ ) { c = 0 ; for ( var h = 0 , i = this . layers [ a ] . width ; i > h ; h ++ ) { var j = this . layers [ a ] . data [ f ] [ h ] ; if ( j ) if ( right = this . getTil