2015-05-06 07:00:42 +00:00
/* Phaser v2.4.0 - http://phaser.io - @photonstorm - (c) 2015 Photon Storm Ltd. */
2015-02-25 02:59:00 +00:00
2015-07-17 16:51:05 +00:00
( function ( ) { var a = this , b = b || { } ; b . WEBGL _RENDERER = 0 , b . CANVAS _RENDERER = 1 , b . VERSION = "v2.2.8" , b . _UID = 0 , "undefined" != typeof Float32Array ? ( b . Float32Array = Float32Array , b . Uint16Array = Uint16Array , b . Uint32Array = Uint32Array , b . ArrayBuffer = ArrayBuffer ) : ( b . Float32Array = Array , b . Uint16Array = Array ) , b . PI _2 = 2 * Math . PI , b . RAD _TO _DEG = 180 / Math . PI , b . DEG _TO _RAD = Math . PI / 180 , b . RETINA _PREFIX = "@2x" , b . defaultRenderOptions = { view : null , transparent : ! 1 , antialias : ! 1 , preserveDrawingBuffer : ! 1 , resolution : 1 , clearBeforeRender : ! 0 , autoResize : ! 1 } , b . DisplayObject = function ( ) { this . position = new b . Point ( 0 , 0 ) , this . scale = new b . Point ( 1 , 1 ) , this . transformCallback = null , this . transformCallbackContext = null , this . pivot = new b . Point ( 0 , 0 ) , this . rotation = 0 , this . alpha = 1 , this . visible = ! 0 , this . hitArea = null , this . renderable = ! 1 , this . parent = null , this . stage = null , this . worldAlpha = 1 , this . worldTransform = new b . Matrix , this . worldPosition = new b . Point ( 0 , 0 ) , this . worldScale = new b . Point ( 1 , 1 ) , this . worldRotation = 0 , this . _sr = 0 , this . _cr = 1 , this . filterArea = null , this . _bounds = new b . Rectangle ( 0 , 0 , 1 , 1 ) , this . _currentBounds = null , this . _mask = null , this . _cacheAsBitmap = ! 1 , this . _cacheIsDirty = ! 1 } , b . DisplayObject . prototype . constructor = b . DisplayObject , b . DisplayObject . prototype . destroy = function ( ) { if ( this . children ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . destroy ( ) ; this . children = [ ] } 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 . renderable = ! 1 , this . _destroyCachedSprite ( ) } , Object . defineProperty ( b . DisplayObject . prototype , "worldVisible" , { get : function ( ) { var a = this ; do { if ( ! a . visible ) return ! 1 ; a = a . parent } while ( a ) ; return ! 0 } } ) , Object . defineProperty ( b . DisplayObject . prototype , "mask" , { get : function ( ) { return this . _mask } , set : function ( a ) { this . _mask && ( this . _mask . isMask = ! 1 ) , this . _mask = a , this . _mask && ( this . _mask . isMask = ! 0 ) } } ) , Object . defineProperty ( b . DisplayObject . prototype , "filters" , { get : function ( ) { return this . _filters } , set : function ( a ) { if ( a ) { for ( var b = [ ] , c = 0 ; c < a . length ; c ++ ) for ( var d = a [ c ] . passes , e = 0 ; e < d . length ; e ++ ) b . push ( d [ e ] ) ; this . _filterBlock = { target : this , filterPasses : b } } this . _filters = a } } ) , Object . defineProperty ( b . DisplayObject . prototype , "cacheAsBitmap" , { get : function ( ) { return this . _cacheAsBitmap } , set : function ( a ) { this . _cacheAsBitmap !== a && ( a ? this . _generateCachedSprite ( ) : this . _destroyCachedSprite ( ) , this . _cacheAsBitmap = a ) } } ) , b . DisplayObject . prototype . updateTransform = function ( a ) { if ( a || this . parent || this . game ) { var c = this . parent ; a ? c = a : this . parent || ( c = this . game . world ) ; var d , e , f , g , h , i , j = c . worldTransform , k = this . worldTransform ; this . rotation % b . PI _2 ? ( this . rotation !== this . rotationCache && ( this . rotationCache = this . rotation , this . _sr = Math . sin ( this . rotation ) , this . _cr = Math . cos ( this . rotation ) ) , d = this . _cr * this . scale . x , e = this . _sr * this . scale . x , f = - this . _sr * this . scale . y , g = this . _cr * this . scale . y , h = this . position . x , i = this . position . y , ( this . pivot . x || this . pivot . y ) && ( h -= this . pivot . x * d + this . pivot . y * f , i -= this . pivot . x * e + this . pivot . y * g ) , k . a = d * j . a + e * j . c , k . b = d * j . b + e * j . d , k . c = f * j . a + g * j . c , k . d = f * j . b + g * j . d , k . tx = h * j . a + i * j . c + j . tx , k . ty = h * j . b + i * j . d + j . ty ) : ( d = this . scale . x , g = this . scale . y , h = this . position . x - this . pivot . x * d , i = this . position . y - this . pivot . y * g , k . a = d * j . a , k . b = d * j . b , k . c = g * j . c , k . d = g * j . d , k . tx = h * j . a + i * j . c + j . tx , k . ty = h * j . b + i * j . d + j . ty ) , this . worldAlpha = this . alpha * c . worldAlpha , this . worldPosition . set ( k . tx , k . ty ) , this . worldScale . set ( Math . sqrt ( k . a * k . a + k . b * k . b ) , Math . sqrt ( k . c * k . c + k . d * k . d ) ) , this . worldRotation = Math . atan2 ( - k . c , k . d ) , this . _currentBounds = null , this . transformCallback && this . transformCallback . call ( this . transformCallbackContext , k , j ) } } , b . DisplayObject . prototype . displayObjectUpdateTransform = b . DisplayObject . prototype . updateTransform , b . DisplayObject . prototype . getBounds = function ( a ) { return a = a , b . EmptyRectangle } , b . DisplayObject . prototype . getLocalBounds = function ( ) { return this . getBounds ( b . identityMatrix ) } , b . DisplayObject . prototype . setStageReference = function ( a ) { this . stage = a } , b . DisplayObject . prototype . preUpdate = function ( ) { } , b . DisplayObject . prototype . generateTexture = function ( a , c , d ) { var e = this . getLocalBounds ( ) , f = new b . RenderTexture ( 0 |
2015-07-10 16:27:31 +00:00
} , b . WebGLGraphics . updateGraphics = function ( a , c ) { var d = a . _webGL [ c . id ] ; d || ( d = a . _webGL [ c . id ] = { lastIndex : 0 , data : [ ] , gl : c } ) , a . dirty = ! 1 ; var e ; if ( a . clearDirty ) { for ( a . clearDirty = ! 1 , e = 0 ; e < d . data . length ; e ++ ) { var f = d . data [ e ] ; f . reset ( ) , b . WebGLGraphics . graphicsDataPool . push ( f ) } d . data = [ ] , d . lastIndex = 0 } var g ; for ( e = d . lastIndex ; e < a . graphicsData . length ; e ++ ) { var h = a . graphicsData [ e ] ; if ( h . type === b . Graphics . POLY ) { if ( h . points = h . shape . points . slice ( ) , h . shape . closed && ( h . points [ 0 ] !== h . points [ h . points . length - 2 ] || h . points [ 1 ] !== h . points [ h . points . length - 1 ] ) && h . points . push ( h . points [ 0 ] , h . points [ 1 ] ) , h . fill && h . points . length >= 6 ) if ( h . points . length < 12 ) { g = b . WebGLGraphics . switchMode ( d , 0 ) ; var i = b . WebGLGraphics . buildPoly ( h , g ) ; i || ( g = b . WebGLGraphics . switchMode ( d , 1 ) , b . WebGLGraphics . buildComplexPoly ( h , g ) ) } else g = b . WebGLGraphics . switchMode ( d , 1 ) , b . WebGLGraphics . buildComplexPoly ( h , g ) ; h . lineWidth > 0 && ( g = b . WebGLGraphics . switchMode ( d , 0 ) , b . WebGLGraphics . buildLine ( h , g ) ) } else g = b . WebGLGraphics . switchMode ( d , 0 ) , h . type === b . Graphics . RECT ? b . WebGLGraphics . buildRectangle ( h , g ) : h . type === b . Graphics . CIRC || h . type === b . Graphics . ELIP ? b . WebGLGraphics . buildCircle ( h , g ) : h . type === b . Graphics . RREC && b . WebGLGraphics . buildRoundedRectangle ( h , g ) ; d . lastIndex ++ } for ( e = 0 ; e < d . data . length ; e ++ ) g = d . data [ e ] , g . dirty && g . upload ( ) } , b . WebGLGraphics . switchMode = function ( a , c ) { var d ; return a . data . length ? ( d = a . data [ a . data . length - 1 ] , ( d . mode !== c || 1 === c ) && ( d = b . WebGLGraphics . graphicsDataPool . pop ( ) || new b . WebGLGraphicsData ( a . gl ) , d . mode = c , a . data . push ( d ) ) ) : ( d = b . WebGLGraphics . graphicsDataPool . pop ( ) || new b . WebGLGraphicsData ( a . gl ) , d . mode = c , a . data . push ( d ) ) , d . dirty = ! 0 , d } , b . WebGLGraphics . buildRectangle = function ( a , c ) { var d = a . shape , e = d . x , f = d . y , g = d . width , h = d . height ; if ( a . fill ) { var i = b . hex2rgb ( a . fillColor ) , j = a . fillAlpha , k = i [ 0 ] * j , l = i [ 1 ] * j , m = i [ 2 ] * j , n = c . points , o = c . indices , p = n . length / 6 ; n . push ( e , f ) , n . push ( k , l , m , j ) , n . push ( e + g , f ) , n . push ( k , l , m , j ) , n . push ( e , f + h ) , n . push ( k , l , m , j ) , n . push ( e + g , f + h ) , n . push ( k , l , m , j ) , o . push ( p , p , p + 1 , p + 2 , p + 3 , p + 3 ) } if ( a . lineWidth ) { var q = a . points ; a . points = [ e , f , e + g , f , e + g , f + h , e , f + h , e , f ] , b . WebGLGraphics . buildLine ( a , c ) , a . points = q } } , b . WebGLGraphics . buildRoundedRectangle = function ( a , c ) { var d = a . shape , e = d . x , f = d . y , g = d . width , h = d . height , i = d . radius , j = [ ] ; if ( j . push ( e , f + i ) , j = j . concat ( b . WebGLGraphics . quadraticBezierCurve ( e , f + h - i , e , f + h , e + i , f + h ) ) , j = j . concat ( b . WebGLGraphics . quadraticBezierCurve ( e + g - i , f + h , e + g , f + h , e + g , f + h - i ) ) , j = j . concat ( b . WebGLGraphics . quadraticBezierCurve ( e + g , f + i , e + g , f , e + g - i , f ) ) , j = j . concat ( b . WebGLGraphics . quadraticBezierCurve ( e + i , f , e , f , e , f + i ) ) , a . fill ) { var k = b . hex2rgb ( a . fillColor ) , l = a . fillAlpha , m = k [ 0 ] * l , n = k [ 1 ] * l , o = k [ 2 ] * l , p = c . points , q = c . indices , r = p . length / 6 , s = b . PolyK . Triangulate ( j ) , t = 0 ; for ( t = 0 ; t < s . length ; t += 3 ) q . push ( s [ t ] + r ) , q . push ( s [ t ] + r ) , q . push ( s [ t + 1 ] + r ) , q . push ( s [ t + 2 ] + r ) , q . push ( s [ t + 2 ] + r ) ; for ( t = 0 ; t < j . length ; t ++ ) p . push ( j [ t ] , j [ ++ t ] , m , n , o , l ) } if ( a . lineWidth ) { var u = a . points ; a . points = j , b . WebGLGraphics . buildLine ( a , c ) , a . points = u } } , b . WebGLGraphics . quadraticBezierCurve = function ( a , b , c , d , e , f ) { 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 } , b . WebGLGraphics . buildCircle = function ( a , c ) { var d , e , f = a . shape , g = f . x , h = f . y ; a . type === b . Graphics . CIRC ? ( d = f . radius , e = f . radius ) : ( d = f . width , e = f . height ) ; var i = 40 , j = 2 * Math . PI / i , k = 0 ; if ( a . fill ) { var l = b . hex2rgb ( a . fillColor ) , m = a . fillAlpha , n = l [ 0 ] * m , o = l [ 1 ] * m , p = l [ 2 ] * m , q = c . points , r = c . indices , s = q . length / 6 ; for ( r . push ( s ) , k = 0 ; i + 1 > k ; k ++ ) q . push ( g , h , n , o , p , m ) , q . push ( g + Math . sin ( j * k ) * d , h + Math . cos ( j * k ) * e , n , o , p , m ) , r . push ( s ++ , s ++ ) ; r . push ( s - 1 ) } if ( a . lineWidth ) { var t = a . points ; for ( a . points = [ ] , k = 0 ; i + 1 > k ; k ++ ) a . points . push ( g + Math . sin ( j * k ) * d , h + Math . cos ( j * k ) * e ) ; b . WebGLGraphics . buildLine ( a , c ) , a . points = t } } , b . WebGLGraphics . buildLine = function ( a , c ) { var d = 0 , e = a . points ; if ( 0 !== e . length ) { if ( a . lineWidth % 2 ) for ( d = 0 ; d < e . length ; d ++ ) e [ d ] += . 5 ; var f = new b . Point ( e [ 0 ] , e [ 1 ] ) , g = new b . Point ( e [ e . length - 2 ] , e [ e . length - 1 ] ) ; if ( f . x === g . x && f . y === g . y ) { e = e . slice ( ) , e . pop ( ) , e . pop ( ) , g = new b . Point ( e [ e . length - 2 ] , e [ e . length - 1 ] ) ; var h = g . x + . 5 * ( f . x - g . x ) , i = g . y + . 5 * ( f . y - g . y ) ; e . unshift ( h , i ) , e . push ( h , i ) } var j , k , l , m , n , o , p , q , r , s , t , u , v , w , x , y , z , A , B , C , D , E , F , G = c . points ,
var h = e , i = this . texturePool . pop ( ) ; i || ( i = new b . FilterTexture ( this . gl , this . width , this . height ) ) , i . resize ( this . width , this . height ) , a . bindFramebuffer ( a . FRAMEBUFFER , i . frameBuffer ) , a . clear ( a . COLOR _BUFFER _BIT ) , a . disable ( a . BLEND ) ; for ( var j = 0 ; j < c . filterPasses . length - 1 ; j ++ ) { var k = c . filterPasses [ j ] ; a . bindFramebuffer ( a . FRAMEBUFFER , i . frameBuffer ) , a . activeTexture ( a . TEXTURE0 ) , a . bindTexture ( a . TEXTURE _2D , h . texture ) , this . applyFilterPass ( k , d , d . width , d . height ) ; var l = h ; h = i , i = l } a . enable ( a . BLEND ) , e = h , this . texturePool . push ( i ) } var m = c . filterPasses [ c . filterPasses . length - 1 ] ; this . offsetX -= d . x , this . offsetY -= d . y ; var n = this . width , o = this . height , p = 0 , q = 0 , r = this . buffer ; if ( 0 === this . filterStack . length ) a . colorMask ( ! 0 , ! 0 , ! 0 , ! 0 ) ; else { var s = this . filterStack [ this . filterStack . length - 1 ] ; d = s . _filterArea , n = d . width , o = d . height , p = d . x , q = d . y , r = s . _glFilterTexture . frameBuffer } f . x = n / 2 , f . y = - o / 2 , g . x = p , g . y = q , d = c . _filterArea ; var t = d . x - p , u = d . y - q ; a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , this . vertexArray [ 0 ] = t , this . vertexArray [ 1 ] = u + d . height , this . vertexArray [ 2 ] = t + d . width , this . vertexArray [ 3 ] = u + d . height , this . vertexArray [ 4 ] = t , this . vertexArray [ 5 ] = u , this . vertexArray [ 6 ] = t + d . width , this . vertexArray [ 7 ] = u , a . bufferSubData ( a . ARRAY _BUFFER , 0 , this . vertexArray ) , a . bindBuffer ( a . ARRAY _BUFFER , this . uvBuffer ) , this . uvArray [ 2 ] = d . width / this . width , this . uvArray [ 5 ] = d . height / this . height , this . uvArray [ 6 ] = d . width / this . width , this . uvArray [ 7 ] = d . height / this . height , a . bufferSubData ( a . ARRAY _BUFFER , 0 , this . uvArray ) , a . viewport ( 0 , 0 , n * this . renderSession . resolution , o * this . renderSession . resolution ) , a . bindFramebuffer ( a . FRAMEBUFFER , r ) , a . activeTexture ( a . TEXTURE0 ) , a . bindTexture ( a . TEXTURE _2D , e . texture ) , this . applyFilterPass ( m , d , n , o ) , this . texturePool . push ( e ) , c . _glFilterTexture = null } , b . WebGLFilterManager . prototype . applyFilterPass = function ( a , c , d , e ) { var f = this . gl , g = a . shaders [ f . id ] ; g || ( g = new b . PixiShader ( f ) , g . fragmentSrc = a . fragmentSrc , g . uniforms = a . uniforms , g . init ( ) , a . shaders [ f . id ] = g ) , this . renderSession . shaderManager . setShader ( g ) , f . uniform2f ( g . projectionVector , d / 2 , - e / 2 ) , f . uniform2f ( g . offsetVector , 0 , 0 ) , a . uniforms . dimensions && ( a . uniforms . dimensions . value [ 0 ] = this . width , a . uniforms . dimensions . value [ 1 ] = this . height , a . uniforms . dimensions . value [ 2 ] = this . vertexArray [ 0 ] , a . uniforms . dimensions . value [ 3 ] = this . vertexArray [ 5 ] ) , g . syncUniforms ( ) , f . bindBuffer ( f . ARRAY _BUFFER , this . vertexBuffer ) , f . vertexAttribPointer ( g . aVertexPosition , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ARRAY _BUFFER , this . uvBuffer ) , f . vertexAttribPointer ( g . aTextureCoord , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ARRAY _BUFFER , this . colorBuffer ) , f . vertexAttribPointer ( g . colorAttribute , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , f . drawElements ( f . TRIANGLES , 6 , f . UNSIGNED _SHORT , 0 ) , this . renderSession . drawCount ++ } , b . WebGLFilterManager . prototype . initShaderBuffers = function ( ) { var a = this . gl ; this . vertexBuffer = a . createBuffer ( ) , this . uvBuffer = a . createBuffer ( ) , this . colorBuffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , this . vertexArray = new b . Float32Array ( [ 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . vertexArray , a . STATIC _DRAW ) , this . uvArray = new b . Float32Array ( [ 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . uvBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . uvArray , a . STATIC _DRAW ) , this . colorArray = new b . Float32Array ( [ 1 , 16777215 , 1 , 16777215 , 1 , 16777215 , 1 , 16777215 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . colorBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . colorArray , a . STATIC _DRAW ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , new Uint16Array ( [ 0 , 1 , 2 , 1 , 3 , 2 ] ) , a . STATIC _DRAW ) } , b . WebGLFilterManager . prototype . destroy = function ( ) { var a = this . gl ; this . filterStack = null , this . offsetX = 0 , this . offsetY = 0 ; for ( var b = 0 ; b < this . texturePool . length ; b ++ ) this . texturePool [ b ] . destroy ( ) ; this . texturePool = null , a . deleteBuffer ( this . vertexBuffer ) , a . deleteBuffer ( this . uvBuffer ) , a . deleteBuffer ( this . colorBuffer ) , a . deleteBuffer ( this . indexBuffer ) } , b . FilterTexture = function ( a , c , d , e ) { this . gl = a , this . frameBuffer = a . createFramebuffer ( ) , this . texture = a . createTexture ( ) , e = e || b . scaleModes . DEFAULT , a . bindTexture ( a . TEXTURE _2D , this . texture ) , a . texParameteri ( a . TEXTURE _2D , a . TEXTUR
2015-07-17 16:51:05 +00:00
a . transform ( D / C , G / C , E / C , H / C , F / C , I / C ) , a . drawImage ( g , 0 , 0 ) , a . restore ( ) } , b . Strip . prototype . renderStripFlat = function ( a ) { var b = this . context , c = a . vertices , d = c . length / 2 ; this . count ++ , b . beginPath ( ) ; for ( var e = 1 ; d - 2 > e ; e ++ ) { var f = 2 * e , g = c [ f ] , h = c [ f + 2 ] , i = c [ f + 4 ] , j = c [ f + 1 ] , k = c [ f + 3 ] , l = c [ f + 5 ] ; b . moveTo ( g , j ) , b . lineTo ( h , k ) , b . lineTo ( i , l ) } b . fillStyle = "#FF0000" , b . fill ( ) , b . closePath ( ) } , b . Strip . prototype . onTextureUpdate = function ( ) { this . updateFrame = ! 0 } , b . Strip . prototype . getBounds = function ( a ) { for ( var c = a || this . worldTransform , d = c . a , e = c . b , f = c . c , g = c . d , h = c . tx , i = c . ty , j = - 1 / 0 , k = - 1 / 0 , l = 1 / 0 , m = 1 / 0 , n = this . vertices , o = 0 , p = n . length ; p > o ; o += 2 ) { var q = n [ o ] , r = n [ o + 1 ] , s = d * q + f * r + h , t = g * r + e * q + i ; l = l > s ? s : l , m = m > t ? t : m , j = s > j ? s : j , k = t > k ? t : k } if ( l === - 1 / 0 || 1 / 0 === k ) return b . EmptyRectangle ; var u = this . _bounds ; return u . x = l , u . width = j - l , u . y = m , u . height = k - m , this . _currentBounds = u , u } , b . Strip . DrawModes = { TRIANGLE _STRIP : 0 , TRIANGLES : 1 } , b . Rope = function ( a , c ) { b . Strip . call ( this , a ) , this . points = c , this . vertices = new b . Float32Array ( 4 * c . length ) , this . uvs = new b . Float32Array ( 4 * c . length ) , this . colors = new b . Float32Array ( 2 * c . length ) , this . indices = new b . Uint16Array ( 2 * c . length ) , this . refresh ( ) } , b . Rope . prototype = Object . create ( b . Strip . prototype ) , b . Rope . prototype . constructor = b . Rope , b . Rope . prototype . refresh = function ( ) { var a = this . points ; if ( ! ( a . length < 1 ) ) { var b = this . uvs , c = a [ 0 ] , d = this . indices , e = this . colors ; this . count -= . 2 , b [ 0 ] = 0 , b [ 1 ] = 0 , b [ 2 ] = 0 , b [ 3 ] = 1 , e [ 0 ] = 1 , e [ 1 ] = 1 , d [ 0 ] = 0 , d [ 1 ] = 1 ; for ( var f , g , h , i = a . length , j = 1 ; i > j ; j ++ ) f = a [ j ] , g = 4 * j , h = j / ( i - 1 ) , j % 2 ? ( b [ g ] = h , b [ g + 1 ] = 0 , b [ g + 2 ] = h , b [ g + 3 ] = 1 ) : ( b [ g ] = h , b [ g + 1 ] = 0 , b [ g + 2 ] = h , b [ g + 3 ] = 1 ) , g = 2 * j , e [ g ] = 1 , e [ g + 1 ] = 1 , g = 2 * j , d [ g ] = g , d [ g + 1 ] = g + 1 , c = f } } , b . Rope . prototype . updateTransform = function ( ) { var a = this . points ; if ( ! ( a . length < 1 ) ) { var c , d = a [ 0 ] , e = { x : 0 , y : 0 } ; this . count -= . 2 ; for ( var f , g , h , i , j , k = this . vertices , l = a . length , m = 0 ; l > m ; m ++ ) f = a [ m ] , g = 4 * m , c = m < a . length - 1 ? a [ m + 1 ] : f , e . y = - ( c . x - d . x ) , e . x = c . y - d . y , h = 10 * ( 1 - m / ( l - 1 ) ) , h > 1 && ( h = 1 ) , i = Math . sqrt ( e . x * e . x + e . y * e . y ) , j = this . texture . height / 2 , e . x /= i , e . y /= i , e . x *= j , e . y *= j , k [ g ] = f . x + e . x , k [ g + 1 ] = f . y + e . y , k [ g + 2 ] = f . x - e . x , k [ g + 3 ] = f . y - e . y , d = f ; b . DisplayObjectContainer . prototype . updateTransform . call ( this ) } } , b . Rope . prototype . setTexture = function ( a ) { this . texture = a } , b . TilingSprite = function ( a , c , d ) { b . Sprite . call ( this , a ) , this . _width = c || 128 , this . _height = d || 128 , this . tileScale = new b . Point ( 1 , 1 ) , this . tileScaleOffset = new b . Point ( 1 , 1 ) , this . tilePosition = new b . Point , this . renderable = ! 0 , this . tint = 16777215 , this . textureDebug = ! 1 , this . blendMode = b . blendModes . NORMAL , this . canvasBuffer = null , this . tilingTexture = null , this . tilePattern = null , this . refreshTexture = ! 0 , this . frameWidth = 0 , this . frameHeight = 0 } , b . TilingSprite . prototype = Object . create ( b . Sprite . prototype ) , b . TilingSprite . prototype . constructor = b . TilingSprite , b . TilingSprite . prototype . setTexture = function ( a ) { this . texture !== a && ( this . texture = a , this . refreshTexture = ! 0 , this . cachedTint = 16777215 ) } , b . TilingSprite . prototype . _renderWebGL = function ( a ) { if ( this . visible !== ! 1 && 0 !== this . alpha ) { if ( this . _mask && ( a . spriteBatch . stop ( ) , a . maskManager . pushMask ( this . mask , a ) , a . spriteBatch . start ( ) ) , this . _filters && ( a . spriteBatch . flush ( ) , a . filterManager . pushFilter ( this . _filterBlock ) ) , this . refreshTexture ) { if ( this . generateTilingTexture ( ! 0 ) , ! this . tilingTexture ) return ; this . tilingTexture . needsUpdate && ( a . renderer . updateTexture ( this . tilingTexture . baseTexture ) , this . tilingTexture . needsUpdate = ! 1 ) } a . spriteBatch . renderTilingSprite ( this ) ; for ( var b = 0 ; b < this . children . length ; b ++ ) this . children [ b ] . _renderWebGL ( a ) ; a . spriteBatch . stop ( ) , this . _filters && a . filterManager . popFilter ( ) , this . _mask && a . maskManager . popMask ( this . _mask , a ) , a . spriteBatch . start ( ) } } , b . TilingSprite . prototype . _renderCanvas = function ( a ) { if ( this . visible !== ! 1 && 0 !== this . alpha ) { var c = a . context ; this . _mask && a . maskManager . pushMask ( this . _mask , a ) , c . globalAlpha = this . worldAlpha ; var d = this . worldTransform , e = a . resolution ; if ( c . setTransform ( d . a * e , d . b * e , d . c * e , d . d * e , d . tx * e , d . ty * e ) , this . refreshTexture ) { if ( this . generateTilingTexture ( ! 1 ) , ! this . tilingTexture ) return ; this . tilePattern = c . createPattern ( this . tilingTexture . baseTexture . source , "repeat" ) } var f = a . currentBlendMode ; this . blendMode !== a . currentBlendMode && ( a . currentBlendMode = this . blendMode , c . globalCompositeOperation = b . blendModesCanvas [ a . currentBle
} , invert : function ( ) { return this . setTo ( this . y , this . x ) } , setTo : function ( a , b ) { return this . x = a || 0 , this . y = b || ( 0 !== b ? this . x : 0 ) , this } , set : function ( a , b ) { return this . x = a || 0 , this . y = b || ( 0 !== b ? this . x : 0 ) , this } , add : function ( a , b ) { return this . x += a , this . y += b , this } , subtract : function ( a , b ) { return this . x -= a , this . y -= b , this } , multiply : function ( a , b ) { return this . x *= a , this . y *= b , this } , divide : function ( a , b ) { return this . x /= a , this . y /= b , this } , clampX : function ( a , b ) { return this . x = c . Math . clamp ( this . x , a , b ) , this } , clampY : function ( a , b ) { return this . y = c . Math . clamp ( this . y , a , b ) , this } , clamp : function ( a , b ) { return this . x = c . Math . clamp ( this . x , a , b ) , this . y = c . Math . clamp ( this . y , a , b ) , this } , clone : function ( a ) { return "undefined" == typeof a || null === a ? a = new c . Point ( this . x , this . y ) : a . setTo ( this . x , this . y ) , a } , copyTo : function ( a ) { return a . x = this . x , a . y = this . y , a } , distance : function ( a , b ) { return c . Point . distance ( this , a , b ) } , equals : function ( a ) { return a . x === this . x && a . y === this . y } , angle : function ( a , b ) { return "undefined" == typeof b && ( b = ! 1 ) , b ? c . Math . radToDeg ( Math . atan2 ( a . y - this . y , a . x - this . x ) ) : Math . atan2 ( a . y - this . y , a . x - this . x ) } , rotate : function ( a , b , d , e , f ) { return c . Point . rotate ( this , a , b , d , e , f ) } , getMagnitude : function ( ) { return Math . sqrt ( this . x * this . x + this . y * this . y ) } , getMagnitudeSq : function ( ) { return this . x * this . x + this . y * this . y } , setMagnitude : function ( a ) { return this . normalize ( ) . multiply ( a , a ) } , normalize : function ( ) { if ( ! this . isZero ( ) ) { var a = this . getMagnitude ( ) ; this . x /= a , this . y /= a } return this } , isZero : function ( ) { return 0 === this . x && 0 === this . y } , dot : function ( a ) { return this . x * a . x + this . y * a . y } , cross : function ( a ) { return this . x * a . y - this . y * a . x } , perp : function ( ) { return this . setTo ( - this . y , this . x ) } , rperp : function ( ) { return this . setTo ( this . y , - this . x ) } , normalRightHand : function ( ) { return this . setTo ( - 1 * this . y , this . x ) } , floor : function ( ) { return this . setTo ( Math . floor ( this . x ) , Math . floor ( this . y ) ) } , ceil : function ( ) { return this . setTo ( Math . ceil ( this . x ) , Math . ceil ( this . y ) ) } , toString : function ( ) { return "[{Point (x=" + this . x + " y=" + this . y + ")}]" } } , c . Point . prototype . constructor = c . Point , c . Point . add = function ( a , b , d ) { return "undefined" == typeof d && ( d = new c . Point ) , d . x = a . x + b . x , d . y = a . y + b . y , d } , c . Point . subtract = function ( a , b , d ) { return "undefined" == typeof d && ( d = new c . Point ) , d . x = a . x - b . x , d . y = a . y - b . y , d } , c . Point . multiply = function ( a , b , d ) { return "undefined" == typeof d && ( d = new c . Point ) , d . x = a . x * b . x , d . y = a . y * b . y , d } , c . Point . divide = function ( a , b , d ) { return "undefined" == typeof d && ( d = new c . Point ) , d . x = a . x / b . x , d . y = a . y / b . y , d } , c . Point . equals = function ( a , b ) { return a . x === b . x && a . y === b . y } , c . Point . angle = function ( a , b ) { return Math . atan2 ( a . y - b . y , a . x - b . x ) } , c . Point . negative = function ( a , b ) { return "undefined" == typeof b && ( b = new c . Point ) , b . setTo ( - a . x , - a . y ) } , c . Point . multiplyAdd = function ( a , b , d , e ) { return "undefined" == typeof e && ( e = new c . Point ) , e . setTo ( a . x + b . x * d , a . y + b . y * d ) } , c . Point . interpolate = function ( a , b , d , e ) { return "undefined" == typeof e && ( e = new c . Point ) , e . setTo ( a . x + ( b . x - a . x ) * d , a . y + ( b . y - a . y ) * d ) } , c . Point . perp = function ( a , b ) { return "undefined" == typeof b && ( b = new c . Point ) , b . setTo ( - a . y , a . x ) } , c . Point . rperp = function ( a , b ) { return "undefined" == typeof b && ( b = new c . Point ) , b . setTo ( a . y , - a . x ) } , c . Point . distance = function ( a , b , d ) { var e = c . Math . distance ( a . x , a . y , b . x , b . y ) ; return d ? Math . round ( e ) : e } , c . Point . project = function ( a , b , d ) { "undefined" == typeof d && ( d = new c . Point ) ; var e = a . dot ( b ) / b . getMagnitudeSq ( ) ; return 0 !== e && d . setTo ( e * b . x , e * b . y ) , d } , c . Point . projectUnit = function ( a , b , d ) { "undefined" == typeof d && ( d = new c . Point ) ; var e = a . dot ( b ) ; return 0 !== e && d . setTo ( e * b . x , e * b . y ) , d } , c . Point . normalRightHand = function ( a , b ) { return "undefined" == typeof b && ( b = new c . Point ) , b . setTo ( - 1 * a . y , a . x ) } , c . Point . normalize = function ( a , b ) { "undefined" == typeof b && ( b = new c . Point ) ; var d = a . getMagnitude ( ) ; return 0 !== d && b . setTo ( a . x / d , a . y / d ) , b } , c . Point . rotate = function ( a , b , d , e , f , g ) { "undefined" == typeof f && ( f = ! 1 ) , "undefined" == typeof g && ( g = null ) , f && ( e = c . Math . degToRad ( e ) ) , null === g && ( g = Math . sqrt ( ( b - a . x ) * ( b - a . x ) + ( d - a . y ) * ( d - a . y ) ) ) ; var h = e + Math . atan2 ( a . y - d , a . x - b ) ; return a . x = b + g * Math . cos ( h ) , a . y = d + g * Math . sin ( h ) , a } , c . Point . centroid = function ( a , b ) { if ( "undefined" == typeof b && ( b = new c . Point ) , "[object Array]" !== Object . prototype . toString . call ( a ) ) throw new Error ( " Phaser . Point . Parameter 'points' must be an ar
} , update : function ( a ) { if ( "undefined" != typeof a ) { var b = a . x / this . game . width , c = 1 - a . y / this . game . height ; ( b !== this . prevPoint . x || c !== this . prevPoint . y ) && ( this . uniforms . mouse . value . x = b . toFixed ( 2 ) , this . uniforms . mouse . value . y = c . toFixed ( 2 ) , this . prevPoint . set ( b , c ) ) } this . uniforms . time . value = this . game . time . totalElapsedSeconds ( ) } , destroy : function ( ) { this . game = null } } , c . Filter . prototype . constructor = c . Filter , Object . defineProperty ( c . Filter . prototype , "width" , { get : function ( ) { return this . uniforms . resolution . value . x } , set : function ( a ) { this . uniforms . resolution . value . x = a } } ) , Object . defineProperty ( c . Filter . prototype , "height" , { get : function ( ) { return this . uniforms . resolution . value . y } , set : function ( a ) { this . uniforms . resolution . value . y = a } } ) , c . Plugin = function ( a , b ) { "undefined" == typeof b && ( b = null ) , this . game = a , this . parent = b , this . active = ! 1 , this . visible = ! 1 , this . hasPreUpdate = ! 1 , this . hasUpdate = ! 1 , this . hasPostUpdate = ! 1 , this . hasRender = ! 1 , this . hasPostRender = ! 1 } , c . Plugin . prototype = { preUpdate : function ( ) { } , update : function ( ) { } , render : function ( ) { } , postRender : function ( ) { } , destroy : function ( ) { this . game = null , this . parent = null , this . active = ! 1 , this . visible = ! 1 } } , c . Plugin . prototype . constructor = c . Plugin , c . PluginManager = function ( a ) { this . game = a , this . plugins = [ ] , this . _len = 0 , this . _i = 0 } , c . PluginManager . prototype = { add : function ( a ) { var b = Array . prototype . splice . call ( arguments , 1 ) , c = ! 1 ; return "function" == typeof a ? a = new a ( this . game , this ) : ( a . game = this . game , a . parent = this ) , "function" == typeof a . preUpdate && ( a . hasPreUpdate = ! 0 , c = ! 0 ) , "function" == typeof a . update && ( a . hasUpdate = ! 0 , c = ! 0 ) , "function" == typeof a . postUpdate && ( a . hasPostUpdate = ! 0 , c = ! 0 ) , "function" == typeof a . render && ( a . hasRender = ! 0 , c = ! 0 ) , "function" == typeof a . postRender && ( a . hasPostRender = ! 0 , c = ! 0 ) , c ? ( ( a . hasPreUpdate || a . hasUpdate || a . hasPostUpdate ) && ( a . active = ! 0 ) , ( a . hasRender || a . hasPostRender ) && ( a . visible = ! 0 ) , this . _len = this . plugins . push ( a ) , "function" == typeof a . init && a . init . apply ( a , b ) , a ) : null } , remove : function ( a ) { for ( this . _i = this . _len ; this . _i -- ; ) if ( this . plugins [ this . _i ] === a ) return a . destroy ( ) , this . plugins . splice ( this . _i , 1 ) , void this . _len -- } , removeAll : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . destroy ( ) ; this . plugins . length = 0 , this . _len = 0 } , preUpdate : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . active && this . plugins [ this . _i ] . hasPreUpdate && this . plugins [ this . _i ] . preUpdate ( ) } , update : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . active && this . plugins [ this . _i ] . hasUpdate && this . plugins [ this . _i ] . update ( ) } , postUpdate : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . active && this . plugins [ this . _i ] . hasPostUpdate && this . plugins [ this . _i ] . postUpdate ( ) } , render : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . visible && this . plugins [ this . _i ] . hasRender && this . plugins [ this . _i ] . render ( ) } , postRender : function ( ) { for ( this . _i = this . _len ; this . _i -- ; ) this . plugins [ this . _i ] . visible && this . plugins [ this . _i ] . hasPostRender && this . plugins [ this . _i ] . postRender ( ) } , destroy : function ( ) { this . removeAll ( ) , this . game = null } } , c . PluginManager . prototype . constructor = c . PluginManager , c . Stage = function ( a ) { this . game = a , PIXI . Stage . call ( this , 0 ) , this . name = "_stage_root" , this . disableVisibilityChange = ! 1 , this . exists = ! 0 , this . currentRenderOrderID = 0 , this . _hiddenVar = "hidden" , this . _onChange = null , this . _backgroundColor = 0 , a . config && this . parseConfig ( a . config ) } , c . Stage . prototype = Object . create ( PIXI . Stage . prototype ) , c . Stage . prototype . constructor = c . Stage , c . Stage . prototype . parseConfig = function ( a ) { a . disableVisibilityChange && ( this . disableVisibilityChange = a . disableVisibilityChange ) , a . backgroundColor && ( this . backgroundColor = a . backgroundColor ) } , c . Stage . prototype . boot = function ( ) { c . DOM . getOffset ( this . game . canvas , this . offset ) , c . Canvas . setUserSelect ( this . game . canvas , "none" ) , c . Canvas . setTouchAction ( this . game . canvas , "none" ) , this . checkVisibility ( ) } , c . Stage . prototype . preUpdate = function ( ) { this . currentRenderOrderID = 0 ; for ( var a = 0 ; a < this . children . length ; a ++ ) this . children [ a ] . preUpdate ( ) } , c . Stage . prototype . update = function ( ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . update ( ) } , c . Stage . prototype . postUpdate = function ( ) { if ( this . game . world . camera . target ) { this . game . wor
} , setupScale : function ( a , b ) { var d , e = new c . Rectangle ; "" !== this . game . parent && ( "string" == typeof this . game . parent ? d = document . getElementById ( this . game . parent ) : this . game . parent && 1 === this . game . parent . nodeType && ( d = this . game . parent ) ) , d ? ( this . parentNode = d , this . parentIsWindow = ! 1 , this . getParentBounds ( this . _parentBounds ) , e . width = this . _parentBounds . width , e . height = this . _parentBounds . height , this . offset . set ( this . _parentBounds . x , this . _parentBounds . y ) ) : ( this . parentNode = null , this . parentIsWindow = ! 0 , e . width = this . dom . visualBounds . width , e . height = this . dom . visualBounds . height , this . offset . set ( 0 , 0 ) ) ; var f = 0 , g = 0 ; "number" == typeof a ? f = a : ( this . parentScaleFactor . x = parseInt ( a , 10 ) / 100 , f = e . width * this . parentScaleFactor . x ) , "number" == typeof b ? g = b : ( this . parentScaleFactor . y = parseInt ( b , 10 ) / 100 , g = e . height * this . parentScaleFactor . y ) , this . _gameSize . setTo ( 0 , 0 , f , g ) , this . updateDimensions ( f , g , ! 1 ) } , _gameResumed : function ( ) { this . queueUpdate ( ! 0 ) } , setGameSize : function ( a , b ) { this . _gameSize . setTo ( 0 , 0 , a , b ) , this . currentScaleMode !== c . ScaleManager . RESIZE && this . updateDimensions ( a , b , ! 0 ) , this . queueUpdate ( ! 0 ) } , setUserScale : function ( a , b , c , d ) { this . _userScaleFactor . setTo ( a , b ) , this . _userScaleTrim . setTo ( 0 | c , 0 | d ) , this . queueUpdate ( ! 0 ) } , setResizeCallback : function ( a , b ) { this . onResize = a , this . onResizeContext = b } , signalSizeChange : function ( ) { if ( ! c . Rectangle . sameDimensions ( this , this . _lastReportedCanvasSize ) || ! c . Rectangle . sameDimensions ( this . game , this . _lastReportedGameSize ) ) { var a = this . width , b = this . height ; this . _lastReportedCanvasSize . setTo ( 0 , 0 , a , b ) , this . _lastReportedGameSize . setTo ( 0 , 0 , this . game . width , this . game . height ) , this . grid . onResize ( a , b ) , this . onSizeChange . dispatch ( this , a , b ) , this . currentScaleMode === c . ScaleManager . RESIZE && ( this . game . state . resize ( a , b ) , this . game . load . resize ( a , b ) ) } } , setMinMax : function ( a , b , c , d ) { this . minWidth = a , this . minHeight = b , "undefined" != typeof c && ( this . maxWidth = c ) , "undefined" != typeof d && ( this . maxHeight = d ) } , preUpdate : function ( ) { if ( ! ( this . game . time . time < this . _lastUpdate + this . _updateThrottle ) ) { var a = this . _updateThrottle ; this . _updateThrottleReset = a >= 400 ? 0 : 100 , this . dom . getOffset ( this . game . canvas , this . offset ) ; var b = this . _parentBounds . width , d = this . _parentBounds . height , e = this . getParentBounds ( this . _parentBounds ) , f = e . width !== b || e . height !== d , g = this . updateOrientationState ( ) ; ( f || g ) && ( this . onResize && this . onResize . call ( this . onResizeContext , this , e ) , this . updateLayout ( ) , this . signalSizeChange ( ) ) ; var h = 2 * this . _updateThrottle ; this . _updateThrottle < a && ( h = Math . min ( a , this . _updateThrottleReset ) ) , this . _updateThrottle = c . Math . clamp ( h , 25 , this . trackParentInterval ) , this . _lastUpdate = this . game . time . time } } , pauseUpdate : function ( ) { this . preUpdate ( ) , this . _updateThrottle = this . trackParentInterval } , updateDimensions : function ( a , b , c ) { this . width = a * this . parentScaleFactor . x , this . height = b * this . parentScaleFactor . y , this . game . width = this . width , this . game . height = this . height , this . sourceAspectRatio = this . width / this . height , this . updateScalingAndBounds ( ) , c && ( this . game . renderer . resize ( this . width , this . height ) , this . game . camera . setSize ( this . width , this . height ) , this . game . world . resize ( this . width , this . height ) ) } , updateScalingAndBounds : function ( ) { this . scaleFactor . x = this . game . width / this . width , this . scaleFactor . y = this . game . height / this . height , this . scaleFactorInversed . x = this . width / this . game . width , this . scaleFactorInversed . y = this . height / this . game . height , this . aspectRatio = this . width / this . height , this . game . canvas && this . dom . getOffset ( this . game . canvas , this . offset ) , this . bounds . setTo ( this . offset . x , this . offset . y , this . width , this . height ) , this . game . input && this . game . input . scale && this . game . input . scale . setTo ( this . scaleFactor . x , this . scaleFactor . y ) } , forceOrientation : function ( a , b ) { "undefined" == typeof b && ( b = ! 1 ) , this . forceLandscape = a , this . forcePortrait = b , this . queueUpdate ( ! 0 ) } , classifyOrientation : function ( a ) { return "portrait-primary" === a || "portrait-secondary" === a ? "portrait" : "landscape-primary" === a || "landscape-secondary" === a ? "landscape" : null } , updateOrientationState : function ( ) { var a = this . screenOrientation , b = this . incorrectOrientation ; this . screenOrientation = this . dom . getScreenOrientation ( this . compatibility . orientationFallback ) , this . incorrectOrientation = this . forceLandscape && ! this . isLandsc
} , c . Mouse . WHEEL _UP = 1 , c . Mouse . WHEEL _DOWN = - 1 , c . Mouse . prototype = { start : function ( ) { if ( ( ! this . game . device . android || this . game . device . chrome !== ! 1 ) && null === this . _onMouseDown ) { var b = this ; this . _onMouseDown = function ( a ) { return b . onMouseDown ( a ) } , this . _onMouseMove = function ( a ) { return b . onMouseMove ( a ) } , this . _onMouseUp = function ( a ) { return b . onMouseUp ( a ) } , this . _onMouseUpGlobal = function ( a ) { return b . onMouseUpGlobal ( a ) } , this . _onMouseOut = function ( a ) { return b . onMouseOut ( a ) } , this . _onMouseOver = function ( a ) { return b . onMouseOver ( a ) } , this . _onMouseWheel = function ( a ) { return b . onMouseWheel ( a ) } , this . game . canvas . addEventListener ( "mousedown" , this . _onMouseDown , ! 0 ) , this . game . canvas . addEventListener ( "mousemove" , this . _onMouseMove , ! 0 ) , this . game . canvas . addEventListener ( "mouseup" , this . _onMouseUp , ! 0 ) , this . game . device . cocoonJS || ( window . addEventListener ( "mouseup" , this . _onMouseUpGlobal , ! 0 ) , this . game . canvas . addEventListener ( "mouseover" , this . _onMouseOver , ! 0 ) , this . game . canvas . addEventListener ( "mouseout" , this . _onMouseOut , ! 0 ) ) ; var c = this . game . device . wheelEvent ; c && ( this . game . canvas . addEventListener ( c , this . _onMouseWheel , ! 0 ) , "mousewheel" === c ? this . _wheelEvent = new a ( - 1 / 40 , 1 ) : "DOMMouseScroll" === c && ( 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 . game . input . enabled && this . enabled && ( a . identifier = 0 , this . game . input . mousePointer . start ( a ) ) } , onMouseMove : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . mouseMoveCallback && this . mouseMoveCallback . call ( this . callbackContext , a ) , this . game . input . enabled && this . enabled && ( a . identifier = 0 , this . game . input . mousePointer . move ( a ) ) } , onMouseUp : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . mouseUpCallback && this . mouseUpCallback . call ( this . callbackContext , a ) , this . game . input . enabled && this . enabled && ( a . identifier = 0 , this . game . input . mousePointer . stop ( a ) ) } , onMouseUpGlobal : function ( a ) { this . game . input . mousePointer . withinGame || ( this . mouseUpCallback && this . mouseUpCallback . call ( this . callbackContext , a ) , a . identifier = 0 , this . game . input . mousePointer . stop ( a ) ) } , onMouseOut : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . game . input . mousePointer . withinGame = ! 1 , this . mouseOutCallback && this . mouseOutCallback . call ( this . callbackContext , a ) , this . game . input . enabled && this . enabled && this . stopOnGameOut && ( a . identifier = 0 , this . game . input . mousePointer . stop ( 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 ) } , onMouseOver : function ( a ) { this . event = a , this . capture && a . preventDefault ( ) , this . game . input . mousePointer . withinGame = ! 0 , this . mouseOverCallback && this . mouseOverCallback . call ( this . callbackContext , a ) , ! this . game . input . enabled || ! this . enabled } , 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 ( ) { this . game . canvas .
} , 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 ) { "undefined" == typeof a && ( a = ! 1 ) , "undefined" == typeof b && ( b = ! 1 ) , "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = 255 ) , "undefined" == typeof f && ( f = null ) , "undefined" == typeof g && ( g = null ) , this . _dragPoint = new c . Point , this . draggable = ! 0 , this . bringToTop = b , this . dragOffset = new c . Point , this . dragFromCenter = a , this . pixelPerfectClick = d , this . pixelPerfectAlpha = e , f && ( this . boundsRect = f ) , g && ( this . boundsSprite = g ) } , disableDrag : function ( ) { if ( this . _pointerData ) for ( var a = 0 ; 10 > a ; a ++ ) this . _pointerData [ a ] . isDragged = ! 1 ; this . draggable = ! 1 , this . isDragged = ! 1 , this . _draggedPointerID = - 1 } , startDrag : function ( a ) { var b = this . sprite . x , c = this . sprite . y ; if ( this . isDragged = ! 0 , this . _draggedPointerID = a . id , this . _pointerData [ a . id ] . isDragged = ! 0 , this . sprite . fixedToCamera ) this . dragFromCenter ? ( this . sprite . centerOn ( a . x , a . y ) , this . _dragPoint . setTo ( this . sprite . cameraOffset . x - a . x , this . sprite . cameraOffset . y - a . y ) ) : this . _dragPoint . setTo ( this . sprite . cameraOffset . x - a . x , this . sprite . cameraOffset . y - a . y ) ; else { if ( this . dragFromCenter ) { var d = this . sprite . getBounds ( ) ; this . sprite . x = this . globalToLocalX ( a . x ) + ( this . sprite . x - d . centerX ) , this . sprite . y = this . globalToLocalY ( a . y ) + ( this . sprite . y - d . centerY ) } this . _dragPoint . setTo ( this . sprite . x - this . globalToLocalX ( a . x ) , this . sprite . y - this . globalToLocalY ( a . y ) ) } this . updateDrag ( a ) , this . bringToTop && ( this . _dragPhase = ! 0 , this . sprite . bringToTop ( ) ) , this . dragStartPoint . set ( b , c ) , this . sprite . events . onDragStart$dispatch ( this . sprite , a , b , c ) } , globalToLocalX : function ( a ) { return this . scaleLayer && ( a -= this . game . scale . grid . boundsFluid . x , a *= this . game . scale . grid . scaleFluidInversed . x ) , a } , globalToLocalY : function ( a ) { return this . scaleLayer && ( a -= this . game . scale . grid . boundsFluid . y , a *= this . game . scale . grid . scaleFluidInversed . y ) , a } , stopDrag : function ( a ) { this . isDragged = ! 1 , this . _draggedPointerID = - 1 , this . _pointerData [ a . id ] . isDragged = ! 1 , this . _dragPhase = ! 1 , this . snapOnRelease && ( this . sprite . fixedToCamera ? ( 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 . 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 . sprite . events . onDragStop$dispatch ( this . sprite , a ) , this . checkPointerOver ( a ) === ! 1 && this . _pointerOutHandler ( a ) } , setDragLock : function ( a , b ) { "undefined" == typeof a && ( a = ! 0 ) , "undefined" == typeof b && ( b = ! 0 ) , this . allowHorizontalDrag = a , this . allowVerticalDrag = b } , enableSnap : function ( a , b , c , d , e , f ) { "undefined" == typeof c && ( c = ! 0 ) , "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = 0 ) , "undefined" == typeof f && ( f = 0 ) , this . snapX = a , this . snapY = b , this . snapOffsetX = e , this . snapOffsetY = f , this . snapOnDrag = c , this . snapOnRelease = d } , disableSnap : function ( ) { this . snapOnDrag = ! 1 , this . snapOnRelease = ! 1 } , checkBoundsRect : function ( ) { this . sprite . fixedToCamera ? ( this . sprite . cameraOffset . x < this . boundsRect . left ? this . sprite . cameraOffset . x = this . boundsRect . left : this . sprite . cameraOffset . x + this . sprite . width > this . boundsRect . right && ( this . sprite . cameraOffset . x = this . boundsRect . right - this . sprite . width ) , this . sprite . cameraOffset . y < this . boundsRect . top ? this . sprite . cameraOffset . y = this . boundsRect . top : this . sprite . cam
} , onAddedToGroup : null , onRemovedFromGroup : null , onRemovedFromWorld : null , onDestroy : null , onKilled : null , onRevived : null , onOutOfBounds : null , onEnterBounds : null , onInputOver : null , onInputOut : null , onInputDown : null , onInputUp : null , onDragStart : null , onDragUpdate : null , onDragStop : null , onAnimationStart : null , onAnimationComplete : null , onAnimationLoop : null } , c . Events . prototype . constructor = c . Events ; for ( var e in c . Events . prototype ) c . Events . prototype . hasOwnProperty ( e ) && 0 === e . indexOf ( "on" ) && null === c . Events . prototype [ e ] && ! function ( a , b ) { "use strict" ; Object . defineProperty ( c . Events . prototype , a , { get : function ( ) { return this [ b ] || ( this [ b ] = new c . Signal ) } } ) , c . Events . prototype [ a + "$dispatch" ] = function ( ) { return this [ b ] ? this [ b ] . dispatch . apply ( this [ b ] , arguments ) : null } } ( e , "_" + e ) ; c . Component . FixedToCamera = function ( ) { } , c . Component . FixedToCamera . postUpdate = function ( ) { this . fixedToCamera && ( this . position . x = ( this . game . camera . view . x + this . cameraOffset . x ) / this . game . camera . scale . x , this . position . y = ( this . game . camera . view . y + this . cameraOffset . y ) / this . game . camera . scale . y ) } , c . Component . FixedToCamera . prototype = { _fixedToCamera : ! 1 , fixedToCamera : { get : function ( ) { return this . _fixedToCamera } , set : function ( a ) { a ? ( this . _fixedToCamera = ! 0 , this . cameraOffset . set ( this . x , this . y ) ) : this . _fixedToCamera = ! 1 } } , cameraOffset : new c . Point } , c . Component . Health = function ( ) { } , c . Component . Health . prototype = { health : 1 , maxHealth : 100 , damage : function ( a ) { return this . alive && ( this . health -= a , this . health <= 0 && this . kill ( ) ) , this } , heal : function ( a ) { return this . alive && ( this . health += a , this . health > this . maxHealth && ( this . health = this . maxHealth ) ) , this } } , c . Component . InCamera = function ( ) { } , c . Component . InCamera . prototype = { inCamera : { get : function ( ) { return this . game . world . camera . view . intersects ( this . _bounds ) } } } , c . Component . InputEnabled = function ( ) { } , c . Component . InputEnabled . prototype = { input : null , inputEnabled : { get : function ( ) { return this . input && this . input . enabled } , set : function ( a ) { a ? null === this . input ? ( this . input = new c . InputHandler ( this ) , this . input . start ( ) ) : this . input && ! this . input . enabled && this . input . start ( ) : this . input && this . input . enabled && this . input . stop ( ) } } } , c . Component . InWorld = function ( ) { } , c . Component . InWorld . preUpdate = function ( ) { if ( ( this . autoCull || this . checkWorldBounds ) && ( this . _bounds . copyFrom ( this . getBounds ( ) ) , this . _bounds . x += this . game . camera . view . x , this . _bounds . y += this . game . camera . view . y , this . autoCull && ( this . game . world . camera . view . intersects ( this . _bounds ) ? ( this . renderable = ! 0 , this . game . world . camera . totalInView ++ ) : this . renderable = ! 1 ) , this . checkWorldBounds ) ) if ( this . _outOfBoundsFired && this . game . world . bounds . intersects ( this . _bounds ) ) this . _outOfBoundsFired = ! 1 , this . events . onEnterBounds$dispatch ( this ) ; else if ( ! this . _outOfBoundsFired && ! this . game . world . bounds . intersects ( this . _bounds ) && ( this . _outOfBoundsFired = ! 0 , this . events . onOutOfBounds$dispatch ( this ) , this . outOfBoundsKill ) ) return this . kill ( ) , ! 1 ; return ! 0 } , c . Component . InWorld . prototype = { checkWorldBounds : ! 1 , outOfBoundsKill : ! 1 , _outOfBoundsFired : ! 1 , inWorld : { get : function ( ) { return this . game . world . bounds . intersects ( this . getBounds ( ) ) } } } , c . Component . LifeSpan = function ( ) { } , c . Component . LifeSpan . preUpdate = function ( ) { return this . lifespan > 0 && ( this . lifespan -= this . game . time . physicsElapsedMS , this . lifespan <= 0 ) ? ( this . kill ( ) , ! 1 ) : ! 0 } , c . Component . LifeSpan . prototype = { alive : ! 0 , lifespan : 0 , revive : function ( a ) { return "undefined" == typeof a && ( a = 1 ) , this . alive = ! 0 , this . exists = ! 0 , this . visible = ! 0 , "number" == typeof this . health && ( this . health = a ) , this . events && this . events . onRevived$dispatch ( this ) , this } , kill : function ( ) { return this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . events && this . events . onKilled$dispatch ( this ) , this } } , c . Component . LoadTexture = function ( ) { } , c . Component . LoadTexture . prototype = { customRender : ! 1 , _frame : null , loadTexture : function ( a , b , d ) { b = b || 0 , ( d || "undefined" == typeof d ) && this . animations && this . animations . stop ( ) , this . key = a , this . customRender = ! 1 ; var e = this . game . cache , f = ! 0 , g = ! this . texture . baseTexture . scaleMode ; if ( c . RenderTexture && a instanceof c . RenderTexture ) this . key = a . key , this . setTexture ( a ) ; else if ( c . BitmapData && a instanceof c . BitmapData ) this . customRender = ! 0 , this . setTexture ( a . texture ) , e . hasFrameData ( a . key , c . Cache . BITMAPDATA ) && ( f = ! this .
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 ) } return ( "undefined" == typeof b || null === b ) && ( b = 0 ) , ( "undefined" == typeof d || null === d ) && ( d = 0 ) , e && ( this . _size . x = e ) , f && ( this . _size . y = f ) , ( "undefined" == typeof g || null === g ) && ( g = b ) , ( "undefined" == typeof h || null === h ) && ( h = d ) , ( "undefined" == typeof i || null === i ) && ( i = this . _size . x ) , ( "undefined" == typeof 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 ) , "undefined" == typeof q && ( q = null ) , "undefined" == typeof r && ( r = ! 1 ) , this . _alpha . current <= 0 || 0 === this . _scale . x || 0 === this . _scale . y || 0 === this . _size . x || 0 === this . _size . y ? void 0 : ( this . _alpha . prev = this . context . globalAlpha , this . context . save ( ) , this . context . globalAlpha = this . _alpha . current , q && ( this . context . globalCompositeOperation = q ) , r && ( g |= 0 , h |= 0 ) , this . context . translate ( g , h ) , this . context . scale ( this . _scale . x , this . _scale . y ) , this . context . rotate ( this . _rotate ) , this . context . 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 ) , this . context . restore ( ) , this . context . 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 . copy , this , null , null , null , null , null , null , null , null , null , null , null , null , null , null , b , c ) , this } , shadow : function ( a , b , c , d ) { "undefined" == typeof a || null === a ? this . context . shadowColor = "rgba(0,0,0,0)" : ( this . context . shadowColor = a , this . context . shadowBlur = b || 5 , this . context . shadowOffsetX = c || 10 , this . context . shadowOffsetY = d || 10 ) } , alphaMask : function ( a , b , c , d ) { return "undefined" == typeof d || null === d ? this . draw ( b ) . blendSourceAtop ( ) : this . draw ( b , d . x , d . y , d . width , d . height ) . blendSourceAtop ( ) , "undefined" == typeof c || null === c ? this . draw ( a ) . blendReset ( ) : this . draw ( a , c . x , c . y , c . width , c . height ) . blendReset ( ) , this } , extract : function ( a , b , c , d , e , f , g , h , i ) { return "undefined" == typeof e && ( e = 255 ) , "undefined" == typeof f && ( f = ! 1 ) , "undefined" == typeof g && ( g = b ) , "undefined" == typeof h && ( h = c ) , "undefined" == typeof i && ( i = d ) , f && a . resize ( this . width , this . height ) , this . processPixelRGB ( function ( f , j , k ) { return f . r === b && f . g === c && f . b === d && a . setPixel32 ( j , k , g , h , i , e , ! 1 ) , ! 1 } , this ) , a . context . putImageData ( a . imageData , 0 , 0 ) , a . dirty = ! 0 , a } , rect : function ( a , b , c , d , e ) { return "undefined" != typeof e && ( this . context . fillStyle = e ) , this . context . fillRect ( a , b , c , d ) , this } , text : function ( a , b , c , d , e , f ) { "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 0 ) , "undefined" == typeof d && ( d = "14px Courier" ) , "undefined" == typeof e && ( e = "rgb(255,255,255)" ) , "undefined" == typeof f && ( f = ! 0 ) ; var g = this . context . font ; this . context . font = d , f && ( this . context . fillStyle = "rgb(0,0,0)" , this . context . fillText ( a , b + 1 , c + 1 ) ) , this . context . fillStyle = e , this . context . fillText ( a , b , c ) , this . context . font = g } , circle : function ( a , b , c , d ) { return "undefined" != typeof d && ( this . context . fillStyle = d ) , this . context . beginPath ( ) , this . context . arc ( a , b , c , 0 , 2 * Math . PI , ! 1 ) , this . context . closePath ( ) , this . context . fill ( ) , this } , textureLine : function ( a , b , d ) { if ( "undefined" == typeof d && ( d = "repeat-x" ) , "string" != typeof b || ( b = this . game . cache . getImage ( b ) ) ) { var e = a . length ; return "no-repeat" === d && e > b . width && ( e = b . width ) , this . context . fillStyle = this . context . createPattern ( b , d ) , this . _circle = new c . Circle ( a . start . x , a . start . y , b . height ) , this . _circle . circumferencePoint ( a . angle - 1.5707963267948966 , ! 1 , this . _pos ) , this . context . save ( ) , this . context . translate ( this . _pos . x , this . _pos . y ) , this . context . rotate ( a . angle ) , this . context . fillRect ( 0 , 0 , e , b . height ) , this . context . restore ( ) , this . dirty = ! 0 , this } } , render : function ( ) { return ! this . disableTextureUpload && this . dirty && ( this . baseTexture . dirty ( ) , this . dirty = ! 1 ) , this } , blendReset : function ( ) { return this . context . globalCompositeOperation = "source-over" , this } , blendSourceOver : functio
} , c . RetroFont . prototype . setText = function ( a , b , c , d , e , f ) { this . multiLine = b || ! 1 , this . customSpacingX = c || 0 , this . customSpacingY = d || 0 , this . align = e || "left" , this . autoUpperCase = f ? ! 1 : ! 0 , a . length > 0 && ( this . text = a ) } , c . RetroFont . prototype . buildRetroFontText = function ( ) { var a = 0 , b = 0 ; if ( this . clear ( ) , this . multiLine ) { var d = this . _text . split ( "\n" ) ; this . fixedWidth > 0 ? this . resize ( this . fixedWidth , d . length * ( this . characterHeight + this . customSpacingY ) - this . customSpacingY , ! 0 ) : this . resize ( this . getLongestLine ( ) * ( this . characterWidth + this . customSpacingX ) , d . length * ( this . characterHeight + this . customSpacingY ) - this . customSpacingY , ! 0 ) ; for ( var e = 0 ; e < d . length ; e ++ ) a = 0 , this . align === c . RetroFont . ALIGN _RIGHT ? a = this . width - d [ e ] . length * ( this . characterWidth + this . customSpacingX ) : this . align === c . RetroFont . ALIGN _CENTER && ( a = this . width / 2 - d [ e ] . length * ( this . characterWidth + this . customSpacingX ) / 2 , a += this . customSpacingX / 2 ) , 0 > a && ( a = 0 ) , this . pasteLine ( d [ e ] , a , b , this . customSpacingX ) , b += this . characterHeight + this . customSpacingY } else this . fixedWidth > 0 ? this . resize ( this . fixedWidth , this . characterHeight , ! 0 ) : this . resize ( this . _text . length * ( this . characterWidth + this . customSpacingX ) , this . characterHeight , ! 0 ) , a = 0 , this . align === c . RetroFont . ALIGN _RIGHT ? a = this . width - this . _text . length * ( this . characterWidth + this . customSpacingX ) : this . align === c . RetroFont . ALIGN _CENTER && ( a = this . width / 2 - this . _text . length * ( this . characterWidth + this . customSpacingX ) / 2 , a += this . customSpacingX / 2 ) , 0 > a && ( a = 0 ) , this . pasteLine ( this . _text , a , 0 , this . customSpacingX ) ; this . requiresReTint = ! 0 } , c . RetroFont . prototype . pasteLine = function ( a , b , c , d ) { for ( var e = 0 ; e < a . length ; e ++ ) if ( " " === a . charAt ( e ) ) b += this . characterWidth + d ; else if ( this . grabData [ a . charCodeAt ( e ) ] >= 0 && ( this . stamp . frame = this . grabData [ a . charCodeAt ( e ) ] , this . renderXY ( this . stamp , b , c , ! 1 ) , b += this . characterWidth + d , b > this . width ) ) break } , c . RetroFont . prototype . getLongestLine = function ( ) { var a = 0 ; if ( this . _text . length > 0 ) for ( var b = this . _text . split ( "\n" ) , c = 0 ; c < b . length ; c ++ ) b [ c ] . length > a && ( a = b [ c ] . length ) ; return a } , c . RetroFont . prototype . removeUnsupportedCharacters = function ( a ) { for ( var b = "" , c = 0 ; c < this . _text . length ; c ++ ) { var d = this . _text [ c ] , e = d . charCodeAt ( 0 ) ; ( this . grabData [ e ] >= 0 || ! a && "\n" === d ) && ( b = b . concat ( d ) ) } return b } , c . RetroFont . prototype . updateOffset = function ( a , b ) { if ( this . offsetX !== a || this . offsetY !== b ) { for ( var c = a - this . offsetX , d = b - this . offsetY , e = this . game . cache . getFrameData ( this . stamp . key ) . getFrames ( ) , f = e . length ; f -- ; ) e [ f ] . x += c , e [ f ] . y += d ; this . buildRetroFontText ( ) } } , Object . defineProperty ( c . RetroFont . prototype , "text" , { get : function ( ) { return this . _text } , set : function ( a ) { var b ; b = this . autoUpperCase ? a . toUpperCase ( ) : a , b !== this . _text && ( this . _text = b , this . removeUnsupportedCharacters ( this . multiLine ) , this . buildRetroFontText ( ) ) } } ) , Object . defineProperty ( c . RetroFont . prototype , "smoothed" , { get : function ( ) { return this . stamp . smoothed } , set : function ( a ) { this . stamp . smoothed = a , this . buildRetroFontText ( ) } } ) , c . Device = function ( ) { this . deviceReadyAt = 0 , this . initialized = ! 1 , this . desktop = ! 1 , this . iOS = ! 1 , this . cocoonJS = ! 1 , this . cocoonJSApp = ! 1 , this . cordova = ! 1 , this . node = ! 1 , this . nodeWebkit = ! 1 , this . electron = ! 1 , this . ejecta = ! 1 , this . crosswalk = ! 1 , this . android = ! 1 , this . chromeOS = ! 1 , this . linux = ! 1 , this . macOS = ! 1 , this . windows = ! 1 , this . windowsPhone = ! 1 , this . canvas = ! 1 , this . canvasBitBltShift = null , this . webGL = ! 1 , this . file = ! 1 , this . fileSystem = ! 1 , this . localStorage = ! 1 , this . worker = ! 1 , this . css3D = ! 1 , this . pointerLock = ! 1 , this . typedArray = ! 1 , this . vibration = ! 1 , this . getUserMedia = ! 0 , this . quirksMode = ! 1 , this . touch = ! 1 , this . mspointer = ! 1 , this . wheelEvent = null , this . arora = ! 1 , this . chrome = ! 1 , this . chromeVersion = 0 , this . epiphany = ! 1 , this . firefox = ! 1 , this . firefoxVersion = 0 , this . ie = ! 1 , this . ieVersion = 0 , this . trident = ! 1 , this . tridentVersion = 0 , this . mobileSafari = ! 1 , this . midori = ! 1 , this . opera = ! 1 , this . safari = ! 1 , this . webApp = ! 1 , this . silk = ! 1 , this . audioData = ! 1 , this . webAudio = ! 1 , this . ogg = ! 1 , this . opus = ! 1 , this . mp3 = ! 1 , this . wav = ! 1 , this . m4a = ! 1 , this . webm = ! 1 , this . oggVideo = ! 1 , this . h264Video = ! 1 , this . mp4Video = ! 1 , this . webmVideo = ! 1 , this . vp9Video = ! 1 , this . hlsVideo = ! 1 , this . iPhone = ! 1 , this . iPhone4 = ! 1 , this . iPad = ! 1 , this . pixelRatio = 0 , this . littleEndian = ! 1 , this . LITTLE _ENDIAN = ! 1 , this . support32bit = ! 1 , this . fullscreen = ! 1 , this . requestFullscreen = "" , thi
this . _add = [ ] } , removeFrom : function ( a , b ) { "undefined" == typeof b && ( b = ! 0 ) ; var d , e ; if ( Array . isArray ( a ) ) for ( d = 0 , e = a . length ; e > d ; d ++ ) this . removeFrom ( a [ d ] ) ; else if ( a . type === c . GROUP && b ) for ( var d = 0 , e = a . children . length ; e > d ; d ++ ) this . removeFrom ( a . children [ d ] ) ; else { for ( d = 0 , e = this . _tweens . length ; e > d ; d ++ ) a === this . _tweens [ d ] . target && this . remove ( this . _tweens [ d ] ) ; for ( d = 0 , e = this . _add . length ; e > d ; d ++ ) a === this . _add [ d ] . target && this . remove ( this . _add [ d ] ) } } , add : function ( a ) { a . _manager = this , this . _add . push ( a ) } , create : function ( a ) { return new c . Tween ( a , this . game , this ) } , remove : function ( a ) { var b = this . _tweens . indexOf ( a ) ; - 1 !== b ? this . _tweens [ b ] . pendingDelete = ! 0 : ( b = this . _add . indexOf ( a ) , - 1 !== b && ( this . _add [ b ] . pendingDelete = ! 0 ) ) } , update : function ( ) { var a = this . _add . length , b = this . _tweens . length ; if ( 0 === b && 0 === a ) return ! 1 ; for ( var c = 0 ; b > c ; ) this . _tweens [ c ] . update ( this . game . time . time ) ? c ++ : ( this . _tweens . splice ( c , 1 ) , b -- ) ; return a > 0 && ( this . _tweens = this . _tweens . concat ( this . _add ) , this . _add . length = 0 ) , ! 0 } , isTweening : function ( a ) { return this . _tweens . some ( function ( b ) { return b . target === a } ) } , _pauseAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . _pause ( ) } , _resumeAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . _resume ( ) } , pauseAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . pause ( ) } , resumeAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . resume ( ! 0 ) } } , c . TweenManager . prototype . constructor = c . TweenManager , c . Tween = function ( a , b , d ) { this . game = b , this . target = a , this . manager = d , this . timeline = [ ] , this . reverse = ! 1 , this . timeScale = 1 , this . repeatCounter = 0 , this . pendingDelete = ! 1 , this . onStart = new c . Signal , this . onLoop = new c . Signal , this . onRepeat = new c . Signal , this . onChildComplete = new c . Signal , this . onComplete = new c . Signal , this . isRunning = ! 1 , this . current = 0 , this . properties = { } , this . chainedTween = null , this . isPaused = ! 1 , this . _onUpdateCallback = null , this . _onUpdateCallbackContext = null , this . _pausedTime = 0 , this . _codePaused = ! 1 , this . _hasStarted = ! 1 } , c . Tween . prototype = { to : function ( a , b , d , e , f , g , h ) { return ( "undefined" == typeof b || 0 >= b ) && ( b = 1e3 ) , ( "undefined" == typeof d || null === d ) && ( d = c . Easing . Default ) , "undefined" == typeof e && ( e = ! 1 ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = 0 ) , "undefined" == typeof h && ( h = ! 1 ) , "string" == typeof d && this . manager . easeMap [ d ] && ( d = this . manager . easeMap [ d ] ) , this . isRunning ? ( console . warn ( "Phaser.Tween.to cannot be called after Tween.start" ) , this ) : ( this . timeline . push ( new c . TweenData ( this ) . to ( a , b , d , f , g , h ) ) , e && this . start ( ) , this ) } , from : function ( a , b , d , e , f , g , h ) { return "undefined" == typeof b && ( b = 1e3 ) , ( "undefined" == typeof d || null === d ) && ( d = c . Easing . Default ) , "undefined" == typeof e && ( e = ! 1 ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = 0 ) , "undefined" == typeof h && ( h = ! 1 ) , "string" == typeof d && this . manager . easeMap [ d ] && ( d = this . manager . easeMap [ d ] ) , this . isRunning ? ( console . warn ( "Phaser.Tween.from cannot be called after Tween.start" ) , this ) : ( this . timeline . push ( new c . TweenData ( this ) . from ( a , b , d , f , g , h ) ) , e && this . start ( ) , this ) } , start : function ( a ) { if ( "undefined" == typeof a && ( a = 0 ) , null === this . game || null === this . target || 0 === this . timeline . length || this . isRunning ) return this ; for ( var b = 0 ; b < this . timeline . length ; b ++ ) for ( var c in this . timeline [ b ] . vEnd ) this . properties [ c ] = this . target [ c ] || 0 , Array . isArray ( this . properties [ c ] ) || ( this . properties [ c ] *= 1 ) ; for ( var b = 0 ; b < this . timeline . length ; b ++ ) this . timeline [ b ] . loadValues ( ) ; return this . manager . add ( this ) , this . isRunning = ! 0 , ( 0 > a || a > this . timeline . length - 1 ) && ( a = 0 ) , this . current = a , this . timeline [ this . current ] . start ( ) , this } , stop : function ( a ) { return "undefined" == typeof a && ( a = ! 1 ) , this . isRunning = ! 1 , this . _onUpdateCallback = null , this . _onUpdateCallbackContext = null , a && ( this . onComplete . dispatch ( this . target , this ) , this . chainedTween && this . chainedTween . start ( ) ) , this . manager . remove ( this ) , this } , updateTweenData : function ( a , b , c ) { if ( 0 === this . timeline . length ) return this ; if ( "undefined" == typeof c && ( c = 0 ) , - 1 === c ) for ( var d = 0 ; d < this . timeline . length ; d ++ ) this . timeline [ d ] [ a ] = b ; else this . timeline [ c ] [ a ] = b ; return this } , delay : function ( a , b ) { return this . updateTweenData ( "delay" , a , b ) } , repeat : function ( a , b , c ) { return "undefined" == typeof b && ( b = 0 ) , this . updateTweenDa
} , c . Frame . prototype = { resize : function ( a , b ) { this . width = a , this . height = b , this . centerX = Math . floor ( a / 2 ) , this . centerY = Math . floor ( b / 2 ) , this . distance = c . Math . distance ( 0 , 0 , a , b ) , this . sourceSizeW = a , this . sourceSizeH = b , this . right = this . x + a , this . bottom = this . y + b } , setTrim : function ( a , b , c , d , e , f , g ) { this . trimmed = a , a && ( this . sourceSizeW = b , this . sourceSizeH = c , this . centerX = Math . floor ( b / 2 ) , this . centerY = Math . floor ( c / 2 ) , this . spriteSourceSizeX = d , this . spriteSourceSizeY = e , this . spriteSourceSizeW = f , this . spriteSourceSizeH = g ) } , clone : function ( ) { var a = new c . Frame ( this . index , this . x , this . y , this . width , this . height , this . name ) ; for ( var b in this ) this . hasOwnProperty ( b ) && ( a [ b ] = this [ b ] ) ; return a } , getRect : function ( a ) { return "undefined" == typeof a ? a = new c . Rectangle ( this . x , this . y , this . width , this . height ) : a . setTo ( this . x , this . y , this . width , this . height ) , a } } , c . Frame . prototype . constructor = c . Frame , c . FrameData = function ( ) { this . _frames = [ ] , this . _frameNames = [ ] } , c . FrameData . prototype = { addFrame : function ( a ) { return a . index = this . _frames . length , this . _frames . push ( a ) , "" !== a . name && ( this . _frameNames [ a . name ] = a . index ) , a } , getFrame : function ( a ) { return a >= this . _frames . length && ( a = 0 ) , this . _frames [ a ] } , getFrameByName : function ( a ) { return "number" == typeof this . _frameNames [ a ] ? this . _frames [ this . _frameNames [ a ] ] : null } , checkFrameName : function ( a ) { return null == this . _frameNames [ a ] ? ! 1 : ! 0 } , clone : function ( ) { for ( var a = new c . FrameData , b = 0 ; b < this . _frames . length ; b ++ ) a . _frames . push ( this . _frames [ b ] . clone ( ) ) ; for ( var d in this . _frameNames ) this . _frameNames . hasOwnProperty ( d ) && a . _frameNames . push ( this . _frameNames [ d ] ) ; return a } , getFrameRange : function ( a , b , c ) { "undefined" == typeof c && ( c = [ ] ) ; for ( var d = a ; b >= d ; d ++ ) c . push ( this . _frames [ d ] ) ; return c } , getFrames : function ( a , b , c ) { if ( "undefined" == typeof b && ( b = ! 0 ) , "undefined" == typeof c && ( c = [ ] ) , "undefined" == typeof a || 0 === a . length ) for ( var d = 0 ; d < this . _frames . length ; d ++ ) c . push ( this . _frames [ d ] ) ; else for ( var d = 0 ; d < a . length ; d ++ ) c . push ( b ? this . getFrame ( a [ d ] ) : this . getFrameByName ( a [ d ] ) ) ; return c } , getFrameIndexes : function ( a , b , c ) { if ( "undefined" == typeof b && ( b = ! 0 ) , "undefined" == typeof c && ( c = [ ] ) , "undefined" == typeof a || 0 === a . length ) for ( var d = 0 ; d < this . _frames . length ; d ++ ) c . push ( this . _frames [ d ] . index ) ; else for ( var d = 0 ; d < a . length ; d ++ ) b ? c . push ( this . _frames [ a [ d ] ] . index ) : this . getFrameByName ( a [ d ] ) && c . push ( this . getFrameByName ( a [ d ] ) . index ) ; return c } } , c . FrameData . prototype . constructor = c . FrameData , Object . defineProperty ( c . FrameData . prototype , "total" , { get : function ( ) { return this . _frames . length } } ) , c . AnimationParser = { spriteSheet : function ( a , b , d , e , f , g , h ) { var i = b ; if ( "string" == typeof b && ( i = a . cache . getImage ( b ) ) , null === i ) return null ; var j = i . width , k = i . height ; 0 >= d && ( d = Math . floor ( - j / Math . min ( - 1 , d ) ) ) , 0 >= e && ( e = Math . floor ( - k / Math . min ( - 1 , e ) ) ) ; var l = Math . floor ( ( j - g ) / ( d + h ) ) , m = Math . floor ( ( k - g ) / ( e + h ) ) , n = l * m ; if ( - 1 !== f && ( n = f ) , 0 === j || 0 === k || d > j || e > k || 0 === n ) return console . warn ( "Phaser.AnimationParser.spriteSheet: '" + b + "'s width/height zero or width/height < given frameWidth/frameHeight" ) , null ; for ( var o = new c . FrameData , p = g , q = g , r = 0 ; n > r ; r ++ ) o . addFrame ( new c . Frame ( r , p , q , d , e , "" ) ) , p += d + h , p + d > j && ( p = g , q += e + h ) ; return o } , JSONData : function ( a , b ) { if ( ! b . frames ) return console . warn ( "Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array" ) , void console . log ( b ) ; for ( var d , e = new c . FrameData , f = b . frames , g = 0 ; g < f . length ; g ++ ) d = e . addFrame ( new c . Frame ( g , f [ g ] . frame . x , f [ g ] . frame . y , f [ g ] . frame . w , f [ g ] . frame . h , f [ g ] . filename ) ) , f [ g ] . trimmed && d . setTrim ( f [ g ] . trimmed , f [ g ] . sourceSize . w , f [ g ] . sourceSize . h , f [ g ] . spriteSourceSize . x , f [ g ] . spriteSourceSize . y , f [ g ] . spriteSourceSize . w , f [ g ] . spriteSourceSize . h ) ; return e } , JSONDataHash : function ( a , b ) { if ( ! b . frames ) return console . warn ( "Phaser.AnimationParser.JSONDataHash: Invalid Texture Atlas JSON given, missing 'frames' object" ) , void console . log ( b ) ; var d , e = new c . FrameData , f = b . frames , g = 0 ; for ( var h in f ) d = e . addFrame ( new c . Frame ( g , f [ h ] . frame . x , f [ h ] . frame . y , f [ h ] . frame . w , f [ h ] . frame . h , h ) ) , f [ h ] . trimmed && d . setTrim ( f [ h ] . trimmed , f [ h ] . sourceSize . w , f [ h ] . sourceSize . h , f [ h ] . spriteSourceSize . x , f [ h ] . spriteSourceSize . y , f [ h ] . spriteSourceSize . w , f [ h ] . spriteSourceSize . h ) , g ++ ; return e } , XMLData : function ( a , b ) { if ( ! b . getElementsByTagName ( " TextureAtlas
} catch ( b ) { g . asyncComplete ( a , b . message || "Exception" ) } } , f . ontimeout = function ( ) { try { return e . call ( g , a , f ) } catch ( b ) { g . asyncComplete ( a , b . message || "Exception" ) } } , f . onprogress = function ( ) { } , f . onload = function ( ) { try { return d . call ( g , a , f ) } catch ( b ) { g . asyncComplete ( a , b . message || "Exception" ) } } , a . requestObject = f , a . requestUrl = b , setTimeout ( function ( ) { f . send ( ) } , 0 ) } , getVideoURL : function ( a ) { for ( var b = 0 ; b < a . length ; b ++ ) { var c , d = a [ b ] ; if ( d . uri ) d = d . uri , c = d . type ; else { if ( 0 === d . indexOf ( "blob:" ) || 0 === d . indexOf ( "data:" ) ) return d ; d . indexOf ( "?" ) >= 0 && ( d = d . substr ( 0 , d . indexOf ( "?" ) ) ) ; var e = d . substr ( ( Math . max ( 0 , d . lastIndexOf ( "." ) ) || 1 / 0 ) + 1 ) ; c = e . toLowerCase ( ) } if ( this . game . device . canPlayVideo ( c ) ) return a [ b ] } return null } , getAudioURL : function ( a ) { if ( this . game . sound . noAudio ) return null ; for ( var b = 0 ; b < a . length ; b ++ ) { var c , d = a [ b ] ; if ( d . uri ) d = d . uri , c = d . type ; else { if ( 0 === d . indexOf ( "blob:" ) || 0 === d . indexOf ( "data:" ) ) return d ; d . indexOf ( "?" ) >= 0 && ( d = d . substr ( 0 , d . indexOf ( "?" ) ) ) ; var e = d . substr ( ( Math . max ( 0 , d . lastIndexOf ( "." ) ) || 1 / 0 ) + 1 ) ; c = e . toLowerCase ( ) } if ( this . game . device . canPlayAudio ( c ) ) return a [ b ] } return null } , fileError : function ( a , b , c ) { var d = a . requestUrl || this . transformUrl ( a . url , a ) , e = "error loading asset from URL " + d ; ! c && b && ( c = b . status ) , c && ( e = e + " (" + c + ")" ) , this . asyncComplete ( a , e ) } , fileComplete : function ( a , b ) { var d = ! 0 ; switch ( a . type ) { case "packfile" : var e = JSON . parse ( b . responseText ) ; a . data = e || { } ; break ; case "image" : this . cache . addImage ( a . key , a . url , a . data ) ; break ; case "spritesheet" : this . cache . addSpriteSheet ( a . key , a . url , a . data , a . frameWidth , a . frameHeight , a . frameMax , a . margin , a . spacing ) ; break ; case "textureatlas" : if ( null == a . atlasURL ) this . cache . addTextureAtlas ( a . key , a . url , a . data , a . atlasData , a . format ) ; else if ( d = ! 1 , a . format == c . Loader . TEXTURE _ATLAS _JSON _ARRAY || a . format == c . Loader . TEXTURE _ATLAS _JSON _HASH ) this . xhrLoad ( a , this . transformUrl ( a . atlasURL , a ) , "text" , this . jsonLoadComplete ) ; else { if ( a . format != c . Loader . TEXTURE _ATLAS _XML _STARLING ) throw new Error ( "Phaser.Loader. Invalid Texture Atlas format: " + a . format ) ; this . xhrLoad ( a , this . transformUrl ( a . atlasURL , a ) , "text" , this . xmlLoadComplete ) } break ; case "bitmapfont" : a . atlasURL ? ( d = ! 1 , this . xhrLoad ( a , this . transformUrl ( a . atlasURL , a ) , "text" , function ( a , b ) { var c ; try { c = JSON . parse ( b . responseText ) } catch ( d ) { } c ? ( a . atlasType = "json" , this . jsonLoadComplete ( a , b ) ) : ( a . atlasType = "xml" , this . xmlLoadComplete ( a , b ) ) } ) ) : this . cache . addBitmapFont ( a . key , a . url , a . data , a . atlasData , a . atlasType , a . xSpacing , a . ySpacing ) ; break ; case "video" : if ( a . asBlob ) try { a . data = new Blob ( [ new Uint8Array ( b . response ) ] ) } catch ( f ) { throw new Error ( "Phaser.Loader. Unable to parse video file as Blob: " + a . key ) } this . cache . addVideo ( a . key , a . url , a . data , a . asBlob ) ; break ; case "audio" : this . game . sound . usingWebAudio ? ( a . data = b . response , this . cache . addSound ( a . key , a . url , a . data , ! 0 , ! 1 ) , a . autoDecode && this . game . sound . decode ( a . key ) ) : this . cache . addSound ( a . key , a . url , a . data , ! 1 , ! 0 ) ; break ; case "text" : a . data = b . responseText , this . cache . addText ( a . key , a . url , a . data ) ; break ; case "shader" : a . data = b . responseText , this . cache . addShader ( a . key , a . url , a . data ) ; break ; case "physics" : var e = JSON . parse ( b . responseText ) ; this . cache . addPhysicsData ( a . key , a . url , e , a . format ) ; break ; case "script" : a . data = document . createElement ( "script" ) , a . data . language = "javascript" , a . data . type = "text/javascript" , a . data . defer = ! 1 , a . data . text = b . responseText , document . head . appendChild ( a . data ) , a . callback && ( a . data = a . callback . call ( a . callbackContext , a . key , b . responseText ) ) ; break ; case "binary" : a . data = a . callback ? a . callback . call ( a . callbackContext , a . key , b . response ) : b . response , this . cache . addBinary ( a . key , a . data ) } d && this . asyncComplete ( a ) } , jsonLoadComplete : function ( a , b ) { var c = JSON . parse ( b . responseText ) ; "tilemap" === a . type ? this . cache . addTilemap ( a . key , a . url , c , a . format ) : "bitmapfont" === a . type ? this . cache . addBitmapFont ( a . key , a . url , a . data , c , a . atlasType , a . xSpacing , a . ySpacing ) : "json" === a . type ? this . cache . addJSON ( a . key , a . url , c ) : this . cache . addTextureAtlas ( a . key , a . url , a . data , c , a . format ) , this . asyncComplete ( a ) } , csvLoadComplete : function ( a , b ) { var c = b . responseText ; this . cache . addTilemap ( a . key , a . url , c , a . format ) , this . asyncComplete ( a ) } , xmlLoadComplete : function ( a , b ) { var c = b . responseText , d = this . parseXml ( c ) ; if ( ! d ) { var e = b . responseType || b . contentType ; retu
for ( var d = 0 ; d < a . objects . length ; d ++ ) this . context . strokeRect ( a . objects [ d ] . x , a . objects [ d ] . y , a . objects [ d ] . width , a . objects [ d ] . height ) } else for ( var d = 0 ; d < a . nodes . length ; d ++ ) this . quadTree ( a . nodes [ d ] ) ; this . stop ( ) } , body : function ( a , b , d ) { a . body && ( this . start ( ) , a . body . type === c . Physics . ARCADE ? c . Physics . Arcade . Body . render ( this . context , a . body , b , d ) : a . body . type === c . Physics . NINJA ? c . Physics . Ninja . Body . render ( this . context , a . body , b , d ) : a . body . type === c . Physics . BOX2D && c . Physics . Box2D . renderBody ( this . context , a . body , b ) , this . stop ( ) ) } , bodyInfo : function ( a , b , d , e ) { a . body && ( this . start ( b , d , e , 210 ) , a . body . type === c . Physics . ARCADE ? c . Physics . Arcade . Body . renderBodyInfo ( this , a . body ) : a . body . type === c . Physics . BOX2D && this . game . physics . box2d . renderBodyInfo ( this , a . body ) , this . stop ( ) ) } , box2dWorld : function ( ) { this . start ( ) , this . context . translate ( - this . game . camera . view . x , - this . game . camera . view . y , 0 ) , this . game . physics . box2d . renderDebugDraw ( this . context ) , this . stop ( ) } , box2dBody : function ( a , b ) { this . start ( ) , c . Physics . Box2D . renderBody ( this . context , a , b ) , this . stop ( ) } } , c . Utils . Debug . prototype . constructor = c . Utils . Debug , 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 . splice . 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 ) { "undefined" == typeof 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 ; "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof 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 ; "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof 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 = 0 ; d < a . length ; d ++ ) a [ d ] . reverse ( ) ; a = a . reverse ( ) } return a } , findClosest : function ( a , b ) { if ( ! b . length ) return 0 / 0 ; if ( 1 === b . length || a < b [ 0 ] ) return b [ 0 ] ; for ( var c = 1 ; b [ c ] < a ; ) c ++ ; var d = b [ c - 1 ] , e = c < b . length ? b [ c ] : Number . POSITIVE _INFINITY ; return a - d >= e - a ? e : d } , rotate : function ( a ) { var b = a . shift ( ) ; return a . push ( b ) , b } , numberArray : function ( a , b ) { for ( var c = [ ] , d = a ; b >= d ; d ++ ) c . push ( d ) ; return c } , numberArrayStep : function ( a , b , d ) { a = + a || 0 ; var e = typeof b ; "number" !== e && "string" !== e || ! d || d [ b ] !== a || ( b = d = null ) , d = null == d ? 1 : + d || 0 , null === b ? ( b = a , a = 0 ) : b = + b || 0 ; for ( var f = - 1 , g = Math . max ( c . Math . roundAwayFromZero ( ( b - a ) / ( d || 1 ) ) , 0 ) , h = new Array ( g ) ; ++ f < g ; ) h [ f ] = a , a += d ; return h } } , c . Color = { packPixel : function ( a , b , d , e ) { retur
2015-02-25 02:59:00 +00:00
//# sourceMappingURL=phaser-no-physics.map