2015-05-06 07:00:42 +00:00
/* Phaser v2.4.0 - http://phaser.io - @photonstorm - (c) 2015 Photon Storm Ltd. */
2014-02-28 09:30:53 +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
} , destroy : function ( ) { this . sprite . parent && this . sprite . parent instanceof c . Group && this . sprite . parent . removeFromHash ( this . sprite ) , this . sprite . body = null , this . sprite = null } , checkWorldBounds : function ( ) { this . position . x < this . game . physics . arcade . bounds . x && this . game . physics . arcade . checkCollision . left ? ( this . position . x = this . game . physics . arcade . bounds . x , this . velocity . x *= - this . bounce . x , this . blocked . left = ! 0 ) : this . right > this . game . physics . arcade . bounds . right && this . game . physics . arcade . checkCollision . right && ( this . position . x = this . game . physics . arcade . bounds . right - this . width , this . velocity . x *= - this . bounce . x , this . blocked . right = ! 0 ) , this . position . y < this . game . physics . arcade . bounds . y && this . game . physics . arcade . checkCollision . up ? ( this . position . y = this . game . physics . arcade . bounds . y , this . velocity . y *= - this . bounce . y , this . blocked . up = ! 0 ) : this . bottom > this . game . physics . arcade . bounds . bottom && this . game . physics . arcade . checkCollision . down && ( this . position . y = this . game . physics . arcade . bounds . bottom - this . height , this . velocity . y *= - this . bounce . y , this . blocked . down = ! 0 ) } , setSize : function ( a , b , c , d ) { "undefined" == typeof c && ( c = this . offset . x ) , "undefined" == typeof d && ( d = this . offset . y ) , this . sourceWidth = a , this . sourceHeight = b , this . width = this . sourceWidth * this . _sx , this . height = this . sourceHeight * this . _sy , this . halfWidth = Math . floor ( this . width / 2 ) , this . halfHeight = Math . floor ( this . height / 2 ) , this . offset . setTo ( c , d ) , this . center . setTo ( this . position . x + this . halfWidth , this . position . y + this . halfHeight ) } , reset : function ( a , b ) { this . velocity . set ( 0 ) , this . acceleration . set ( 0 ) , this . speed = 0 , this . angularVelocity = 0 , this . angularAcceleration = 0 , this . position . x = a - this . sprite . anchor . x * this . width + this . offset . x , this . position . y = b - this . sprite . anchor . y * this . height + this . offset . y , this . prev . x = this . position . x , this . prev . y = this . position . y , this . rotation = this . sprite . angle , this . preRotation = this . rotation , this . _sx = this . sprite . scale . x , this . _sy = this . sprite . scale . y , this . center . setTo ( this . position . x + this . halfWidth , this . position . y + this . halfHeight ) } , hitTest : function ( a , b ) { return c . Rectangle . contains ( this , a , b ) } , onFloor : function ( ) { return this . blocked . down } , onWall : function ( ) { return this . blocked . left || this . blocked . right } , deltaAbsX : function ( ) { return this . deltaX ( ) > 0 ? this . deltaX ( ) : - this . deltaX ( ) } , deltaAbsY : function ( ) { return this . deltaY ( ) > 0 ? this . deltaY ( ) : - this . deltaY ( ) } , deltaX : function ( ) { return this . position . x - this . prev . x } , deltaY : function ( ) { return this . position . y - this . prev . y } , deltaZ : function ( ) { return this . rotation - this . preRotation } } , Object . defineProperty ( c . Physics . Arcade . Body . prototype , "bottom" , { get : function ( ) { return this . position . y + this . height } } ) , Object . defineProperty ( c . Physics . Arcade . Body . prototype , "right" , { get : function ( ) { return this . position . x + this . width } } ) , Object . defineProperty ( c . Physics . Arcade . Body . prototype , "x" , { get : function ( ) { return this . position . x } , set : function ( a ) { this . position . x = a } } ) , Object . defineProperty ( c . Physics . Arcade . Body . prototype , "y" , { get : function ( ) { return this . position . y } , set : function ( a ) { this . position . y = a } } ) , c . Physics . Arcade . Body . render = function ( a , b , c , d ) { "undefined" == typeof d && ( d = ! 0 ) , c = c || "rgba(0,255,0,0.4)" , d ? ( a . fillStyle = c , a . fillRect ( b . position . x - b . game . camera . x , b . position . y - b . game . camera . y , b . width , b . height ) ) : ( a . strokeStyle = c , a . strokeRect ( b . position . x - b . game . camera . x , b . position . y - b . game . camera . y , b . width , b . height ) ) } , c . Physics . Arcade . Body . renderBodyInfo = function ( a , b ) { a . line ( "x: " + b . x . toFixed ( 2 ) , "y: " + b . y . toFixed ( 2 ) , "width: " + b . width , "height: " + b . height ) , a . line ( "velocity x: " + b . velocity . x . toFixed ( 2 ) , "y: " + b . velocity . y . toFixed ( 2 ) , "deltaX: " + b . _dx . toFixed ( 2 ) , "deltaY: " + b . _dy . toFixed ( 2 ) ) , a . line ( "acceleration x: " + b . acceleration . x . toFixed ( 2 ) , "y: " + b . acceleration . y . toFixed ( 2 ) , "speed: " + b . speed . toFixed ( 2 ) , "angle: " + b . angle . toFixed ( 2 ) ) , a . line ( "gravity x: " + b . gravity . x , "y: " + b . gravity . y , "bounce x: " + b . bounce . x . toFixed ( 2 ) , "y: " + b . bounce . y . toFixed ( 2 ) ) , a . line ( "touching left: " + b . touching . left , "right: " + b . touching . right , "up: " + b . touching . up , "down: " + b . touching . down ) , a . line ( "blocked left: " + b . blocked . left , "right: " + b . blocked . right , "up: " + b . blocked . up , "down: " + b . blocked . down ) } , c . Physics . Arcade . Body . prototype . constructor = c . Physics . Arcade . Body , c . Physi
} } return this . enableFrictionReduction && this . enableFriction && q && this . frictionEquations . push ( this . createFrictionFromAverage ( q ) ) , q } , c . prototype [ p . PARTICLE | p . PLANE ] = c . prototype . particlePlane = function ( a , b , c , d , e , h , j , k , l ) { var m = s , n = t ; k = k || 0 , g ( m , c , j ) , f . rotate ( n , r , k ) ; var o = i ( m , n ) ; if ( o > 0 ) return 0 ; if ( l ) return ! 0 ; var p = this . createContactEquation ( e , a , h , b ) ; return f . copy ( p . normalA , n ) , f . scale ( m , p . normalA , o ) , g ( p . contactPointA , c , m ) , g ( p . contactPointA , p . contactPointA , e . position ) , g ( p . contactPointB , c , a . position ) , this . contactEquations . push ( p ) , this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( p ) ) , 1 } , c . prototype [ p . CIRCLE | p . PARTICLE ] = c . prototype . circleParticle = function ( a , b , c , d , e , i , j , k , l ) { var m = s ; if ( g ( m , j , c ) , f . squaredLength ( m ) > Math . pow ( b . radius , 2 ) ) return 0 ; if ( l ) return ! 0 ; var n = this . createContactEquation ( a , e , b , i ) ; return f . copy ( n . normalA , m ) , f . normalize ( n . normalA , n . normalA ) , f . scale ( n . contactPointA , n . normalA , b . radius ) , h ( n . contactPointA , n . contactPointA , c ) , g ( n . contactPointA , n . contactPointA , a . position ) , g ( n . contactPointB , j , e . position ) , this . contactEquations . push ( n ) , this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( n ) ) , 1 } ; { var W = new n ( { radius : 1 } ) , X = f . create ( ) , Y = f . create ( ) ; f . create ( ) } c . prototype [ p . PLANE | p . CAPSULE ] = c . prototype . planeCapsule = function ( a , b , c , d , e , g , i , j , k ) { var l = X , m = Y , n = W ; f . set ( l , - g . length / 2 , 0 ) , f . rotate ( l , l , j ) , h ( l , l , i ) , f . set ( m , g . length / 2 , 0 ) , f . rotate ( m , m , j ) , h ( m , m , i ) , n . radius = g . radius ; var o ; this . enableFrictionReduction && ( o = this . enableFriction , this . enableFriction = ! 1 ) ; var p = this . circlePlane ( e , n , l , 0 , a , b , c , d , k ) , q = this . circlePlane ( e , n , m , 0 , a , b , c , d , k ) ; if ( this . enableFrictionReduction && ( this . enableFriction = o ) , k ) return p || q ; var r = p + q ; return this . enableFrictionReduction && r && this . frictionEquations . push ( this . createFrictionFromAverage ( r ) ) , r } , c . prototype [ p . CIRCLE | p . PLANE ] = c . prototype . circlePlane = function ( a , b , c , d , e , j , k , l , m ) { var n = a , o = b , p = c , q = e , v = k , w = l ; w = w || 0 ; var x = s , y = t , z = u ; g ( x , p , v ) , f . rotate ( y , r , w ) ; var A = i ( y , x ) ; if ( A > o . radius ) return 0 ; if ( m ) return ! 0 ; var B = this . createContactEquation ( q , n , j , b ) ; return f . copy ( B . normalA , y ) , f . scale ( B . contactPointB , B . normalA , - o . radius ) , h ( B . contactPointB , B . contactPointB , p ) , g ( B . contactPointB , B . contactPointB , n . position ) , f . scale ( z , B . normalA , A ) , g ( B . contactPointA , x , z ) , h ( B . contactPointA , B . contactPointA , v ) , g ( B . contactPointA , B . contactPointA , q . position ) , this . contactEquations . push ( B ) , this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( B ) ) , 1 } , c . prototype [ p . CONVEX ] = c . prototype [ p . CONVEX | p . BOX ] = c . prototype [ p . BOX ] = c . prototype . convexConvex = function ( a , b , d , e , j , k , l , m , n , o ) { var p = s , q = t , r = u , x = v , B = w , C = y , D = z , E = A , F = 0 , o = "number" == typeof o ? o : 0 , G = c . findSeparatingAxis ( b , d , e , k , l , m , p ) ; if ( ! G ) return 0 ; g ( D , l , d ) , i ( p , D ) > 0 && f . scale ( p , p , - 1 ) ; var H = c . getClosestEdge ( b , e , p , ! 0 ) , I = c . getClosestEdge ( k , m , p ) ; if ( - 1 === H || - 1 === I ) return 0 ; for ( var J = 0 ; 2 > J ; J ++ ) { var K = H , L = I , M = b , N = k , O = d , P = l , Q = e , R = m , S = a , T = j ; if ( 0 === J ) { var U ; U = K , K = L , L = U , U = M , M = N , N = U , U = O , O = P , P = U , U = Q , Q = R , R = U , U = S , S = T , T = U } for ( var V = L ; L + 2 > V ; V ++ ) { var W = N . vertices [ ( V + N . vertices . length ) % N . vertices . length ] ; f . rotate ( q , W , R ) , h ( q , q , P ) ; for ( var X = 0 , Y = K - 1 ; K + 2 > Y ; Y ++ ) { var Z = M . vertices [ ( Y + M . vertices . length ) % M . vertices . length ] , $ = M . vertices [ ( Y + 1 + M . vertices . length ) % M . vertices . length ] ; f . rotate ( r , Z , Q ) , f . rotate ( x , $ , Q ) , h ( r , r , O ) , h ( x , x , O ) , g ( B , x , r ) , f . rotate90cw ( E , B ) , f . normalize ( E , E ) , g ( D , q , r ) ; var _ = i ( E , D ) ; ( Y === K && o >= _ || Y !== K && 0 >= _ ) && X ++ } if ( X >= 3 ) { if ( n ) return ! 0 ; var ab = this . createContactEquation ( S , T , M , N ) ; F ++ ; var Z = M . vertices [ K % M . vertices . length ] , $ = M . vertices [ ( K + 1 ) % M . vertices . length ] ; f . rotate ( r , Z , Q ) , f . rotate ( x , $ , Q ) , h ( r , r , O ) , h ( x , x , O ) , g ( B , x , r ) , f . rotate90cw ( ab . normalA , B ) , f . normalize ( ab . normalA , ab . normalA ) , g ( D , q , r ) ; var _ = i ( ab . normalA , D ) ; f . scale ( C , ab . normalA , _ ) , g ( ab . contactPointA , q , O ) , g ( ab . contactPointA , ab . contactPointA , C ) , h ( ab . contactPointA , ab . contactPointA , O ) , g ( ab . contactPointA , ab . contactPointA , S . position ) , g ( ab . contactPointB , q , P ) , h ( ab . contactPointB , ab . contactPointB , P ) , g ( ab . contactPointB , ab . contactPointB , T . position ) , this . contactEquations . push ( ab ) , this . enableFrictionReduction || this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( ab ) ) } } } return this . enableFriction
} { var d = a ( "./Equation" ) ; a ( "../math/vec2" ) } b . exports = c , c . prototype = new d , c . prototype . constructor = c , c . prototype . computeB = function ( a , b , c ) { var d = this . G ; d [ 2 ] = - 1 , d [ 5 ] = this . ratio ; var e = this . computeGiMf ( ) , f = this . computeGW ( ) , g = - f * b - c * e ; return g } } , { "../math/vec2" : 30 , "./Equation" : 22 } ] , 26 : [ function ( a , b ) { var c = function ( ) { } ; b . exports = c , c . prototype = { constructor : c , on : function ( a , b , c ) { b . context = c || this , void 0 === this . _listeners && ( this . _listeners = { } ) ; var d = this . _listeners ; return void 0 === d [ a ] && ( d [ a ] = [ ] ) , - 1 === d [ a ] . indexOf ( b ) && d [ a ] . push ( b ) , this } , has : function ( a , b ) { if ( void 0 === this . _listeners ) return ! 1 ; var c = this . _listeners ; if ( b ) { if ( void 0 !== c [ a ] && - 1 !== c [ a ] . indexOf ( b ) ) return ! 0 } else if ( void 0 !== c [ a ] ) return ! 0 ; return ! 1 } , off : function ( a , b ) { if ( void 0 === this . _listeners ) return this ; var c = this . _listeners , d = c [ a ] . indexOf ( b ) ; return - 1 !== d && c [ a ] . splice ( d , 1 ) , this } , emit : function ( a ) { if ( void 0 === this . _listeners ) return this ; var b = this . _listeners , c = b [ a . type ] ; if ( void 0 !== c ) { a . target = this ; for ( var d = 0 , e = c . length ; e > d ; d ++ ) { var f = c [ d ] ; f . call ( f . context , a ) } } return this } } } , { } ] , 27 : [ function ( a , b ) { function c ( a , b , f ) { if ( f = f || { } , ! ( a instanceof d && b instanceof d ) ) throw new Error ( "First two arguments must be Material instances." ) ; this . id = c . idCounter ++ , this . materialA = a , this . materialB = b , this . friction = "undefined" != typeof f . friction ? Number ( f . friction ) : . 3 , this . restitution = "undefined" != typeof f . restitution ? Number ( f . restitution ) : 0 , this . stiffness = "undefined" != typeof f . stiffness ? Number ( f . stiffness ) : e . DEFAULT _STIFFNESS , this . relaxation = "undefined" != typeof f . relaxation ? Number ( f . relaxation ) : e . DEFAULT _RELAXATION , this . frictionStiffness = "undefined" != typeof f . frictionStiffness ? Number ( f . frictionStiffness ) : e . DEFAULT _STIFFNESS , this . frictionRelaxation = "undefined" != typeof f . frictionRelaxation ? Number ( f . frictionRelaxation ) : e . DEFAULT _RELAXATION , this . surfaceVelocity = "undefined" != typeof f . surfaceVelocity ? Number ( f . surfaceVelocity ) : 0 , this . contactSkinSize = . 005 } var d = a ( "./Material" ) , e = a ( "../equations/Equation" ) ; b . exports = c , c . idCounter = 0 } , { "../equations/Equation" : 22 , "./Material" : 28 } ] , 28 : [ function ( a , b ) { function c ( a ) { this . id = a || c . idCounter ++ } b . exports = c , c . idCounter = 0 } , { } ] , 29 : [ function ( a , b ) { var c = { } ; c . GetArea = function ( a ) { if ( a . length < 6 ) return 0 ; for ( var b = a . length - 2 , c = 0 , d = 0 ; b > d ; d += 2 ) c += ( a [ d + 2 ] - a [ d ] ) * ( a [ d + 1 ] + a [ d + 3 ] ) ; return c += ( a [ 0 ] - a [ b ] ) * ( a [ b + 1 ] + a [ 1 ] ) , . 5 * - c } , c . Triangulate = function ( a ) { var b = a . length >> 1 ; if ( 3 > b ) return [ ] ; for ( var d = [ ] , e = [ ] , f = 0 ; b > f ; f ++ ) e . push ( f ) ; for ( var f = 0 , g = b ; g > 3 ; ) { var h = e [ ( f + 0 ) % g ] , i = e [ ( f + 1 ) % g ] , j = e [ ( f + 2 ) % g ] , k = a [ 2 * h ] , l = a [ 2 * h + 1 ] , m = a [ 2 * i ] , n = a [ 2 * i + 1 ] , o = a [ 2 * j ] , p = a [ 2 * j + 1 ] , q = ! 1 ; if ( c . _convex ( k , l , m , n , o , p ) ) { q = ! 0 ; for ( var r = 0 ; g > r ; r ++ ) { var s = e [ r ] ; if ( s != h && s != i && s != j && c . _PointInTriangle ( a [ 2 * s ] , a [ 2 * s + 1 ] , k , l , m , n , o , p ) ) { q = ! 1 ; break } } } if ( q ) d . push ( h , i , j ) , e . splice ( ( f + 1 ) % g , 1 ) , g -- , f = 0 ; else if ( f ++ > 3 * g ) break } return d . push ( e [ 0 ] , e [ 1 ] , e [ 2 ] ) , d } , c . _PointInTriangle = function ( a , b , c , d , e , f , g , h ) { var i = g - c , j = h - d , k = e - c , l = f - d , m = a - c , n = b - d , o = i * i + j * j , p = i * k + j * l , q = i * m + j * n , r = k * k + l * l , s = k * m + l * n , t = 1 / ( o * r - p * p ) , u = ( r * q - p * s ) * t , v = ( o * s - p * q ) * t ; return u >= 0 && v >= 0 && 1 > u + v } , c . _convex = function ( a , b , c , d , e , f ) { return ( b - d ) * ( e - c ) + ( c - a ) * ( f - d ) >= 0 } , b . exports = c } , { } ] , 30 : [ function ( a , b ) { var c = b . exports = { } , d = a ( "../utils/Utils" ) ; c . crossLength = function ( a , b ) { return a [ 0 ] * b [ 1 ] - a [ 1 ] * b [ 0 ] } , c . crossVZ = function ( a , b , d ) { return c . rotate ( a , b , - Math . PI / 2 ) , c . scale ( a , a , d ) , a } , c . crossZV = function ( a , b , d ) { return c . rotate ( a , d , Math . PI / 2 ) , c . scale ( a , a , b ) , a } , c . rotate = function ( a , b , c ) { if ( 0 !== c ) { var d = Math . cos ( c ) , e = Math . sin ( c ) , f = b [ 0 ] , g = b [ 1 ] ; a [ 0 ] = d * f - e * g , a [ 1 ] = e * f + d * g } else a [ 0 ] = b [ 0 ] , a [ 1 ] = b [ 1 ] } , c . rotate90cw = function ( a , b ) { var c = b [ 0 ] , d = b [ 1 ] ; a [ 0 ] = d , a [ 1 ] = - c } , c . toLocalFrame = function ( a , b , d , e ) { c . copy ( a , b ) , c . sub ( a , a , d ) , c . rotate ( a , a , - e ) } , c . toGlobalFrame = function ( a , b , d , e ) { c . copy ( a , b ) , c . rotate ( a , a , e ) , c . add ( a , a , d ) } , c . vectorToLocalFrame = function ( a , b , d ) { c . rotate ( a , b , - d ) } , c . vectorToGlobalFrame = function ( a , b , d ) { c . rotate ( a , b , d ) } , c . centroid = function ( a , b , d , e ) { return c . add ( a , b , d ) , c . add ( a , a , e ) , c . scale ( a , a , 1 / 3 ) , a } , c . create = function ( ) { var a = new d . ARRAY _TYPE ( 2 ) ; return a [ 0 ] = 0 , a [ 1 ] = 0 , a } , c . clone = function ( a ) { var b = new d . ARRAY _TYPE ( 2 ) ; return b [ 0 ] = a [ 0 ] , b [ 1 ] = a [ 1 ] , b } , c . fromValues = function ( a , b ) { var c = new d . ARRAY _TYPE ( 2 ) ; return c [ 0 ] = a , c [ 1 ] = b , c } , c .
c . prototype . raycast = function ( a , b , c , d ) { var f = n , g = o , h = p , i = this . vertices ; e . toLocalFrame ( f , b . from , c , d ) , e . toLocalFrame ( g , b . to , c , d ) ; for ( var j = i . length , k = 0 ; j > k && ! a . shouldStop ( b ) ; k ++ ) { var l = i [ k ] , m = i [ ( k + 1 ) % j ] , q = e . getLineSegmentsIntersectionFraction ( f , g , l , m ) ; q >= 0 && ( e . sub ( h , m , l ) , e . rotate ( h , h , - Math . PI / 2 + d ) , e . normalize ( h , h ) , b . reportIntersection ( a , q , h , k ) ) } } } , { "../math/polyk" : 29 , "../math/vec2" : 30 , "./Shape" : 45 , "poly-decomp" : 5 } ] , 41 : [ function ( a , b ) { function c ( a ) { if ( Array . isArray ( arguments [ 0 ] ) ) { if ( a = { heights : arguments [ 0 ] } , "object" == typeof arguments [ 1 ] ) for ( var b in arguments [ 1 ] ) a [ b ] = arguments [ 1 ] [ b ] ; console . warn ( "The Heightfield constructor signature has changed. Please use the following format: new Heightfield({ heights: [...], ... })" ) } a = a || { } , this . heights = a . heights ? a . heights . slice ( 0 ) : [ ] , this . maxValue = a . maxValue || null , this . minValue = a . minValue || null , this . elementWidth = a . elementWidth || . 1 , ( void 0 === a . maxValue || void 0 === a . minValue ) && this . updateMaxMinValues ( ) , a . type = d . HEIGHTFIELD , d . call ( this , a ) } { var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; a ( "../utils/Utils" ) } b . exports = c , c . prototype = new d , c . prototype . constructor = c , c . prototype . updateMaxMinValues = function ( ) { for ( var a = this . heights , b = a [ 0 ] , c = a [ 0 ] , d = 0 ; d !== a . length ; d ++ ) { var e = a [ d ] ; e > b && ( b = e ) , c > e && ( c = e ) } this . maxValue = b , this . minValue = c } , c . prototype . computeMomentOfInertia = function ( ) { return Number . MAX _VALUE } , c . prototype . updateBoundingRadius = function ( ) { this . boundingRadius = Number . MAX _VALUE } , c . prototype . updateArea = function ( ) { for ( var a = this . heights , b = 0 , c = 0 ; c < a . length - 1 ; c ++ ) b += ( a [ c ] + a [ c + 1 ] ) / 2 * this . elementWidth ; this . area = b } ; var f = [ e . create ( ) , e . create ( ) , e . create ( ) , e . create ( ) ] ; c . prototype . computeAABB = function ( a , b , c ) { e . set ( f [ 0 ] , 0 , this . maxValue ) , e . set ( f [ 1 ] , this . elementWidth * this . heights . length , this . maxValue ) , e . set ( f [ 2 ] , this . elementWidth * this . heights . length , this . minValue ) , e . set ( f [ 3 ] , 0 , this . minValue ) , a . setFromPoints ( f , b , c ) } , c . prototype . getLineSegment = function ( a , b , c ) { var d = this . heights , f = this . elementWidth ; e . set ( a , c * f , d [ c ] ) , e . set ( b , ( c + 1 ) * f , d [ c + 1 ] ) } , c . prototype . getSegmentIndex = function ( a ) { return Math . floor ( a [ 0 ] / this . elementWidth ) } , c . prototype . getClampedSegmentIndex = function ( a ) { var b = this . getSegmentIndex ( a ) ; return b = Math . min ( this . heights . length , Math . max ( b , 0 ) ) } ; { var g = ( e . create ( ) , e . create ( ) ) , h = e . create ( ) , i = e . create ( ) , j = e . create ( ) , k = e . create ( ) ; e . fromValues ( 0 , 1 ) } c . prototype . raycast = function ( a , b , c , d ) { var f = b . from , l = b . to , m = ( b . direction , g ) , n = h , o = i , p = j , q = k ; e . toLocalFrame ( p , f , c , d ) , e . toLocalFrame ( q , l , c , d ) ; var r = this . getClampedSegmentIndex ( p ) , s = this . getClampedSegmentIndex ( q ) ; if ( r > s ) { var t = r ; r = s , s = t } for ( var u = 0 ; u < this . heights . length - 1 ; u ++ ) { this . getLineSegment ( n , o , u ) ; var v = e . getLineSegmentsIntersectionFraction ( p , q , n , o ) ; if ( v >= 0 && ( e . sub ( m , o , n ) , e . rotate ( m , m , d + Math . PI / 2 ) , e . normalize ( m , m ) , b . reportIntersection ( a , v , m , - 1 ) , a . shouldStop ( b ) ) ) return } } } , { "../math/vec2" : 30 , "../utils/Utils" : 57 , "./Shape" : 45 } ] , 42 : [ function ( a , b ) { function c ( a ) { "number" == typeof arguments [ 0 ] && ( a = { length : arguments [ 0 ] } , console . warn ( "The Line constructor signature has changed. Please use the following format: new Line({ length: 1, ... })" ) ) , a = a || { } , this . length = a . length || 1 , a . type = d . LINE , d . call ( this , a ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . constructor = c , c . prototype . computeMomentOfInertia = function ( a ) { return a * Math . pow ( this . length , 2 ) / 12 } , c . prototype . updateBoundingRadius = function ( ) { this . boundingRadius = this . length / 2 } ; var f = [ e . create ( ) , e . create ( ) ] ; c . prototype . computeAABB = function ( a , b , c ) { var d = this . length / 2 ; e . set ( f [ 0 ] , - d , 0 ) , e . set ( f [ 1 ] , d , 0 ) , a . setFromPoints ( f , b , c , 0 ) } ; var g = ( e . create ( ) , e . create ( ) ) , h = e . create ( ) , i = e . create ( ) , j = e . fromValues ( 0 , 1 ) ; c . prototype . raycast = function ( a , b , c , d ) { var f = b . from , k = b . to , l = h , m = i , n = this . length / 2 ; e . set ( l , - n , 0 ) , e . set ( m , n , 0 ) , e . toGlobalFrame ( l , l , c , d ) , e . toGlobalFrame ( m , m , c , d ) ; var o = e . getLineSegmentsIntersectionFraction ( l , m , f , k ) ; if ( o >= 0 ) { var p = g ; e . rotate ( p , j , d ) , b . reportIntersection ( a , o , p , - 1 ) } } } , { "../math/vec2" : 30 , "./Shape" : 45 } ] , 43 : [ function ( a , b ) { function c ( a ) { a = a || { } , a . type = d . PARTICLE , d . call ( this , a ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . constructor = c , c . prototype . computeMomentOfInertia
} , c . Physics . P2 . prototype = { removeBodyNextStep : function ( a ) { this . _toRemove . push ( a ) } , preUpdate : function ( ) { for ( var a = this . _toRemove . length ; a -- ; ) this . removeBody ( this . _toRemove [ a ] ) ; this . _toRemove . length = 0 } , enable : function ( a , b , d ) { "undefined" == typeof b && ( b = ! 1 ) , "undefined" == typeof d && ( d = ! 0 ) ; var e = 1 ; if ( Array . isArray ( a ) ) for ( e = a . length ; e -- ; ) a [ e ] instanceof c . Group ? this . enable ( a [ e ] . children , b , d ) : ( this . enableBody ( a [ e ] , b ) , d && a [ e ] . hasOwnProperty ( "children" ) && a [ e ] . children . length > 0 && this . enable ( a [ e ] , b , ! 0 ) ) ; else a instanceof c . Group ? this . enable ( a . children , b , d ) : ( this . enableBody ( a , b ) , d && a . hasOwnProperty ( "children" ) && a . children . length > 0 && this . enable ( a . children , b , ! 0 ) ) } , enableBody : function ( a , b ) { a . hasOwnProperty ( "body" ) && null === a . body && ( a . body = new c . Physics . P2 . Body ( this . game , a , a . x , a . y , 1 ) , a . body . debug = b , "undefined" != typeof a . anchor && a . anchor . set ( . 5 ) ) } , setImpactEvents : function ( a ) { a ? this . world . on ( "impact" , this . impactHandler , this ) : this . world . off ( "impact" , this . impactHandler , this ) } , setPostBroadphaseCallback : function ( a , b ) { this . postBroadphaseCallback = a , this . callbackContext = b , null !== a ? this . world . on ( "postBroadphase" , this . postBroadphaseHandler , this ) : this . world . off ( "postBroadphase" , this . postBroadphaseHandler , this ) } , postBroadphaseHandler : function ( a ) { if ( this . postBroadphaseCallback && 0 !== a . pairs . length ) for ( var b = a . pairs . length - 2 ; b >= 0 ; b -= 2 ) a . pairs [ b ] . parent && a . pairs [ b + 1 ] . parent && ! this . postBroadphaseCallback . call ( this . callbackContext , a . pairs [ b ] . parent , a . pairs [ b + 1 ] . parent ) && a . pairs . splice ( b , 2 ) } , impactHandler : function ( a ) { if ( a . bodyA . parent && a . bodyB . parent ) { var b = a . bodyA . parent , c = a . bodyB . parent ; b . _bodyCallbacks [ a . bodyB . id ] && b . _bodyCallbacks [ a . bodyB . id ] . call ( b . _bodyCallbackContext [ a . bodyB . id ] , b , c , a . shapeA , a . shapeB ) , c . _bodyCallbacks [ a . bodyA . id ] && c . _bodyCallbacks [ a . bodyA . id ] . call ( c . _bodyCallbackContext [ a . bodyA . id ] , c , b , a . shapeB , a . shapeA ) , b . _groupCallbacks [ a . shapeB . collisionGroup ] && b . _groupCallbacks [ a . shapeB . collisionGroup ] . call ( b . _groupCallbackContext [ a . shapeB . collisionGroup ] , b , c , a . shapeA , a . shapeB ) , c . _groupCallbacks [ a . shapeA . collisionGroup ] && c . _groupCallbacks [ a . shapeA . collisionGroup ] . call ( c . _groupCallbackContext [ a . shapeA . collisionGroup ] , c , b , a . shapeB , a . shapeA ) } } , beginContactHandler : function ( a ) { a . bodyA && a . bodyB && ( this . onBeginContact . dispatch ( a . bodyA , a . bodyB , a . shapeA , a . shapeB , a . contactEquations ) , a . bodyA . parent && a . bodyA . parent . onBeginContact . dispatch ( a . bodyB . parent , a . bodyB , a . shapeA , a . shapeB , a . contactEquations ) , a . bodyB . parent && a . bodyB . parent . onBeginContact . dispatch ( a . bodyA . parent , a . bodyA , a . shapeB , a . shapeA , a . contactEquations ) ) } , endContactHandler : function ( a ) { a . bodyA && a . bodyB && ( this . onEndContact . dispatch ( a . bodyA , a . bodyB , a . shapeA , a . shapeB ) , a . bodyA . parent && a . bodyA . parent . onEndContact . dispatch ( a . bodyB . parent , a . bodyB , a . shapeA , a . shapeB ) , a . bodyB . parent && a . bodyB . parent . onEndContact . dispatch ( a . bodyA . parent , a . bodyA , a . shapeB , a . shapeA ) ) } , setBoundsToWorld : function ( a , b , c , d , e ) { this . setBounds ( this . game . world . bounds . x , this . game . world . bounds . y , this . game . world . bounds . width , this . game . world . bounds . height , a , b , c , d , e ) } , setWorldMaterial : function ( a , b , c , d , e ) { "undefined" == typeof b && ( b = ! 0 ) , "undefined" == typeof c && ( c = ! 0 ) , "undefined" == typeof d && ( d = ! 0 ) , "undefined" == typeof e && ( e = ! 0 ) , b && this . walls . left && ( this . walls . left . shapes [ 0 ] . material = a ) , c && this . walls . right && ( this . walls . right . shapes [ 0 ] . material = a ) , d && this . walls . top && ( this . walls . top . shapes [ 0 ] . material = a ) , e && this . walls . bottom && ( this . walls . bottom . shapes [ 0 ] . material = a ) } , updateBoundsCollisionGroup : function ( a ) { var b = this . everythingCollisionGroup . mask ; "undefined" == typeof a && ( b = this . boundsCollisionGroup . mask ) , this . walls . left && ( this . walls . left . shapes [ 0 ] . collisionGroup = b ) , this . walls . right && ( this . walls . right . shapes [ 0 ] . collisionGroup = b ) , this . walls . top && ( this . walls . top . shapes [ 0 ] . collisionGroup = b ) , this . walls . bottom && ( this . walls . bottom . shapes [ 0 ] . collisionGroup = b ) } , setBounds : function ( a , b , c , d , e , f , g , h , i ) { "undefined" == typeof e && ( e = this . _boundsLeft ) , "undefined" == typeof f && ( f = this . _boundsRight ) , "undefined" == typeof g && ( g = this . _boundsTop ) , "undefined" == typeof h && ( h = this . _boundsBottom ) , "undefined" == typeof i && ( i = this . _boundsOwnGroup ) , this . walls . left && this . world . removeBody ( this . walls .
} } ) , Object . defineProperty ( c . Physics . P2 . Body . prototype , "collideWorldBounds" , { get : function ( ) { return this . _collideWorldBounds } , set : function ( a ) { a && ! this . _collideWorldBounds ? ( this . _collideWorldBounds = ! 0 , this . updateCollisionMask ( ) ) : ! a && this . _collideWorldBounds && ( this . _collideWorldBounds = ! 1 , this . updateCollisionMask ( ) ) } } ) , c . Physics . P2 . BodyDebug = function ( a , b , d ) { c . Group . call ( this , a ) ; var e = { pixelsPerLengthUnit : 20 , debugPolygons : ! 1 , lineWidth : 1 , alpha : . 5 } ; this . settings = c . Utils . extend ( e , d ) , this . ppu = this . settings . pixelsPerLengthUnit , this . ppu = - 1 * this . ppu , this . body = b , this . canvas = new c . Graphics ( a ) , this . canvas . alpha = this . settings . alpha , this . add ( this . canvas ) , this . draw ( ) , this . updateSpriteTransform ( ) } , c . Physics . P2 . BodyDebug . prototype = Object . create ( c . Group . prototype ) , c . Physics . P2 . BodyDebug . prototype . constructor = c . Physics . P2 . BodyDebug , c . Utils . extend ( c . Physics . P2 . BodyDebug . prototype , { updateSpriteTransform : function ( ) { this . position . x = this . body . position [ 0 ] * this . ppu , this . position . y = this . body . position [ 1 ] * this . ppu , this . rotation = this . body . angle } , draw : function ( ) { var a , b , c , d , e , f , g , h , i , j , k , l , m , n , o ; if ( h = this . body , j = this . canvas , j . clear ( ) , c = parseInt ( this . randomPastelHex ( ) , 16 ) , f = 16711680 , g = this . lineWidth , h instanceof p2 . Body && h . shapes . length ) { var p = h . shapes . length ; for ( d = 0 ; d !== p ; ) { if ( b = h . shapes [ d ] , i = b . position || 0 , a = b . angle || 0 , b instanceof p2 . Circle ) this . drawCircle ( j , i [ 0 ] * this . ppu , i [ 1 ] * this . ppu , a , b . radius * this . ppu , c , g ) ; else if ( b instanceof p2 . Capsule ) this . drawCapsule ( j , i [ 0 ] * this . ppu , i [ 1 ] * this . ppu , a , b . length * this . ppu , b . radius * this . ppu , f , c , g ) ; else if ( b instanceof p2 . Plane ) this . drawPlane ( j , i [ 0 ] * this . ppu , - i [ 1 ] * this . ppu , c , f , 5 * g , 10 * g , 10 * g , 100 * this . ppu , a ) ; else if ( b instanceof p2 . Line ) this . drawLine ( j , b . length * this . ppu , f , g ) ; else if ( b instanceof p2 . Box ) this . drawRectangle ( j , i [ 0 ] * this . ppu , i [ 1 ] * this . ppu , a , b . width * this . ppu , b . height * this . ppu , f , c , g ) ; else if ( b instanceof p2 . Convex ) { for ( l = [ ] , m = p2 . vec2 . create ( ) , e = n = 0 , o = b . vertices . length ; o >= 0 ? o > n : n > o ; e = o >= 0 ? ++ n : -- n ) k = b . vertices [ e ] , p2 . vec2 . rotate ( m , k , a ) , l . push ( [ ( m [ 0 ] + i [ 0 ] ) * this . ppu , - ( m [ 1 ] + i [ 1 ] ) * this . ppu ] ) ; this . drawConvex ( j , l , b . triangles , f , c , g , this . settings . debugPolygons , [ i [ 0 ] * this . ppu , - i [ 1 ] * this . ppu ] ) } d ++ } } } , drawRectangle : function ( a , b , c , d , e , f , g , h , i ) { "undefined" == typeof i && ( i = 1 ) , "undefined" == typeof g && ( g = 0 ) , a . lineStyle ( i , g , 1 ) , a . beginFill ( h ) , a . drawRect ( b - e / 2 , c - f / 2 , e , f ) } , drawCircle : function ( a , b , c , d , e , f , g ) { "undefined" == typeof g && ( g = 1 ) , "undefined" == typeof f && ( f = 16777215 ) , a . lineStyle ( g , 0 , 1 ) , a . beginFill ( f , 1 ) , a . drawCircle ( b , c , 2 * - e ) , a . endFill ( ) , a . moveTo ( b , c ) , a . lineTo ( b + e * Math . cos ( - d ) , c + e * Math . sin ( - d ) ) } , drawLine : function ( a , b , c , d ) { "undefined" == typeof d && ( d = 1 ) , "undefined" == typeof c && ( c = 0 ) , a . lineStyle ( 5 * d , c , 1 ) , a . moveTo ( - b / 2 , 0 ) , a . lineTo ( b / 2 , 0 ) } , drawConvex : function ( a , b , c , d , e , f , g , h ) { var i , j , k , l , m , n , o , p , q , r , s ; if ( "undefined" == typeof f && ( f = 1 ) , "undefined" == typeof d && ( d = 0 ) , g ) { for ( i = [ 16711680 , 65280 , 255 ] , j = 0 ; j !== b . length + 1 ; ) l = b [ j % b . length ] , m = b [ ( j + 1 ) % b . length ] , o = l [ 0 ] , r = l [ 1 ] , p = m [ 0 ] , s = m [ 1 ] , a . lineStyle ( f , i [ j % i . length ] , 1 ) , a . moveTo ( o , - r ) , a . lineTo ( p , - s ) , a . drawCircle ( o , - r , 2 * f ) , j ++ ; return a . lineStyle ( f , 0 , 1 ) , a . drawCircle ( h [ 0 ] , h [ 1 ] , 2 * f ) } for ( a . lineStyle ( f , d , 1 ) , a . beginFill ( e ) , j = 0 ; j !== b . length ; ) k = b [ j ] , n = k [ 0 ] , q = k [ 1 ] , 0 === j ? a . moveTo ( n , - q ) : a . lineTo ( n , - q ) , j ++ ; return a . endFill ( ) , b . length > 2 ? ( a . moveTo ( b [ b . length - 1 ] [ 0 ] , - b [ b . length - 1 ] [ 1 ] ) , a . lineTo ( b [ 0 ] [ 0 ] , - b [ 0 ] [ 1 ] ) ) : void 0 } , drawPath : function ( a , b , c , d , e ) { var f , g , h , i , j , k , l , m , n , o , p , q , r ; for ( "undefined" == typeof e && ( e = 1 ) , "undefined" == typeof c && ( c = 0 ) , a . lineStyle ( e , c , 1 ) , "number" == typeof d && a . beginFill ( d ) , h = null , i = null , g = 0 ; g < b . length ; ) p = b [ g ] , q = p [ 0 ] , r = p [ 1 ] , ( q !== h || r !== i ) && ( 0 === g ? a . moveTo ( q , r ) : ( j = h , k = i , l = q , m = r , n = b [ ( g + 1 ) % b . length ] [ 0 ] , o = b [ ( g + 1 ) % b . length ] [ 1 ] , f = ( l - j ) * ( o - k ) - ( n - j ) * ( m - k ) , 0 !== f && a . lineTo ( q , r ) ) , h = q , i = r ) , g ++ ; "number" == typeof d && a . endFill ( ) , b . length > 2 && "number" == typeof d && ( a . moveTo ( b [ b . length - 1 ] [ 0 ] , b [ b . length - 1 ] [ 1 ] ) , a . lineTo ( b [ 0 ] [ 0 ] , b [ 0 ] [ 1 ] ) ) } , drawPlane : function ( a , b , c , d , e , f , g , h , i , j ) { var k , l , m ; "undefined" == typeof f && ( f = 1 ) , "undefined" == typeof d && ( d = 16777215 ) , a . lineStyle ( f , e , 11 ) , a . beginFill ( d ) , k = i , a . moveTo ( b , - c ) , l = b + Math . cos ( j ) * this . game . width , m = c + Math . sin ( j ) * this . game . height , a . lineTo ( l , - m ) , a . moveTo ( b , - c ) , l = b + Math . cos ( j ) * - this . game . width
var n , o , p , q , r , s , t = c * j - a , u = d * k - b , v = ( c + ( 1 << 20 ) * h ) % h , w = ( d + ( 1 << 20 ) * i ) % i ; for ( g . fillStyle = this . tileColor , q = w , s = f - d , o = u ; s >= 0 ; q ++ , s -- , o += k ) { q >= i && ( q -= i ) ; var x = this . layer . data [ q ] ; for ( p = v , r = e - c , n = t ; r >= 0 ; p ++ , r -- , n += j ) { p >= h && ( p -= h ) ; var y = x [ p ] ; if ( y && ! ( y . index < 0 ) ) { var z = y . index , A = l [ z ] ; void 0 === A && ( A = this . resolveTileset ( z ) ) , y . alpha === m || this . debug || ( g . globalAlpha = y . alpha , m = y . alpha ) , A ? y . rotation || y . flipped ? ( g . save ( ) , g . translate ( n + y . centerX , o + y . centerY ) , g . rotate ( y . rotation ) , y . flipped && g . scale ( - 1 , 1 ) , A . draw ( g , - y . centerX , - y . centerY , z ) , g . restore ( ) ) : A . draw ( g , n , o , z ) : this . debugSettings . missingImageFill && ( g . fillStyle = this . debugSettings . missingImageFill , g . fillRect ( n , o , j , k ) ) , y . debug && this . debugSettings . debuggedTileOverfill && ( g . fillStyle = this . debugSettings . debuggedTileOverfill , g . fillRect ( n , o , j , k ) ) } } } } , c . TilemapLayer . prototype . renderDeltaScroll = function ( a , b ) { var c = this . _mc . scrollX , d = this . _mc . scrollY , e = this . canvas . width , f = this . canvas . height , g = this . _mc . tileWidth , h = this . _mc . tileHeight , i = 0 , j = - g , k = 0 , l = - h ; if ( 0 > a ? ( i = e + a , j = e - 1 ) : a > 0 && ( j = a ) , 0 > b ? ( k = f + b , l = f - 1 ) : b > 0 && ( l = b ) , this . shiftCanvas ( this . context , a , b ) , i = Math . floor ( ( i + c ) / g ) , j = Math . floor ( ( j + c ) / g ) , k = Math . floor ( ( k + d ) / h ) , l = Math . floor ( ( l + d ) / h ) , j >= i ) { this . context . clearRect ( i * g - c , 0 , ( j - i + 1 ) * g , f ) ; var m = Math . floor ( ( 0 + d ) / h ) , n = Math . floor ( ( f - 1 + d ) / h ) ; this . renderRegion ( c , d , i , m , j , n ) } if ( l >= k ) { this . context . clearRect ( 0 , k * h - d , e , ( l - k + 1 ) * h ) ; var o = Math . floor ( ( 0 + c ) / g ) , p = Math . floor ( ( e - 1 + c ) / g ) ; this . renderRegion ( c , d , o , k , p , l ) } } , c . TilemapLayer . prototype . renderFull = function ( ) { var a = this . _mc . scrollX , b = this . _mc . scrollY , c = this . canvas . width , d = this . canvas . height , e = this . _mc . tileWidth , f = this . _mc . tileHeight , g = Math . floor ( a / e ) , h = Math . floor ( ( c - 1 + a ) / e ) , i = Math . floor ( b / f ) , j = Math . floor ( ( d - 1 + b ) / f ) ; this . context . clearRect ( 0 , 0 , c , d ) , this . renderRegion ( a , b , g , i , h , j ) } , c . TilemapLayer . prototype . render = function ( ) { var a = ! 1 ; if ( this . visible ) { this . context . save ( ) , ( this . dirty || this . layer . dirty ) && ( this . layer . dirty = ! 1 , a = ! 0 ) ; var b = this . canvas . width , c = this . canvas . height , d = 0 | this . _scrollX , e = 0 | this . _scrollY , f = this . _mc , g = f . scrollX - d , h = f . scrollY - e ; if ( a || 0 !== g || 0 !== h || f . renderWidth !== b || f . renderHeight !== c ) return f . scrollX = d , f . scrollY = e , ( f . renderWidth !== b || f . renderHeight !== c ) && ( f . renderWidth = b , f . renderHeight = c ) , this . debug && ( this . context . globalAlpha = this . debugSettings . debugAlpha , this . debugSettings . forceFullRedraw && ( a = ! 0 ) ) , ! a && this . renderSettings . enableScrollDelta && Math . abs ( g ) + Math . abs ( h ) < Math . min ( b , c ) ? this . renderDeltaScroll ( g , h ) : this . renderFull ( ) , this . debug && ( this . context . globalAlpha = 1 , this . renderDebug ( ) ) , this . texture . baseTexture . dirty ( ) , this . dirty = ! 1 , this . context . restore ( ) , ! 0 } } , c . TilemapLayer . prototype . renderDebug = function ( ) { var a , b , c , d , e , f , g = this . _mc . scrollX , h = this . _mc . scrollY , i = this . context , j = this . canvas . width , k = this . canvas . height , l = this . layer . width , m = this . layer . height , n = this . _mc . tileWidth , o = this . _mc . tileHeight , p = Math . floor ( g / n ) , q = Math . floor ( ( j - 1 + g ) / n ) , r = Math . floor ( h / o ) , s = Math . floor ( ( k - 1 + h ) / o ) , t = p * n - g , u = r * o - h , v = ( p + ( 1 << 20 ) * l ) % l , w = ( r + ( 1 << 20 ) * m ) % m ; for ( i . strokeStyle = this . debugSettings . facingEdgeStroke , d = w , f = s - r , b = u ; f >= 0 ; d ++ , f -- , b += o ) { d >= m && ( d -= m ) ; var x = this . layer . data [ d ] ; for ( c = v , e = q - p , a = t ; e >= 0 ; c ++ , e -- , a += n ) { c >= l && ( c -= l ) ; var y = x [ c ] ; ! y || y . index < 0 || ! y . collides || ( this . debugSettings . collidingTileOverfill && ( i . fillStyle = this . debugSettings . collidingTileOverfill , i . fillRect ( a , b , this . _mc . cw , this . _mc . ch ) ) , this . debugSettings . facingEdgeStroke && ( i . beginPath ( ) , y . faceTop && ( i . moveTo ( a , b ) , i . lineTo ( a + this . _mc . cw , b ) ) , y . faceBottom && ( i . moveTo ( a , b + this . _mc . ch ) , i . lineTo ( a + this . _mc . cw , b + this . _mc . ch ) ) , y . faceLeft && ( i . moveTo ( a , b ) , i . lineTo ( a , b + this . _mc . ch ) ) , y . faceRight && ( i . moveTo ( a + this . _mc . cw , b ) , i . lineTo ( a + this . _mc . cw , b + this . _mc . ch ) ) , i . stroke ( ) ) ) } } } , Object . defineProperty ( c . TilemapLayer . prototype , "wrap" , { get : function ( ) { return this . _wrap } , set : function ( a ) { this . _wrap = a , this . dirty = ! 0 } } ) , Object . defineProperty ( c . TilemapLayer . prototype , "scrollX" , { get : function ( ) { return this . _scrollX } , set : function ( a ) { this . _scrollX = a } } ) , Object . defineProperty ( c . TilemapLayer . prototype , "scrollY" , { get : function ( ) { return this . _scrollY } , set : function ( a ) { this . _scrollY = a } } ) , Object . defineProperty ( c . TilemapLayer . prototype , "collisionWidth" , { get : func
} ( ) ) : b . Phaser = c } . call ( this ) ;
2014-02-28 09:30:53 +00:00
//# sourceMappingURL=phaser.map