2014-10-09 15:16:41 +00:00
/* Phaser (NJ) v2.1.2 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */
2014-09-09 13:47:54 +00:00
( function ( ) { var a = this , b = b || { } ; b . WEBGL _RENDERER = 0 , b . CANVAS _RENDERER = 1 , b . VERSION = "v1.6.1" , b . blendModes = { NORMAL : 0 , ADD : 1 , MULTIPLY : 2 , SCREEN : 3 , OVERLAY : 4 , DARKEN : 5 , LIGHTEN : 6 , COLOR _DODGE : 7 , COLOR _BURN : 8 , HARD _LIGHT : 9 , SOFT _LIGHT : 10 , DIFFERENCE : 11 , EXCLUSION : 12 , HUE : 13 , SATURATION : 14 , COLOR : 15 , LUMINOSITY : 16 } , b . scaleModes = { DEFAULT : 0 , LINEAR : 0 , NEAREST : 1 } , b . _UID = 0 , "undefined" != typeof Float32Array ? ( b . Float32Array = Float32Array , b . Uint16Array = Uint16Array ) : ( b . Float32Array = Array , b . Uint16Array = Array ) , b . INTERACTION _FREQUENCY = 30 , b . AUTO _PREVENT _DEFAULT = ! 0 , b . RAD _TO _DEG = 180 / Math . PI , b . DEG _TO _RAD = Math . PI / 180 , b . dontSayHello = ! 1 , b . sayHello = function ( a ) { if ( ! b . dontSayHello ) { if ( navigator . userAgent . toLowerCase ( ) . indexOf ( "chrome" ) > - 1 ) { var c = [ "%c %c %c Pixi.js " + b . VERSION + " - " + a + " %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ " , "background: #ff66a5" , "background: #ff66a5" , "color: #ff66a5; background: #030307;" , "background: #ff66a5" , "background: #ffc3dc" , "background: #ff66a5" , "color: #ff2424; background: #fff" , "color: #ff2424; background: #fff" , "color: #ff2424; background: #fff" ] ; console . log . apply ( console , c ) } else window . console && console . log ( "Pixi.js " + b . VERSION + " - http://www.pixijs.com/" ) ; b . dontSayHello = ! 0 } } , b . Matrix = function ( ) { this . a = 1 , this . b = 0 , this . c = 0 , this . d = 1 , this . tx = 0 , this . ty = 0 } , b . Matrix . prototype . fromArray = function ( a ) { this . a = a [ 0 ] , this . b = a [ 1 ] , this . c = a [ 3 ] , this . d = a [ 4 ] , this . tx = a [ 2 ] , this . ty = a [ 5 ] } , b . Matrix . prototype . toArray = function ( a ) { this . array || ( this . array = new Float32Array ( 9 ) ) ; var b = this . array ; return a ? ( b [ 0 ] = this . a , b [ 1 ] = this . c , b [ 2 ] = 0 , b [ 3 ] = this . b , b [ 4 ] = this . d , b [ 5 ] = 0 , b [ 6 ] = this . tx , b [ 7 ] = this . ty , b [ 8 ] = 1 ) : ( b [ 0 ] = this . a , b [ 1 ] = this . b , b [ 2 ] = this . tx , b [ 3 ] = this . c , b [ 4 ] = this . d , b [ 5 ] = this . ty , b [ 6 ] = 0 , b [ 7 ] = 0 , b [ 8 ] = 1 ) , b } , b . Matrix . prototype . apply = function ( a , c ) { return c = c || new b . Point , c . x = this . a * a . x + this . b * a . y + this . tx , c . y = this . c * a . x + this . d * a . y + this . ty , c } , b . Matrix . prototype . applyInverse = function ( a , c ) { c = c || new b . Point ; var d = 1 / ( this . a * this . d + this . b * - this . c ) ; return c . x = this . d * d * a . x - this . b * d * a . y + ( this . ty * this . b - this . tx * this . d ) * d , c . y = this . a * d * a . y - this . c * d * a . x + ( this . tx * this . c - this . ty * this . a ) * d , c } , b . identityMatrix = new b . Matrix , b . determineMatrixArrayType = function ( ) { return "undefined" != typeof Float32Array ? Float32Array : Array } , b . Matrix2 = b . determineMatrixArrayType ( ) , b . DisplayObject = function ( ) { this . position = new b . Point , this . scale = new b . Point ( 1 , 1 ) , this . pivot = new b . Point ( 0 , 0 ) , this . rotation = 0 , this . alpha = 1 , this . visible = ! 0 , this . hitArea = null , this . buttonMode = ! 1 , this . renderable = ! 1 , this . parent = null , this . stage = null , this . worldAlpha = 1 , this . _interactive = ! 1 , this . defaultCursor = "pointer" , this . worldTransform = new b . Matrix , this . color = [ ] , this . dynamic = ! 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 . setInteractive = function ( a ) { this . interactive = a } , Object . defineProperty ( b . DisplayObject . prototype , "interactive" , { get : function ( ) { return this . _interactive } , set : function ( a ) { this . _interactive = a , this . stage && ( this . stage . dirty = ! 0 ) } } ) , 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 ( ) { this . rotation !== this . rotationCache && ( this . rotationCache = this . rotation , this . _sr = Math . sin ( this . rotation ) , this . _cr = Math . cos (
} , b . PixiShader . prototype . destroy = function ( ) { this . gl . deleteProgram ( this . program ) , this . uniforms = null , this . gl = null , this . attributes = null } , b . PixiShader . defaultVertexSrc = [ "attribute vec2 aVertexPosition;" , "attribute vec2 aTextureCoord;" , "attribute vec2 aColor;" , "uniform vec2 projectionVector;" , "uniform vec2 offsetVector;" , "varying vec2 vTextureCoord;" , "varying vec4 vColor;" , "const vec2 center = vec2(-1.0, 1.0);" , "void main(void) {" , " gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);" , " vTextureCoord = aTextureCoord;" , " vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;" , " vColor = vec4(color * aColor.x, aColor.x);" , "}" ] , b . PixiFastShader = function ( a ) { this . _UID = b . _UID ++ , this . gl = a , this . program = null , this . fragmentSrc = [ "precision lowp float;" , "varying vec2 vTextureCoord;" , "varying float vColor;" , "uniform sampler2D uSampler;" , "void main(void) {" , " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;" , "}" ] , this . vertexSrc = [ "attribute vec2 aVertexPosition;" , "attribute vec2 aPositionCoord;" , "attribute vec2 aScale;" , "attribute float aRotation;" , "attribute vec2 aTextureCoord;" , "attribute float aColor;" , "uniform vec2 projectionVector;" , "uniform vec2 offsetVector;" , "uniform mat3 uMatrix;" , "varying vec2 vTextureCoord;" , "varying float vColor;" , "const vec2 center = vec2(-1.0, 1.0);" , "void main(void) {" , " vec2 v;" , " vec2 sv = aVertexPosition * aScale;" , " v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);" , " v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);" , " v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;" , " gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);" , " vTextureCoord = aTextureCoord;" , " vColor = aColor;" , "}" ] , this . textureCount = 0 , this . init ( ) } , b . PixiFastShader . prototype . init = function ( ) { var a = this . gl , c = b . compileProgram ( a , this . vertexSrc , this . fragmentSrc ) ; a . useProgram ( c ) , this . uSampler = a . getUniformLocation ( c , "uSampler" ) , this . projectionVector = a . getUniformLocation ( c , "projectionVector" ) , this . offsetVector = a . getUniformLocation ( c , "offsetVector" ) , this . dimensions = a . getUniformLocation ( c , "dimensions" ) , this . uMatrix = a . getUniformLocation ( c , "uMatrix" ) , this . aVertexPosition = a . getAttribLocation ( c , "aVertexPosition" ) , this . aPositionCoord = a . getAttribLocation ( c , "aPositionCoord" ) , this . aScale = a . getAttribLocation ( c , "aScale" ) , this . aRotation = a . getAttribLocation ( c , "aRotation" ) , this . aTextureCoord = a . getAttribLocation ( c , "aTextureCoord" ) , this . colorAttribute = a . getAttribLocation ( c , "aColor" ) , - 1 === this . colorAttribute && ( this . colorAttribute = 2 ) , this . attributes = [ this . aVertexPosition , this . aPositionCoord , this . aScale , this . aRotation , this . aTextureCoord , this . colorAttribute ] , this . program = c } , b . PixiFastShader . prototype . destroy = function ( ) { this . gl . deleteProgram ( this . program ) , this . uniforms = null , this . gl = null , this . attributes = null } , b . StripShader = function ( a ) { this . _UID = b . _UID ++ , this . gl = a , this . program = null , this . fragmentSrc = [ "precision mediump float;" , "varying vec2 vTextureCoord;" , "uniform float alpha;" , "uniform sampler2D uSampler;" , "void main(void) {" , " gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));" , "}" ] , this . vertexSrc = [ "attribute vec2 aVertexPosition;" , "attribute vec2 aTextureCoord;" , "uniform mat3 translationMatrix;" , "uniform vec2 projectionVector;" , "uniform vec2 offsetVector;" , "varying vec2 vTextureCoord;" , "void main(void) {" , " vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);" , " v -= offsetVector.xyx;" , " gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);" , " vTextureCoord = aTextureCoord;" , "}" ] , this . init ( ) } , b . StripShader . prototype . init = function ( ) { var a = this . gl , c = b . compileProgram ( a , this . vertexSrc , this . fragmentSrc ) ; a . useProgram ( c ) , this . uSampler = a . getUniformLocation ( c , "uSampler" ) , this . projectionVector = a . getUniformLocation ( c , "projectionVector" ) , this . offsetVector = a . getUniformLocation ( c , "offsetVector" ) , this . colorAttribute = a . getAttribLocation ( c , "aColor" ) , this . aVertexPosition = a . getAttribLocation ( c , "aVertexPosition" ) , this . aTextureCoord = a . getAttribLocation ( c , " aTextureCoord
} , b . WebGLSpriteBatch . prototype . flush = function ( ) { if ( 0 !== this . currentBatchSize ) { var a = this . gl ; if ( this . renderSession . shaderManager . setShader ( this . renderSession . shaderManager . defaultShader ) , this . dirty ) { this . dirty = ! 1 , a . activeTexture ( a . TEXTURE0 ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) ; var b = this . renderSession . projection ; a . uniform2f ( this . shader . projectionVector , b . x , b . y ) ; var c = 4 * this . vertSize ; a . vertexAttribPointer ( this . shader . aVertexPosition , 2 , a . FLOAT , ! 1 , c , 0 ) , a . vertexAttribPointer ( this . shader . aTextureCoord , 2 , a . FLOAT , ! 1 , c , 8 ) , a . vertexAttribPointer ( this . shader . colorAttribute , 2 , a . FLOAT , ! 1 , c , 16 ) } if ( this . currentBatchSize > . 5 * this . size ) a . bufferSubData ( a . ARRAY _BUFFER , 0 , this . vertices ) ; else { var d = this . vertices . subarray ( 0 , 4 * this . currentBatchSize * this . vertSize ) ; a . bufferSubData ( a . ARRAY _BUFFER , 0 , d ) } for ( var e , f , g = 0 , h = 0 , i = null , j = this . renderSession . blendModeManager . currentBlendMode , k = 0 , l = this . currentBatchSize ; l > k ; k ++ ) e = this . textures [ k ] , f = this . blendModes [ k ] , ( i !== e || j !== f ) && ( this . renderBatch ( i , g , h ) , h = k , g = 0 , i = e , j = f , this . renderSession . blendModeManager . setBlendMode ( j ) ) , g ++ ; this . renderBatch ( i , g , h ) , this . currentBatchSize = 0 } } , b . WebGLSpriteBatch . prototype . renderBatch = function ( a , c , d ) { if ( 0 !== c ) { var e = this . gl ; e . bindTexture ( e . TEXTURE _2D , a . _glTextures [ e . id ] || b . createWebGLTexture ( a , e ) ) , a . _dirty [ e . id ] && b . updateWebGLTexture ( this . currentBaseTexture , e ) , e . drawElements ( e . TRIANGLES , 6 * c , e . UNSIGNED _SHORT , 6 * d * 2 ) , this . renderSession . drawCount ++ } } , b . WebGLSpriteBatch . prototype . stop = function ( ) { this . flush ( ) } , b . WebGLSpriteBatch . prototype . start = function ( ) { this . dirty = ! 0 } , b . WebGLSpriteBatch . prototype . destroy = function ( ) { this . vertices = null , this . indices = null , this . gl . deleteBuffer ( this . vertexBuffer ) , this . gl . deleteBuffer ( this . indexBuffer ) , this . currentBaseTexture = null , this . gl = null } , b . WebGLFastSpriteBatch = function ( a ) { this . vertSize = 10 , this . maxSize = 6e3 , this . size = this . maxSize ; var b = 4 * this . size * this . vertSize , c = 6 * this . maxSize ; this . vertices = new Float32Array ( b ) , this . indices = new Uint16Array ( c ) , this . vertexBuffer = null , this . indexBuffer = null , this . lastIndexCount = 0 ; for ( var d = 0 , e = 0 ; c > d ; d += 6 , e += 4 ) this . indices [ d + 0 ] = e + 0 , this . indices [ d + 1 ] = e + 1 , this . indices [ d + 2 ] = e + 2 , this . indices [ d + 3 ] = e + 0 , this . indices [ d + 4 ] = e + 2 , this . indices [ d + 5 ] = e + 3 ; this . drawing = ! 1 , this . currentBatchSize = 0 , this . currentBaseTexture = null , this . currentBlendMode = 0 , this . renderSession = null , this . shader = null , this . matrix = null , this . setContext ( a ) } , b . WebGLFastSpriteBatch . prototype . setContext = function ( a ) { this . gl = a , this . vertexBuffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , this . indices , a . STATIC _DRAW ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . vertices , a . DYNAMIC _DRAW ) } , b . WebGLFastSpriteBatch . prototype . begin = function ( a , b ) { this . renderSession = b , this . shader = this . renderSession . shaderManager . fastShader , this . matrix = a . worldTransform . toArray ( ! 0 ) , this . start ( ) } , b . WebGLFastSpriteBatch . prototype . end = function ( ) { this . flush ( ) } , b . WebGLFastSpriteBatch . prototype . render = function ( a ) { var b = a . children , c = b [ 0 ] ; if ( c . texture . _uvs ) { this . currentBaseTexture = c . texture . baseTexture , c . blendMode !== this . renderSession . blendModeManager . currentBlendMode && ( this . flush ( ) , this . renderSession . blendModeManager . setBlendMode ( c . blendMode ) ) ; for ( var d = 0 , e = b . length ; e > d ; d ++ ) this . renderSprite ( b [ d ] ) ; this . flush ( ) } } , b . WebGLFastSpriteBatch . prototype . renderSprite = function ( a ) { if ( a . visible && ( a . texture . baseTexture === this . currentBaseTexture || ( this . flush ( ) , this . currentBaseTexture = a . texture . baseTexture , a . texture . _uvs ) ) ) { var b , c , d , e , f , g , h , i , j = this . vertices ; if ( b = a . texture . _uvs , c = a . texture . frame . width , d = a . texture . frame . height , a . texture . trim ) { var k = a . texture . trim ; f = k . x - a . anchor . x * k . width , e = f + a . texture . crop . width , h = k . y - a . anchor . y * k . height , g = h + a . texture . crop . height } else e = a . texture . frame . width * ( 1 - a . anchor . x ) , f = a . texture . frame . width * - a . anchor . x , g = a . texture . frame . height * ( 1 - a . anchor . y ) , h = a . texture . frame . height * - a . anchor . y ; i = 4 * this . currentBatchSize * this . vertSize , j [ i ++ ] = f , j [ i ++ ] = h , j [ i ++ ] = a . position . x , j [ i ++ ] = a . position . y , j [ i ++ ] = a . scale . x , j [ i ++
2014-10-09 15:16:41 +00:00
} } , b . Graphics . prototype . _renderCanvas = function ( a ) { if ( this . visible !== ! 1 && 0 !== this . alpha && this . isMask !== ! 0 ) { var c = a . context , d = this . worldTransform ; this . blendMode !== a . currentBlendMode && ( a . currentBlendMode = this . blendMode , c . globalCompositeOperation = b . blendModesCanvas [ a . currentBlendMode ] ) , this . _mask && a . maskManager . pushMask ( this . _mask , a . context ) , c . setTransform ( d . a , d . c , d . b , d . d , d . tx , d . ty ) , b . CanvasGraphics . renderGraphics ( this , c ) ; for ( var e = 0 , f = this . children . length ; f > e ; e ++ ) this . children [ e ] . _renderCanvas ( a ) ; this . _mask && a . maskManager . popMask ( a . context ) } } , b . Graphics . prototype . getBounds = function ( a ) { this . bounds || this . updateBounds ( ) ; var b = this . bounds . x , c = this . bounds . width + this . bounds . x , d = this . bounds . y , e = this . bounds . height + this . bounds . y , f = a || this . worldTransform , g = f . a , h = f . c , i = f . b , j = f . d , k = f . tx , l = f . ty , m = g * c + i * e + k , n = j * e + h * c + l , o = g * b + i * e + k , p = j * e + h * b + l , q = g * b + i * d + k , r = j * d + h * b + l , s = g * c + i * d + k , t = j * d + h * c + l , u = m , v = n , w = m , x = n ; w = w > o ? o : w , w = w > q ? q : w , w = w > s ? s : w , x = x > p ? p : x , x = x > r ? r : x , x = x > t ? t : x , u = o > u ? o : u , u = q > u ? q : u , u = s > u ? s : u , v = p > v ? p : v , v = r > v ? r : v , v = t > v ? t : v ; var y = this . _bounds ; return y . x = w , y . width = u - w , y . y = x , y . height = v - x , y } , b . Graphics . prototype . updateBounds = function ( ) { for ( var a , c , d , e , f , g = 1 / 0 , h = - 1 / 0 , i = 1 / 0 , j = - 1 / 0 , k = 0 ; k < this . graphicsData . length ; k ++ ) { var l = this . graphicsData [ k ] , m = l . type , n = l . lineWidth ; if ( a = l . points , m === b . Graphics . RECT ) c = a [ 0 ] - n / 2 , d = a [ 1 ] - n / 2 , e = a [ 2 ] + n , f = a [ 3 ] + n , g = g > c ? c : g , h = c + e > h ? c + e : h , i = i > d ? c : i , j = d + f > j ? d + f : j ; else if ( m === b . Graphics . CIRC || m === b . Graphics . ELIP ) c = a [ 0 ] , d = a [ 1 ] , e = a [ 2 ] + n / 2 , f = a [ 3 ] + n / 2 , g = g > c - e ? c - e : g , h = c + e > h ? c + e : h , i = i > d - f ? d - f : i , j = d + f > j ? d + f : j ; else for ( var o = 0 ; o < a . length ; o += 2 ) c = a [ o ] , d = a [ o + 1 ] , g = g > c - n ? c - n : g , h = c + n > h ? c + n : h , i = i > d - n ? d - n : i , j = d + n > j ? d + n : j } var p = this . boundsPadding ; this . bounds = new b . Rectangle ( g - p , i - p , h - g + 2 * p , j - i + 2 * p ) } , b . Graphics . prototype . _generateCachedSprite = function ( ) { var a = this . getLocalBounds ( ) ; if ( this . _cachedSprite ) this . _cachedSprite . buffer . resize ( a . width , a . height ) ; else { var c = new b . CanvasBuffer ( a . width , a . height ) , d = b . Texture . fromCanvas ( c . canvas ) ; this . _cachedSprite = new b . Sprite ( d ) , this . _cachedSprite . buffer = c , this . _cachedSprite . worldTransform = this . worldTransform } this . _cachedSprite . anchor . x = - ( a . x / a . width ) , this . _cachedSprite . anchor . y = - ( a . y / a . height ) , this . _cachedSprite . buffer . context . translate ( - a . x , - a . y ) , b . CanvasGraphics . renderGraphics ( this , this . _cachedSprite . buffer . context ) , this . _cachedSprite . alpha = this . alpha } , b . Graphics . prototype . destroyCachedSprite = function ( ) { this . _cachedSprite . texture . destroy ( ! 0 ) , this . _cachedSprite = null } , b . Graphics . POLY = 0 , b . Graphics . RECT = 1 , b . Graphics . CIRC = 2 , b . Graphics . ELIP = 3 , b . Graphics . RREC = 4 , b . Strip = function ( a ) { b . DisplayObjectContainer . call ( this ) , this . texture = a , this . uvs = new b . Float32Array ( [ 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 ] ) , this . verticies = new b . Float32Array ( [ 0 , 0 , 100 , 0 , 100 , 100 , 0 , 100 ] ) , this . colors = new b . Float32Array ( [ 1 , 1 , 1 , 1 ] ) , this . indices = new b . Uint16Array ( [ 0 , 1 , 2 , 3 ] ) , this . dirty = ! 0 , this . padding = 0 } , b . Strip . prototype = Object . create ( b . DisplayObjectContainer . prototype ) , b . Strip . prototype . constructor = b . Strip , b . Strip . prototype . _renderWebGL = function ( a ) { ! this . visible || this . alpha <= 0 || ( a . spriteBatch . stop ( ) , this . _vertexBuffer || this . _initWebGL ( a ) , a . shaderManager . setShader ( a . shaderManager . stripShader ) , this . _renderStrip ( a ) , a . spriteBatch . start ( ) ) } , b . Strip . prototype . _initWebGL = function ( a ) { var b = a . gl ; this . _vertexBuffer = b . createBuffer ( ) , this . _indexBuffer = b . createBuffer ( ) , this . _uvBuffer = b . createBuffer ( ) , this . _colorBuffer = b . createBuffer ( ) , b . bindBuffer ( b . ARRAY _BUFFER , this . _vertexBuffer ) , b . bufferData ( b . ARRAY _BUFFER , this . verticies , b . DYNAMIC _DRAW ) , b . bindBuffer ( b . ARRAY _BUFFER , this . _uvBuffer ) , b . bufferData ( b . ARRAY _BUFFER , this . uvs , b . STATIC _DRAW ) , b . bindBuffer ( b . ARRAY _BUFFER , this . _colorBuffer ) , b . bufferData ( b . ARRAY _BUFFER , this . colors , b . STATIC _DRAW ) , b . bindBuffer ( b . ELEMENT _ARRAY _BUFFER , this . _indexBuffer ) , b . bufferData ( b . ELEMENT _ARRAY _BUFFER , this . indices , b . STATIC _DRAW ) } , b . Strip . prototype . _renderStrip = function ( a ) { var c = a . gl , d = a . projection , e = a . offset , f = a . shaderManager . stripShader ; c . blendFunc ( c . ONE , c . ONE _MINUS _SRC _ALPHA ) , c . uniformMatrix3fv ( f . translationMatrix , ! 1 , this . worldTransform . toArray ( ! 0 ) ) , c . uniform2f ( f . projectionVector , d . x , - d . y ) , c . uniform2f ( f . offsetVector , - e . x , - e . y ) , c . uniform1f ( f . alpha , 1 )
var d = a . length ; if ( 1 > d ) throw new Error ( "Phaser.Point. Parameter 'points' array must not be empty" ) ; if ( 1 === d ) return c . copyFrom ( a [ 0 ] ) , c ; for ( var e = 0 ; d > e ; e ++ ) b . Point . add ( c , a [ e ] , c ) ; return c . divide ( d , d ) , c } , b . Point . parse = function ( a , c , d ) { c = c || "x" , d = d || "y" ; var e = new b . Point ; return a [ c ] && ( e . x = parseInt ( a [ c ] , 10 ) ) , a [ d ] && ( e . y = parseInt ( a [ d ] , 10 ) ) , e } , PIXI . Point = b . Point , b . Rectangle = function ( a , b , c , d ) { a = a || 0 , b = b || 0 , c = c || 0 , d = d || 0 , this . x = a , this . y = b , this . width = c , this . height = d } , b . Rectangle . prototype = { offset : function ( a , b ) { return this . x += a , this . y += b , this } , offsetPoint : function ( a ) { return this . offset ( a . x , a . y ) } , setTo : function ( a , b , c , d ) { return this . x = a , this . y = b , this . width = c , this . height = d , this } , centerOn : function ( a , b ) { return this . centerX = a , this . centerY = b , this } , floor : function ( ) { this . x = Math . floor ( this . x ) , this . y = Math . floor ( this . y ) } , floorAll : function ( ) { this . x = Math . floor ( this . x ) , this . y = Math . floor ( this . y ) , this . width = Math . floor ( this . width ) , this . height = Math . floor ( this . height ) } , copyFrom : function ( a ) { return this . setTo ( a . x , a . y , a . width , a . height ) } , copyTo : function ( a ) { return a . x = this . x , a . y = this . y , a . width = this . width , a . height = this . height , a } , inflate : function ( a , c ) { return b . Rectangle . inflate ( this , a , c ) } , size : function ( a ) { return b . Rectangle . size ( this , a ) } , clone : function ( a ) { return b . Rectangle . clone ( this , a ) } , contains : function ( a , c ) { return b . Rectangle . contains ( this , a , c ) } , containsRect : function ( a ) { return b . Rectangle . containsRect ( a , this ) } , equals : function ( a ) { return b . Rectangle . equals ( this , a ) } , intersection : function ( a , c ) { return b . Rectangle . intersection ( this , a , c ) } , intersects : function ( a , c ) { return b . Rectangle . intersects ( this , a , c ) } , intersectsRaw : function ( a , c , d , e , f ) { return b . Rectangle . intersectsRaw ( this , a , c , d , e , f ) } , union : function ( a , c ) { return b . Rectangle . union ( this , a , c ) } , toString : function ( ) { return "[{Rectangle (x=" + this . x + " y=" + this . y + " width=" + this . width + " height=" + this . height + " empty=" + this . empty + ")}]" } } , Object . defineProperty ( b . Rectangle . prototype , "halfWidth" , { get : function ( ) { return Math . round ( this . width / 2 ) } } ) , Object . defineProperty ( b . Rectangle . prototype , "halfHeight" , { get : function ( ) { return Math . round ( this . height / 2 ) } } ) , Object . defineProperty ( b . Rectangle . prototype , "bottom" , { get : function ( ) { return this . y + this . height } , set : function ( a ) { this . height = a <= this . y ? 0 : a - this . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "bottomRight" , { get : function ( ) { return new b . Point ( this . right , this . bottom ) } , set : function ( a ) { this . right = a . x , this . bottom = a . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "left" , { get : function ( ) { return this . x } , set : function ( a ) { this . width = a >= this . right ? 0 : this . right - a , this . x = a } } ) , Object . defineProperty ( b . Rectangle . prototype , "right" , { get : function ( ) { return this . x + this . width } , set : function ( a ) { this . width = a <= this . x ? 0 : a - this . x } } ) , Object . defineProperty ( b . Rectangle . prototype , "volume" , { get : function ( ) { return this . width * this . height } } ) , Object . defineProperty ( b . Rectangle . prototype , "perimeter" , { get : function ( ) { return 2 * this . width + 2 * this . height } } ) , Object . defineProperty ( b . Rectangle . prototype , "centerX" , { get : function ( ) { return this . x + this . halfWidth } , set : function ( a ) { this . x = a - this . halfWidth } } ) , Object . defineProperty ( b . Rectangle . prototype , "centerY" , { get : function ( ) { return this . y + this . halfHeight } , set : function ( a ) { this . y = a - this . halfHeight } } ) , Object . defineProperty ( b . Rectangle . prototype , "randomX" , { get : function ( ) { return this . x + Math . random ( ) * this . width } } ) , Object . defineProperty ( b . Rectangle . prototype , "randomY" , { get : function ( ) { return this . y + Math . random ( ) * this . height } } ) , Object . defineProperty ( b . Rectangle . prototype , "top" , { get : function ( ) { return this . y } , set : function ( a ) { a >= this . bottom ? ( this . height = 0 , this . y = a ) : this . height = this . bottom - a } } ) , Object . defineProperty ( b . Rectangle . prototype , "topLeft" , { get : function ( ) { return new b . Point ( this . x , this . y ) } , set : function ( a ) { this . x = a . x , this . y = a . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "topRight" , { get : function ( ) { return new b . Point ( this . x + this . width , this . y ) } , set : function ( a ) { this . right = a . x , this . y = a . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "empty" , { get : function ( ) { return ! this . width || ! this . height } , set : function ( a ) { a === ! 0 && this . setTo ( 0 , 0 , 0 , 0 ) } } ) , b . Rectangle . prototype . constructor = b . Rectangle , b . Rectangle . i
} , 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 } } , b . PluginManager . prototype . constructor = b . PluginManager , b . Stage = function ( a ) { this . game = a , PIXI . Stage . call ( this , 0 ) , this . name = "_stage_root" , this . interactive = ! 1 , this . disableVisibilityChange = ! 1 , this . exists = ! 0 , this . currentRenderOrderID = 0 , this . _hiddenVar = "hidden" , this . _backgroundColor = 0 , a . config && this . parseConfig ( a . config ) } , b . Stage . prototype = Object . create ( PIXI . Stage . prototype ) , b . Stage . prototype . constructor = b . Stage , b . Stage . prototype . parseConfig = function ( a ) { a . disableVisibilityChange && ( this . disableVisibilityChange = a . disableVisibilityChange ) , a . backgroundColor && ( this . backgroundColor = a . backgroundColor ) } , b . Stage . prototype . boot = function ( ) { b . Canvas . getOffset ( this . game . canvas , this . offset ) ; var a = this ; this . _onChange = function ( b ) { return a . visibilityChange ( b ) } , b . Canvas . setUserSelect ( this . game . canvas , "none" ) , b . Canvas . setTouchAction ( this . game . canvas , "none" ) , this . checkVisibility ( ) } , b . Stage . prototype . preUpdate = function ( ) { this . currentRenderOrderID = 0 ; for ( var a = this . children . length , b = 0 ; a > b ; b ++ ) this . children [ b ] . preUpdate ( ) } , b . Stage . prototype . update = function ( ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . update ( ) } , b . Stage . prototype . postUpdate = function ( ) { if ( this . game . world . camera . target ) { this . game . world . camera . target . postUpdate ( ) , this . game . world . camera . update ( ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] !== this . game . world . camera . target && this . children [ a ] . postUpdate ( ) } else { this . game . world . camera . update ( ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] . postUpdate ( ) } } , b . Stage . prototype . checkVisibility = function ( ) { this . _hiddenVar = void 0 !== document . webkitHidden ? "webkitvisibilitychange" : void 0 !== document . mozHidden ? "mozvisibilitychange" : void 0 !== document . msHidden ? "msvisibilitychange" : void 0 !== document . hidden ? "visibilitychange" : null , this . _hiddenVar && document . addEventListener ( this . _hiddenVar , this . _onChange , ! 1 ) , window . onpagehide = this . _onChange , window . onpageshow = this . _onChange , window . onblur = this . _onChange , window . onfocus = this . _onChange ; var a = this ; this . game . device . cocoonJSApp && ( CocoonJS . App . onSuspended . addEventListener ( function ( ) { b . Stage . prototype . visibilityChange . call ( a , { type : "pause" } ) } ) , CocoonJS . App . onActivated . addEventListener ( function ( ) { b . Stage . prototype . visibilityChange . call ( a , { type : "resume" } ) } ) ) } , b . Stage . prototype . visibilityChange = function ( a ) { return "pagehide" === a . type || "blur" === a . type || "pageshow" === a . type || "focus" === a . type ? void ( "pagehide" === a . type || "blur" === a . type ? this . game . focusLoss ( a ) : ( "pageshow" === a . type || "focus" === a . type ) && this . game . focusGain ( a ) ) : void ( this . disableVisibilityChange || ( document . hidden || document . mozHidden || document . msHidden || document . webkitHidden || "pause" === a . type ? this . game . gamePaused ( a ) : this . game . gameResumed ( a ) ) ) } , b . Stage . prototype . setBackgroundColor = function ( a ) { if ( "string" == typeof a ) { var c = b . Color . hexToColor ( a ) ; this . _backgroundColor = b . Color . getColor ( c . r , c . g , c . b ) } else { var c = b . Color . getRGB ( a ) ; this . _backgroundColor = a } this . backgroundColorSplit = [ c . r / 255 , c . g / 255 , c . b / 255 ] , this . backgroundColorString = b . Color . RGBtoString ( c . r , c . g , c . b , 255 , "#" ) } , b . Stage . prototype . destroy = function ( ) { this . _hiddenVar && document . removeEventListener ( this . _hiddenVar , this . _onChange , ! 1 ) , window . onpagehide = null , window . onpageshow = null , window . onblur = null , window . onfocus = null } , Object . defineProperty ( b . Stage . prototype , "backgroundColor" , { get : function ( ) { return this . _backgroundColor } , set : function ( a ) { this . game . transparent || this . setBackgroundColor ( a ) } } ) , Object . defineProperty ( b . Stage . prototype , "smoothed" , { get : function ( ) { ret
} , reset : function ( a ) { a && this . grid . reset ( ) } , setMaximum : function ( ) { this . width = window . innerWidth , this . height = window . innerHeight } , setShowAll : function ( ) { var a = Math . min ( window . innerHeight / this . game . height , window . innerWidth / this . game . width ) ; this . width = Math . round ( this . game . width * a ) , this . height = Math . round ( this . game . height * a ) } , setExactFit : function ( ) { var a = window . innerWidth , b = window . innerHeight ; this . width = this . maxWidth && a > this . maxWidth ? this . maxWidth : a , this . height = this . maxHeight && b > this . maxHeight ? this . maxHeight : b } , startFullScreen : function ( a ) { ! this . isFullScreen && this . game . device . fullscreen && ( "undefined" != typeof a && this . game . renderType === b . CANVAS && ( this . game . stage . smoothed = a ) , this . _width = this . width , this . _height = this . height , this . game . device . fullscreenKeyboard ? this . fullScreenTarget [ this . game . device . requestFullscreen ] ( Element . ALLOW _KEYBOARD _INPUT ) : this . fullScreenTarget [ this . game . device . requestFullscreen ] ( ) ) } , stopFullScreen : function ( ) { document [ this . game . device . cancelFullscreen ] ( ) } , fullScreenChange : function ( a ) { this . event = a , this . isFullScreen ? ( this . fullScreenScaleMode === b . ScaleManager . EXACT _FIT ? ( this . fullScreenTarget . style . width = "100%" , this . fullScreenTarget . style . height = "100%" , this . width = window . outerWidth , this . height = window . outerHeight , this . game . input . scale . setTo ( this . game . width / this . width , this . game . height / this . height ) , this . aspectRatio = this . width / this . height , this . scaleFactor . x = this . game . width / this . width , this . scaleFactor . y = this . game . height / this . height , this . checkResize ( ) ) : this . fullScreenScaleMode === b . ScaleManager . SHOW _ALL && ( this . setShowAll ( ) , this . refresh ( ) ) , this . enterFullScreen . dispatch ( this . width , this . height ) ) : ( this . fullScreenTarget . style . width = this . game . width + "px" , this . fullScreenTarget . style . height = this . game . height + "px" , this . width = this . _width , this . height = this . _height , this . game . input . scale . setTo ( this . game . width / this . width , this . game . height / this . height ) , this . aspectRatio = this . width / this . height , this . scaleFactor . x = this . game . width / this . width , this . scaleFactor . y = this . game . height / this . height , this . leaveFullScreen . dispatch ( this . width , this . height ) ) } , destroy : function ( ) { window . removeEventListener ( "orientationchange" , this . _checkOrientation , ! 1 ) , window . removeEventListener ( "resize" , this . _checkResize , ! 1 ) , this . game . device . cocoonJS || ( document . removeEventListener ( "webkitfullscreenchange" , this . _fullScreenChange , ! 1 ) , document . removeEventListener ( "mozfullscreenchange" , this . _fullScreenChange , ! 1 ) , document . removeEventListener ( "fullscreenchange" , this . _fullScreenChange , ! 1 ) ) } } , b . ScaleManager . prototype . constructor = b . ScaleManager , Object . defineProperty ( b . ScaleManager . prototype , "scaleMode" , { get : function ( ) { return this . _scaleMode } , set : function ( a ) { a !== this . _scaleMode && ( this . _scaleMode = a ) } } ) , Object . defineProperty ( b . ScaleManager . prototype , "isFullScreen" , { get : function ( ) { return document . fullscreenElement || document . mozFullScreenElement || document . webkitFullscreenElement } } ) , Object . defineProperty ( b . ScaleManager . prototype , "isPortrait" , { get : function ( ) { return 0 === this . orientation || 180 === this . orientation } } ) , Object . defineProperty ( b . ScaleManager . prototype , "isLandscape" , { get : function ( ) { return 90 === this . orientation || - 90 === this . orientation } } ) , b . Game = function ( a , c , d , e , f , g , h , i ) { this . id = b . GAMES . push ( this ) - 1 , this . config = null , this . physicsConfig = i , this . parent = "" , this . width = 800 , this . height = 600 , this . transparent = ! 1 , this . antialias = ! 0 , this . preserveDrawingBuffer = ! 1 , this . renderer = null , this . renderType = b . AUTO , this . state = null , this . isBooted = ! 1 , this . isRunning = ! 1 , this . raf = null , this . add = null , this . make = null , this . cache = null , this . input = null , this . load = null , this . math = null , this . net = null , this . scale = null , this . sound = null , this . stage = null , this . time = null , this . tweens = null , this . world = null , this . physics = null , this . rnd = null , this . device = null , this . camera = null , this . canvas = null , this . context = null , this . debug = null , this . particles = null , this . stepping = ! 1 , this . pendingStep = ! 1 , this . stepCount = 0 , this . onPause = null , this . onResume = null , this . onBlur = null , this . onFocus = null , this . _paused = ! 1 , this . _codePaused = ! 1 , this . _width = 800 , this . _height = 600 , 1 === arguments . length && "object" == typeof arguments [ 0 ] ? this . parseConfig ( arguments [ 0 ] ) : ( this . config = { enableDebug : ! 0 } , " undef
this . game . device . mspointer && ( this . _onMSPointerDown = function ( b ) { return a . onPointerDown ( b ) } , this . _onMSPointerMove = function ( b ) { return a . onPointerMove ( b ) } , this . _onMSPointerUp = function ( b ) { return a . onPointerUp ( b ) } , this . game . canvas . addEventListener ( "MSPointerDown" , this . _onMSPointerDown , ! 1 ) , this . game . canvas . addEventListener ( "MSPointerMove" , this . _onMSPointerMove , ! 1 ) , this . game . canvas . addEventListener ( "MSPointerUp" , this . _onMSPointerUp , ! 1 ) , this . game . canvas . addEventListener ( "pointerDown" , this . _onMSPointerDown , ! 1 ) , this . game . canvas . addEventListener ( "pointerMove" , this . _onMSPointerMove , ! 1 ) , this . game . canvas . addEventListener ( "pointerUp" , this . _onMSPointerUp , ! 1 ) , this . game . canvas . style [ "-ms-content-zooming" ] = "none" , this . game . canvas . style [ "-ms-touch-action" ] = "none" ) } } , onPointerDown : function ( a ) { this . game . input . disabled || this . disabled || ( a . preventDefault ( ) , a . identifier = a . pointerId , this . game . input . startPointer ( a ) ) } , onPointerMove : function ( a ) { this . game . input . disabled || this . disabled || ( a . preventDefault ( ) , a . identifier = a . pointerId , this . game . input . updatePointer ( a ) ) } , onPointerUp : function ( a ) { this . game . input . disabled || this . disabled || ( a . preventDefault ( ) , a . identifier = a . pointerId , this . game . input . stopPointer ( a ) ) } , stop : function ( ) { this . game . canvas . removeEventListener ( "MSPointerDown" , this . _onMSPointerDown ) , this . game . canvas . removeEventListener ( "MSPointerMove" , this . _onMSPointerMove ) , this . game . canvas . removeEventListener ( "MSPointerUp" , this . _onMSPointerUp ) , this . game . canvas . removeEventListener ( "pointerDown" , this . _onMSPointerDown ) , this . game . canvas . removeEventListener ( "pointerMove" , this . _onMSPointerMove ) , this . game . canvas . removeEventListener ( "pointerUp" , this . _onMSPointerUp ) } } , b . MSPointer . prototype . constructor = b . MSPointer , b . Pointer = function ( a , c ) { this . game = a , this . id = c , this . type = b . POINTER , this . exists = ! 0 , this . identifier = 0 , this . pointerId = null , this . target = null , this . button = null , this . _holdSent = ! 1 , this . _history = [ ] , this . _nextDrop = 0 , this . _stateReset = ! 1 , this . withinGame = ! 1 , this . clientX = - 1 , this . clientY = - 1 , this . pageX = - 1 , this . pageY = - 1 , this . screenX = - 1 , this . screenY = - 1 , this . rawMovementX = 0 , this . rawMovementY = 0 , this . movementX = 0 , this . movementY = 0 , this . x = - 1 , this . y = - 1 , this . isMouse = ! 1 , this . isDown = ! 1 , this . isUp = ! 0 , this . timeDown = 0 , this . timeUp = 0 , this . previousTapTime = 0 , this . totalTouches = 0 , this . msSinceLastClick = Number . MAX _VALUE , this . targetObject = null , this . active = ! 1 , this . dirty = ! 1 , this . position = new b . Point , this . positionDown = new b . Point , this . positionUp = new b . Point , this . circle = new b . Circle ( 0 , 0 , 44 ) , 0 === c && ( this . isMouse = ! 0 ) } , b . Pointer . prototype = { start : function ( a ) { return a . pointerId && ( this . pointerId = a . pointerId ) , this . identifier = a . identifier , this . target = a . target , "undefined" != typeof a . button && ( this . button = a . button ) , this . _history = [ ] , this . active = ! 0 , this . withinGame = ! 0 , this . isDown = ! 0 , this . isUp = ! 1 , this . dirty = ! 1 , this . msSinceLastClick = this . game . time . now - this . timeDown , this . timeDown = this . game . time . now , this . _holdSent = ! 1 , this . move ( a , ! 0 ) , this . positionDown . setTo ( this . x , this . y ) , ( this . game . input . multiInputOverride === b . Input . MOUSE _OVERRIDES _TOUCH || this . game . input . multiInputOverride === b . Input . MOUSE _TOUCH _COMBINE || this . game . input . multiInputOverride === b . Input . TOUCH _OVERRIDES _MOUSE && 0 === this . game . input . currentPointers ) && ( this . game . input . x = this . x , this . game . input . y = this . y , this . game . input . position . setTo ( this . x , this . y ) , this . game . input . onDown . dispatch ( this , a ) , this . game . input . resetSpeed ( this . x , this . y ) ) , this . _stateReset = ! 1 , this . totalTouches ++ , this . isMouse || this . game . input . currentPointers ++ , null !== this . targetObject && this . targetObject . _touchedHandler ( this ) , this } , update : function ( ) { this . active && ( this . dirty && ( this . game . input . interactiveItems . total > 0 && this . processInteractiveObjects ( ! 0 ) , this . dirty = ! 1 ) , this . _holdSent === ! 1 && this . duration >= this . game . input . holdRate && ( ( this . game . input . multiInputOverride == b . Input . MOUSE _OVERRIDES _TOUCH || this . game . input . multiInputOverride == b . Input . MOUSE _TOUCH _COMBINE || this . game . input . multiInputOverride == b . Input . TOUCH _OVERRIDES _MOUSE && 0 === this . game . input . currentPointers ) && this . game . input . onHold . dispatch ( this ) , this . _holdSent = ! 0 ) , this . game . input . recordPointerHistory && this . game . time . now >= this . _nextDrop && ( this . _nextDrop = this .
} return this . consumePointerEvent } } , _releasedHandler : function ( a ) { null !== this . sprite && this . _pointerData [ a . id ] . isDown && a . isUp && ( this . _pointerData [ a . id ] . isDown = ! 1 , this . _pointerData [ a . id ] . isUp = ! 0 , this . _pointerData [ a . id ] . timeUp = this . game . time . now , this . _pointerData [ a . id ] . downDuration = this . _pointerData [ a . id ] . timeUp - this . _pointerData [ a . id ] . timeDown , this . checkPointerOver ( a ) ? this . sprite && this . sprite . events && this . sprite . events . onInputUp . dispatch ( this . sprite , a , ! 0 ) : ( this . sprite && this . sprite . events && this . sprite . events . onInputUp . dispatch ( this . sprite , a , ! 1 ) , this . useHandCursor && ( this . game . canvas . style . cursor = "default" , this . _setHandCursor = ! 1 ) ) , a . dirty = ! 0 , this . draggable && this . isDragged && this . _draggedPointerID === a . id && this . stopDrag ( a ) ) } , updateDrag : function ( a ) { if ( a . isUp ) return this . stopDrag ( a ) , ! 1 ; var b = this . globalToLocalX ( a . x ) + this . _dragPoint . x + this . dragOffset . x , c = this . globalToLocalY ( a . y ) + this . _dragPoint . y + this . dragOffset . y ; return this . sprite . fixedToCamera ? ( this . allowHorizontalDrag && ( this . sprite . cameraOffset . x = b ) , this . allowVerticalDrag && ( this . sprite . cameraOffset . y = c ) , this . boundsRect && this . checkBoundsRect ( ) , this . boundsSprite && this . checkBoundsSprite ( ) , this . snapOnDrag && ( this . sprite . cameraOffset . x = Math . round ( ( this . sprite . cameraOffset . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . cameraOffset . y = Math . round ( ( this . sprite . cameraOffset . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY ) ) : ( this . allowHorizontalDrag && ( this . sprite . x = b ) , this . allowVerticalDrag && ( this . sprite . y = c ) , this . boundsRect && this . checkBoundsRect ( ) , this . boundsSprite && this . checkBoundsSprite ( ) , this . snapOnDrag && ( this . sprite . x = Math . round ( ( this . sprite . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . y = Math . round ( ( this . sprite . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY ) ) , ! 0 } , justOver : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isOver && this . overDuration ( a ) < b } , justOut : function ( a , b ) { return a = a || 0 , b = b || 500 , this . _pointerData [ a ] . isOut && this . game . time . now - 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 . now - this . _pointerData [ a ] . timeUp < b } , overDuration : function ( a ) { return a = a || 0 , this . _pointerData [ a ] . isOver ? this . game . time . now - this . _pointerData [ a ] . timeOver : - 1 } , downDuration : function ( a ) { return a = a || 0 , this . _pointerData [ a ] . isDown ? this . game . time . now - this . _pointerData [ a ] . timeDown : - 1 } , enableDrag : function ( a , c , d , e , f , g ) { "undefined" == typeof a && ( a = ! 1 ) , "undefined" == typeof c && ( c = ! 1 ) , "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = 255 ) , "undefined" == typeof f && ( f = null ) , "undefined" == typeof g && ( g = null ) , this . _dragPoint = new b . Point , this . draggable = ! 0 , this . bringToTop = c , this . dragOffset = new b . 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 ) { 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 b = this . sprite . getBounds ( ) ; this . sprite . x = this . globalToLocalX ( a . x ) + ( this . sprite . x - b . centerX ) , this . sprite . y = this . globalToLocalY ( a . y ) + ( this . sprite . y - b . 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 . sprite . events . onDragStart . dispatch ( this . sprite , a ) } , globalToLocalX : function ( a ) { return this . scaleLayer && ( a -= this . game . scale . grid . boundsFluid . x , a *= this . game . scale . grid . scaleFluidInversed . x
} , b . Sprite . prototype . kill = function ( ) { return this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . events && this . events . onKilled . dispatch ( this ) , this } , b . Sprite . prototype . destroy = function ( a ) { if ( null !== this . game && 1 !== this . _cache [ 8 ] ) { "undefined" == typeof a && ( a = ! 0 ) , this . _cache [ 8 ] = 1 , this . events && this . events . onDestroy . dispatch ( this ) , this . parent && ( this . parent instanceof b . Group ? this . parent . remove ( this ) : this . parent . removeChild ( this ) ) , this . input && this . input . destroy ( ) , this . animations && this . animations . destroy ( ) , this . body && this . body . destroy ( ) , this . events && this . events . destroy ( ) ; var c = this . children . length ; if ( a ) for ( ; c -- ; ) this . children [ c ] . destroy ( a ) ; else for ( ; c -- ; ) this . removeChild ( this . children [ c ] ) ; this . _crop && ( this . _crop = null ) , this . _frame && ( this . _frame = null ) , this . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . filters = null , this . mask = null , this . game = null , this . _cache [ 8 ] = 0 } } , b . Sprite . prototype . damage = function ( a ) { return this . alive && ( this . health -= a , this . health <= 0 && this . kill ( ) ) , this } , b . Sprite . prototype . reset = function ( a , b , c ) { return "undefined" == typeof c && ( c = 1 ) , this . world . setTo ( a , b ) , this . position . x = a , this . position . y = b , this . alive = ! 0 , this . exists = ! 0 , this . visible = ! 0 , this . renderable = ! 0 , this . _outOfBoundsFired = ! 1 , this . health = c , this . body && this . body . reset ( a , b , ! 1 , ! 1 ) , this . _cache [ 4 ] = 1 , this } , b . Sprite . prototype . bringToTop = function ( ) { return this . parent && this . parent . bringToTop ( this ) , this } , b . Sprite . prototype . play = function ( a , b , c , d ) { return this . animations ? this . animations . play ( a , b , c , d ) : void 0 } , b . Sprite . prototype . overlap = function ( a ) { return b . Rectangle . intersects ( this . getBounds ( ) , a . getBounds ( ) ) } , Object . defineProperty ( b . Sprite . prototype , "angle" , { get : function ( ) { return b . Math . wrapAngle ( b . Math . radToDeg ( this . rotation ) ) } , set : function ( a ) { this . rotation = b . Math . degToRad ( b . Math . wrapAngle ( a ) ) } } ) , Object . defineProperty ( b . Sprite . prototype , "deltaX" , { get : function ( ) { return this . world . x - this . _cache [ 0 ] } } ) , Object . defineProperty ( b . Sprite . prototype , "deltaY" , { get : function ( ) { return this . world . y - this . _cache [ 1 ] } } ) , Object . defineProperty ( b . Sprite . prototype , "deltaZ" , { get : function ( ) { return this . rotation - this . _cache [ 2 ] } } ) , Object . defineProperty ( b . Sprite . prototype , "inWorld" , { get : function ( ) { return this . game . world . bounds . intersects ( this . getBounds ( ) ) } } ) , Object . defineProperty ( b . Sprite . prototype , "inCamera" , { get : function ( ) { return this . game . world . camera . screenView . intersects ( this . getBounds ( ) ) } } ) , Object . defineProperty ( b . Sprite . prototype , "frame" , { get : function ( ) { return this . animations . frame } , set : function ( a ) { this . animations . frame = a } } ) , Object . defineProperty ( b . Sprite . prototype , "frameName" , { get : function ( ) { return this . animations . frameName } , set : function ( a ) { this . animations . frameName = a } } ) , Object . defineProperty ( b . Sprite . prototype , "renderOrderID" , { get : function ( ) { return this . _cache [ 3 ] } } ) , Object . defineProperty ( b . Sprite . prototype , "inputEnabled" , { get : function ( ) { return this . input && this . input . enabled } , set : function ( a ) { a ? null === this . input ? ( this . input = new b . InputHandler ( this ) , this . input . start ( ) ) : this . input && ! this . input . enabled && this . input . start ( ) : this . input && this . input . enabled && this . input . stop ( ) } } ) , Object . defineProperty ( b . Sprite . prototype , "exists" , { get : function ( ) { return ! ! this . _cache [ 6 ] } , set : function ( a ) { a ? ( this . _cache [ 6 ] = 1 , this . body && this . body . type === b . Physics . P2JS && this . body . addToWorld ( ) , this . visible = ! 0 ) : ( this . _cache [ 6 ] = 0 , this . body && this . body . type === b . Physics . P2JS && this . body . removeFromWorld ( ) , this . visible = ! 1 ) } } ) , Object . defineProperty ( b . Sprite . prototype , "fixedToCamera" , { get : function ( ) { return ! ! this . _cache [ 7 ] } , set : function ( a ) { a ? ( this . _cache [ 7 ] = 1 , this . cameraOffset . set ( this . x , this . y ) ) : this . _cache [ 7 ] = 0 } } ) , Object . defineProperty ( b . Sprite . prototype , "smoothed" , { get : function ( ) { return ! this . texture . baseTexture . scaleMode } , set : function ( a ) { a ? this . texture && ( this . texture . baseTexture . scaleMode = 0 ) : this . texture && ( this . texture . baseTexture . scaleMode = 1 ) } } ) , Object . defineProperty ( b . Sprite . prototype , "x" , { get : function ( ) { return this . position . x } , set : function ( a ) { this . position . x = a , this . body && this . body . type === b . Physics . ARCADE && 2 === this . body . phase && ( this . body . _reset = 1 ) } } ) , Object . defineProperty ( b . Sprite . prototype , "y" , { get : function ( ) { return this . position . y } , set : function ( a )
} , set : function ( a ) { a !== this . _text && ( this . _text = a . toString ( ) || " " , this . dirty = ! 0 , this . parent && this . updateTransform ( ) ) } } ) , Object . defineProperty ( b . Text . prototype , "font" , { get : function ( ) { return this . _font } , set : function ( a ) { a !== this . _font && ( this . _font = a . trim ( ) , this . style . font = this . _fontWeight + " " + this . _fontSize + "px '" + this . _font + "'" , this . dirty = ! 0 , this . parent && this . updateTransform ( ) ) } } ) , Object . defineProperty ( b . Text . prototype , "fontSize" , { get : function ( ) { return this . _fontSize } , set : function ( a ) { a = parseInt ( a , 10 ) , a !== this . _fontSize && ( this . _fontSize = a , this . style . font = this . _fontWeight + " " + this . _fontSize + "px '" + this . _font + "'" , this . dirty = ! 0 , this . parent && this . updateTransform ( ) ) } } ) , Object . defineProperty ( b . Text . prototype , "fontWeight" , { get : function ( ) { return this . _fontWeight } , set : function ( a ) { a !== this . _fontWeight && ( this . _fontWeight = a , this . style . font = this . _fontWeight + " " + this . _fontSize + "px '" + this . _font + "'" , this . dirty = ! 0 , this . parent && this . updateTransform ( ) ) } } ) , Object . defineProperty ( b . Text . prototype , "fill" , { get : function ( ) { return this . style . fill } , set : function ( a ) { a !== this . style . fill && ( this . style . fill = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "align" , { get : function ( ) { return this . style . align } , set : function ( a ) { a !== this . style . align && ( this . style . align = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "stroke" , { get : function ( ) { return this . style . stroke } , set : function ( a ) { a !== this . style . stroke && ( this . style . stroke = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "strokeThickness" , { get : function ( ) { return this . style . strokeThickness } , set : function ( a ) { a !== this . style . strokeThickness && ( this . style . strokeThickness = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "wordWrap" , { get : function ( ) { return this . style . wordWrap } , set : function ( a ) { a !== this . style . wordWrap && ( this . style . wordWrap = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "wordWrapWidth" , { get : function ( ) { return this . style . wordWrapWidth } , set : function ( a ) { a !== this . style . wordWrapWidth && ( this . style . wordWrapWidth = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "lineSpacing" , { get : function ( ) { return this . _lineSpacing } , set : function ( a ) { a !== this . _lineSpacing && ( this . _lineSpacing = parseFloat ( a ) , this . dirty = ! 0 , this . parent && this . updateTransform ( ) ) } } ) , Object . defineProperty ( b . Text . prototype , "shadowOffsetX" , { get : function ( ) { return this . style . shadowOffsetX } , set : function ( a ) { a !== this . style . shadowOffsetX && ( this . style . shadowOffsetX = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "shadowOffsetY" , { get : function ( ) { return this . style . shadowOffsetY } , set : function ( a ) { a !== this . style . shadowOffsetY && ( this . style . shadowOffsetY = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "shadowColor" , { get : function ( ) { return this . style . shadowColor } , set : function ( a ) { a !== this . style . shadowColor && ( this . style . shadowColor = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "shadowBlur" , { get : function ( ) { return this . style . shadowBlur } , set : function ( a ) { a !== this . style . shadowBlur && ( this . style . shadowBlur = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . Text . prototype , "inputEnabled" , { get : function ( ) { return this . input && this . input . enabled } , set : function ( a ) { a ? null === this . input ? ( this . input = new b . InputHandler ( this ) , this . input . start ( ) ) : this . input && ! this . input . enabled && this . input . start ( ) : this . input && this . input . enabled && this . input . stop ( ) } } ) , Object . defineProperty ( b . Text . prototype , "fixedToCamera" , { get : function ( ) { return ! ! this . _cache [ 7 ] } , set : function ( a ) { a ? ( this . _cache [ 7 ] = 1 , this . cameraOffset . set ( this . x , this . y ) ) : this . _cache [ 7 ] = 0 } } ) , Object . defineProperty ( b . Text . prototype , "destroyPhase" , { get : function ( ) { return ! ! this . _cache [ 8 ] } } ) , b . BitmapText = function ( a , c , d , e , f , g ) { c = c || 0 , d = d || 0 , e = e || "" , f = f || "" , g = g || 32 , this . game = a , this . exists = ! 0 , this . name = "" , this . type = b . BITMAPTEXT , this . z = 0 , this . world = new b . Point ( c , d ) , this . _text = f , this . _font = e , this . _fontSize = g , this . _align = "left" , this . _tint = 16777215 , this . events = new b . Events ( this ) , this . input = null , this . cameraOffset = new b . Point , PIXI . BitmapText . call ( this , f ) , this . position . set ( c , d ) , this . _cache = [ 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 ] } , b . BitmapText . prototype = Object . create ( PIXI . BitmapText . prototype ) , b . BitmapText . prototype
} } , b . Device . prototype . constructor = b . Device , b . Device . isAndroidStockBrowser = function ( ) { var a = window . navigator . userAgent . match ( /Android.*AppleWebKit\/([\d.]+)/ ) ; return a && a [ 1 ] < 537 } , b . RequestAnimationFrame = function ( a , b ) { "undefined" == typeof b && ( b = ! 1 ) , this . game = a , this . isRunning = ! 1 , this . forceSetTimeOut = b ; for ( var c = [ "ms" , "moz" , "webkit" , "o" ] , d = 0 ; d < c . length && ! window . requestAnimationFrame ; d ++ ) window . requestAnimationFrame = window [ c [ d ] + "RequestAnimationFrame" ] , window . cancelAnimationFrame = window [ c [ d ] + "CancelAnimationFrame" ] ; this . _isSetTimeOut = ! 1 , this . _onLoop = null , this . _timeOutID = null } , b . RequestAnimationFrame . prototype = { start : function ( ) { this . isRunning = ! 0 ; var a = this ; ! window . requestAnimationFrame || this . forceSetTimeOut ? ( this . _isSetTimeOut = ! 0 , this . _onLoop = function ( ) { return a . updateSetTimeout ( ) } , this . _timeOutID = window . setTimeout ( this . _onLoop , 0 ) ) : ( this . _isSetTimeOut = ! 1 , this . _onLoop = function ( b ) { return a . updateRAF ( b ) } , this . _timeOutID = window . requestAnimationFrame ( this . _onLoop ) ) } , updateRAF : function ( ) { this . game . update ( Date . now ( ) ) , this . _timeOutID = window . requestAnimationFrame ( this . _onLoop ) } , updateSetTimeout : function ( ) { this . game . update ( Date . now ( ) ) , this . _timeOutID = window . setTimeout ( this . _onLoop , this . game . time . timeToCall ) } , stop : function ( ) { this . _isSetTimeOut ? clearTimeout ( this . _timeOutID ) : window . cancelAnimationFrame ( this . _timeOutID ) , this . isRunning = ! 1 } , isSetTimeOut : function ( ) { return this . _isSetTimeOut } , isRAF : function ( ) { return this . _isSetTimeOut === ! 1 } } , b . RequestAnimationFrame . prototype . constructor = b . RequestAnimationFrame , b . Math = { PI2 : 2 * Math . PI , fuzzyEqual : function ( a , b , c ) { return "undefined" == typeof c && ( c = 1e-4 ) , Math . abs ( a - b ) < c } , fuzzyLessThan : function ( a , b , c ) { return "undefined" == typeof c && ( c = 1e-4 ) , b + c > a } , fuzzyGreaterThan : function ( a , b , c ) { return "undefined" == typeof c && ( c = 1e-4 ) , a > b - c } , fuzzyCeil : function ( a , b ) { return "undefined" == typeof b && ( b = 1e-4 ) , Math . ceil ( a - b ) } , fuzzyFloor : function ( a , b ) { return "undefined" == typeof b && ( b = 1e-4 ) , Math . floor ( a + b ) } , average : function ( ) { for ( var a = [ ] , b = 0 ; b < arguments . length - 0 ; b ++ ) a [ b ] = arguments [ b + 0 ] ; for ( var c = 0 , d = 0 ; d < a . length ; d ++ ) c += a [ d ] ; return c / a . length } , truncate : function ( a ) { return a > 0 ? Math . floor ( a ) : Math . ceil ( a ) } , shear : function ( a ) { return a % 1 } , snapTo : function ( a , b , c ) { return "undefined" == typeof c && ( c = 0 ) , 0 === b ? a : ( a -= c , a = b * Math . round ( a / b ) , c + a ) } , snapToFloor : function ( a , b , c ) { return "undefined" == typeof c && ( c = 0 ) , 0 === b ? a : ( a -= c , a = b * Math . floor ( a / b ) , c + a ) } , snapToCeil : function ( a , b , c ) { return "undefined" == typeof c && ( c = 0 ) , 0 === b ? a : ( a -= c , a = b * Math . ceil ( a / b ) , c + a ) } , snapToInArray : function ( a , b , c ) { if ( "undefined" == typeof c && ( c = ! 0 ) , c && b . sort ( ) , a < b [ 0 ] ) return b [ 0 ] ; for ( var d = 1 ; b [ d ] < a ; ) d ++ ; var e = b [ d - 1 ] , f = d < b . length ? b [ d ] : Number . POSITIVE _INFINITY ; return a - e >= f - a ? f : e } , roundTo : function ( a , b , c ) { "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 10 ) ; var d = Math . pow ( c , - b ) ; return Math . round ( a * d ) / d } , floorTo : function ( a , b , c ) { "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 10 ) ; var d = Math . pow ( c , - b ) ; return Math . floor ( a * d ) / d } , ceilTo : function ( a , b , c ) { "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 10 ) ; var d = Math . pow ( c , - b ) ; return Math . ceil ( a * d ) / d } , interpolateFloat : function ( a , b , c ) { return ( b - a ) * c + a } , angleBetween : function ( a , b , c , d ) { return Math . atan2 ( d - b , c - a ) } , angleBetweenY : function ( a , b , c , d ) { return Math . atan2 ( c - a , d - b ) } , angleBetweenPoints : function ( a , b ) { return Math . atan2 ( b . y - a . y , b . x - a . x ) } , angleBetweenPointsY : function ( a , b ) { return Math . atan2 ( b . x - a . x , b . y - a . y ) } , reverseAngle : function ( a ) { return this . normalizeAngle ( a + Math . PI , ! 0 ) } , normalizeAngle : function ( a ) { return a %= 2 * Math . PI , a >= 0 ? a : a + 2 * Math . PI } , normalizeLatitude : function ( a ) { return Math . max ( - 90 , Math . min ( 90 , a ) ) } , normalizeLongitude : function ( a ) { return a % 360 == 180 ? 180 : ( a %= 360 , - 180 > a ? a + 360 : a > 180 ? a - 360 : a ) } , chanceRoll : function ( a ) { return "undefined" == typeof a && ( a = 50 ) , 0 >= a ? ! 1 : a >= 100 ? ! 0 : 100 * Math . random ( ) >= a ? ! 1 : ! 0 } , numberArray : function ( a , b ) { for ( var c = [ ] , d = a ; b >= d ; d ++ ) c . push ( d ) ; return c } , numberArrayStep : function ( a , c , d ) { a = + a || 0 ; var e = typeof c ; "number" !== e && "string" !== e || ! d || d [ c ] !== a || ( c = d = null ) , d = null == d ? 1 : + d || 0 , null === c ? ( c = a , a = 0 ) : c = + c || 0 ; for ( var f = - 1 , g = b . Math . max ( b . Math . ceil ( ( c - a ) / ( d || 1 ) ) , 0 ) , h = new Array ( g ) ; ++ f < g ; ) h [ f ] = a , a += d ; return h } , maxAdd : function ( a , b , c ) { retu
} , refreshFrame : function ( ) { this . sprite . setTexture ( PIXI . TextureCache [ this . currentFrame . uuid ] ) , this . sprite . _ _tilePattern && ( this . _ _tilePattern = ! 1 , this . tilingTexture = ! 1 ) } , destroy : function ( ) { var a = null ; for ( var a in this . _anims ) this . _anims . hasOwnProperty ( a ) && this . _anims [ a ] . destroy ( ) ; this . _anims = { } , this . _frameData = null , this . _frameIndex = 0 , this . currentAnim = null , this . currentFrame = null } } , b . AnimationManager . prototype . constructor = b . AnimationManager , Object . defineProperty ( b . AnimationManager . prototype , "frameData" , { get : function ( ) { return this . _frameData } } ) , Object . defineProperty ( b . AnimationManager . prototype , "frameTotal" , { get : function ( ) { return this . _frameData . total } } ) , Object . defineProperty ( b . AnimationManager . prototype , "paused" , { get : function ( ) { return this . currentAnim . isPaused } , set : function ( a ) { this . currentAnim . paused = a } } ) , Object . defineProperty ( b . AnimationManager . prototype , "name" , { get : function ( ) { return this . currentAnim ? this . currentAnim . name : void 0 } } ) , Object . defineProperty ( b . AnimationManager . prototype , "frame" , { get : function ( ) { return this . currentFrame ? this . _frameIndex : void 0 } , set : function ( a ) { "number" == typeof a && null !== this . _frameData . getFrame ( a ) && ( this . currentFrame = this . _frameData . getFrame ( a ) , this . currentFrame && ( this . _frameIndex = a , this . sprite . setFrame ( this . currentFrame ) , this . sprite . _ _tilePattern && ( this . _ _tilePattern = ! 1 , this . tilingTexture = ! 1 ) ) ) } } ) , Object . defineProperty ( b . AnimationManager . prototype , "frameName" , { get : function ( ) { return this . currentFrame ? this . currentFrame . name : void 0 } , set : function ( a ) { "string" == typeof a && null !== this . _frameData . getFrameByName ( a ) ? ( this . currentFrame = this . _frameData . getFrameByName ( a ) , this . currentFrame && ( this . _frameIndex = this . currentFrame . index , this . sprite . setFrame ( this . currentFrame ) , this . sprite . _ _tilePattern && ( this . _ _tilePattern = ! 1 , this . tilingTexture = ! 1 ) ) ) : console . warn ( "Cannot set frameName: " + a ) } } ) , b . Animation = function ( a , c , d , e , f , g , h ) { this . game = a , this . _parent = c , this . _frameData = e , this . name = d , this . _frames = [ ] , this . _frames = this . _frames . concat ( f ) , this . delay = 1e3 / g , this . loop = h , this . loopCount = 0 , this . killOnComplete = ! 1 , this . isFinished = ! 1 , this . isPlaying = ! 1 , this . isPaused = ! 1 , this . _pauseStartTime = 0 , this . _frameIndex = 0 , this . _frameDiff = 0 , this . _frameSkip = 1 , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . onStart = new b . Signal , this . onUpdate = null , this . onComplete = new b . Signal , this . onLoop = new b . Signal , this . game . onPause . add ( this . onPause , this ) , this . game . onResume . add ( this . onResume , this ) } , b . Animation . prototype = { play : function ( a , b , c ) { return "number" == typeof a && ( this . delay = 1e3 / a ) , "boolean" == typeof b && ( this . loop = b ) , "undefined" != typeof c && ( this . killOnComplete = c ) , this . isPlaying = ! 0 , this . isFinished = ! 1 , this . paused = ! 1 , this . loopCount = 0 , this . _timeLastFrame = this . game . time . now , this . _timeNextFrame = this . game . time . now + this . delay , this . _frameIndex = 0 , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . _parent . setFrame ( this . currentFrame ) , this . _parent . _ _tilePattern && ( this . _parent . _ _tilePattern = ! 1 , this . _parent . tilingTexture = ! 1 ) , this . _parent . events . onAnimationStart . dispatch ( this . _parent , this ) , this . onStart . dispatch ( this . _parent , this ) , this } , restart : function ( ) { this . isPlaying = ! 0 , this . isFinished = ! 1 , this . paused = ! 1 , this . loopCount = 0 , this . _timeLastFrame = this . game . time . now , this . _timeNextFrame = this . game . time . now + this . delay , this . _frameIndex = 0 , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . _parent . setFrame ( this . currentFrame ) , this . onStart . dispatch ( this . _parent , this ) } , setFrame : function ( a , b ) { var c ; if ( "undefined" == typeof b && ( b = ! 1 ) , "string" == typeof a ) for ( var d = 0 ; d < this . _frames . length ; d ++ ) this . _frameData . getFrame ( this . _frames [ d ] ) . name === a && ( c = d ) ; else if ( "number" == typeof a ) if ( b ) c = a ; else for ( var d = 0 ; d < this . _frames . length ; d ++ ) this . frames [ d ] === c && ( c = d ) ; c && ( this . _frameIndex = c - 1 , this . _timeNextFrame = this . game . time . now , this . update ( ) ) } , stop : function ( a , b ) { "undefined" == typeof a && ( a = ! 1 ) , "undefined" == typeof b && ( b = ! 1 ) , this . isPlaying = ! 1 , this . isFinished = ! 0 , this . paused = ! 1 , a && ( this . currentFrame = this . _frameData . getFrame ( this . _frames [ 0 ] ) , this . _parent . setFrame ( this . currentFrame ) ) , b && ( this . _parent . events . onAnimationComplete .
g = h . parseFromString ( e , "text/xml" ) } else g = new ActiveXObject ( "Microsoft.XMLDOM" ) , g . async = "false" , g . loadXML ( e ) } catch ( i ) { g = void 0 } if ( ! g || ! g . documentElement || g . getElementsByTagName ( "parsererror" ) . length ) throw new Error ( "Phaser.Loader. Invalid Texture Atlas XML given" ) ; e = g } } this . addToFileList ( "textureatlas" , a , c , { atlasURL : null , atlasData : e , format : f } ) } return this } , removeFile : function ( a , b ) { var c = this . getAsset ( a , b ) ; c !== ! 1 && this . _fileList . splice ( c . index , 1 ) } , removeAll : function ( ) { this . _fileList . length = 0 } , start : function ( ) { this . isLoading || ( this . _packList . length > 0 ? ( this . _packIndex = 0 , this . loadPack ( ) ) : this . beginLoad ( ) ) } , beginLoad : function ( ) { this . progress = 0 , this . progressFloat = 0 , this . hasLoaded = ! 1 , this . isLoading = ! 0 , this . onLoadStart . dispatch ( this . _fileList . length ) , this . _fileList . length > 0 ? ( this . _fileIndex = 0 , this . _progressChunk = 100 / this . _fileList . length , this . loadFile ( ) ) : ( this . progress = 100 , this . progressFloat = 100 , this . hasLoaded = ! 0 , this . isLoading = ! 1 , this . onLoadComplete . dispatch ( ) ) } , loadPack : function ( ) { if ( ! this . _packList [ this . _packIndex ] ) return void console . warn ( "Phaser.Loader loadPackList invalid index " + this . _packIndex ) ; var a = this . _packList [ this . _packIndex ] ; null !== a . data ? this . packLoadComplete ( this . _packIndex , ! 1 ) : this . xhrLoad ( this . _packIndex , this . baseURL + a . url , "text" , "packLoadComplete" , "packLoadError" ) } , packLoadComplete : function ( a , c ) { if ( "undefined" == typeof c && ( c = ! 0 ) , ! this . _packList [ a ] ) return void console . warn ( "Phaser.Loader packLoadComplete invalid index " + a ) ; var d = this . _packList [ a ] ; if ( d . loaded = ! 0 , c ) var e = JSON . parse ( this . _xhr . responseText ) ; else var e = this . _packList [ a ] . data ; if ( e [ d . key ] ) for ( var f , g = 0 ; g < e [ d . key ] . length ; g ++ ) switch ( f = e [ d . key ] [ g ] , f . type ) { case "image" : this . image ( f . key , f . url , f . overwrite ) ; break ; case "text" : this . text ( f . key , f . url , f . overwrite ) ; break ; case "json" : this . json ( f . key , f . url , f . overwrite ) ; break ; case "xml" : this . xml ( f . key , f . url , f . overwrite ) ; break ; case "script" : this . script ( f . key , f . url , f . callback , d . callbackContext ) ; break ; case "binary" : this . binary ( f . key , f . url , f . callback , d . callbackContext ) ; break ; case "spritesheet" : this . spritesheet ( f . key , f . url , f . frameWidth , f . frameHeight , f . frameMax , f . margin , f . spacing ) ; break ; case "audio" : this . audio ( f . key , f . urls , f . autoDecode ) ; break ; case "tilemap" : this . tilemap ( f . key , f . url , f . data , b . Tilemap [ f . format ] ) ; break ; case "physics" : this . physics ( f . key , f . url , f . data , b . Loader [ f . format ] ) ; break ; case "bitmapFont" : this . bitmapFont ( f . key , f . textureURL , f . xmlURL , f . xmlData , f . xSpacing , f . ySpacing ) ; break ; case "atlasJSONArray" : this . atlasJSONArray ( f . key , f . textureURL , f . atlasURL , f . atlasData ) ; break ; case "atlasJSONHash" : this . atlasJSONHash ( f . key , f . textureURL , f . atlasURL , f . atlasData ) ; break ; case "atlasXML" : this . atlasXML ( f . key , f . textureURL , f . atlasURL , f . atlasData ) ; break ; case "atlas" : this . atlas ( f . key , f . textureURL , f . atlasURL , f . atlasData , b . Loader [ f . format ] ) } this . nextPack ( a , ! 0 ) } , packError : function ( a ) { this . _packList [ a ] . loaded = ! 0 , this . _packList [ a ] . error = ! 0 , this . onFileError . dispatch ( this . _packList [ a ] . key , this . _packList [ a ] ) , console . warn ( "Phaser.Loader error loading pack file: " + this . _packList [ a ] . key + " from URL " + this . _packList [ a ] . url ) , this . nextPack ( a , ! 1 ) } , nextPack : function ( a , b ) { this . onPackComplete . dispatch ( this . _packList [ a ] . key , b , this . totalLoadedPacks ( ) , this . _packList . length ) , this . _packIndex ++ , this . _packIndex < this . _packList . length ? this . loadPack ( ) : this . beginLoad ( ) } , loadFile : function ( ) { if ( ! this . _fileList [ this . _fileIndex ] ) return void console . warn ( "Phaser.Loader loadFile invalid index " + this . _fileIndex ) ; var a = this . _fileList [ this . _fileIndex ] , c = this ; switch ( this . onFileStart . dispatch ( this . progress , a . key , a . url ) , a . type ) { case "image" : case "spritesheet" : case "textureatlas" : case "bitmapfont" : a . data = new Image , a . data . name = a . key , a . data . onload = function ( ) { return c . fileComplete ( c . _fileIndex ) } , a . data . onerror = function ( ) { return c . fileError ( c . _fileIndex ) } , this . crossOrigin && ( a . data . crossOrigin = this . crossOrigin ) , a . data . src = this . baseURL + a . url ; break ; case "audio" : a . url = this . getAudioURL ( a . url ) , null !== a . url ? this . game . sound . usingWebAudio ? this . xhrLoad ( this . _fileIndex , this . baseURL + a . url , "arraybuffer" , "fileComplete" , "fileError" ) : this . game . sound . usingAudioTag && ( this . game . sound . touchLocked ? ( a . data = new Audio , a . data . n
} , inputInfo : function ( a , b , c ) { this . start ( a , b , c ) , this . line ( "Input" ) , this . line ( "X: " + this . game . input . x + " Y: " + this . game . input . y ) , this . line ( "World X: " + this . game . input . worldX + " World Y: " + this . game . input . worldY ) , this . line ( "Scale X: " + this . game . input . scale . x . toFixed ( 1 ) + " Scale Y: " + this . game . input . scale . x . toFixed ( 1 ) ) , this . line ( "Screen X: " + this . game . input . activePointer . screenX + " Screen Y: " + this . game . input . activePointer . screenY ) , this . stop ( ) } , spriteBounds : function ( a , b , c ) { var d = a . getBounds ( ) ; d . x += this . game . camera . x , d . y += this . game . camera . y , this . rectangle ( d , b , c ) } , ropeSegments : function ( a , b , c ) { var d = a . segments ; d . forEach ( function ( a ) { this . rectangle ( a , b , c ) } , this ) } , spriteInfo : function ( a , b , c , d ) { this . start ( b , c , d ) , this . line ( "Sprite: (" + a . width + " x " + a . height + ") anchor: " + a . anchor . x + " x " + a . anchor . y ) , this . line ( "x: " + a . x . toFixed ( 1 ) + " y: " + a . y . toFixed ( 1 ) ) , this . line ( "angle: " + a . angle . toFixed ( 1 ) + " rotation: " + a . rotation . toFixed ( 1 ) ) , this . line ( "visible: " + a . visible + " in camera: " + a . inCamera ) , this . stop ( ) } , spriteCoords : function ( a , b , c , d ) { this . start ( b , c , d , 100 ) , a . name && this . line ( a . name ) , this . line ( "x:" , a . x . toFixed ( 2 ) , "y:" , a . y . toFixed ( 2 ) ) , this . line ( "pos x:" , a . position . x . toFixed ( 2 ) , "pos y:" , a . position . y . toFixed ( 2 ) ) , this . line ( "world x:" , a . world . x . toFixed ( 2 ) , "world y:" , a . world . y . toFixed ( 2 ) ) , this . stop ( ) } , lineInfo : function ( a , b , c , d ) { this . start ( b , c , d , 80 ) , this . line ( "start.x:" , a . start . x . toFixed ( 2 ) , "start.y:" , a . start . y . toFixed ( 2 ) ) , this . line ( "end.x:" , a . end . x . toFixed ( 2 ) , "end.y:" , a . end . y . toFixed ( 2 ) ) , this . line ( "length:" , a . length . toFixed ( 2 ) , "angle:" , a . angle ) , this . stop ( ) } , pixel : function ( a , b , c , d ) { d = d || 2 , this . start ( ) , this . context . fillStyle = c , this . context . fillRect ( a , b , d , d ) , this . stop ( ) } , geom : function ( a , c , d , e ) { "undefined" == typeof d && ( d = ! 0 ) , "undefined" == typeof e && ( e = 0 ) , c = c || "rgba(0,255,0,0.4)" , this . start ( ) , this . context . fillStyle = c , this . context . strokeStyle = c , a instanceof b . Rectangle || 1 === e ? d ? this . context . fillRect ( a . x - this . game . camera . x , a . y - this . game . camera . y , a . width , a . height ) : this . context . strokeRect ( a . x - this . game . camera . x , a . y - this . game . camera . y , a . width , a . height ) : a instanceof b . Circle || 2 === e ? ( this . context . beginPath ( ) , this . context . arc ( a . x - this . game . camera . x , a . y - this . game . camera . y , a . radius , 0 , 2 * Math . PI , ! 1 ) , this . context . closePath ( ) , d ? this . context . fill ( ) : this . context . stroke ( ) ) : a instanceof b . Point || 3 === e ? this . context . fillRect ( a . x - this . game . camera . x , a . y - this . game . camera . y , 4 , 4 ) : ( a instanceof b . Line || 4 === e ) && ( this . context . lineWidth = 1 , this . context . beginPath ( ) , this . context . moveTo ( a . start . x + . 5 - this . game . camera . x , a . start . y + . 5 - this . game . camera . y ) , this . context . lineTo ( a . end . x + . 5 - this . game . camera . x , a . end . y + . 5 - this . game . camera . y ) , this . context . closePath ( ) , this . context . stroke ( ) ) , this . stop ( ) } , rectangle : function ( a , b , c ) { "undefined" == typeof c && ( c = ! 0 ) , b = b || "rgba(0, 255, 0, 0.4)" , this . start ( ) , c ? ( this . context . fillStyle = b , this . context . fillRect ( a . x - this . game . camera . x , a . y - this . game . camera . y , a . width , a . height ) ) : ( this . context . strokeStyle = b , this . context . strokeRect ( a . x - this . game . camera . x , a . y - this . game . camera . y , a . width , a . height ) ) , this . stop ( ) } , text : function ( a , b , c , d , e ) { d = d || "rgb(255,255,255)" , e = e || "16px Courier" , this . start ( ) , this . context . font = e , this . renderShadow && ( this . context . fillStyle = "rgb(0,0,0)" , this . context . fillText ( a , b + 1 , c + 1 ) ) , this . context . fillStyle = d , this . context . fillText ( a , b , c ) , this . stop ( ) } , quadTree : function ( a , b ) { b = b || "rgba(255,0,0,0.3)" , this . start ( ) ; var c = a . bounds ; if ( 0 === a . nodes . length ) { this . context . strokeStyle = b , this . context . strokeRect ( c . x , c . y , c . width , c . height ) , this . text ( "size: " + a . objects . length , c . x + 4 , c . y + 16 , "rgb(0,200,0)" , "12px Courier" ) , this . context . strokeStyle = "rgb(0,255,0)" ; 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 , c , d ) { a . body && ( this . start ( ) , a . body . type === b . Physics . ARCADE ? b . Physics . Arcade . Body . render ( this . context , a . body , c , d ) : a . body . type === b . Physics . NINJA ? b . Physics . Ninja . Body . render ( this . context , a . body , c , d ) : a . body . type === b . Physics . BOX2D && b . Physics . Box2D . renderBody ( this . context , a . body , c ) , this . stop ( ) ) } , bodyInfo : function ( a ,
} , destroy : function ( ) { 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 . 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 , c ) { return b . Rectangle . contains ( this , a , c ) } , 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 ( b . Physics . Arcade . Body . prototype , "bottom" , { get : function ( ) { return this . position . y + this . height } } ) , Object . defineProperty ( b . Physics . Arcade . Body . prototype , "right" , { get : function ( ) { return this . position . x + this . width } } ) , Object . defineProperty ( b . Physics . Arcade . Body . prototype , "x" , { get : function ( ) { return this . position . x } , set : function ( a ) { this . position . x = a } } ) , Object . defineProperty ( b . Physics . Arcade . Body . prototype , "y" , { get : function ( ) { return this . position . y } , set : function ( a ) { this . position . y = a } } ) , b . 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 ) ) } , b . 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 ) } , b . Physics . Arcade . Body . prototype . constructor = b . Physics . Arcade . Body , b . Particles = function ( a ) { this . game = a , this . emitters = { } , this . ID = 0 } , b . Particles . prototype = { add : function ( a ) { return this . emitters [ a .
} this . _mc . tx = this . _mc . dx , this . _mc . ty += this . map . tileHeight } return this . debug && ( this . context . globalAlpha = 1 , this . renderDebug ( ) ) , this . game . renderType === b . WEBGL && PIXI . updateWebGLTexture ( this . baseTexture , this . game . renderer . gl ) , this . dirty = ! 1 , this . layer . dirty = ! 1 , ! 0 } } , b . TilemapLayer . prototype . renderDebug = function ( ) { this . _mc . tx = this . _mc . dx , this . _mc . ty = this . _mc . dy , this . context . strokeStyle = this . debugColor , this . context . fillStyle = this . debugFillColor ; for ( var a = this . _mc . startY , b = this . _mc . startY + this . _mc . maxY ; b > a ; a ++ ) { if ( this . _column = null , 0 > a && this . wrap ? this . _column = this . layer . data [ a + this . map . height ] : a >= this . map . height && this . wrap ? this . _column = this . layer . data [ a - this . map . height ] : this . layer . data [ a ] && ( this . _column = this . layer . data [ a ] ) , this . _column ) for ( var c = this . _mc . startX , d = this . _mc . startX + this . _mc . maxX ; d > c ; c ++ ) { var e = null ; 0 > c && this . wrap ? e = this . _column [ c + this . map . width ] : c >= this . map . width && this . wrap ? e = this . _column [ c - this . map . width ] : this . _column [ c ] && ( e = this . _column [ c ] ) , e && ( e . faceTop || e . faceBottom || e . faceLeft || e . faceRight ) && ( this . _mc . tx = Math . floor ( this . _mc . tx ) , this . debugFill && this . context . fillRect ( this . _mc . tx , this . _mc . ty , this . _mc . cw , this . _mc . ch ) , this . context . beginPath ( ) , e . faceTop && ( this . context . moveTo ( this . _mc . tx , this . _mc . ty ) , this . context . lineTo ( this . _mc . tx + this . _mc . cw , this . _mc . ty ) ) , e . faceBottom && ( this . context . moveTo ( this . _mc . tx , this . _mc . ty + this . _mc . ch ) , this . context . lineTo ( this . _mc . tx + this . _mc . cw , this . _mc . ty + this . _mc . ch ) ) , e . faceLeft && ( this . context . moveTo ( this . _mc . tx , this . _mc . ty ) , this . context . lineTo ( this . _mc . tx , this . _mc . ty + this . _mc . ch ) ) , e . faceRight && ( this . context . moveTo ( this . _mc . tx + this . _mc . cw , this . _mc . ty ) , this . context . lineTo ( this . _mc . tx + this . _mc . cw , this . _mc . ty + this . _mc . ch ) ) , this . context . stroke ( ) ) , this . _mc . tx += this . map . tileWidth } this . _mc . tx = this . _mc . dx , this . _mc . ty += this . map . tileHeight } } , Object . defineProperty ( b . TilemapLayer . prototype , "scrollX" , { get : function ( ) { return this . _mc . x } , set : function ( a ) { a !== this . _mc . x && ( this . _mc . x = a , this . _mc . startX = this . game . math . floor ( this . _mc . x / this . map . tileWidth ) , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . TilemapLayer . prototype , "scrollY" , { get : function ( ) { return this . _mc . y } , set : function ( a ) { a !== this . _mc . y && ( this . _mc . y = a , this . _mc . startY = this . game . math . floor ( this . _mc . y / this . map . tileHeight ) , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . TilemapLayer . prototype , "collisionWidth" , { get : function ( ) { return this . _mc . cw } , set : function ( a ) { this . _mc . cw = a , this . dirty = ! 0 } } ) , Object . defineProperty ( b . TilemapLayer . prototype , "collisionHeight" , { get : function ( ) { return this . _mc . ch } , set : function ( a ) { this . _mc . ch = a , this . dirty = ! 0 } } ) , b . TilemapParser = { parse : function ( a , c , d , e , f , g ) { if ( "undefined" == typeof d && ( d = 32 ) , "undefined" == typeof e && ( e = 32 ) , "undefined" == typeof f && ( f = 10 ) , "undefined" == typeof g && ( g = 10 ) , "undefined" == typeof c ) return this . getEmptyData ( ) ; if ( null === c ) return this . getEmptyData ( d , e , f , g ) ; var h = a . cache . getTilemapData ( c ) ; if ( h ) { if ( h . format === b . Tilemap . CSV ) return this . parseCSV ( c , h . data , d , e ) ; if ( ! h . format || h . format === b . Tilemap . TILED _JSON ) return this . parseTiledJSON ( h . data ) } else console . warn ( "Phaser.TilemapParser.parse - No map data found for key " + c ) } , parseCSV : function ( a , c , d , e ) { var f = this . getEmptyData ( ) ; c = c . trim ( ) ; for ( var g = [ ] , h = c . split ( "\n" ) , i = h . length , j = 0 , k = 0 ; k < h . length ; k ++ ) { g [ k ] = [ ] ; for ( var l = h [ k ] . split ( "," ) , m = 0 ; m < l . length ; m ++ ) g [ k ] [ m ] = new b . Tile ( f . layers [ 0 ] , parseInt ( l [ m ] , 10 ) , m , k , d , e ) ; 0 === j && ( j = l . length ) } return f . format = b . Tilemap . CSV , f . name = a , f . width = j , f . height = i , f . tileWidth = d , f . tileHeight = e , f . widthInPixels = j * d , f . heightInPixels = i * e , f . layers [ 0 ] . width = j , f . layers [ 0 ] . height = i , f . layers [ 0 ] . widthInPixels = f . widthInPixels , f . layers [ 0 ] . heightInPixels = f . heightInPixels , f . layers [ 0 ] . data = g , f } , getEmptyData : function ( a , b , c , d ) { var e = { } ; e . width = 0 , e . height = 0 , e . tileWidth = 0 , e . tileHeight = 0 , "undefined" != typeof a && null !== a && ( e . tileWidth = a ) , "undefined" != typeof b && null !== b && ( e . tileHeight = b ) , "undefined" != typeof c && null !== c && ( e . width = c ) , "undefined" != typeof d && null !== d && ( e . height = d ) , e . orientation = "orthogonal" , e . version = "1" , e . properties = { } , e . widthInPixels = 0 , e . heightInPixels = 0 ; var f = [ ] , g = { name : "layer" , x : 0 , y : 0 , width : 0 , height : 0 , widthInPixels : 0 , heightInPixels : 0 , alpha : 1 , visible : ! 0 , properties : { } , index
var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _22DEGnnS ) { this . signx = - 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _22DEGnpS ) { this . signx = - 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else { if ( this . id != Phaser . Physics . Ninja . Tile . SLOPE _22DEGppS ) return ! 1 ; this . signx = 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id < Phaser . Physics . Ninja . Tile . TYPE _67DEGs ) if ( this . type = Phaser . Physics . Ninja . Tile . TYPE _22DEGb , this . id == Phaser . Physics . Ninja . Tile . SLOPE _22DEGpnB ) { this . signx = 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _22DEGnnB ) { this . signx = - 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _22DEGnpB ) { this . signx = - 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else { if ( this . id != Phaser . Physics . Ninja . Tile . SLOPE _22DEGppB ) return ! 1 ; this . signx = 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 1 * this . signx / a , this . sy = 2 * this . signy / a } else if ( this . id < Phaser . Physics . Ninja . Tile . TYPE _67DEGb ) if ( this . type = Phaser . Physics . Ninja . Tile . TYPE _67DEGs , this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGpnS ) { this . signx = 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGnnS ) { this . signx = - 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGnpS ) { this . signx = - 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else { if ( this . id != Phaser . Physics . Ninja . Tile . SLOPE _67DEGppS ) return ! 1 ; this . signx = 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . id < Phaser . Physics . Ninja . Tile . TYPE _HALF ) if ( this . type = Phaser . Physics . Ninja . Tile . TYPE _67DEGb , this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGpnB ) { this . signx = 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGnnB ) { this . signx = - 1 , this . signy = - 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . id == Phaser . Physics . Ninja . Tile . SLOPE _67DEGnpB ) { this . signx = - 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else { if ( this . id != Phaser . Physics . Ninja . Tile . SLOPE _67DEGppB ) return ! 1 ; this . signx = 1 , this . signy = 1 ; var a = Math . sqrt ( 5 ) ; this . sx = 2 * this . signx / a , this . sy = 1 * this . signy / a } else if ( this . type = Phaser . Physics . Ninja . Tile . TYPE _HALF , this . id == Phaser . Physics . Ninja . Tile . HALFd ) this . signx = 0 , this . signy = - 1 , this . sx = this . signx , this . sy = this . signy ; else if ( this . id == Phaser . Physics . Ninja . Tile . HALFu ) this . signx = 0 , this . signy = 1 , this . sx = this . signx , this . sy = this . signy ; else if ( this . id == Phaser . Physics . Ninja . Tile . HALFl ) this . signx = 1 , this . signy = 0 , this . sx = this . signx , this . sy = this . signy ; else { if ( this . id != Phaser . Physics . Ninja . Tile . HALFr ) return ! 1 ; this . signx = - 1 , this . signy = 0 , this . sx = this . signx , this . sy = this . signy } } } , Object . defineProperty ( Phaser . Physics . Ninja . Tile . prototype , "x" , { get : function ( ) { return this . pos . x - this . xw } , set : function ( a ) { this . pos . x = a } } ) , Object . defineProperty ( Phaser . Physics . Ninja . Tile . prototype , "y" , { get : function ( ) { return this . pos . y - this . yw } , set : function ( a ) { this . pos . y = a } } ) , Object . defineProperty ( Phaser . Physics . Ninja . Tile . prototype , "bottom" , { get : function ( ) { return this . pos . y + this . yw } } ) , Object . defineProperty ( Phaser . Physics . Ninja . Tile . prototype , "right" , { get : function ( ) { return this . pos . x + this . xw } } ) , Phaser . Physics . Ninja . Tile . EMPTY = 0 , Phaser . Physics . Ninja . Tile . FULL = 1 , Phaser . Physics . Ninja . Tile . SLOPE _45DEGpn = 2 , Phaser . Physics . Ninja . Tile . SLOPE _45DEGnn = 3 , Phaser . Physics . Ninja . Tile . SLOPE _45DEGnp = 4 , Phaser . Physics . Ninja . Tile . SLOPE _45DEGpp = 5 , Phaser . Physics . Ninja . Tile . CONCAVEpn = 6 , Phaser . Physics . Ninja . Tile . CONCAVEnn = 7 , Phaser . Physics . Ninja . Tile . CONCAVEnp = 8 , Phaser . Physics . Ninja . Tile . CONCAVEpp = 9 , Phaser . Physics . Ninja . Tile . CONVEXpn = 10 , Phaser . Phy