2016-07-01 15:57:13 +00:00
/* Phaser v2.5.1 - http://phaser.io - @photonstorm - (c) 2016 Photon Storm Ltd. */
2016-02-12 16:00:36 +00:00
2016-07-01 15:57:13 +00:00
( function ( ) { function a ( a , b ) { this . _scaleFactor = a , this . _deltaMode = b , this . originalEvent = null } var b = this , c = c || { VERSION : "2.5.1 RC1" , GAMES : [ ] , AUTO : 0 , CANVAS : 1 , WEBGL : 2 , HEADLESS : 3 , NONE : 0 , LEFT : 1 , RIGHT : 2 , UP : 3 , DOWN : 4 , 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 , RETROFONT : 18 , POINTER : 19 , ROPE : 20 , CIRCLE : 21 , RECTANGLE : 22 , LINE : 23 , MATRIX : 24 , POINT : 25 , ROUNDEDRECTANGLE : 26 , CREATURE : 27 , VIDEO : 28 , PENDING _ATLAS : - 1 , HORIZONTAL : 0 , VERTICAL : 1 , LANDSCAPE : 0 , PORTRAIT : 1 , ANGLE _UP : 270 , ANGLE _DOWN : 90 , ANGLE _LEFT : 180 , ANGLE _RIGHT : 0 , ANGLE _NORTH _EAST : 315 , ANGLE _NORTH _WEST : 225 , ANGLE _SOUTH _EAST : 45 , ANGLE _SOUTH _WEST : 135 , TOP _LEFT : 0 , TOP _CENTER : 1 , TOP _RIGHT : 2 , LEFT _TOP : 3 , LEFT _CENTER : 4 , LEFT _BOTTOM : 5 , CENTER : 6 , RIGHT _TOP : 7 , RIGHT _CENTER : 8 , RIGHT _BOTTOM : 9 , BOTTOM _LEFT : 10 , BOTTOM _CENTER : 11 , BOTTOM _RIGHT : 12 , 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 : PIXI || { } } ; if ( Math . trunc || ( Math . trunc = function ( a ) { return 0 > a ? Math . ceil ( a ) : Math . floor ( a ) } ) , 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 ) } ) , Array . prototype . forEach || ( Array . prototype . forEach = function ( a ) { "use strict" ; if ( void 0 === this || null === this ) throw new TypeError ; var b = Object ( this ) , c = b . length >>> 0 ; if ( "function" != typeof a ) throw new TypeError ; for ( var d = arguments . length >= 2 ? arguments [ 1 ] : void 0 , e = 0 ; c > e ; e ++ ) e in b && a . call ( d , b [ e ] , e , b ) } ) , "function" != typeof window . Uint32Array && "object" != typeof window . Uint32Array ) { var d = function ( a ) { var b = new Array ; window [ a ] = function ( a ) { if ( "number" == typeof a ) { Array . call ( this , a ) , this . length = a ; for ( var b = 0 ; b < this . length ; b ++ ) this [ b ] = 0 } else { Array . call ( this , a . length ) , this . length = a . length ; for ( var b = 0 ; b < this . length ; b ++ ) this [ b ] = a [ b ] } } , window [ a ] . prototype = b , window [ a ] . constructor = window [ a ] } ; d ( "Uint32Array" ) , d ( "Int16Array" ) } window . console || ( window . console = { } , window . console . log = window . console . assert = function ( ) { } , window . console . warn = window . console . assert = function ( ) { } ) , c . Utils = { reverseString : function ( a ) { return a . split ( "" ) . reverse ( ) . join ( "" ) } , getProperty : function ( a , b ) { for ( var c = b . split ( "." ) , d = c . pop ( ) , e = c . length , f = 1 , g = c [ 0 ] ; e > f && ( a = a [ g ] ) ; ) g = c [ f ] , f ++ ; return a ? a [ d ] : null } , setProperty : function ( a , b , c ) { for ( var d = b . split ( "." ) , e = d . pop ( ) , f = d . length , g = 1 , h = d [ 0 ] ; f > g && ( a = a [ h ] ) ; ) h = d [ g ] , g ++ ; return a && ( a [ e ] = c ) , a } , chanceRoll : function ( a ) { return void 0 === a && ( a = 50 ) , a > 0 && 100 * Math . random ( ) <= a } , randomChoice : function ( a , b ) { return Math . random ( ) < . 5 ? a : b } , 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 } , pad : function ( a , b , c , d ) { if ( void 0 === b ) var b = 0 ; if ( void 0 === c ) var c = " " ; if ( void 0 === d ) var d = 3 ; a = a . toString ( ) ; var e = 0 ; if ( b + 1 >= a . length ) switch ( d ) { case 1 : a = new Array ( b + 1 - a . length ) . join ( c ) + a ; break ; case 3 : var f = Math . ceil ( ( e = b - a . length ) / 2 ) , g = e - f ; a = new Array ( g + 1 ) . join ( c ) + a + new Array ( f + 1 ) . join ( c ) ; break ; default : a += new 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 && ! { } . hasOwnProperty . call ( a . constructor . prototype , "isPrototypeOf" ) ) return ! 1 } catch ( b ) { return ! 1 } return ! 0 } , extend : function ( ) { var a , b , 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 ( b in a ) d = h [ b ] , e = a [ b ] , h !== e && ( k && e && ( c . Utils . isPlainObject ( e ) || ( f = Array . isArray ( e ) ) ) ? ( f ? ( f = ! 1 , g = d && Array . isArray ( d )
} , c . Camera . FOLLOW _LOCKON = 0 , c . Camera . FOLLOW _PLATFORMER = 1 , c . Camera . FOLLOW _TOPDOWN = 2 , c . Camera . FOLLOW _TOPDOWN _TIGHT = 3 , c . Camera . SHAKE _BOTH = 4 , c . Camera . SHAKE _HORIZONTAL = 5 , c . Camera . SHAKE _VERTICAL = 6 , c . Camera . ENABLE _FX = ! 0 , c . Camera . prototype = { boot : function ( ) { this . displayObject = this . game . world , this . scale = this . game . world . scale , this . game . camera = this , c . Graphics && c . Camera . ENABLE _FX && ( this . fx = new c . Graphics ( this . game ) , this . game . stage . addChild ( this . fx ) ) } , preUpdate : function ( ) { this . totalInView = 0 } , follow : function ( a , b , d , e ) { void 0 === b && ( b = c . Camera . FOLLOW _LOCKON ) , void 0 === d && ( d = 1 ) , void 0 === e && ( e = 1 ) , this . target = a , this . lerp . set ( d , e ) ; var f ; switch ( b ) { case c . Camera . FOLLOW _PLATFORMER : var g = this . width / 8 , h = this . height / 3 ; this . deadzone = new c . Rectangle ( ( this . width - g ) / 2 , ( this . height - h ) / 2 - . 25 * h , g , h ) ; break ; case c . Camera . FOLLOW _TOPDOWN : f = Math . max ( this . width , this . height ) / 4 , this . deadzone = new c . Rectangle ( ( this . width - f ) / 2 , ( this . height - f ) / 2 , f , f ) ; break ; case c . Camera . FOLLOW _TOPDOWN _TIGHT : f = Math . max ( this . width , this . height ) / 8 , this . deadzone = new c . Rectangle ( ( this . width - f ) / 2 , ( this . height - f ) / 2 , f , f ) ; break ; case c . Camera . FOLLOW _LOCKON : this . deadzone = null ; break ; default : this . deadzone = null } } , unfollow : function ( ) { this . target = null } , focusOn : function ( a ) { this . setPosition ( Math . round ( a . x - this . view . halfWidth ) , Math . round ( a . y - this . view . halfHeight ) ) } , focusOnXY : function ( a , b ) { this . setPosition ( Math . round ( a - this . view . halfWidth ) , Math . round ( b - this . view . halfHeight ) ) } , shake : function ( a , b , d , e , f ) { return void 0 === a && ( a = . 05 ) , void 0 === b && ( b = 500 ) , void 0 === d && ( d = ! 0 ) , void 0 === e && ( e = c . Camera . SHAKE _BOTH ) , void 0 === f && ( f = ! 0 ) , ! d && this . _shake . duration > 0 ? ! 1 : ( this . _shake . intensity = a , this . _shake . duration = b , this . _shake . shakeBounds = f , this . _shake . x = 0 , this . _shake . y = 0 , this . _shake . horizontal = e === c . Camera . SHAKE _BOTH || e === c . Camera . SHAKE _HORIZONTAL , this . _shake . vertical = e === c . Camera . SHAKE _BOTH || e === c . Camera . SHAKE _VERTICAL , ! 0 ) } , flash : function ( a , b , c ) { return void 0 === a && ( a = 16777215 ) , void 0 === b && ( b = 500 ) , void 0 === c && ( c = ! 1 ) , ! this . fx || ! c && this . _fxDuration > 0 ? ! 1 : ( this . fx . clear ( ) , this . fx . beginFill ( a ) , this . fx . drawRect ( 0 , 0 , this . width , this . height ) , this . fx . endFill ( ) , this . fx . alpha = 1 , this . _fxDuration = b , this . _fxType = 0 , ! 0 ) } , fade : function ( a , b , c ) { return void 0 === a && ( a = 0 ) , void 0 === b && ( b = 500 ) , void 0 === c && ( c = ! 1 ) , ! this . fx || ! c && this . _fxDuration > 0 ? ! 1 : ( this . fx . clear ( ) , this . fx . beginFill ( a ) , this . fx . drawRect ( 0 , 0 , this . width , this . height ) , this . fx . endFill ( ) , this . fx . alpha = 0 , this . _fxDuration = b , this . _fxType = 1 , ! 0 ) } , update : function ( ) { this . _fxDuration > 0 && this . updateFX ( ) , this . _shake . duration > 0 && this . updateShake ( ) , this . bounds && this . checkBounds ( ) , this . roundPx && ( this . view . floor ( ) , this . _shake . x = Math . floor ( this . _shake . x ) , this . _shake . y = Math . floor ( this . _shake . y ) ) , this . displayObject . position . x = - this . view . x , this . displayObject . position . y = - this . view . y } , updateFX : function ( ) { 0 === this . _fxType ? ( this . fx . alpha -= this . game . time . elapsedMS / this . _fxDuration , this . fx . alpha <= 0 && ( this . _fxDuration = 0 , this . fx . alpha = 0 , this . onFlashComplete . dispatch ( ) ) ) : ( this . fx . alpha += this . game . time . elapsedMS / this . _fxDuration , this . fx . alpha >= 1 && ( this . _fxDuration = 0 , this . fx . alpha = 1 , this . onFadeComplete . dispatch ( ) ) ) } , updateShake : function ( ) { this . _shake . duration -= this . game . time . elapsedMS , this . _shake . duration <= 0 ? ( this . onShakeComplete . dispatch ( ) , this . _shake . x = 0 , this . _shake . y = 0 ) : ( this . _shake . horizontal && ( this . _shake . x = this . game . rnd . frac ( ) * this . _shake . intensity * this . view . width * 2 - this . _shake . intensity * this . view . width ) , this . _shake . vertical && ( this . _shake . y = this . game . rnd . frac ( ) * this . _shake . intensity * this . view . height * 2 - this . _shake . intensity * this . view . height ) ) } , updateTarget : function ( ) { this . _targetPosition . x = this . view . x + this . target . worldPosition . x , this . _targetPosition . y = this . view . y + this . target . worldPosition . y , this . deadzone ? ( this . _edge = this . _targetPosition . x - this . view . x , this . _edge < this . deadzone . left ? this . view . x = this . game . math . linear ( this . view . x , this . _targetPosition . x - this . deadzone . left , this . lerp . x ) : this . _edge > this . deadzone . right && ( this . view . x = this . game . math . linear ( this . view . x , this . _targetPosition . x - this . deadzone . right , this . lerp . x ) ) , this . _edge = this . _targetPosition . y - this . view . y , this . _edge < this . deadzone . top ? this . view . y = this . game . math
this . remove ( a ) , this . addAt ( b , d ) , a ) : void 0 } , c . Group . prototype . hasProperty = function ( a , b ) { var c = b . length ; return 1 === c && b [ 0 ] in a ? ! 0 : 2 === c && b [ 0 ] in a && b [ 1 ] in a [ b [ 0 ] ] ? ! 0 : 3 === c && b [ 0 ] in a && b [ 1 ] in a [ b [ 0 ] ] && b [ 2 ] in a [ b [ 0 ] ] [ b [ 1 ] ] ? ! 0 : 4 === c && b [ 0 ] in a && b [ 1 ] in a [ b [ 0 ] ] && b [ 2 ] in a [ b [ 0 ] ] [ b [ 1 ] ] && b [ 3 ] in a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] } , c . Group . prototype . setProperty = function ( a , b , c , d , e ) { if ( void 0 === e && ( e = ! 1 ) , d = d || 0 , ! this . hasProperty ( a , b ) && ( ! e || d > 0 ) ) return ! 1 ; var f = b . length ; return 1 === f ? 0 === d ? a [ b [ 0 ] ] = c : 1 == d ? a [ b [ 0 ] ] += c : 2 == d ? a [ b [ 0 ] ] -= c : 3 == d ? a [ b [ 0 ] ] *= c : 4 == d && ( a [ b [ 0 ] ] /= c ) : 2 === f ? 0 === d ? a [ b [ 0 ] ] [ b [ 1 ] ] = c : 1 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] += c : 2 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] -= c : 3 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] *= c : 4 == d && ( a [ b [ 0 ] ] [ b [ 1 ] ] /= c ) : 3 === f ? 0 === d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] = c : 1 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] += c : 2 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] -= c : 3 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] *= c : 4 == d && ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] /= c ) : 4 === f && ( 0 === d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] = c : 1 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] += c : 2 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] -= c : 3 == d ? a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] *= c : 4 == d && ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] /= c ) ) , ! 0 } , c . Group . prototype . checkProperty = function ( a , b , d , e ) { return void 0 === e && ( e = ! 1 ) , ! c . Utils . getProperty ( a , b ) && e ? ! 1 : c . Utils . getProperty ( a , b ) === d } , c . Group . prototype . set = function ( a , b , c , d , e , f , g ) { return void 0 === g && ( g = ! 1 ) , b = b . split ( "." ) , void 0 === d && ( d = ! 1 ) , void 0 === e && ( e = ! 1 ) , ( d === ! 1 || d && a . alive ) && ( e === ! 1 || e && a . visible ) ? this . setProperty ( a , b , c , f , g ) : void 0 } , c . Group . prototype . setAll = function ( a , b , c , d , e , f ) { void 0 === c && ( c = ! 1 ) , void 0 === d && ( d = ! 1 ) , void 0 === f && ( f = ! 1 ) , a = a . split ( "." ) , e = e || 0 ; for ( var g = 0 ; g < this . children . length ; g ++ ) ( ! c || c && this . children [ g ] . alive ) && ( ! d || d && this . children [ g ] . visible ) && this . setProperty ( this . children [ g ] , a , b , e , f ) } , c . Group . prototype . setAllChildren = function ( a , b , d , e , f , g ) { void 0 === d && ( d = ! 1 ) , void 0 === e && ( e = ! 1 ) , void 0 === g && ( g = ! 1 ) , f = f || 0 ; for ( var h = 0 ; h < this . children . length ; h ++ ) ( ! d || d && this . children [ h ] . alive ) && ( ! e || e && this . children [ h ] . visible ) && ( this . children [ h ] instanceof c . Group ? this . children [ h ] . setAllChildren ( a , b , d , e , f , g ) : this . setProperty ( this . children [ h ] , a . split ( "." ) , b , f , g ) ) } , c . Group . prototype . checkAll = function ( a , b , c , d , e ) { void 0 === c && ( c = ! 1 ) , void 0 === d && ( d = ! 1 ) , void 0 === e && ( e = ! 1 ) ; for ( var f = 0 ; f < this . children . length ; f ++ ) if ( ( ! c || c && this . children [ f ] . alive ) && ( ! d || d && this . children [ f ] . visible ) && ! this . checkProperty ( this . children [ f ] , a , b , e ) ) return ! 1 ; return ! 0 } , c . Group . prototype . addAll = function ( a , b , c , d ) { this . setAll ( a , b , c , d , 1 ) } , c . Group . prototype . subAll = function ( a , b , c , d ) { this . setAll ( a , b , c , d , 2 ) } , c . Group . prototype . multiplyAll = function ( a , b , c , d ) { this . setAll ( a , b , c , d , 3 ) } , c . Group . prototype . divideAll = function ( a , b , c , d ) { this . setAll ( a , b , c , d , 4 ) } , c . Group . prototype . callAllExists = function ( a , b ) { var c ; if ( arguments . length > 2 ) { c = [ ] ; for ( var d = 2 ; d < arguments . length ; d ++ ) c . push ( arguments [ d ] ) } for ( var d = 0 ; d < this . children . length ; d ++ ) this . children [ d ] . exists === b && this . children [ d ] [ a ] && this . children [ d ] [ a ] . apply ( this . children [ d ] , c ) } , c . Group . prototype . callbackFromArray = function ( a , b , c ) { if ( 1 == c ) { if ( a [ b [ 0 ] ] ) return a [ b [ 0 ] ] } else if ( 2 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] } else if ( 3 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] } else if ( 4 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] } else if ( a [ b ] ) return a [ b ] ; return ! 1 } , c . Group . prototype . callAll = function ( a , b ) { if ( void 0 !== a ) { a = a . split ( "." ) ; var c = a . length ; if ( void 0 === b || null === b || "" === b ) b = null ; else if ( "string" == typeof b ) { b = b . split ( "." ) ; var d = b . length } var e ; if ( arguments . length > 2 ) { e = [ ] ; for ( var f = 2 ; f < arguments . length ; f ++ ) e . push ( arguments [ f ] ) } for ( var g = null , h = null , f = 0 ; f < this . children . length ; f ++ ) g = this . callbackFromArray ( this . children [ f ] , a , c ) , b && g ? ( h = this . callbackFromArray ( this . children [ f ] , b , d ) , g && g . apply ( h , e ) ) : g && g . apply ( this . children [ f ] , e ) } } , c . Group . prototype . preUpdate = function ( ) { if ( this . pendingDestroy ) return this . destroy ( ) , ! 1 ; if ( ! this . exists || ! this . parent . exists ) return this . renderOrderID = - 1 , ! 1 ; for ( var a = 0 ; a < this . children . length ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , c . Group . prototype . update = function ( ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . update ( ) } , c . Group . prototype . postUpdate = function ( ) { this . fixedToCamera && ( this . x = this . game . camera . view . x + this . cameraOffset . x , this . y = this . game . camera . view . y + this . cameraOffset . y ) ; for ( var a = 0
window . addEventListener ( "mouseout" , this . _onMouseOutGlobal , ! 0 ) , c . addEventListener ( "mouseover" , this . _onMouseOver , ! 0 ) , c . addEventListener ( "mouseout" , this . _onMouseOut , ! 0 ) ) ; var d = this . game . device . wheelEvent ; d && ( c . addEventListener ( d , this . _onMouseWheel , ! 0 ) , "mousewheel" === d ? this . _wheelEvent = new a ( - 1 / 40 , 1 ) : "DOMMouseScroll" === d && ( this . _wheelEvent = new a ( 1 , 1 ) ) ) } } , onMouseDown : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . mouseDownCallback && this . mouseDownCallback . call ( this . callbackContext , a ) , this . input . enabled && this . enabled && ( a . identifier = 0 , this . input . mousePointer . start ( a ) ) } , onMouseMove : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . mouseMoveCallback && this . mouseMoveCallback . call ( this . callbackContext , a ) , this . input . enabled && this . enabled && ( a . identifier = 0 , this . input . mousePointer . move ( a ) ) } , onMouseUp : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . mouseUpCallback && this . mouseUpCallback . call ( this . callbackContext , a ) , this . input . enabled && this . enabled && ( a . identifier = 0 , this . input . mousePointer . stop ( a ) ) } , onMouseUpGlobal : function ( a ) { this . input . mousePointer . withinGame || ( this . mouseUpCallback && this . mouseUpCallback . call ( this . callbackContext , a ) , a . identifier = 0 , this . input . mousePointer . stop ( a ) ) } , onMouseOutGlobal : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . input . mousePointer . withinGame = ! 1 , this . input . enabled && this . enabled && ( this . input . mousePointer . stop ( a ) , this . input . mousePointer . leftButton . stop ( a ) , this . input . mousePointer . rightButton . stop ( a ) ) } , onMouseOut : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . input . mousePointer . withinGame = ! 1 , this . mouseOutCallback && this . mouseOutCallback . call ( this . callbackContext , a ) , this . input . enabled && this . enabled && this . stopOnGameOut && ( a . identifier = 0 , this . input . mousePointer . stop ( a ) ) } , onMouseOver : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . input . mousePointer . withinGame = ! 0 , this . mouseOverCallback && this . mouseOverCallback . call ( this . callbackContext , a ) } , onMouseWheel : function ( a ) { this . _wheelEvent && ( a = this . _wheelEvent . bindEvent ( a ) ) , this . event = a , this . capture && a . preventDefault ( ) , this . wheelDelta = c . Math . clamp ( - a . deltaY , - 1 , 1 ) , this . mouseWheelCallback && this . mouseWheelCallback . call ( this . callbackContext , a ) } , requestPointerLock : function ( ) { if ( this . game . device . pointerLock ) { var a = this . game . canvas ; a . requestPointerLock = a . requestPointerLock || a . mozRequestPointerLock || a . webkitRequestPointerLock , a . requestPointerLock ( ) ; var b = this ; this . _pointerLockChange = function ( a ) { return b . pointerLockChange ( a ) } , document . addEventListener ( "pointerlockchange" , this . _pointerLockChange , ! 0 ) , document . addEventListener ( "mozpointerlockchange" , this . _pointerLockChange , ! 0 ) , document . addEventListener ( "webkitpointerlockchange" , this . _pointerLockChange , ! 0 ) } } , pointerLockChange : function ( a ) { var b = this . game . canvas ; document . pointerLockElement === b || document . mozPointerLockElement === b || document . webkitPointerLockElement === b ? ( this . locked = ! 0 , this . pointerLock . dispatch ( ! 0 , a ) ) : ( this . locked = ! 1 , this . pointerLock . dispatch ( ! 1 , a ) ) } , releasePointerLock : function ( ) { document . exitPointerLock = document . exitPointerLock || document . mozExitPointerLock || document . webkitExitPointerLock , document . exitPointerLock ( ) , document . removeEventListener ( "pointerlockchange" , this . _pointerLockChange , ! 0 ) , document . removeEventListener ( "mozpointerlockchange" , this . _pointerLockChange , ! 0 ) , document . removeEventListener ( "webkitpointerlockchange" , this . _pointerLockChange , ! 0 ) } , stop : function ( ) { var a = this . game . canvas ; a . removeEventListener ( "mousedown" , this . _onMouseDown , ! 0 ) , a . removeEventListener ( "mousemove" , this . _onMouseMove , ! 0 ) , a . removeEventListener ( "mouseup" , this . _onMouseUp , ! 0 ) , a . removeEventListener ( "mouseover" , this . _onMouseOver , ! 0 ) , a . removeEventListener ( "mouseout" , this . _onMouseOut , ! 0 ) ; var b = this . game . device . wheelEvent ; b && a . removeEventListener ( b , this . _onMouseWheel , ! 0 ) , window . removeEventListener ( "mouseup" , this . _onMouseUpGlobal , ! 0 ) , window . removeEventListener ( "mouseout" , this . _onMouseOutGlobal , ! 0 ) , document . removeEventListener ( "pointerlockchange" , this . _pointerLockChange , ! 0 ) , document . removeEventListener ( "mozpointerlockchange" , this . _pointerLockChange , ! 0 ) , document . removeEvent
} } , _touchedHandler : function ( a ) { if ( null !== this . sprite ) { var b = this . _pointerData [ a . id ] ; if ( ! b . isDown && b . isOver ) { if ( this . pixelPerfectClick && ! this . checkPixel ( null , null , a ) ) return ; if ( b . isDown = ! 0 , b . isUp = ! 1 , b . timeDown = this . game . time . time , this . downPoint . set ( a . x , a . y ) , a . dirty = ! 0 , this . sprite && this . sprite . events && ( this . sprite . events . onInputDown$dispatch ( this . sprite , a ) , this . sprite && this . sprite . parent && this . sprite . parent . type === c . GROUP && this . sprite . parent . onChildInputDown . dispatch ( this . sprite , a ) , null === this . sprite ) ) return ; this . draggable && this . isDragged === ! 1 && ( 0 === this . dragTimeThreshold && 0 === this . dragDistanceThreshold ? this . startDrag ( a ) : ( this . _pendingDrag = ! 0 , this . _dragDistancePass = 0 === this . dragDistanceThreshold , this . dragTimeThreshold > 0 ? ( this . _dragTimePass = ! 1 , this . game . time . events . add ( this . dragTimeThreshold , this . dragTimeElapsed , this , a ) ) : this . _dragTimePass = ! 0 ) ) , this . bringToTop && this . sprite . bringToTop ( ) } } } , dragTimeElapsed : function ( a ) { this . _dragTimePass = ! 0 , this . _pendingDrag && this . sprite && this . _dragDistancePass && this . startDrag ( a ) } , _releasedHandler : function ( a ) { if ( null !== this . sprite ) { var b = this . _pointerData [ a . id ] ; if ( b . isDown && a . isUp ) { b . isDown = ! 1 , b . isUp = ! 0 , b . timeUp = this . game . time . time , b . downDuration = b . timeUp - b . timeDown ; var d = this . checkPointerOver ( a ) ; this . sprite && this . sprite . events && ( this . dragStopBlocksInputUp && ( ! this . dragStopBlocksInputUp || this . draggable && this . isDragged && this . _draggedPointerID === a . id ) || this . sprite . events . onInputUp$dispatch ( this . sprite , a , d ) , this . sprite && this . sprite . parent && this . sprite . parent . type === c . GROUP && this . sprite . parent . onChildInputUp . dispatch ( this . sprite , a , d ) , d && ( d = this . checkPointerOver ( a ) ) ) , b . isOver = d , ! d && this . useHandCursor && ( this . game . canvas . style . cursor = "default" , this . _setHandCursor = ! 1 ) , a . dirty = ! 0 , this . _pendingDrag = ! 1 , this . draggable && this . isDragged && this . _draggedPointerID === a . id && this . stopDrag ( a ) } } } , updateDrag : function ( a , b ) { if ( a . isUp ) return this . stopDrag ( a ) , ! 1 ; void 0 === b && ( b = ! 1 ) ; var c = this . globalToLocalX ( a . x ) + this . _dragPoint . x + this . dragOffset . x , d = this . globalToLocalY ( a . y ) + this . _dragPoint . y + this . dragOffset . y ; if ( this . sprite . fixedToCamera ) this . allowHorizontalDrag && ( this . sprite . cameraOffset . x = c ) , this . allowVerticalDrag && ( this . sprite . cameraOffset . y = d ) , this . boundsRect && this . checkBoundsRect ( ) , this . boundsSprite && this . checkBoundsSprite ( ) , this . snapOnDrag && ( this . sprite . cameraOffset . x = Math . round ( ( this . sprite . cameraOffset . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . cameraOffset . y = Math . round ( ( this . sprite . cameraOffset . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY , this . snapPoint . set ( this . sprite . cameraOffset . x , this . sprite . cameraOffset . y ) ) ; else { var e = this . game . camera . x - this . _pointerData [ a . id ] . camX , f = this . game . camera . y - this . _pointerData [ a . id ] . camY ; this . allowHorizontalDrag && ( this . sprite . x = c + e ) , this . allowVerticalDrag && ( this . sprite . y = d + f ) , this . boundsRect && this . checkBoundsRect ( ) , this . boundsSprite && this . checkBoundsSprite ( ) , this . snapOnDrag && ( this . sprite . x = Math . round ( ( this . sprite . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . y = Math . round ( ( this . sprite . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY , this . snapPoint . set ( this . sprite . x , this . sprite . y ) ) } return this . sprite . events . onDragUpdate . dispatch ( this . sprite , a , c , d , this . snapPoint , b ) , ! 0 } , justOver : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isOver && this . overDuration ( a ) < b } , justOut : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isOut && this . game . time . time - this . _pointerData [ a ] . timeOut < b } , justPressed : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isDown && this . downDuration ( a ) < b } , justReleased : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isUp && this . game . time . time - this . _pointerData [ a ] . timeUp < b } , overDuration : function ( a ) { return a = a || 0 , this . _pointerData [ a ] . isOver ? this . game . time . time - this . _pointerData [ a ] . timeOver : - 1 } , downDuration : function ( a ) { return a = a || 0 , this . _pointerData [ a ] . isDown ? this . game . time . time - this . _pointerData [ a ] . timeDown : - 1 } , enableDrag : function ( a , b , d , e , f , g ) { void 0 === a && ( a = ! 1 ) , void 0 === b && ( b = ! 1 )
this . animations && this . animations . update ( ) , this . body && this . body . preUpdate ( ) ; for ( var a = 0 ; a < this . children . length ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , c . Component . Core . prototype = { game : null , name : "" , data : { } , components : { } , z : 0 , events : void 0 , animations : void 0 , key : "" , world : null , debug : ! 1 , previousPosition : null , previousRotation : 0 , renderOrderID : 0 , fresh : ! 0 , pendingDestroy : ! 1 , _bounds : null , _exists : ! 0 , exists : { get : function ( ) { return this . _exists } , set : function ( a ) { a ? ( this . _exists = ! 0 , this . body && this . body . type === c . Physics . P2JS && this . body . addToWorld ( ) , this . visible = ! 0 ) : ( this . _exists = ! 1 , this . body && this . body . type === c . Physics . P2JS && this . body . removeFromWorld ( ) , this . visible = ! 1 ) } } , update : function ( ) { } , postUpdate : function ( ) { this . customRender && this . key . render ( ) , this . components . PhysicsBody && c . Component . PhysicsBody . postUpdate . call ( this ) , this . components . FixedToCamera && c . Component . FixedToCamera . postUpdate . call ( this ) ; for ( var a = 0 ; a < this . children . length ; a ++ ) this . children [ a ] . postUpdate ( ) } } , c . Component . Crop = function ( ) { } , c . Component . Crop . prototype = { cropRect : null , _crop : null , crop : function ( a , b ) { void 0 === b && ( b = ! 1 ) , a ? ( b && null !== this . cropRect ? this . cropRect . setTo ( a . x , a . y , a . width , a . height ) : b && null === this . cropRect ? this . cropRect = new c . Rectangle ( a . x , a . y , a . width , a . height ) : this . cropRect = a , this . updateCrop ( ) ) : ( this . _crop = null , this . cropRect = null , this . resetFrame ( ) ) } , updateCrop : function ( ) { if ( this . cropRect ) { this . _crop = c . Rectangle . clone ( this . cropRect , this . _crop ) , this . _crop . x += this . _frame . x , this . _crop . y += this . _frame . y ; var a = Math . max ( this . _frame . x , this . _crop . x ) , b = Math . max ( this . _frame . y , this . _crop . y ) , d = Math . min ( this . _frame . right , this . _crop . right ) - a , e = Math . min ( this . _frame . bottom , this . _crop . bottom ) - b ; this . texture . crop . x = a , this . texture . crop . y = b , this . texture . crop . width = d , this . texture . crop . height = e , this . texture . frame . width = Math . min ( d , this . cropRect . width ) , this . texture . frame . height = Math . min ( e , this . cropRect . height ) , this . texture . width = this . texture . frame . width , this . texture . height = this . texture . frame . height , this . texture . _updateUvs ( ) } } } , c . Component . Delta = function ( ) { } , c . Component . Delta . prototype = { deltaX : { get : function ( ) { return this . world . x - this . previousPosition . x } } , deltaY : { get : function ( ) { return this . world . y - this . previousPosition . y } } , deltaZ : { get : function ( ) { return this . rotation - this . previousRotation } } } , c . Component . Destroy = function ( ) { } , c . Component . Destroy . prototype = { destroyPhase : ! 1 , destroy : function ( a , b ) { if ( null !== this . game && ! this . destroyPhase ) { void 0 === a && ( a = ! 0 ) , void 0 === b && ( b = ! 1 ) , this . destroyPhase = ! 0 , this . events && this . events . onDestroy$dispatch ( this ) , this . parent && ( this . parent instanceof c . 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 ( ) , this . game . tweens . removeFrom ( this ) ; var d = this . children . length ; if ( a ) for ( ; d -- ; ) this . children [ d ] . destroy ( a ) ; else for ( ; d -- ; ) this . removeChild ( this . children [ d ] ) ; this . _crop && ( this . _crop = null ) , this . _frame && ( this . _frame = null ) , c . Video && this . key instanceof c . Video && this . key . onChangeSource . remove ( this . resizeFrame , this ) , c . BitmapText && this . _glyphs && ( this . _glyphs = [ ] ) , this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . filters = null , this . mask = null , this . game = null , this . data = { } , this . renderable = ! 1 , this . transformCallback && ( this . transformCallback = null , this . transformCallbackContext = null ) , this . hitArea = null , this . parent = null , this . stage = null , this . worldTransform = null , this . filterArea = null , this . _bounds = null , this . _currentBounds = null , this . _mask = null , this . _destroyCachedSprite ( ) , b && this . texture . destroy ( ! 0 ) , this . destroyPhase = ! 1 , this . pendingDestroy = ! 1 } } } , c . Events = function ( a ) { this . parent = a } , c . Events . prototype = { destroy : function ( ) { this . _parent = null , this . _onDestroy && this . _onDestroy . dispose ( ) , this . _onAddedToGroup && this . _onAddedToGroup . dispose ( ) , this . _onRemovedFromGroup && this . _onRemovedFromGroup . dispose ( ) , this . _onRemovedFromWorld && this . _onRemovedFromWorld . dispose ( ) , this . _onKilled && this . _onKilled . dispose ( ) , this . _onRevived && this . _onRevived . dispose ( ) , this . _onEnterBounds && this . _onEnterBounds . dispose ( ) , this . _onOutOfBounds && this . _onOutOfBounds . dispose ( ) , this . _onInpu
this . _anchor . set ( a . anchor . x , a . anchor . y ) , this . _rotate = a . rotation , this . _alpha . current = a . alpha , a . texture instanceof c . RenderTexture || a . texture instanceof PIXI . RenderTexture ? this . _image = a . texture . getCanvas ( ) : this . _image = a . texture . baseTexture . source , void 0 !== g && null !== g || ( g = a . x ) , void 0 !== h && null !== h || ( h = a . y ) , a . texture . trim && ( g += a . texture . trim . x - a . anchor . x * a . texture . trim . width , h += a . texture . trim . y - a . anchor . y * a . texture . trim . height ) , 16777215 !== a . tint && ( a . cachedTint !== a . tint && ( a . cachedTint = a . tint , a . tintedTexture = PIXI . CanvasTinter . getTintedTexture ( a , a . tint ) ) , this . _image = a . tintedTexture , this . _pos . set ( 0 ) ) ; else { if ( this . _pos . set ( 0 ) , this . _scale . set ( 1 ) , this . _anchor . set ( 0 ) , this . _rotate = 0 , this . _alpha . current = 1 , a instanceof c . BitmapData ) this . _image = a . canvas ; else if ( "string" == typeof a ) { if ( a = this . game . cache . getImage ( a ) , null === a ) return ; this . _image = a } this . _size . set ( this . _image . width , this . _image . height ) } if ( void 0 !== b && null !== b || ( b = 0 ) , void 0 !== d && null !== d || ( d = 0 ) , e && ( this . _size . x = e ) , f && ( this . _size . y = f ) , void 0 !== g && null !== g || ( g = b ) , void 0 !== h && null !== h || ( h = d ) , void 0 !== i && null !== i || ( i = this . _size . x ) , void 0 !== j && null !== j || ( j = this . _size . y ) , "number" == typeof k && ( this . _rotate = k ) , "number" == typeof l && ( this . _anchor . x = l ) , "number" == typeof m && ( this . _anchor . y = m ) , "number" == typeof n && ( this . _scale . x = n ) , "number" == typeof o && ( this . _scale . y = o ) , "number" == typeof p && ( this . _alpha . current = p ) , void 0 === q && ( q = null ) , void 0 === r && ( r = ! 1 ) , ! ( this . _alpha . current <= 0 || 0 === this . _scale . x || 0 === this . _scale . y || 0 === this . _size . x || 0 === this . _size . y ) ) { var s = this . context ; return this . _alpha . prev = s . globalAlpha , s . save ( ) , s . globalAlpha = this . _alpha . current , q && ( this . op = q ) , r && ( g |= 0 , h |= 0 ) , s . translate ( g , h ) , s . scale ( this . _scale . x , this . _scale . y ) , s . rotate ( this . _rotate ) , s . drawImage ( this . _image , this . _pos . x + b , this . _pos . y + d , this . _size . x , this . _size . y , - i * this . _anchor . x , - j * this . _anchor . y , i , j ) , s . restore ( ) , s . globalAlpha = this . _alpha . prev , this . dirty = ! 0 , this } } , copyTransform : function ( a , b , d ) { if ( void 0 === b && ( b = null ) , void 0 === d && ( d = ! 1 ) , ! a . hasOwnProperty ( "worldTransform" ) || ! a . worldVisible || 0 === a . worldAlpha ) return this ; var e = a . worldTransform ; if ( this . _pos . set ( a . texture . crop . x , a . texture . crop . y ) , this . _size . set ( a . texture . crop . width , a . texture . crop . height ) , 0 === e . a || 0 === e . d || 0 === this . _size . x || 0 === this . _size . y ) return this ; a . texture instanceof c . RenderTexture || a . texture instanceof PIXI . RenderTexture ? this . _image = a . texture . getCanvas ( ) : this . _image = a . texture . baseTexture . source ; var f = e . tx , g = e . ty ; a . texture . trim && ( f += a . texture . trim . x - a . anchor . x * a . texture . trim . width , g += a . texture . trim . y - a . anchor . y * a . texture . trim . height ) , 16777215 !== a . tint && ( a . cachedTint !== a . tint && ( a . cachedTint = a . tint , a . tintedTexture = PIXI . CanvasTinter . getTintedTexture ( a , a . tint ) ) , this . _image = a . tintedTexture , this . _pos . set ( 0 ) ) , d && ( f |= 0 , g |= 0 ) ; var h = this . context ; return this . _alpha . prev = h . globalAlpha , h . save ( ) , h . globalAlpha = this . _alpha . current , b && ( this . op = b ) , h [ this . smoothProperty ] = a . texture . baseTexture . scaleMode === PIXI . scaleModes . LINEAR , h . setTransform ( e . a , e . b , e . c , e . d , f , g ) , h . drawImage ( this . _image , this . _pos . x , this . _pos . y , this . _size . x , this . _size . y , - this . _size . x * a . anchor . x , - this . _size . y * a . anchor . y , this . _size . x , this . _size . y ) , h . restore ( ) , h . globalAlpha = this . _alpha . prev , this . dirty = ! 0 , this } , copyRect : function ( a , b , c , d , e , f , g ) { return this . copy ( a , b . x , b . y , b . width , b . height , c , d , b . width , b . height , 0 , 0 , 0 , 1 , 1 , e , f , g ) } , draw : function ( a , b , c , d , e , f , g ) { return this . copy ( a , null , null , null , null , b , c , d , e , null , null , null , null , null , null , f , g ) } , drawGroup : function ( a , b , c ) { return a . total > 0 && a . forEachExists ( this . drawGroupProxy , this , b , c ) , this } , drawGroupProxy : function ( a , b , d ) { if ( a . hasOwnProperty ( "texture" ) && this . copyTransform ( a , b , d ) , a . type === c . GROUP && a . exists ) this . drawGroup ( a , b , d ) ; else if ( a . hasOwnProperty ( "children" ) && a . children . length > 0 ) for ( var e = 0 ; e < a . children . length ; e ++ ) a . children [ e ] . exists && this . copyTransform ( a . children [ e ] , b , d ) } , drawFull : function ( a , b , d ) { if ( a . worldVisible === ! 1 || 0 === a . worldAlpha || a . hasOwnProperty ( "exists" ) && a . exists === ! 1 ) return this ; if ( a . type !== c . GROUP && a . type !== c . EMITTER && a . type !== c . BITMAPTEXT ) if ( a . type === c . GRAPHICS ) { var e = a . getBounds ( ) ; this . ctx . save ( ) , this . ctx . translate ( e . x , e . y ) , PIXI . CanvasGraphics . renderGraphics
function g ( a , b , c ) { var d = b - a ; return a + d * c } for ( var h , i , j , k , l , m , n = 20 , o = [ ] , p = 0 , q = 0 ; n >= q ; q ++ ) p = q / n , h = g ( a , c , p ) , i = g ( b , d , p ) , j = g ( c , e , p ) , k = g ( d , f , p ) , l = g ( h , j , p ) , m = g ( i , k , p ) , o . push ( l , m ) ; return o } , PIXI . WebGLGraphics . buildCircle = function ( a , b ) { var c , d , e = a . shape , f = e . x , g = e . y ; a . type === PIXI . Graphics . CIRC ? ( c = e . radius , d = e . radius ) : ( c = e . width , d = e . height ) ; var h = 40 , i = 2 * Math . PI / h , j = 0 ; if ( a . fill ) { var k = PIXI . hex2rgb ( a . fillColor ) , l = a . fillAlpha , m = k [ 0 ] * l , n = k [ 1 ] * l , o = k [ 2 ] * l , p = b . points , q = b . indices , r = p . length / 6 ; for ( q . push ( r ) , j = 0 ; h + 1 > j ; j ++ ) p . push ( f , g , m , n , o , l ) , p . push ( f + Math . sin ( i * j ) * c , g + Math . cos ( i * j ) * d , m , n , o , l ) , q . push ( r ++ , r ++ ) ; q . push ( r - 1 ) } if ( a . lineWidth ) { var s = a . points ; for ( a . points = [ ] , j = 0 ; h + 1 > j ; j ++ ) a . points . push ( f + Math . sin ( i * j ) * c , g + Math . cos ( i * j ) * d ) ; PIXI . WebGLGraphics . buildLine ( a , b ) , a . points = s } } , PIXI . WebGLGraphics . buildLine = function ( a , b ) { var c = 0 , d = a . points ; if ( 0 !== d . length ) { if ( a . lineWidth % 2 ) for ( c = 0 ; c < d . length ; c ++ ) d [ c ] += . 5 ; var e = new PIXI . Point ( d [ 0 ] , d [ 1 ] ) , f = new PIXI . Point ( d [ d . length - 2 ] , d [ d . length - 1 ] ) ; if ( e . x === f . x && e . y === f . y ) { d = d . slice ( ) , d . pop ( ) , d . pop ( ) , f = new PIXI . Point ( d [ d . length - 2 ] , d [ d . length - 1 ] ) ; var g = f . x + . 5 * ( e . x - f . x ) , h = f . y + . 5 * ( e . y - f . y ) ; d . unshift ( g , h ) , d . push ( g , h ) } var i , j , k , l , m , n , o , p , q , r , s , t , u , v , w , x , y , z , A , B , C , D , E , F = b . points , G = b . indices , H = d . length / 2 , I = d . length , J = F . length / 6 , K = a . lineWidth / 2 , L = PIXI . hex2rgb ( a . lineColor ) , M = a . lineAlpha , N = L [ 0 ] * M , O = L [ 1 ] * M , P = L [ 2 ] * M ; for ( k = d [ 0 ] , l = d [ 1 ] , m = d [ 2 ] , n = d [ 3 ] , q = - ( l - n ) , r = k - m , E = Math . sqrt ( q * q + r * r ) , q /= E , r /= E , q *= K , r *= K , F . push ( k - q , l - r , N , O , P , M ) , F . push ( k + q , l + r , N , O , P , M ) , c = 1 ; H - 1 > c ; c ++ ) k = d [ 2 * ( c - 1 ) ] , l = d [ 2 * ( c - 1 ) + 1 ] , m = d [ 2 * c ] , n = d [ 2 * c + 1 ] , o = d [ 2 * ( c + 1 ) ] , p = d [ 2 * ( c + 1 ) + 1 ] , q = - ( l - n ) , r = k - m , E = Math . sqrt ( q * q + r * r ) , q /= E , r /= E , q *= K , r *= K , s = - ( n - p ) , t = m - o , E = Math . sqrt ( s * s + t * t ) , s /= E , t /= E , s *= K , t *= K , w = - r + l - ( - r + n ) , x = - q + m - ( - q + k ) , y = ( - q + k ) * ( - r + n ) - ( - q + m ) * ( - r + l ) , z = - t + p - ( - t + n ) , A = - s + m - ( - s + o ) , B = ( - s + o ) * ( - t + n ) - ( - s + m ) * ( - t + p ) , C = w * A - z * x , Math . abs ( C ) < . 1 ? ( C += 10.1 , F . push ( m - q , n - r , N , O , P , M ) , F . push ( m + q , n + r , N , O , P , M ) ) : ( i = ( x * B - A * y ) / C , j = ( z * y - w * B ) / C , D = ( i - m ) * ( i - m ) + ( j - n ) + ( j - n ) , D > 19600 ? ( u = q - s , v = r - t , E = Math . sqrt ( u * u + v * v ) , u /= E , v /= E , u *= K , v *= K , F . push ( m - u , n - v ) , F . push ( N , O , P , M ) , F . push ( m + u , n + v ) , F . push ( N , O , P , M ) , F . push ( m - u , n - v ) , F . push ( N , O , P , M ) , I ++ ) : ( F . push ( i , j ) , F . push ( N , O , P , M ) , F . push ( m - ( i - m ) , n - ( j - n ) ) , F . push ( N , O , P , M ) ) ) ; for ( k = d [ 2 * ( H - 2 ) ] , l = d [ 2 * ( H - 2 ) + 1 ] , m = d [ 2 * ( H - 1 ) ] , n = d [ 2 * ( H - 1 ) + 1 ] , q = - ( l - n ) , r = k - m , E = Math . sqrt ( q * q + r * r ) , q /= E , r /= E , q *= K , r *= K , F . push ( m - q , n - r ) , F . push ( N , O , P , M ) , F . push ( m + q , n + r ) , F . push ( N , O , P , M ) , G . push ( J ) , c = 0 ; I > c ; c ++ ) G . push ( J ++ ) ; G . push ( J - 1 ) } } , PIXI . WebGLGraphics . buildComplexPoly = function ( a , b ) { var c = a . points . slice ( ) ; if ( ! ( c . length < 6 ) ) { var d = b . indices ; b . points = c , b . alpha = a . fillAlpha , b . color = PIXI . hex2rgb ( a . fillColor ) ; for ( var e , f , g = 1 / 0 , h = - ( 1 / 0 ) , i = 1 / 0 , j = - ( 1 / 0 ) , k = 0 ; k < c . length ; k += 2 ) e = c [ k ] , f = c [ k + 1 ] , g = g > e ? e : g , h = e > h ? e : h , i = i > f ? f : i , j = f > j ? f : j ; c . push ( g , i , h , i , h , j , g , j ) ; var l = c . length / 2 ; for ( k = 0 ; l > k ; k ++ ) d . push ( k ) } } , PIXI . WebGLGraphics . buildPoly = function ( a , b ) { var c = a . points ; if ( ! ( c . length < 6 ) ) { var d = b . points , e = b . indices , f = c . length / 2 , g = PIXI . hex2rgb ( a . fillColor ) , h = a . fillAlpha , i = g [ 0 ] * h , j = g [ 1 ] * h , k = g [ 2 ] * h , l = PIXI . EarCut . Triangulate ( c , null , 2 ) ; if ( ! l ) return ! 1 ; var m = d . length / 6 , n = 0 ; for ( n = 0 ; n < l . length ; n += 3 ) e . push ( l [ n ] + m ) , e . push ( l [ n ] + m ) , e . push ( l [ n + 1 ] + m ) , e . push ( l [ n + 2 ] + m ) , e . push ( l [ n + 2 ] + m ) ; for ( n = 0 ; f > n ; n ++ ) d . push ( c [ 2 * n ] , c [ 2 * n + 1 ] , i , j , k , h ) ; return ! 0 } } , PIXI . WebGLGraphics . graphicsDataPool = [ ] , PIXI . WebGLGraphicsData = function ( a ) { this . gl = a , this . color = [ 0 , 0 , 0 ] , this . points = [ ] , this . indices = [ ] , this . buffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , this . mode = 1 , this . alpha = 1 , this . dirty = ! 0 } , PIXI . WebGLGraphicsData . prototype . reset = function ( ) { this . points = [ ] , this . indices = [ ] } , PIXI . WebGLGraphicsData . prototype . upload = function ( ) { var a = this . gl ; this . glPoints = new PIXI . Float32Array ( this . points ) , a . bindBuffer ( a . ARRAY _BUFFER , this . buffer ) , a . bufferData ( a . ARRAY _BUFFER , this . glPoints , a . STATIC _DRAW ) , this . glIndicies = new PIXI . Uint16Array ( this . indices ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , this . glIndicies , a . STATIC _DRAW ) , this . dirty = ! 1 } , PIXI . CanvasGraphics = function ( ) { } , PIXI . CanvasGraphics . renderGraphics = function ( a , b ) { var c = a . worldAlpha ; a . dirty && ( this . updateGraphicsTint ( a ) , a . dirty = ! 1 ) ; for ( var d = 0 ; d < a . graphicsData . length ; d ++ ) { var e = a . graphicsD
void 0 === n && ( m = 32 , n = a . chars [ m ] ) ; var p = h && n . kerning [ h ] ? n . kerning [ h ] : 0 ; if ( /(\s)/ . test ( c . charAt ( k ) ) && ( f = k , g = e ) , o = ( p + n . texture . width + n . xOffset ) * b , i && e + o >= i && f > - 1 ) return { width : g || e , text : c . substr ( 0 , k - ( k - f ) ) , end : l , chars : j } ; e += ( n . xAdvance + p ) * b , j . push ( d + ( n . xOffset + p ) * b ) , d += ( n . xAdvance + p ) * b , h = m } return { width : e , text : c , end : l , chars : j } } , c . BitmapText . prototype . cleanText = function ( a , b ) { void 0 === b && ( b = "" ) ; var c = this . _data . font ; if ( ! c ) return "" ; for ( var d = /\r\n|\n\r|\n|\r/g , e = a . replace ( d , "\n" ) . split ( "\n" ) , f = 0 ; f < e . length ; f ++ ) { for ( var g = "" , h = e [ f ] , i = 0 ; i < h . length ; i ++ ) g = c . chars [ h . charCodeAt ( i ) ] ? g . concat ( h [ i ] ) : g . concat ( b ) ; e [ f ] = g } return e . join ( "\n" ) } , c . BitmapText . prototype . updateText = function ( ) { var a = this . _data . font ; if ( a ) { var b = this . text , c = this . _fontSize / a . size , d = [ ] , e = 0 ; this . textWidth = 0 ; do { var f = this . scanLine ( a , c , b ) ; f . y = e , d . push ( f ) , f . width > this . textWidth && ( this . textWidth = f . width ) , e += a . lineHeight * c , b = b . substr ( f . text . length + 1 ) } while ( f . end === ! 1 ) ; this . textHeight = e ; for ( var g = 0 , h = 0 , i = this . textWidth * this . anchor . x , j = this . textHeight * this . anchor . y , k = 0 ; k < d . length ; k ++ ) { var f = d [ k ] ; "right" === this . _align ? h = this . textWidth - f . width : "center" === this . _align && ( h = ( this . textWidth - f . width ) / 2 ) ; for ( var l = 0 ; l < f . text . length ; l ++ ) { var m = f . text . charCodeAt ( l ) , n = a . chars [ m ] ; void 0 === n && ( m = 32 , n = a . chars [ m ] ) ; var o = this . _glyphs [ g ] ; o ? o . texture = n . texture : ( o = new PIXI . Sprite ( n . texture ) , o . name = f . text [ l ] , this . _glyphs . push ( o ) ) , o . position . x = f . chars [ l ] + h - i , o . position . y = f . y + n . yOffset * c - j , o . scale . set ( c ) , o . tint = this . tint , o . texture . requiresReTint = ! 0 , o . parent || this . addChild ( o ) , g ++ } } for ( k = g ; k < this . _glyphs . length ; k ++ ) this . removeChild ( this . _glyphs [ k ] ) } } , c . BitmapText . prototype . purgeGlyphs = function ( ) { for ( var a = this . _glyphs . length , b = [ ] , c = 0 ; c < this . _glyphs . length ; c ++ ) this . _glyphs [ c ] . parent !== this ? this . _glyphs [ c ] . destroy ( ) : b . push ( this . _glyphs [ c ] ) ; return this . _glyphs = [ ] , this . _glyphs = b , this . updateText ( ) , a - b . length } , c . BitmapText . prototype . updateTransform = function ( ) { ! this . dirty && this . anchor . equals ( this . _prevAnchor ) || ( this . updateText ( ) , this . dirty = ! 1 , this . _prevAnchor . copyFrom ( this . anchor ) ) , PIXI . DisplayObjectContainer . prototype . updateTransform . call ( this ) } , Object . defineProperty ( c . BitmapText . prototype , "align" , { get : function ( ) { return this . _align } , set : function ( a ) { a === this . _align || "left" !== a && "center" !== a && "right" !== a || ( this . _align = a , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "tint" , { get : function ( ) { return this . _tint } , set : function ( a ) { a !== this . _tint && ( this . _tint = a , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "font" , { get : function ( ) { return this . _font } , set : function ( a ) { a !== this . _font && ( this . _font = a . trim ( ) , this . _data = this . game . cache . getBitmapFont ( this . _font ) , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "fontSize" , { get : function ( ) { return this . _fontSize } , set : function ( a ) { a = parseInt ( a , 10 ) , a !== this . _fontSize && a > 0 && ( this . _fontSize = a , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "text" , { get : function ( ) { return this . _text } , set : function ( a ) { a !== this . _text && ( this . _text = a . toString ( ) || "" , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "maxWidth" , { get : function ( ) { return this . _maxWidth } , set : function ( a ) { a !== this . _maxWidth && ( this . _maxWidth = a , this . updateText ( ) ) } } ) , Object . defineProperty ( c . BitmapText . prototype , "smoothed" , { get : function ( ) { return ! this . _data . base . scaleMode } , set : function ( a ) { a ? this . _data . base . scaleMode = 0 : this . _data . base . scaleMode = 1 } } ) , c . RetroFont = function ( a , b , d , e , f , g , h , i , j , k ) { if ( ! a . cache . checkImageKey ( b ) ) return ! 1 ; void 0 !== g && null !== g || ( g = a . cache . getImage ( b ) . width / d ) , 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 ( b ) , this . _text = "" , this . grabData = [ ] , this . frameData = new c . FrameData ; for ( var l = this . offsetX , m = this . offsetY , n = 0 , o = 0 ; o < f . length ; o ++ ) { var p = this . frameData . addFrame ( new c . Frame ( o , l , m , this . characterWidth , this . characterHeight ) ) ; this . grabData [ f . charCodeAt ( o ) ] = p . index , n ++ , n === this . c
} , sign : function ( ) { return this . pick ( [ - 1 , 1 ] ) } , weightedPick : function ( a ) { return a [ ~ ~ ( Math . pow ( this . frac ( ) , 2 ) * ( a . length - 1 ) + . 5 ) ] } , timestamp : function ( a , b ) { return this . realInRange ( a || 9466848e5 , b || 1577862e6 ) } , angle : function ( ) { return this . integerInRange ( - 180 , 180 ) } , state : function ( a ) { return "string" == typeof a && a . match ( /^!rnd/ ) && ( a = a . split ( "," ) , this . c = parseFloat ( a [ 1 ] ) , this . s0 = parseFloat ( a [ 2 ] ) , this . s1 = parseFloat ( a [ 3 ] ) , this . s2 = parseFloat ( a [ 4 ] ) ) , [ "!rnd" , this . c , this . s0 , this . s1 , this . s2 ] . join ( "," ) } } , c . RandomDataGenerator . prototype . constructor = c . RandomDataGenerator , c . QuadTree = function ( a , b , c , d , e , f , g ) { this . maxObjects = 10 , this . maxLevels = 4 , this . level = 0 , this . bounds = { } , this . objects = [ ] , this . nodes = [ ] , this . _empty = [ ] , this . reset ( a , b , c , d , e , f , g ) } , c . QuadTree . prototype = { reset : function ( a , b , c , d , e , f , g ) { this . maxObjects = e || 10 , this . maxLevels = f || 4 , this . level = g || 0 , this . bounds = { x : Math . round ( a ) , y : Math . round ( b ) , width : c , height : d , subWidth : Math . floor ( c / 2 ) , subHeight : Math . floor ( d / 2 ) , right : Math . round ( a ) + Math . floor ( c / 2 ) , bottom : Math . round ( b ) + Math . floor ( d / 2 ) } , this . objects . length = 0 , this . nodes . length = 0 } , populate : function ( a ) { a . forEach ( this . populateHandler , this , ! 0 ) } , populateHandler : function ( a ) { a . body && a . exists && this . insert ( a . body ) } , split : function ( ) { this . nodes [ 0 ] = new c . QuadTree ( this . bounds . right , this . bounds . y , this . bounds . subWidth , this . bounds . subHeight , this . maxObjects , this . maxLevels , this . level + 1 ) , this . nodes [ 1 ] = new c . QuadTree ( this . bounds . x , this . bounds . y , this . bounds . subWidth , this . bounds . subHeight , this . maxObjects , this . maxLevels , this . level + 1 ) , this . nodes [ 2 ] = new c . QuadTree ( this . bounds . x , this . bounds . bottom , this . bounds . subWidth , this . bounds . subHeight , this . maxObjects , this . maxLevels , this . level + 1 ) , this . nodes [ 3 ] = new c . QuadTree ( this . bounds . right , this . bounds . bottom , this . bounds . subWidth , this . bounds . subHeight , this . maxObjects , this . maxLevels , this . level + 1 ) } , insert : function ( a ) { var b , c = 0 ; if ( null != this . nodes [ 0 ] && ( b = this . getIndex ( a ) , - 1 !== b ) ) return void this . nodes [ b ] . insert ( a ) ; if ( this . objects . push ( a ) , this . objects . length > this . maxObjects && this . level < this . maxLevels ) for ( null == this . nodes [ 0 ] && this . split ( ) ; c < this . objects . length ; ) b = this . getIndex ( this . objects [ c ] ) , - 1 !== b ? this . nodes [ b ] . insert ( this . objects . splice ( c , 1 ) [ 0 ] ) : c ++ } , getIndex : function ( a ) { var b = - 1 ; return a . x < this . bounds . right && a . right < this . bounds . right ? a . y < this . bounds . bottom && a . bottom < this . bounds . bottom ? b = 1 : a . y > this . bounds . bottom && ( b = 2 ) : a . x > this . bounds . right && ( a . y < this . bounds . bottom && a . bottom < this . bounds . bottom ? b = 0 : a . y > this . bounds . bottom && ( b = 3 ) ) , b } , retrieve : function ( a ) { if ( a instanceof c . Rectangle ) var b = this . objects , d = this . getIndex ( a ) ; else { if ( ! a . body ) return this . _empty ; var b = this . objects , d = this . getIndex ( a . body ) } return this . nodes [ 0 ] && ( - 1 !== d ? b = b . concat ( this . nodes [ d ] . retrieve ( a ) ) : ( b = b . concat ( this . nodes [ 0 ] . retrieve ( a ) ) , b = b . concat ( this . nodes [ 1 ] . retrieve ( a ) ) , b = b . concat ( this . nodes [ 2 ] . retrieve ( a ) ) , b = b . concat ( this . nodes [ 3 ] . retrieve ( a ) ) ) ) , b } , clear : function ( ) { this . objects . length = 0 ; for ( var a = this . nodes . length ; a -- ; ) this . nodes [ a ] . clear ( ) , this . nodes . splice ( a , 1 ) ; this . nodes . length = 0 } } , c . QuadTree . prototype . constructor = c . QuadTree , c . Net = function ( a ) { this . game = a } , c . Net . prototype = { getHostName : function ( ) { return window . location && window . location . hostname ? window . location . hostname : null } , checkDomainName : function ( a ) { return - 1 !== window . location . hostname . indexOf ( a ) } , updateQueryString : function ( a , b , c , d ) { void 0 === c && ( c = ! 1 ) , void 0 !== d && "" !== d || ( d = window . location . href ) ; var e = "" , f = new RegExp ( "([?|&])" + a + "=.*?(&|#|$)(.*)" , "gi" ) ; if ( f . test ( d ) ) e = "undefined" != typeof b && null !== b ? d . replace ( f , "$1" + a + "=" + b + "$2$3" ) : d . replace ( f , "$1$3" ) . replace ( /(&|\?)$/ , "" ) ; else if ( "undefined" != typeof b && null !== b ) { var g = - 1 !== d . indexOf ( "?" ) ? "&" : "?" , h = d . split ( "#" ) ; d = h [ 0 ] + g + a + "=" + b , h [ 1 ] && ( d += "#" + h [ 1 ] ) , e = d } else e = d ; return c ? void ( window . location . href = e ) : e } , getQueryString : function ( a ) { void 0 === a && ( a = "" ) ; var b = { } , c = location . search . substring ( 1 ) . split ( "&" ) ; for ( var d in c ) { var e = c [ d ] . split ( "=" ) ; if ( e . length > 1 ) { if ( a && a == this . decodeURI ( e [ 0 ] ) ) return this . decodeURI ( e [ 1 ] ) ; b [ this . decodeURI ( e [ 0 ] ) ] = this . decodeURI ( e [ 1 ] ) } } return b } , decodeURI : function ( a ) { return decodeURIComponent ( a . replace ( /\+/g , " " ) ) } } , c . Net . prototype . constructor = c . Net , c . TweenMan
this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . onStart = new c . Signal , this . onUpdate = null , this . onComplete = new c . Signal , this . onLoop = new c . Signal , this . isReversed = ! 1 , this . game . onPause . add ( this . onPause , this ) , this . game . onResume . add ( this . onResume , this ) } , c . Animation . prototype = { play : function ( a , b , c ) { return "number" == typeof a && ( this . delay = 1e3 / a ) , "boolean" == typeof b && ( this . loop = b ) , "undefined" != typeof c && ( this . killOnComplete = c ) , this . isPlaying = ! 0 , this . isFinished = ! 1 , this . paused = ! 1 , this . loopCount = 0 , this . _timeLastFrame = this . game . time . time , this . _timeNextFrame = this . game . time . time + this . delay , this . _frameIndex = this . isReversed ? this . _frames . length - 1 : 0 , this . updateCurrentFrame ( ! 1 , ! 0 ) , this . _parent . events . onAnimationStart$dispatch ( this . _parent , this ) , this . onStart . dispatch ( this . _parent , this ) , this . _parent . animations . currentAnim = this , this . _parent . animations . currentFrame = this . currentFrame , this } , restart : function ( ) { this . isPlaying = ! 0 , this . isFinished = ! 1 , this . paused = ! 1 , this . loopCount = 0 , this . _timeLastFrame = this . game . time . time , this . _timeNextFrame = this . game . time . time + this . delay , this . _frameIndex = 0 , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . _parent . setFrame ( this . currentFrame ) , this . _parent . animations . currentAnim = this , this . _parent . animations . currentFrame = this . currentFrame , this . onStart . dispatch ( this . _parent , this ) } , reverse : function ( ) { return this . reversed = ! this . reversed , this } , reverseOnce : function ( ) { return this . onComplete . addOnce ( this . reverse . bind ( this ) ) , this . reverse ( ) } , setFrame : function ( a , b ) { var c ; if ( void 0 === b && ( b = ! 1 ) , "string" == typeof a ) for ( var d = 0 ; d < this . _frames . length ; d ++ ) this . _frameData . getFrame ( this . _frames [ d ] ) . name === a && ( c = d ) ; else if ( "number" == typeof a ) if ( b ) c = a ; else for ( var d = 0 ; d < this . _frames . length ; d ++ ) this . _frames [ d ] === a && ( c = d ) ; c && ( this . _frameIndex = c - 1 , this . _timeNextFrame = this . game . time . time , this . update ( ) ) } , stop : function ( a , b ) { void 0 === a && ( a = ! 1 ) , void 0 === b && ( b = ! 1 ) , this . isPlaying = ! 1 , this . isFinished = ! 0 , this . paused = ! 1 , a && ( this . currentFrame = this . _frameData . getFrame ( this . _frames [ 0 ] ) , this . _parent . setFrame ( this . currentFrame ) ) , b && ( this . _parent . events . onAnimationComplete$dispatch ( this . _parent , this ) , this . onComplete . dispatch ( this . _parent , this ) ) } , onPause : function ( ) { this . isPlaying && ( this . _frameDiff = this . _timeNextFrame - this . game . time . time ) } , onResume : function ( ) { this . isPlaying && ( this . _timeNextFrame = this . game . time . time + this . _frameDiff ) } , update : function ( ) { return this . isPaused ? ! 1 : this . isPlaying && this . game . time . time >= this . _timeNextFrame ? ( this . _frameSkip = 1 , this . _frameDiff = this . game . time . time - this . _timeNextFrame , this . _timeLastFrame = this . game . time . time , this . _frameDiff > this . delay && ( this . _frameSkip = Math . floor ( this . _frameDiff / this . delay ) , this . _frameDiff -= this . _frameSkip * this . delay ) , this . _timeNextFrame = this . game . time . time + ( this . delay - this . _frameDiff ) , this . isReversed ? this . _frameIndex -= this . _frameSkip : this . _frameIndex += this . _frameSkip , ! this . isReversed && this . _frameIndex >= this . _frames . length || this . isReversed && this . _frameIndex <= - 1 ? this . loop ? ( this . _frameIndex = Math . abs ( this . _frameIndex ) % this . _frames . length , this . isReversed && ( this . _frameIndex = this . _frames . length - 1 - this . _frameIndex ) , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . currentFrame && this . _parent . setFrame ( this . currentFrame ) , this . loopCount ++ , this . _parent . events . onAnimationLoop$dispatch ( this . _parent , this ) , this . onLoop . dispatch ( this . _parent , this ) , this . onUpdate ? ( this . onUpdate . dispatch ( this , this . currentFrame ) , ! ! this . _frameData ) : ! 0 ) : ( this . complete ( ) , ! 1 ) : this . updateCurrentFrame ( ! 0 ) ) : ! 1 } , updateCurrentFrame : function ( a , b ) { if ( void 0 === b && ( b = ! 1 ) , ! this . _frameData ) return ! 1 ; var c = this . currentFrame . index ; return this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . currentFrame && ( b || ! b && c !== this . currentFrame . index ) && this . _parent . setFrame ( this . currentFrame ) , this . onUpdate && a ? ( this . onUpdate . dispatch ( this , this . currentFrame ) , ! ! this . _frameData ) : ! 0 } , next : function ( a ) { void 0 === a && ( a = 1 ) ; var b = this . _frameIndex + a ; b >= this . _frames . length && ( this . loop ? b %= this . _frames . length : b = this . _frames . length - 1 ) , b !== this . _frameIndex && ( this . _frameIndex = b , this . up
e = g } } this . addToFileList ( "textureatlas" , a , b , { atlasURL : null , atlasData : e , format : f } ) } return this } , withSyncPoint : function ( a , b ) { this . _withSyncPointDepth ++ ; try { a . call ( b || this , this ) } finally { this . _withSyncPointDepth -- } return this } , addSyncPoint : function ( a , b ) { var c = this . getAsset ( a , b ) ; return c && ( c . file . syncPoint = ! 0 ) , this } , removeFile : function ( a , b ) { var c = this . getAsset ( a , b ) ; c && ( c . loaded || c . loading || this . _fileList . splice ( c . index , 1 ) ) } , removeAll : function ( ) { this . _fileList . length = 0 , this . _flightQueue . length = 0 } , start : function ( ) { this . isLoading || ( this . hasLoaded = ! 1 , this . isLoading = ! 0 , this . updateProgress ( ) , this . processLoadQueue ( ) ) } , processLoadQueue : function ( ) { if ( ! this . isLoading ) return console . warn ( "Phaser.Loader - active loading canceled / reset" ) , void this . finishedLoading ( ! 0 ) ; for ( var a = 0 ; a < this . _flightQueue . length ; a ++ ) { var b = this . _flightQueue [ a ] ; ( b . loaded || b . error ) && ( this . _flightQueue . splice ( a , 1 ) , a -- , b . loading = ! 1 , b . requestUrl = null , b . requestObject = null , b . error && this . onFileError . dispatch ( b . key , b ) , "packfile" !== b . type ? ( this . _loadedFileCount ++ , this . onFileComplete . dispatch ( this . progress , b . key , ! b . error , this . _loadedFileCount , this . _totalFileCount ) ) : "packfile" === b . type && b . error && ( this . _loadedPackCount ++ , this . onPackComplete . dispatch ( b . key , ! b . error , this . _loadedPackCount , this . _totalPackCount ) ) ) } for ( var d = ! 1 , e = this . enableParallel ? c . Math . clamp ( this . maxParallelDownloads , 1 , 12 ) : 1 , a = this . _processingHead ; a < this . _fileList . length ; a ++ ) { var b = this . _fileList [ a ] ; if ( "packfile" === b . type && ! b . error && b . loaded && a === this . _processingHead && ( this . processPack ( b ) , this . _loadedPackCount ++ , this . onPackComplete . dispatch ( b . key , ! b . error , this . _loadedPackCount , this . _totalPackCount ) ) , b . loaded || b . error ? a === this . _processingHead && ( this . _processingHead = a + 1 ) : ! b . loading && this . _flightQueue . length < e && ( "packfile" !== b . type || b . data ? d || ( this . _fileLoadStarted || ( this . _fileLoadStarted = ! 0 , this . onLoadStart . dispatch ( ) ) , this . _flightQueue . push ( b ) , b . loading = ! 0 , this . onFileStart . dispatch ( this . progress , b . key , b . url ) , this . loadFile ( b ) ) : ( this . _flightQueue . push ( b ) , b . loading = ! 0 , this . loadFile ( b ) ) ) , ! b . loaded && b . syncPoint && ( d = ! 0 ) , this . _flightQueue . length >= e || d && this . _loadedPackCount === this . _totalPackCount ) break } if ( this . updateProgress ( ) , this . _processingHead >= this . _fileList . length ) this . finishedLoading ( ) ; else if ( ! this . _flightQueue . length ) { console . warn ( "Phaser.Loader - aborting: processing queue empty, loading may have stalled" ) ; var f = this ; setTimeout ( function ( ) { f . finishedLoading ( ! 0 ) } , 2e3 ) } } , finishedLoading : function ( a ) { this . hasLoaded || ( this . hasLoaded = ! 0 , this . isLoading = ! 1 , a || this . _fileLoadStarted || ( this . _fileLoadStarted = ! 0 , this . onLoadStart . dispatch ( ) ) , this . onLoadComplete . dispatch ( ) , this . game . state . loadComplete ( ) , this . reset ( ) ) } , asyncComplete : function ( a , b ) { void 0 === b && ( b = "" ) , a . loaded = ! 0 , a . error = ! ! b , b && ( a . errorMessage = b , console . warn ( "Phaser.Loader - " + a . type + "[" + a . key + "]: " + b ) ) , this . processLoadQueue ( ) } , processPack : function ( a ) { var b = a . data [ a . key ] ; if ( ! b ) return void console . warn ( "Phaser.Loader - " + a . key + ": pack has data, but not for pack key" ) ; for ( var d = 0 ; d < b . length ; d ++ ) { var e = b [ d ] ; switch ( e . type ) { case "image" : this . image ( e . key , e . url , e . overwrite ) ; break ; case "text" : this . text ( e . key , e . url , e . overwrite ) ; break ; case "json" : this . json ( e . key , e . url , e . overwrite ) ; break ; case "xml" : this . xml ( e . key , e . url , e . overwrite ) ; break ; case "script" : this . script ( e . key , e . url , e . callback , a . callbackContext || this ) ; break ; case "binary" : this . binary ( e . key , e . url , e . callback , a . callbackContext || this ) ; break ; case "spritesheet" : this . spritesheet ( e . key , e . url , e . frameWidth , e . frameHeight , e . frameMax , e . margin , e . spacing ) ; break ; case "video" : this . video ( e . key , e . urls ) ; break ; case "audio" : this . audio ( e . key , e . urls , e . autoDecode ) ; break ; case "audiosprite" : this . audiosprite ( e . key , e . urls , e . jsonURL , e . jsonData , e . autoDecode ) ; break ; case "tilemap" : this . tilemap ( e . key , e . url , e . data , c . Tilemap [ e . format ] ) ; break ; case "physics" : this . physics ( e . key , e . url , e . data , c . Loader [ e . format ] ) ; break ; case "bitmapFont" : this . bitmapFont ( e . key , e . textureURL , e . atlasURL , e . atlasData , e . xSpacing , e . ySpacing ) ; break ; case "atlasJSONArray" : this . atlasJSONArray ( e . key , e . textureURL , e . atlasURL , e . atlasData ) ; break ; case "atlasJSONHash" : this . atlasJSONHash ( e . key , e . textureUR
this . onMute . dispatch ( ) } } , unsetMute : function ( ) { if ( this . _muted && ! this . _codeMuted ) { this . _muted = ! 1 , this . usingWebAudio && ( this . masterGain . gain . value = this . _muteVolume ) ; for ( var a = 0 ; a < this . _sounds . length ; a ++ ) this . _sounds [ a ] . usingAudioTag && ( this . _sounds [ a ] . mute = ! 1 ) ; this . onUnMute . dispatch ( ) } } , destroy : function ( ) { this . stopAll ( ) ; for ( var a = 0 ; a < this . _sounds . length ; a ++ ) this . _sounds [ a ] && this . _sounds [ a ] . destroy ( ) ; this . _sounds = [ ] , this . onSoundDecode . dispose ( ) , this . context && ( window . PhaserGlobal ? window . PhaserGlobal . audioContext = this . context : this . context . close && this . context . close ( ) ) } } , c . SoundManager . prototype . constructor = c . SoundManager , Object . defineProperty ( c . SoundManager . prototype , "mute" , { get : function ( ) { return this . _muted } , set : function ( a ) { if ( a = a || ! 1 ) { if ( this . _muted ) return ; this . _codeMuted = ! 0 , this . setMute ( ) } else { if ( ! this . _muted ) return ; this . _codeMuted = ! 1 , this . unsetMute ( ) } } } ) , Object . defineProperty ( c . SoundManager . prototype , "volume" , { get : function ( ) { return this . _volume } , set : function ( a ) { if ( 0 > a ? a = 0 : a > 1 && ( a = 1 ) , this . _volume !== a ) { if ( this . _volume = a , this . usingWebAudio ) this . masterGain . gain . value = a ; else for ( var b = 0 ; b < this . _sounds . length ; b ++ ) this . _sounds [ b ] . usingAudioTag && this . _sounds [ b ] . updateGlobalVolume ( a ) ; this . onVolumeChange . dispatch ( a ) } } } ) , c . ScaleManager = function ( a , b , d ) { this . game = a , this . dom = c . DOM , this . grid = null , this . width = 0 , this . height = 0 , this . minWidth = null , this . maxWidth = null , this . minHeight = null , this . maxHeight = null , this . offset = new c . Point , this . forceLandscape = ! 1 , this . forcePortrait = ! 1 , this . incorrectOrientation = ! 1 , this . _pageAlignHorizontally = ! 1 , this . _pageAlignVertically = ! 1 , this . onOrientationChange = new c . Signal , this . enterIncorrectOrientation = new c . Signal , this . leaveIncorrectOrientation = new c . Signal , this . fullScreenTarget = null , this . _createdFullScreenTarget = null , this . onFullScreenInit = new c . Signal , this . onFullScreenChange = new c . Signal , this . onFullScreenError = new c . Signal , this . screenOrientation = this . dom . getScreenOrientation ( ) , this . scaleFactor = new c . Point ( 1 , 1 ) , this . scaleFactorInversed = new c . Point ( 1 , 1 ) , this . margin = { left : 0 , top : 0 , right : 0 , bottom : 0 , x : 0 , y : 0 } , this . bounds = new c . Rectangle , this . aspectRatio = 0 , this . sourceAspectRatio = 0 , this . event = null , this . windowConstraints = { right : "layout" , bottom : "" } , this . compatibility = { supportsFullScreen : ! 1 , orientationFallback : null , noMargins : ! 1 , scrollTo : null , forceMinimumDocumentHeight : ! 1 , canExpandParent : ! 0 , clickTrampoline : "" } , this . _scaleMode = c . ScaleManager . NO _SCALE , this . _fullScreenScaleMode = c . ScaleManager . NO _SCALE , this . parentIsWindow = ! 1 , this . parentNode = null , this . parentScaleFactor = new c . Point ( 1 , 1 ) , this . trackParentInterval = 2e3 , this . onSizeChange = new c . Signal , this . onResize = null , this . onResizeContext = null , this . _pendingScaleMode = null , this . _fullScreenRestore = null , this . _gameSize = new c . Rectangle , this . _userScaleFactor = new c . Point ( 1 , 1 ) , this . _userScaleTrim = new c . Point ( 0 , 0 ) , this . _lastUpdate = 0 , this . _updateThrottle = 0 , this . _updateThrottleReset = 100 , this . _parentBounds = new c . Rectangle , this . _tempBounds = new c . Rectangle , this . _lastReportedCanvasSize = new c . Rectangle , this . _lastReportedGameSize = new c . Rectangle , this . _booted = ! 1 , a . config && this . parseConfig ( a . config ) , this . setupScale ( b , d ) } , c . ScaleManager . EXACT _FIT = 0 , c . ScaleManager . NO _SCALE = 1 , c . ScaleManager . SHOW _ALL = 2 , c . ScaleManager . RESIZE = 3 , c . ScaleManager . USER _SCALE = 4 , c . ScaleManager . prototype = { boot : function ( ) { var a = this . compatibility ; a . supportsFullScreen = this . game . device . fullscreen && ! this . game . device . cocoonJS , this . game . device . iPad || this . game . device . webApp || this . game . device . desktop || ( this . game . device . android && ! this . game . device . chrome ? a . scrollTo = new c . Point ( 0 , 1 ) : a . scrollTo = new c . Point ( 0 , 0 ) ) , this . game . device . desktop ? ( a . orientationFallback = "screen" , a . clickTrampoline = "when-not-mouse" ) : ( a . orientationFallback = "" , a . clickTrampoline = "" ) ; var b = this ; this . _orientationChange = function ( a ) { return b . orientationChange ( a ) } , this . _windowResize = function ( a ) { return b . windowResize ( a ) } , window . addEventListener ( "orientationchange" , this . _orientationChange , ! 1 ) , window . addEventListener ( "resize" , this . _windowResize , ! 1 ) , this . compatibility . supportsFullScreen && ( this . _fullScreenChange = function ( a ) { return b . fullScreenChange ( a ) } , this . _fullScreenError = function ( a ) { return
} ; Object . defineProperty ( c . DOM , "scrollX" , { get : b } ) , Object . defineProperty ( c . DOM , "scrollY" , { get : d } ) , Object . defineProperty ( c . DOM . visualBounds , "x" , { get : b } ) , Object . defineProperty ( c . DOM . visualBounds , "y" , { get : d } ) , Object . defineProperty ( c . DOM . layoutBounds , "x" , { value : 0 } ) , Object . defineProperty ( c . DOM . layoutBounds , "y" , { value : 0 } ) ; var e = a . desktop && document . documentElement . clientWidth <= window . innerWidth && document . documentElement . clientHeight <= window . innerHeight ; if ( e ) { var f = function ( ) { return Math . max ( window . innerWidth , document . documentElement . clientWidth ) } , g = function ( ) { return Math . max ( window . innerHeight , document . documentElement . clientHeight ) } ; Object . defineProperty ( c . DOM . visualBounds , "width" , { get : f } ) , Object . defineProperty ( c . DOM . visualBounds , "height" , { get : g } ) , Object . defineProperty ( c . DOM . layoutBounds , "width" , { get : f } ) , Object . defineProperty ( c . DOM . layoutBounds , "height" , { get : g } ) } else Object . defineProperty ( c . DOM . visualBounds , "width" , { get : function ( ) { return window . innerWidth } } ) , Object . defineProperty ( c . DOM . visualBounds , "height" , { get : function ( ) { return window . innerHeight } } ) , Object . defineProperty ( c . DOM . layoutBounds , "width" , { get : function ( ) { var a = document . documentElement . clientWidth , b = window . innerWidth ; return b > a ? b : a } } ) , Object . defineProperty ( c . DOM . layoutBounds , "height" , { get : function ( ) { var a = document . documentElement . clientHeight , b = window . innerHeight ; return b > a ? b : a } } ) ; Object . defineProperty ( c . DOM . documentBounds , "x" , { value : 0 } ) , Object . defineProperty ( c . DOM . documentBounds , "y" , { value : 0 } ) , Object . defineProperty ( c . DOM . documentBounds , "width" , { get : function ( ) { var a = document . documentElement ; return Math . max ( a . clientWidth , a . offsetWidth , a . scrollWidth ) } } ) , Object . defineProperty ( c . DOM . documentBounds , "height" , { get : function ( ) { var a = document . documentElement ; return Math . max ( a . clientHeight , a . offsetHeight , a . scrollHeight ) } } ) } , null , ! 0 ) , c . ArraySet = function ( a ) { this . position = 0 , this . list = a || [ ] } , c . ArraySet . prototype = { add : function ( a ) { return this . exists ( a ) || this . list . push ( a ) , a } , getIndex : function ( a ) { return this . list . indexOf ( a ) } , getByKey : function ( a , b ) { for ( var c = this . list . length ; c -- ; ) if ( this . list [ c ] [ a ] === b ) return this . list [ c ] ; return null } , exists : function ( a ) { return this . list . indexOf ( a ) > - 1 } , reset : function ( ) { this . list . length = 0 } , remove : function ( a ) { var b = this . list . indexOf ( a ) ; return b > - 1 ? ( this . list . splice ( b , 1 ) , a ) : void 0 } , setAll : function ( a , b ) { for ( var c = this . list . length ; c -- ; ) this . list [ c ] && ( this . list [ c ] [ a ] = b ) } , callAll : function ( a ) { for ( var b = Array . prototype . slice . call ( arguments , 1 ) , c = this . list . length ; c -- ; ) this . list [ c ] && this . list [ c ] [ a ] && this . list [ c ] [ a ] . apply ( this . list [ c ] , b ) } , removeAll : function ( a ) { void 0 === a && ( a = ! 1 ) ; for ( var b = this . list . length ; b -- ; ) if ( this . list [ b ] ) { var c = this . remove ( this . list [ b ] ) ; a && c . destroy ( ) } this . position = 0 , this . list = [ ] } } , Object . defineProperty ( c . ArraySet . prototype , "total" , { get : function ( ) { return this . list . length } } ) , Object . defineProperty ( c . ArraySet . prototype , "first" , { get : function ( ) { return this . position = 0 , this . list . length > 0 ? this . list [ 0 ] : null } } ) , Object . defineProperty ( c . ArraySet . prototype , "next" , { get : function ( ) { return this . position < this . list . length ? ( this . position ++ , this . list [ this . position ] ) : null } } ) , c . ArraySet . prototype . constructor = c . ArraySet , c . ArrayUtils = { getRandomItem : function ( a , b , c ) { if ( null === a ) return null ; void 0 === b && ( b = 0 ) , void 0 === c && ( c = a . length ) ; var d = b + Math . floor ( Math . random ( ) * c ) ; return void 0 === a [ d ] ? null : a [ d ] } , removeRandomItem : function ( a , b , c ) { if ( null == a ) return null ; void 0 === b && ( b = 0 ) , void 0 === c && ( c = a . length ) ; var d = b + Math . floor ( Math . random ( ) * c ) ; if ( d < a . length ) { var e = a . splice ( d , 1 ) ; return void 0 === e [ 0 ] ? null : e [ 0 ] } return null } , 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 } , transposeMatrix : function ( a ) { for ( var b = a . length , c = a [ 0 ] . length , d = new Array ( c ) , e = 0 ; c > e ; e ++ ) { d [ e ] = new Array ( b ) ; for ( var f = b - 1 ; f > - 1 ; f -- ) d [ e ] [ f ] = a [ f ] [ e ] } return d } , rotateMatrix : function ( a , b ) { if ( "string" != typeof b && ( b = ( b % 360 + 360 ) % 360 ) , 90 === b || - 270 === b || "rotateLeft" === b ) a = c . ArrayUtils . transposeMatrix ( a ) , a = a . reverse ( ) ; else if ( - 90 === b || 270 === b || "rotateRight" === b ) a = a . reverse ( ) , a = c . ArrayUtils . transposeMatrix ( a ) ; else if ( 180 === Math . abs ( b ) || "rotate180" === b ) { for ( var d
g -= i , h -= i , a . velocity . y = i + g * a . bounce . y , b . velocity . y = i + h * b . bounce . y } return ! 0 } , getObjectsUnderPointer : function ( a , b , c , d ) { return 0 !== b . length && a . exists ? this . getObjectsAtLocation ( a . x , a . y , b , c , d , a ) : void 0 } , getObjectsAtLocation : function ( a , b , d , e , f , g ) { this . quadTree . clear ( ) , this . quadTree . reset ( this . game . world . bounds . x , this . game . world . bounds . y , this . game . world . bounds . width , this . game . world . bounds . height , this . maxObjects , this . maxLevels ) , this . quadTree . populate ( d ) ; for ( var h = new c . Rectangle ( a , b , 1 , 1 ) , i = [ ] , j = this . quadTree . retrieve ( h ) , k = 0 ; k < j . length ; k ++ ) j [ k ] . hitTest ( a , b ) && ( e && e . call ( f , g , j [ k ] . sprite ) , i . push ( j [ k ] . sprite ) ) ; return i } , moveToObject : function ( a , b , c , d ) { void 0 === c && ( c = 60 ) , void 0 === d && ( d = 0 ) ; var e = Math . atan2 ( b . y - a . y , b . x - a . x ) ; return d > 0 && ( c = this . distanceBetween ( a , b ) / ( d / 1e3 ) ) , a . body . velocity . x = Math . cos ( e ) * c , a . body . velocity . y = Math . sin ( e ) * c , e } , moveToPointer : function ( a , b , c , d ) { void 0 === b && ( b = 60 ) , c = c || this . game . input . activePointer , void 0 === d && ( d = 0 ) ; var e = this . angleToPointer ( a , c ) ; return d > 0 && ( b = this . distanceToPointer ( a , c ) / ( d / 1e3 ) ) , a . body . velocity . x = Math . cos ( e ) * b , a . body . velocity . y = Math . sin ( e ) * b , e } , moveToXY : function ( a , b , c , d , e ) { void 0 === d && ( d = 60 ) , void 0 === e && ( e = 0 ) ; var f = Math . atan2 ( c - a . y , b - a . x ) ; return e > 0 && ( d = this . distanceToXY ( a , b , c ) / ( e / 1e3 ) ) , a . body . velocity . x = Math . cos ( f ) * d , a . body . velocity . y = Math . sin ( f ) * d , f } , velocityFromAngle : function ( a , b , d ) { return void 0 === b && ( b = 60 ) , d = d || new c . Point , d . setTo ( Math . cos ( this . game . math . degToRad ( a ) ) * b , Math . sin ( this . game . math . degToRad ( a ) ) * b ) } , velocityFromRotation : function ( a , b , d ) { return void 0 === b && ( b = 60 ) , d = d || new c . Point , d . setTo ( Math . cos ( a ) * b , Math . sin ( a ) * b ) } , accelerationFromRotation : function ( a , b , d ) { return void 0 === b && ( b = 60 ) , d = d || new c . Point , d . setTo ( Math . cos ( a ) * b , Math . sin ( a ) * b ) } , accelerateToObject : function ( a , b , c , d , e ) { void 0 === c && ( c = 60 ) , void 0 === d && ( d = 1e3 ) , void 0 === e && ( e = 1e3 ) ; var f = this . angleBetween ( a , b ) ; return a . body . acceleration . setTo ( Math . cos ( f ) * c , Math . sin ( f ) * c ) , a . body . maxVelocity . setTo ( d , e ) , f } , accelerateToPointer : function ( a , b , c , d , e ) { void 0 === c && ( c = 60 ) , void 0 === b && ( b = this . game . input . activePointer ) , void 0 === d && ( d = 1e3 ) , void 0 === e && ( e = 1e3 ) ; var f = this . angleToPointer ( a , b ) ; return a . body . acceleration . setTo ( Math . cos ( f ) * c , Math . sin ( f ) * c ) , a . body . maxVelocity . setTo ( d , e ) , f } , accelerateToXY : function ( a , b , c , d , e , f ) { void 0 === d && ( d = 60 ) , void 0 === e && ( e = 1e3 ) , void 0 === f && ( f = 1e3 ) ; var g = this . angleToXY ( a , b , c ) ; return a . body . acceleration . setTo ( Math . cos ( g ) * d , Math . sin ( g ) * d ) , a . body . maxVelocity . setTo ( e , f ) , g } , distanceBetween : function ( a , b , c ) { void 0 === c && ( c = ! 1 ) ; var d = c ? a . world . x - b . world . x : a . x - b . x , e = c ? a . world . y - b . world . y : a . y - b . y ; return Math . sqrt ( d * d + e * e ) } , distanceToXY : function ( a , b , c , d ) { void 0 === d && ( d = ! 1 ) ; var e = d ? a . world . x - b : a . x - b , f = d ? a . world . y - c : a . y - c ; return Math . sqrt ( e * e + f * f ) } , distanceToPointer : function ( a , b , c ) { void 0 === b && ( b = this . game . input . activePointer ) , void 0 === c && ( c = ! 1 ) ; var d = c ? a . world . x - b . worldX : a . x - b . worldX , e = c ? a . world . y - b . worldY : a . y - b . worldY ; return Math . sqrt ( d * d + e * e ) } , angleBetween : function ( a , b , c ) { return void 0 === c && ( c = ! 1 ) , c ? Math . atan2 ( b . world . y - a . world . y , b . world . x - a . world . x ) : Math . atan2 ( b . y - a . y , b . x - a . x ) } , angleToXY : function ( a , b , c , d ) { return void 0 === d && ( d = ! 1 ) , d ? Math . atan2 ( c - a . world . y , b - a . world . x ) : Math . atan2 ( c - a . y , b - a . x ) } , angleToPointer : function ( a , b , c ) { return void 0 === b && ( b = this . game . input . activePointer ) , void 0 === c && ( c = ! 1 ) , c ? Math . atan2 ( b . worldY - a . world . y , b . worldX - a . world . x ) : Math . atan2 ( b . worldY - a . y , b . worldX - a . x ) } , worldAngleToPointer : function ( a , b ) { return this . angleToPointer ( a , b , ! 0 ) } } , c . Physics . Arcade . Body = function ( a ) { this . sprite = a , this . game = a . game , this . type = c . Physics . ARCADE , this . enable = ! 0 , this . offset = new c . Point , this . position = new c . Point ( a . x , a . y ) , this . prev = new c . Point ( this . position . x , this . position . y ) , this . allowRotation = ! 0 , this . rotation = a . rotation , this . preRotation = a . rotation , this . width = a . width , this . height = a . height , this . sourceWidth = a . width , this . sourceHeight = a . height , a . texture && ( this . sourceWidth = a . texture . frame . width , this . sourceHeight = a . texture . frame . height ) , this . halfWidth = Math . abs ( a . width / 2 ) , this . halfHeight = Math . abs ( a . height / 2 ) , this . center = new c . Point ( a . x + this . halfWidth , a . y + this . halfHeight ) , this . velocity = new c . Point , this . newVelocity = new c . Point ( 0 , 0 ) , this . del
get : function ( ) { return this . world . defaultContactMaterial . restitution } , set : function ( a ) { this . world . defaultContactMaterial . restitution = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "contactMaterial" , { get : function ( ) { return this . world . defaultContactMaterial } , set : function ( a ) { this . world . defaultContactMaterial = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "applySpringForces" , { get : function ( ) { return this . world . applySpringForces } , set : function ( a ) { this . world . applySpringForces = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "applyDamping" , { get : function ( ) { return this . world . applyDamping } , set : function ( a ) { this . world . applyDamping = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "applyGravity" , { get : function ( ) { return this . world . applyGravity } , set : function ( a ) { this . world . applyGravity = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "solveConstraints" , { get : function ( ) { return this . world . solveConstraints } , set : function ( a ) { this . world . solveConstraints = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "time" , { get : function ( ) { return this . world . time } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "emitImpactEvent" , { get : function ( ) { return this . world . emitImpactEvent } , set : function ( a ) { this . world . emitImpactEvent = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "sleepMode" , { get : function ( ) { return this . world . sleepMode } , set : function ( a ) { this . world . sleepMode = a } } ) , Object . defineProperty ( c . Physics . P2 . prototype , "total" , { get : function ( ) { return this . world . bodies . length } } ) , c . Physics . P2 . FixtureList = function ( a ) { Array . isArray ( a ) || ( a = [ a ] ) , this . rawList = a , this . init ( ) , this . parse ( this . rawList ) } , c . Physics . P2 . FixtureList . prototype = { init : function ( ) { this . namedFixtures = { } , this . groupedFixtures = [ ] , this . allFixtures = [ ] } , setCategory : function ( a , b ) { var c = function ( b ) { b . collisionGroup = a } ; this . getFixtures ( b ) . forEach ( c ) } , setMask : function ( a , b ) { var c = function ( b ) { b . collisionMask = a } ; this . getFixtures ( b ) . forEach ( c ) } , setSensor : function ( a , b ) { var c = function ( b ) { b . sensor = a } ; this . getFixtures ( b ) . forEach ( c ) } , setMaterial : function ( a , b ) { var c = function ( b ) { b . material = a } ; this . getFixtures ( b ) . forEach ( c ) } , getFixtures : function ( a ) { var b = [ ] ; if ( a ) { a instanceof Array || ( a = [ a ] ) ; var c = this ; return a . forEach ( function ( a ) { c . namedFixtures [ a ] && b . push ( c . namedFixtures [ a ] ) } ) , this . flatten ( b ) } return this . allFixtures } , getFixtureByKey : function ( a ) { return this . namedFixtures [ a ] } , getGroup : function ( a ) { return this . groupedFixtures [ a ] } , parse : function ( ) { var a , b , c , d ; c = this . rawList , d = [ ] ; for ( a in c ) b = c [ a ] , isNaN ( a - 0 ) ? this . namedFixtures [ a ] = this . flatten ( b ) : ( this . groupedFixtures [ a ] = this . groupedFixtures [ a ] || [ ] , this . groupedFixtures [ a ] = this . groupedFixtures [ a ] . concat ( b ) ) , d . push ( this . allFixtures = this . flatten ( this . groupedFixtures ) ) } , flatten : function ( a ) { var b , c ; return b = [ ] , c = arguments . callee , a . forEach ( function ( a ) { return Array . prototype . push . apply ( b , Array . isArray ( a ) ? c ( a ) : [ a ] ) } ) , b } } , c . Physics . P2 . PointProxy = function ( a , b ) { this . world = a , this . destination = b } , c . Physics . P2 . PointProxy . prototype . constructor = c . Physics . P2 . PointProxy , Object . defineProperty ( c . Physics . P2 . PointProxy . prototype , "x" , { get : function ( ) { return this . world . mpx ( this . destination [ 0 ] ) } , set : function ( a ) { this . destination [ 0 ] = this . world . pxm ( a ) } } ) , Object . defineProperty ( c . Physics . P2 . PointProxy . prototype , "y" , { get : function ( ) { return this . world . mpx ( this . destination [ 1 ] ) } , set : function ( a ) { this . destination [ 1 ] = this . world . pxm ( a ) } } ) , Object . defineProperty ( c . Physics . P2 . PointProxy . prototype , "mx" , { get : function ( ) { return this . destination [ 0 ] } , set : function ( a ) { this . destination [ 0 ] = a } } ) , Object . defineProperty ( c . Physics . P2 . PointProxy . prototype , "my" , { get : function ( ) { return this . destination [ 1 ] } , set : function ( a ) { this . destination [ 1 ] = a } } ) , c . Physics . P2 . InversePointProxy = function ( a , b ) { this . world = a , this . destination = b } , c . Physics . P2 . InversePointProxy . prototype . constructor = c . Physics . P2 . InversePointProxy , Object . defineProperty ( c . Physics . P2 . InversePointProxy . prototype , "x" , { get : function ( ) { return this . world . mpxi ( this . destination [ 0 ] ) } , set : function ( a ) { this . destination [ 0 ] = this . world . pxmi ( a ) } } ) , Object . defineProperty ( c . Physics . P2 . InversePointProxy . prototype , "y" , { get : function ( ) { return this . world . mpxi ( this . destination [ 1 ] ) } , set : function ( a ) { this . destination
this . tileWidth = a , this . tileHeight = b , this . widthInPixels = this . width * a , this . heightInPixels = this . height * b } , addTilesetImage : function ( a , b , d , e , f , g , h ) { if ( void 0 === a ) return null ; void 0 === d && ( d = this . tileWidth ) , void 0 === e && ( e = this . tileHeight ) , void 0 === f && ( f = 0 ) , void 0 === g && ( g = 0 ) , void 0 === h && ( h = 0 ) , 0 === d && ( d = 32 ) , 0 === e && ( e = 32 ) ; var i = null ; if ( void 0 !== b && null !== b || ( b = a ) , b instanceof c . BitmapData ) i = b . canvas ; else { if ( ! this . game . cache . checkImageKey ( b ) ) return console . warn ( 'Phaser.Tilemap.addTilesetImage: Invalid image key given: "' + b + '"' ) , null ; i = this . game . cache . getImage ( b ) } var j = this . getTilesetIndex ( a ) ; if ( null === j && this . format === c . Tilemap . TILED _JSON ) return console . warn ( 'Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "' + a + '"' ) , null ; if ( this . tilesets [ j ] ) return this . tilesets [ j ] . setImage ( i ) , this . tilesets [ j ] ; var k = new c . Tileset ( a , h , d , e , f , g , { } ) ; k . setImage ( i ) , this . tilesets . push ( k ) ; for ( var l = this . tilesets . length - 1 , m = f , n = f , o = 0 , p = 0 , q = 0 , r = h ; r < h + k . total && ( this . tiles [ r ] = [ m , n , l ] , m += d + g , o ++ , o !== k . total ) && ( p ++ , p !== k . columns || ( m = f , n += e + g , p = 0 , q ++ , q !== k . rows ) ) ; r ++ ) ; return k } , createFromObjects : function ( a , b , d , e , f , g , h , i , j ) { if ( void 0 === f && ( f = ! 0 ) , void 0 === g && ( g = ! 1 ) , void 0 === h && ( h = this . game . world ) , void 0 === i && ( i = c . Sprite ) , void 0 === j && ( j = ! 0 ) , ! this . objects [ a ] ) return void console . warn ( "Tilemap.createFromObjects: Invalid objectgroup name given: " + a ) ; for ( var k = 0 ; k < this . objects [ a ] . length ; k ++ ) { var l = ! 1 , m = this . objects [ a ] [ k ] ; if ( void 0 !== m . gid && "number" == typeof b && m . gid === b ? l = ! 0 : void 0 !== m . id && "number" == typeof b && m . id === b ? l = ! 0 : void 0 !== m . name && "string" == typeof b && m . name === b && ( l = ! 0 ) , l ) { var n = new i ( this . game , parseFloat ( m . x , 10 ) , parseFloat ( m . y , 10 ) , d , e ) ; n . name = m . name , n . visible = m . visible , n . autoCull = g , n . exists = f , m . width && ( n . width = m . width ) , m . height && ( n . height = m . height ) , m . rotation && ( n . angle = m . rotation ) , j && ( n . y -= n . height ) , h . add ( n ) ; for ( var o in m . properties ) h . set ( n , o , m . properties [ o ] , ! 1 , ! 1 , 0 , ! 0 ) } } } , createFromTiles : function ( a , b , d , e , f , g ) { "number" == typeof a && ( a = [ a ] ) , void 0 === b || null === b ? b = [ ] : "number" == typeof b && ( b = [ b ] ) , e = this . getLayer ( e ) , void 0 === f && ( f = this . game . world ) , void 0 === g && ( g = { } ) , void 0 === g . customClass && ( g . customClass = c . Sprite ) , void 0 === g . adjustY && ( g . adjustY = ! 0 ) ; var h = this . layers [ e ] . width , i = this . layers [ e ] . height ; if ( this . copy ( 0 , 0 , h , i , e ) , this . _results . length < 2 ) return 0 ; for ( var j , k = 0 , l = 1 , m = this . _results . length ; m > l ; l ++ ) if ( - 1 !== a . indexOf ( this . _results [ l ] . index ) ) { j = new g . customClass ( this . game , this . _results [ l ] . worldX , this . _results [ l ] . worldY , d ) ; for ( var n in g ) j [ n ] = g [ n ] ; f . add ( j ) , k ++ } if ( 1 === b . length ) for ( l = 0 ; l < a . length ; l ++ ) this . replace ( a [ l ] , b [ 0 ] , 0 , 0 , h , i , e ) ; else if ( b . length > 1 ) for ( l = 0 ; l < a . length ; l ++ ) this . replace ( a [ l ] , b [ l ] , 0 , 0 , h , i , e ) ; return k } , createLayer : function ( a , b , d , e , f ) { void 0 === b && ( b = this . game . width ) , void 0 === d && ( d = this . game . height ) , void 0 === e && ( e = this . game . world ) ; var g = a ; return "string" == typeof a && ( g = this . getLayerIndex ( a ) ) , null === g || g > this . layers . length ? void console . warn ( "Tilemap.createLayer: Invalid layer ID given: " + g ) : f ? e . add ( new c . TilemapLayerGL ( this . game , this , g , b , d ) ) : e . add ( new c . TilemapLayer ( this . game , this , g , b , d ) ) } , createBlankLayer : function ( a , b , d , e , f , g ) { if ( void 0 === g && ( g = this . game . world ) , null !== this . getLayerIndex ( a ) ) return void console . warn ( "Tilemap.createBlankLayer: Layer with matching name already exists" ) ; for ( var h , i = { name : a , x : 0 , y : 0 , width : b , height : d , widthInPixels : b * e , heightInPixels : d * f , alpha : 1 , visible : ! 0 , properties : { } , indexes : [ ] , callbacks : [ ] , bodies : [ ] , data : null } , j = [ ] , k = 0 ; d > k ; k ++ ) { h = [ ] ; for ( var l = 0 ; b > l ; l ++ ) h . push ( new c . Tile ( i , - 1 , l , k , e , f ) ) ; j . push ( h ) } i . data = j , this . layers . push ( i ) , this . currentLayer = this . layers . length - 1 ; var m = i . widthInPixels , n = i . heightInPixels ; m > this . game . width && ( m = this . game . width ) , n > this . game . height && ( n = this . game . height ) ; var j = new c . TilemapLayer ( this . game , this , this . layers . length - 1 , m , n ) ; return j . name = a , g . add ( j ) } , getIndex : function ( a , b ) { for ( var c = 0 ; c < a . length ; c ++ ) if ( a [ c ] . name === b ) return c ; return null } , getLayerIndex : function ( a ) { return this . getIndex ( this . layers , a ) } , getTilesetIndex : function ( a ) { return this . getIndex ( this . tilesets , a ) } , getImageIndex : function ( a ) { return this . getIndex ( this . images , a ) } , setTileIndexCallback : function ( a , b , c , d ) { if ( d = this .
for ( var h = 0 ; h < this . columns ; h ++ ) this . drawCoords . push ( e ) , this . drawCoords . push ( f ) , e += this . tileWidth + this . tileSpacing ; e = this . tileMargin , f += this . tileHeight + this . tileSpacing } } } , c . Tileset . prototype . constructor = c . Tileset , c . Particle = function ( a , b , d , e , f ) { c . Sprite . call ( this , a , b , d , e , f ) , this . autoScale = ! 1 , this . scaleData = null , this . _s = 0 , this . autoAlpha = ! 1 , this . alphaData = null , this . _a = 0 } , c . Particle . prototype = Object . create ( c . Sprite . prototype ) , c . Particle . prototype . constructor = c . Particle , c . Particle . prototype . update = function ( ) { this . autoScale && ( this . _s -- , this . _s ? this . scale . set ( this . scaleData [ this . _s ] . x , this . scaleData [ this . _s ] . y ) : this . autoScale = ! 1 ) , this . autoAlpha && ( this . _a -- , this . _a ? this . alpha = this . alphaData [ this . _a ] . v : this . autoAlpha = ! 1 ) } , c . Particle . prototype . onEmit = function ( ) { } , c . Particle . prototype . setAlphaData = function ( a ) { this . alphaData = a , this . _a = a . length - 1 , this . alpha = this . alphaData [ this . _a ] . v , this . autoAlpha = ! 0 } , c . Particle . prototype . setScaleData = function ( a ) { this . scaleData = a , this . _s = a . length - 1 , this . scale . set ( this . scaleData [ this . _s ] . x , this . scaleData [ this . _s ] . y ) , this . autoScale = ! 0 } , c . Particle . prototype . reset = function ( a , b , d ) { return c . Component . Reset . prototype . reset . call ( this , a , b , d ) , this . alpha = 1 , this . scale . set ( 1 ) , this . autoScale = ! 1 , this . autoAlpha = ! 1 , this } , c . Particles = function ( a ) { this . game = a , this . emitters = { } , this . ID = 0 } , c . Particles . prototype = { add : function ( a ) { return this . emitters [ a . name ] = a , a } , remove : function ( a ) { delete this . emitters [ a . name ] } , update : function ( ) { for ( var a in this . emitters ) this . emitters [ a ] . exists && this . emitters [ a ] . update ( ) } } , c . Particles . prototype . constructor = c . Particles , c . Particles . Arcade = { } , c . Particles . Arcade . Emitter = function ( a , b , d , e ) { this . maxParticles = e || 50 , c . Group . call ( this , a ) , this . name = "emitter" + this . game . particles . ID ++ , this . type = c . EMITTER , this . physicsType = c . GROUP , this . area = new c . Rectangle ( b , d , 1 , 1 ) , this . minParticleSpeed = new c . Point ( - 100 , - 100 ) , this . maxParticleSpeed = new c . Point ( 100 , 100 ) , this . minParticleScale = 1 , this . maxParticleScale = 1 , this . scaleData = null , this . minRotation = - 360 , this . maxRotation = 360 , this . minParticleAlpha = 1 , this . maxParticleAlpha = 1 , this . alphaData = null , this . gravity = 100 , this . particleClass = c . Particle , this . particleDrag = new c . Point , this . angularDrag = 0 , this . frequency = 100 , this . lifespan = 2e3 , this . bounce = new c . Point , this . on = ! 1 , this . particleAnchor = new c . Point ( . 5 , . 5 ) , this . blendMode = c . blendModes . NORMAL , this . emitX = b , this . emitY = d , this . autoScale = ! 1 , this . autoAlpha = ! 1 , this . particleBringToTop = ! 1 , this . particleSendToBack = ! 1 , this . _minParticleScale = new c . Point ( 1 , 1 ) , this . _maxParticleScale = new c . Point ( 1 , 1 ) , this . _quantity = 0 , this . _timer = 0 , this . _counter = 0 , this . _flowQuantity = 0 , this . _flowTotal = 0 , this . _explode = ! 0 , this . _frames = null } , c . Particles . Arcade . Emitter . prototype = Object . create ( c . Group . prototype ) , c . Particles . Arcade . Emitter . prototype . constructor = c . Particles . Arcade . Emitter , c . Particles . Arcade . Emitter . prototype . update = function ( ) { if ( this . on && this . game . time . time >= this . _timer ) if ( this . _timer = this . game . time . time + this . frequency * this . game . time . slowMotion , 0 !== this . _flowTotal ) if ( this . _flowQuantity > 0 ) { for ( var a = 0 ; a < this . _flowQuantity ; a ++ ) if ( this . emitParticle ( ) && ( this . _counter ++ , - 1 !== this . _flowTotal && this . _counter >= this . _flowTotal ) ) { this . on = ! 1 ; break } } else this . emitParticle ( ) && ( this . _counter ++ , - 1 !== this . _flowTotal && this . _counter >= this . _flowTotal && ( this . on = ! 1 ) ) ; else this . emitParticle ( ) && ( this . _counter ++ , this . _quantity > 0 && this . _counter >= this . _quantity && ( this . on = ! 1 ) ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] . exists && this . children [ a ] . update ( ) } , c . Particles . Arcade . Emitter . prototype . makeParticles = function ( a , b , c , d , e ) { void 0 === b && ( b = 0 ) , void 0 === c && ( c = this . maxParticles ) , void 0 === d && ( d = ! 1 ) , void 0 === e && ( e = ! 1 ) ; var f , g = 0 , h = a , i = b ; for ( this . _frames = b , c > this . maxParticles && ( this . maxParticles = c ) ; c > g ; ) Array . isArray ( a ) && ( h = this . game . rnd . pick ( a ) ) , Array . isArray ( b ) && ( i = this . game . rnd . pick ( b ) ) , f = new this . particleClass ( this . game , 0 , 0 , h , i ) , this . game . physics . arcade . enable ( f , ! 1 ) , d ? ( f . body . checkCollision . any = ! 0 , f . body . checkCollision . none = ! 1 ) : f . body . checkCollision . none = ! 0 , f . body . collideWorldBounds = e , f . body . skipQuadTree = ! 0 , f . exists = ! 1 , f . visible = ! 1 , f . anchor . copyFrom ( this . particleAnchor ) , this . add (
2016-02-12 16:00:36 +00:00
//# sourceMappingURL=phaser-split.map