2014-09-11 09:38:17 +00:00
/* Phaser (AP) v2.1.1 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */
2014-08-29 17:13:33 +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-09-11 09:38:17 +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 } , 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 . inflate = function ( a , b , c ) { return a . x -= b , a . width += 2 * b , a . y -= c , a . height += 2 * c , a } , b . Rectangle . inflatePoint = function ( a , c ) { return b . Rectangle . infl
} , 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 ( ) { return ! PIXI . scaleModes . LINEAR } , set : function ( a ) { PIXI . scaleModes . LINEAR = a ? 0 : 1 } } ) , b . Group = function ( a , c , d , e , f , g ) { "undefined" == typeof e && ( e = ! 1 ) , "undefined" == typeof f && ( f = ! 1 ) , "undefined" == typeof g && ( g = b . Physics . ARCADE ) , this . game = a , "undefined" == typeof c && ( c = a . world ) , this . name = d || "group" , PIXI . DisplayObjectContainer . call ( this ) , e ? this . game . stage . addChild ( this ) : c && c . addChild ( this ) , this . z = 0 , this . type = b . GROUP , this . alive = ! 0 , this . exists = ! 0 , this . classType = b . Sprite , this . scale = new b . Point ( 1 , 1 ) , this . cursor = null , this . cameraOffset = new b . Point , this . enableBody = f , this . enableBodyDebug = ! 1 , this . physicsBodyType = g , this . onDestroy = new b . Signal , this . _sortProperty = "z" , this . _cache = [ 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 ] } , b . Group . prototype = Object . create ( PIXI . DisplayObjectContainer . prototype ) , b . Group . prototype . constructor = b . Group , b . Group . RETURN _NONE = 0 , b . Group . RETURN _TOTAL = 1 , b . Group . RETURN _CHILD = 2 , b . Group . SORT _ASCENDING = - 1 , b . Group . SORT _DESCENDING = 1 , b . Group . prototype . add = function ( a , b ) { return "undefined" == typeof b && ( b = ! 1 ) , a . parent !== this && ( this . enableBody && this . game . physics . enable ( a , this . physicsBodyType ) , this . addChild ( a ) , a . z = this . children . length , ! b && a . events && a . events . onAddedToGroup . dispatch ( a , this ) , null === this . cursor && ( this . cursor = a ) ) , a } , b . Group . prototype . addMultiple = function ( a , b ) { if ( Array . isArray
} , 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 } , "undefined" != typeof a && ( this . _width = a ) , "undefined" != typeof c && ( this . _height = c ) , "undefined" != typeof d && ( this . renderType = d ) , "undefined" != typeof e && ( this . parent = e ) , "undefined" != typeof g && ( this . transparent = g ) , "undefined" != typeof h && ( this . antialias = h ) , this . rnd = new b . RandomDataGenerator ( [ ( Date . now ( ) * Math . random ( ) ) . toString ( ) ] ) , this . state = new b . StateManager ( this , f ) ) ; var j = this ; return this . _onBoot = function ( ) { return j . boot ( ) } , "complete" === document . readyState || "interactive" === document . readyState ? window . setTimeout ( th
} } , 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 . game . time . now + this . game . input . recordRate , this . _history . push ( { x : this . position . x , y : this . position . y } ) , this . _history . length > this . game . input . recordLimit && this . _history . shift ( ) ) ) } , move : function ( a , c ) { if ( ! this . game . input . pollLocked ) { if ( "undefined" == typeof c && ( c = ! 1 ) , "undefined" != typeof a . button && ( this . button = a . button ) , this . clientX = a . clientX , this . clientY = a . clientY , this . pageX = a . pageX , this . pageY = a . pageY , this . screenX = a . screenX , this . screenY = a . screenY , this . isMouse && this . game . input . mouse . locked && ! c && ( this . rawMovementX = a . movementX || a . mozMovementX || a . webkitMovementX || 0 , this . rawMovementY = a . movementY || a . mozMovementY || a . webkitMovementY || 0 , this . movementX += this . rawMovementX , this . movementY += this . rawMovementY ) , this . x = ( this . pageX - this . game . scale . offset . x ) * this . game . inp
} , updateDrag : function ( a ) { return a . isUp ? ( this . stopDrag ( a ) , ! 1 ) : ( this . sprite . fixedToCamera ? ( this . allowHorizontalDrag && ( this . sprite . cameraOffset . x = a . x + this . _dragPoint . x + this . dragOffset . x ) , this . allowVerticalDrag && ( this . sprite . cameraOffset . y = a . y + this . _dragPoint . y + this . dragOffset . y ) , 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 = a . x + this . _dragPoint . x + this . dragOffset . x ) , this . allowVerticalDrag && ( this . sprite . y = a . y + this . _dragPoint . y + this . dragOffset . y ) , 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 = a . x + ( this . sprite . x - b . centerX ) , this . sprite . y = a . y + ( this . sprite . y - b . centerY ) , this . _dragPoint . setTo ( this . sprite . x - a . x , this . sprite . y - a . y ) } else this . _dragPoint . setTo ( this . sprite . x - a . x , this . sprite . y - a . y ) ; this . updateDrag ( a ) , this . bringToTop && ( this . _dragPhase = ! 0 , this . sprite . bringToTop ( ) ) , this . sprite . events . onDragStart . dispatch ( this . sprite , a ) } , stopDrag : function ( a ) { this . isDragged = ! 1 , this . _draggedPointerID = - 1 , this . _pointerData [ a . id ] . isDragged = ! 1 , this . _dragPhase = ! 1 , this . snapOnRelease && ( this . sprite . fixedToCamera ? ( this . sprite . cameraOffset . x = Math . round ( ( this . sprite . cameraOffset . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . cameraOffset . y = Math . round ( ( this . sprite . cameraOffset . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY ) : ( this . sprite . x = Math . round ( ( this . sprite . x - this . snapOffsetX % this . snapX ) / this . snapX ) * this . snapX + this . snapOffsetX % this . snapX , this . sprite . y = Math . round ( ( this . sprite . y - this . snapOffsetY % this . snapY ) / this . snapY ) * this . snapY + this . snapOffsetY % this . snapY ) ) , this . sprite . events . onDragStop . dispatch ( this . sprite , a ) , this . checkPointerOver ( a ) === ! 1 && this . _pointerOutHandler ( a ) } , setDragLock : function ( a , b ) { "undefined" == type
} , 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 ) { this . position . y = a , this . body && this . body . type === b . Physics . ARCADE && 2 === this . body . phase && ( this . body . _reset = 1 ) } } ) , Object . defineProperty ( b . Sprite . prototype , "destroyPhase" , { get : function ( ) { return ! ! this . _cache [ 8 ] } } ) , b . Image = function ( a , c , d , e , f ) { c = c || 0 , d = d || 0 , e = e || null , f = f || null , this . game = a , this . exists = ! 0 , this . name = "" , this . type = b . IMAGE , this . z = 0 , this . events = new b . Events ( this ) , this . animations = new b . AnimationManager ( this ) , this . key = e , PIXI . Sprite . call ( this , PIXI . TextureCache . _ _default ) , this . position . set ( c , d ) , this . world = new b . Point ( c , d ) , this . alive = ! 0 , this . autoCull = ! 1 , this . input = null , this . debug = ! 1 , this . cameraOffset = new b . Point , this . cropRect = null , this . _cache = [ 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 , 0 ] , this . _crop = null , this . _frame = null , this . _bounds = new b . Rectangle , this . loadTexture ( e , f ) } , b . Image . prototype = Object . create ( PIXI . Sprite . prototype ) , b . Image . prototype . constructor = b . Image , b . Image . prototype . preUpdate = function ( ) { if ( this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , ! this . exists || ! this . parent . exists ) return this . _cache [ 3 ] = - 1 , ! 1 ; this . autoCull && ( this . _bounds . copyFrom ( this . getBounds ( ) ) , this . renderable = this . game . world . camera . screenView . intersects ( this . _bounds ) ) , this . world . setTo ( this . game . camera . x + this . worldTransform . tx , this . game . camera . y + this . worldTransform . ty ) , this . visible && ( this . _cache [ 3 ] = this . game . stage . currentRenderOrderID ++ ) ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , b . Image . prototype . update = function ( ) { } , b . Image . prototype . postUpdate = function ( ) { this . key instanceof b . BitmapData && this . key . render ( ) , 1 === this . _cache [ 7 ] && ( this . position . x = ( this . game . camera . view . x + this . cameraOffset . x ) / this . game . camera . scale . x , this . position . y = ( this . game . camera . view . y + this . cameraOffset . y ) / this . game . camera . scale . y ) ; for ( var a = 0 , c = this . children . length ; c > a ; a ++ ) this . children [ a ] . postUpdate ( ) } , b . Image . prototype . loadTexture = function ( a , c ) { c = c || 0 , this . key = a ; var d = ! 0 , e = this . smoothed ; a instanceof b . RenderTexture ? ( this . key = a . key , this . setTexture ( a ) ) : a instanceof b . BitmapData ? this . setTexture ( a . texture ) : a instanceof PIXI . Texture ? this . setTexture ( a ) : null === a || "undefined" == typeof a ? ( this . key = "__default" , this . setTexture ( PIXI . TextureCache [ this . key ] ) ) : "string" != typeof a || this . game . cache . checkImageKey ( a ) ? ( this . setTexture ( new PIXI . Texture ( PIXI . BaseTextureCache [ a ] ) ) , d = ! this . animations . loadFrameData ( this . game . cache . getFrameData ( a ) , c ) ) : ( console . warn ( "Texture with key '" + a + "' not found." ) , this . key = "__missing" , this . s
} , 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 . constructor = b . BitmapText , b . BitmapText . prototype . setStyle = function ( ) { this . style = { align : this . _align } , this . fontName = this . _font , this . fontSize = this . _fontSize , this . dirty = ! 0 } , b . BitmapText . prototype . preUpdate = function ( ) { return this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , this . exists && this . parent . exists ? ( this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . getBounds ( ) ) ) , this . world . setTo ( this . game . camera . x + this . worldTransform . tx , this . game . camera . y + this . worldTransform . ty ) , this . visible && ( this . _cache [ 3 ] = this . game . stage . currentRenderOrderID ++ ) , ! 0 ) : ( this . renderOrderID = - 1 , ! 1 ) } , b . BitmapText . prototype . update = function ( ) { } , b . BitmapText . prototype . postUpdate = function ( ) { 1 === this . _cache [ 7 ] && ( this . position . x = ( this . game . camera . view . x + this . cameraOffset . x ) / this . game . camera . scale . x , this . position . y = ( this . game . camera . view . y + this . cameraOffset . y ) / this . game . camera . scale . y ) } , b . BitmapText . prototype . destroy = function ( a ) { if ( null !== this . game && ! this . destroyPhase ) { "undefined" == typeof a && ( a = ! 0 ) , this . _cache [ 8 ] = 1 , this . parent && ( this . parent instanceof b . Group ? this . parent . remove ( this ) : this . parent . removeChild ( this ) ) ; var c = this . children . length ; if ( a ) for ( ; c -- ; ) this . children [ c ] . destroy ? this . children [ c ] . destroy ( a ) : this . removeChild ( this . children [ c ] ) ; else for ( ; c -- ; ) this . removeChild ( this . children [ c ] ) ; this . exists = ! 1 , this . visible = ! 1 , this . filters = null , this . mask = null , this . game = null , this . _cache [ 8 ] = 0 } } , Object . defineProperty ( b . BitmapText . prototype , "align" , { get : function ( ) { return this . _align } , set : function ( a ) { a !== this . _align && ( this . _align = a , this . setStyle ( ) ) } } ) , Object . defineProperty ( b . BitmapText . prototype , "tint" , { get : function ( ) { return this . _tint } , set : function ( a ) { a !== this . _tint && ( this . _tint = a , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . BitmapText . prototype , "angle" , { get : function ( ) { return b . Math . radToDeg ( this . rotation ) } , set : function ( a ) { this . rotation = b . Math . degToRad ( a ) } } ) , Object . defineProperty ( b . BitmapText . prototype , "font" , { get : function ( ) { return this . _font } , set : function ( a ) { a !== this . _font && ( this . _font = a . trim ( ) , this . style . font = this . _fontSize + "px '" + this . _font + "'" , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . BitmapText . prototype , "fontSize" , { get : function ( ) { return this . _fontSize } , set : function ( a ) { a = parseInt ( a , 10 ) , a !== this . _fontSize && ( this . _fontSize = a , this . style . font = this . _fontSize + "px '" + this . _font + "'" , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . BitmapText . prototype , "text" , { get : function ( ) { return this . _text } , set : function ( a ) { a !== this . _text && ( this . _text = a . toString ( ) || " " , this . dirty = ! 0 ) } } ) , Object . defineProperty ( b . BitmapText . 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 . BitmapText . 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 . BitmapText . prototype , "destroyPhase" , { get : function ( ) { return ! ! this . _cache [ 8 ] } } ) , b . Button = function ( a , c , d , e , f , g , h , i , j , k ) { c = c || 0 , d = d || 0 , e = e || null , f = f || null , g = g || this , b . Image . call ( this , a , c , d , e , i ) , this . type = b . BUTTON , this . _onOverFrameName = null , this . _onOutFrameName = null , this . _onDownFrameName = null , this . _onUpFrameName = null , this . _onOverFrameID = null , this . _onOutFr
} , 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 ) { return a += b , a > c && ( a = c ) , a } , minSub : function ( a , b , c ) { return a -= b , c > a && ( a = c ) , a } , wrap : function ( a , b , c ) { var d = c - b ; if ( 0 >= d ) return 0 ; var e = ( a - b ) % d ; return 0 > e && ( e += d ) , e + b } , wrapValue : function ( a , b , c ) { var d ; return a = Math . abs ( a ) , b = Math . abs ( b ) , c = Math . abs ( c ) , d = ( a + b ) % c } , limitValue : function ( a , b , c ) { return b > a ? b : a > c ? c : a } , randomSign : function ( ) { return Math . random ( ) > . 5 ? 1 : - 1 } , isOdd : function ( a ) { return 1 & a } , isEven : function ( a ) { return 1 & a ? ! 1 : ! 0 } , min : function ( ) { if ( 1 === arguments . length && "object" == typeof arguments [ 0 ] ) var a = arguments [ 0 ] ; else var a = arguments ; for ( var b = 1 , c = 0 , d = a . length ; d > b ; b ++ ) a [ b ] < a [ c ] && ( c = b ) ; return a [ c ] } , max : function ( ) { if ( 1 === arguments . length && "object" == typeof arguments [ 0 ] ) var a = arguments [ 0 ] ; else var a = arguments ; for ( var b = 1 , c = 0 , d = a . length ; d > b ; b ++ ) a [ b ] > a [ c ] && ( c = b ) ; return a [ c ] } , minProperty : function ( a ) { if ( 2 === arguments . length && "object" == typeof arguments [ 1 ] ) var b = arguments [ 1 ] ; else var b = arguments . slice ( 1 ) ; for ( var c = 1 , d = 0 , e = b . length ; e > c ; c ++ ) b [ c ] [ a ] < b [ d ] [ a ] && ( d = c ) ; return b [ d ] [ a ] } , maxProperty : function ( a ) { if ( 2 === arguments . length && "object" == typeof arguments [ 1 ] ) var b = arguments [ 1 ] ; else var b = arguments . slice ( 1 ) ; for ( var c = 1 , d = 0 , e = b . length ; e > c ; c ++ ) b [ c ] [ a ] > b [ d ] [ a ] && ( d = c ) ; return b [ d ] [ a ] } , wrapAngle : function ( a , b ) { var c = b ? Math . PI / 180 : 1 ; return this . wrap ( a , - 180 * c , 180 * c ) } , angleLimit : function ( a , b , c ) { var d = a ; return a > c ? d = c : b > a && ( d = b ) , d } , linearInterpolation : function ( a , b ) { var c = a . length - 1 , d = c * b , e = Math . floor ( d ) ; return 0 > b ? this . linear ( a [ 0 ] , a [ 1 ] , d ) : b > 1 ? this . linear ( a [ c ] , a [ c - 1 ] , c - d ) : this . linear ( a [ e ] , a [ e + 1 > c ? c : e + 1 ] , d - e ) } , bezierInterpolation : function ( a , b ) { for ( var c = 0 , d = a . length - 1 , e = 0 ; d >= e ; e ++ ) c += Math . pow ( 1 - b , d - e ) * Math . pow ( b , e ) * a [ e ] * this . bernstein ( d , e ) ; return c } , catmullRomInterpolation : function ( a , b ) { var c = a . length - 1 , d = c * b , e = Math . floor ( d ) ; return a [ 0 ] === a [ c ] ? ( 0 > b && ( e = Math . floor ( d = c * ( 1 + b ) ) ) , this . catmullRom ( a [ ( e - 1 + c ) % c ] , a [ e ] , a [ ( e + 1 ) % c ] , a [ ( e + 2 ) % c ] , d - e ) ) : 0 > b ? a [ 0 ] - ( this . catmullRom ( a [ 0 ] , a [ 0 ] , a [ 1 ] , a [ 1 ] , - d ) - a [ 0 ] ) : b > 1 ? a [ c ] - ( this . catmullRom ( a [ c ] , a [ c ] , a [ c - 1 ] , a [ c - 1 ] , d - c ) - a [ c ] ) : this . catmullRom ( a [ e ? e - 1 : 0 ] , a [ e ] , a [ e + 1 > c ? c : e + 1 ] , a [ e + 2 > c ? c : e + 2 ] , d - e ) } , linear : function ( a , b , c ) { return ( b - a ) * c + a } , bernstein : function ( a , b ) { return this . factorial ( a ) / this . factorial ( b ) / this . factorial ( a - b ) } , factorial : function ( a ) { if ( 0 === a ) return 1 ; for ( var b = a ; -- a ; ) b *= a ; return b } , catmullRom : function ( a , b , c , d , e ) { var f = . 5 * ( c - a ) , g = . 5 * ( d - b ) , h = e * e , i = e * h ; return ( 2 * b - 2 * c + f + g ) * i + ( - 3 * b + 3 * c - 2 * f - g ) * h + f * e + b } , difference : function ( a , b ) { return Math . abs ( a - b ) } , getRandom : function ( a , b , c ) { if ( "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 0 ) , null != a ) { var d = c ; if ( ( 0 === d || d > a . length - b ) && ( d = a . length - b ) , d > 0 ) return a [ b + Math . floor ( Math . random ( ) * d ) ] } return null } , removeRandom : function ( a , b , c ) { if ( "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 0 ) , null != a ) { var d = c ; if ( ( 0 === d || d > a . length - b ) && ( d = a . length - b ) , d > 0 ) { var e = b + Math . floor ( Math . random ( ) * d ) , f = a . splice ( e , 1 ) ; return f [ 0 ] } } return null } , floor : function ( a ) { var b = 0 | a ; return a > 0 ? b : b != a ? b - 1 : b } , ceil : function ( a ) { var b = 0 | a ; return a > 0 && b != a ? b + 1 : b } , sinCosGenerator : function ( a , b , c , d ) { "undefined" == typeof b && ( b = 1 ) , "undefined" == typeof c && ( c = 1 ) , "undefined" == typeof d && ( d = 1 ) ; for ( var e = b , f = c , g = d * Math . PI / a , h = [ ] , i = [ ] , j = 0 ; a > j ; j ++ ) f -= e * g , e += f * g , h [ j ] = f , i [ j ] = e ; return { sin : i , cos : h , length : a } } , shift : function ( a ) { var b = a . shift ( ) ; return a . push ( b ) , b } , shuffleArray : function ( a ) { for ( var b = a . length - 1 ; b > 0 ; b -- ) { var c = Math . floor ( Math . random ( ) * ( b + 1 ) ) , d = a [ b ] ; a [ b ] = a [ c ] , a [ c ] = d } return a } , distance : function ( a , b
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 . dispatch ( this . _parent , this ) , this . onComplete . dispatch ( this . _parent , this ) ) } , onPause : function ( ) { this . isPlaying && ( this . _frameDiff = this . _timeNextFrame - this . game . time . now ) } , onResume : function ( ) { this . isPlaying && ( this . _timeNextFrame = this . game . time . now + this . _frameDiff ) } , update : function ( ) { return this . isPaused ? ! 1 : this . isPlaying && this . game . time . now >= this . _timeNextFrame ? ( this . _frameSkip = 1 , this . _frameDiff = this . game . time . now - this . _timeNextFrame , this . _timeLastFrame = this . game . time . now , this . _frameDiff > this . delay && ( this . _frameSkip = Math . floor ( this . _frameDiff / this . delay ) , this . _frameDiff -= this . _frameSkip * this . delay ) , this . _timeNextFrame = this . game . time . now + ( this . delay - this . _frameDiff ) , this . _frameIndex += this . _frameSkip , this . _frameIndex >= this . _frames . length && ( this . loop ? ( this . _frameIndex %= this . _frames . length , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . loopCount ++ , this . _parent . events . onAnimationLoop . dispatch ( this . _parent , this ) , this . onLoop . dispatch ( this . _parent , this ) ) : this . complete ( ) ) , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . currentFrame && ( this . _parent . setFrame ( this . currentFrame ) , this . _parent . _ _tilePattern && ( this . _parent . _ _tilePattern = ! 1 , this . _parent . tilingTexture = ! 1 ) , this . onUpdate && this . onUpdate . dispatch ( this , this . currentFrame ) ) , ! 0 ) : ! 1 } , next : function ( a ) { "undefined" == typeof a && ( a = 1 ) ; var b = this . _frameIndex + a ; b >= this . _frames . length && ( this . loop ? b %= this . _frames . length : b = this . _frames . length - 1 ) , b !== this . _frameIndex && ( this . _frameIndex = b , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . currentFrame && ( this . _parent . setFrame ( this . currentFrame ) , this . _parent . _ _tilePattern && ( this . _parent . _ _tilePattern = ! 1 , this . _parent . tilingTexture = ! 1 ) ) , this . onUpdate && this . onUpdate . dispatch ( this , this . currentFrame ) ) } , previous : function ( a ) { "undefined" == typeof a && ( a = 1 ) ; var b = this . _frameIndex - a ; 0 > b && ( this . loop ? b = this . _frames . length + b : b ++ ) , b !== this . _frameIndex && ( this . _frameIndex = b , this . currentFrame = this . _frameData . getFrame ( this . _frames [ this . _frameIndex ] ) , this . currentFrame && ( this . _parent . setFrame ( this . currentFrame ) , this . _parent . _ _tilePattern && ( this . _parent . _ _tilePattern = ! 1 , this . _parent . tilingTexture = ! 1 ) ) , this . onUpdate && this . onUpdate . dispatch ( this , this . currentFrame ) ) } , updateFrameData : function ( a ) { this . _frameData = a , this . currentFrame = this . _frameData ? this . _frameData . getFrame ( this . _frames [ this . _frameIndex % this . _frames . length ] ) : null } , destroy : function ( ) { this . game . onPause . remove ( this . onPause , this ) , this . game . onResume . remove ( this . onResume , this ) , this . game = null , this . _parent = null , this . _frames = null , this . _frameData = null , this . currentFrame = null , this . isPlaying = ! 1 , this . onStart . dispose ( ) , this . onLoop . dispose ( ) , this . onComplete . dispose ( ) , this . onUpdate && this . onUpdate . dispose ( ) } , complete : function ( ) { this . isPlaying = ! 1 , this . isFinished = ! 0 , this . paused = ! 1 , this . _parent . events . onAnimationComplete . dispatch ( this . _parent , this ) , this . onComplete . dispatch ( this . _parent , this ) , this . killOnComplete && this . _parent . kill ( ) } } , b . Animation . prototype . constructor = b . Animation , Object . defineProperty ( b . Animation . prototype , "paused" , { get : function ( ) { return this . isPaused } , set : function ( a ) { this . isPaused = a , a ? this . _pauseStartTime = this . game . time . now : this . isPlaying && ( this . _timeNextFrame = this . game . time . now + this . delay ) } } ) , Object . defineProperty ( b . Animation . prototype , "frameTotal" , { get : function ( ) { return this . _frames . length } } ) , Object . defineProperty ( b . Animation . prototype , "frame" , { get : function ( ) { return null !== this . currentFrame ? this . currentFrame . index : this . _frameIndex } , set : function ( a ) { this . currentFrame = this . _frameData . getFrame ( this . _frames [ a ] ) , null !== this . currentFrame && ( this . _frameIndex = a , this . _parent . s
case "text" : case "script" : case "physics" : this . xhrLoad ( this . _fileIndex , this . baseURL + a . url , "text" , "fileComplete" , "fileError" ) ; break ; case "binary" : this . xhrLoad ( this . _fileIndex , this . baseURL + a . url , "arraybuffer" , "fileComplete" , "fileError" ) } } , xhrLoad : function ( a , b , c , d , e ) { this . _xhr . open ( "GET" , b , ! 0 ) , this . _xhr . responseType = c ; var f = this ; this . _xhr . onload = function ( ) { return f [ d ] ( a ) } , this . _xhr . onerror = function ( ) { return f [ e ] ( a ) } , this . _xhr . send ( ) } , getAudioURL : function ( a ) { var b ; "string" == typeof a && ( a = [ a ] ) ; for ( var c = 0 ; c < a . length ; c ++ ) if ( b = a [ c ] . toLowerCase ( ) , b = b . substr ( ( Math . max ( 0 , b . lastIndexOf ( "." ) ) || 1 / 0 ) + 1 ) , this . game . device . canPlayAudio ( b ) ) return a [ c ] ; return null } , fileError : function ( a ) { this . _fileList [ a ] . loaded = ! 0 , this . _fileList [ a ] . error = ! 0 , this . onFileError . dispatch ( this . _fileList [ a ] . key , this . _fileList [ a ] ) , console . warn ( "Phaser.Loader error loading file: " + this . _fileList [ a ] . key + " from URL " + this . _fileList [ a ] . url ) , this . nextFile ( a , ! 1 ) } , fileComplete : function ( a ) { if ( ! this . _fileList [ a ] ) return void console . warn ( "Phaser.Loader fileComplete invalid index " + a ) ; var c = this . _fileList [ a ] ; c . loaded = ! 0 ; var d = ! 0 ; switch ( c . type ) { case "image" : this . game . cache . addImage ( c . key , c . url , c . data ) ; break ; case "spritesheet" : this . game . cache . addSpriteSheet ( c . key , c . url , c . data , c . frameWidth , c . frameHeight , c . frameMax , c . margin , c . spacing ) ; break ; case "textureatlas" : if ( null == c . atlasURL ) this . game . cache . addTextureAtlas ( c . key , c . url , c . data , c . atlasData , c . format ) ; else if ( d = ! 1 , c . format == b . Loader . TEXTURE _ATLAS _JSON _ARRAY || c . format == b . Loader . TEXTURE _ATLAS _JSON _HASH ) this . xhrLoad ( this . _fileIndex , this . baseURL + c . atlasURL , "text" , "jsonLoadComplete" , "dataLoadError" ) ; else { if ( c . format != b . Loader . TEXTURE _ATLAS _XML _STARLING ) throw new Error ( "Phaser.Loader. Invalid Texture Atlas format: " + c . format ) ; this . xhrLoad ( this . _fileIndex , this . baseURL + c . atlasURL , "text" , "xmlLoadComplete" , "dataLoadError" ) } break ; case "bitmapfont" : null == c . xmlURL ? this . game . cache . addBitmapFont ( c . key , c . url , c . data , c . xmlData , c . xSpacing , c . ySpacing ) : ( d = ! 1 , this . xhrLoad ( this . _fileIndex , this . baseURL + c . xmlURL , "text" , "xmlLoadComplete" , "dataLoadError" ) ) ; break ; case "audio" : if ( this . game . sound . usingWebAudio ) { if ( c . data = this . _xhr . response , this . game . cache . addSound ( c . key , c . url , c . data , ! 0 , ! 1 ) , c . autoDecode ) { var e = this , f = c . key ; this . game . cache . updateSound ( f , "isDecoding" , ! 0 ) , this . game . sound . context . decodeAudioData ( c . data , function ( a ) { a && ( e . game . cache . decodedSound ( f , a ) , e . game . sound . onSoundDecode . dispatch ( f , e . game . cache . getSound ( f ) ) ) } ) } } else c . data . removeEventListener ( "canplaythrough" , b . GAMES [ this . game . id ] . load . fileComplete ) , this . game . cache . addSound ( c . key , c . url , c . data , ! 1 , ! 0 ) ; break ; case "text" : c . data = this . _xhr . responseText , this . game . cache . addText ( c . key , c . url , c . data ) ; break ; case "physics" : var g = JSON . parse ( this . _xhr . responseText ) ; this . game . cache . addPhysicsData ( c . key , c . url , g , c . format ) ; break ; case "script" : c . data = document . createElement ( "script" ) , c . data . language = "javascript" , c . data . type = "text/javascript" , c . data . defer = ! 1 , c . data . text = this . _xhr . responseText , document . head . appendChild ( c . data ) , c . callback && ( c . data = c . callback . call ( c . callbackContext , c . key , this . _xhr . responseText ) ) ; break ; case "binary" : c . data = c . callback ? c . callback . call ( c . callbackContext , c . key , this . _xhr . response ) : this . _xhr . response , this . game . cache . addBinary ( c . key , c . data ) } d && this . nextFile ( a , ! 0 ) } , jsonLoadComplete : function ( a ) { if ( ! this . _fileList [ a ] ) return void console . warn ( "Phaser.Loader jsonLoadComplete invalid index " + a ) ; var b = this . _fileList [ a ] ; if ( this . _ajax && this . _ajax . responseText ) var c = JSON . parse ( this . _ajax . responseText ) ; else var c = JSON . parse ( this . _xhr . responseText ) ; b . loaded = ! 0 , "tilemap" === b . type ? this . game . cache . addTilemap ( b . key , b . url , c , b . format ) : "json" === b . type ? this . game . cache . addJSON ( b . key , b . url , c ) : this . game . cache . addTextureAtlas ( b . key , b . url , b . data , c , b . format ) , this . nextFile ( a , ! 0 ) } , csvLoadComplete : function ( a ) { if ( ! this . _fileList [ a ] ) return void console . warn ( "Phaser.Loader csvLoadComplete invalid index " + a ) ; var b = this . _fileList [ a ] , c = this . _xhr . responseText ; b . loaded = ! 0 , this . game . cache . addTilemap ( b . key , b . url , c , b . format ) , this . nextFile ( a , ! 0 ) } , dataLoadError : function ( a ) { var b = this . _fileList [ a ] ; b . loaded = ! 0 , b . error = ! 0 , console . warn ( " Phaser . Loader
} , hexToRGB : function ( a ) { var c = b . Color . hexToColor ( a ) ; return c ? b . Color . getColor32 ( c . a , c . r , c . g , c . b ) : void 0 } , hexToColor : function ( a , c ) { c || ( c = b . Color . createColor ( ) ) ; var d = /^#?([a-f\d])([a-f\d])([a-f\d])$/i ; a = a . replace ( d , function ( a , b , c , d ) { return b + b + c + c + d + d } ) ; var e = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i . exec ( a ) ; return e && ( c . r = parseInt ( e [ 1 ] , 16 ) , c . g = parseInt ( e [ 2 ] , 16 ) , c . b = parseInt ( e [ 3 ] , 16 ) ) , c } , componentToHex : function ( a ) { var b = a . toString ( 16 ) ; return 1 == b . length ? "0" + b : b } , HSVColorWheel : function ( a , c ) { "undefined" == typeof a && ( a = 1 ) , "undefined" == typeof c && ( c = 1 ) ; for ( var d = [ ] , e = 0 ; 359 >= e ; e ++ ) d . push ( b . Color . HSVtoRGB ( e / 359 , a , c ) ) ; return d } , HSLColorWheel : function ( a , c ) { "undefined" == typeof a && ( a = . 5 ) , "undefined" == typeof c && ( c = . 5 ) ; for ( var d = [ ] , e = 0 ; 359 >= e ; e ++ ) d . push ( b . Color . HSLtoRGB ( e / 359 , a , c ) ) ; return d } , interpolateColor : function ( a , c , d , e , f ) { "undefined" == typeof f && ( f = 255 ) ; var g = b . Color . getRGB ( a ) , h = b . Color . getRGB ( c ) , i = ( h . red - g . red ) * e / d + g . red , j = ( h . green - g . green ) * e / d + g . green , k = ( h . blue - g . blue ) * e / d + g . blue ; return b . Color . getColor32 ( f , i , j , k ) } , interpolateColorWithRGB : function ( a , c , d , e , f , g ) { var h = b . Color . getRGB ( a ) , i = ( c - h . red ) * g / f + h . red , j = ( d - h . green ) * g / f + h . green , k = ( e - h . blue ) * g / f + h . blue ; return b . Color . getColor ( i , j , k ) } , interpolateRGB : function ( a , c , d , e , f , g , h , i ) { var j = ( e - a ) * i / h + a , k = ( f - c ) * i / h + c , l = ( g - d ) * i / h + d ; return b . Color . getColor ( j , k , l ) } , getRandomColor : function ( a , c , d ) { if ( "undefined" == typeof a && ( a = 0 ) , "undefined" == typeof c && ( c = 255 ) , "undefined" == typeof d && ( d = 255 ) , c > 255 || a > c ) return b . Color . getColor ( 255 , 255 , 255 ) ; var e = a + Math . round ( Math . random ( ) * ( c - a ) ) , f = a + Math . round ( Math . random ( ) * ( c - a ) ) , g = a + Math . round ( Math . random ( ) * ( c - a ) ) ; return b . Color . getColor32 ( d , e , f , g ) } , getRGB : function ( a ) { return a > 16777215 ? { alpha : a >>> 24 , red : a >> 16 & 255 , green : a >> 8 & 255 , blue : 255 & a , a : a >>> 24 , r : a >> 16 & 255 , g : a >> 8 & 255 , b : 255 & a } : { alpha : 255 , red : a >> 16 & 255 , green : a >> 8 & 255 , blue : 255 & a , a : 255 , r : a >> 16 & 255 , g : a >> 8 & 255 , b : 255 & a } } , getWebRGB : function ( a ) { if ( "object" == typeof a ) return "rgba(" + a . r . toString ( ) + "," + a . g . toString ( ) + "," + a . b . toString ( ) + "," + ( a . a / 255 ) . toString ( ) + ")" ; var c = b . Color . getRGB ( a ) ; return "rgba(" + c . r . toString ( ) + "," + c . g . toString ( ) + "," + c . b . toString ( ) + "," + ( c . a / 255 ) . toString ( ) + ")" } , getAlpha : function ( a ) { return a >>> 24 } , getAlphaFloat : function ( a ) { return ( a >>> 24 ) / 255 } , getRed : function ( a ) { return a >> 16 & 255 } , getGreen : function ( a ) { return a >> 8 & 255 } , getBlue : function ( a ) { return 255 & a } } , b . Physics = function ( a , b ) { b = b || { } , this . game = a , this . config = b , this . arcade = null , this . p2 = null , this . ninja = null , this . box2d = null , this . chipmunk = null , this . parseConfig ( ) } , b . Physics . ARCADE = 0 , b . Physics . P2JS = 1 , b . Physics . NINJA = 2 , b . Physics . BOX2D = 3 , b . Physics . CHIPMUNK = 5 , b . Physics . prototype = { parseConfig : function ( ) { this . config . hasOwnProperty ( "arcade" ) && this . config . arcade !== ! 0 || ! b . Physics . hasOwnProperty ( "Arcade" ) || ( this . arcade = new b . Physics . Arcade ( this . game ) , this . game . time . deltaCap = . 2 ) , this . config . hasOwnProperty ( "ninja" ) && this . config . ninja === ! 0 && b . Physics . hasOwnProperty ( "Ninja" ) && ( this . ninja = new b . Physics . Ninja ( this . game ) ) , this . config . hasOwnProperty ( "p2" ) && this . config . p2 === ! 0 && b . Physics . hasOwnProperty ( "P2" ) && ( this . p2 = new b . Physics . P2 ( this . game , this . config ) ) } , startSystem : function ( a ) { if ( a === b . Physics . ARCADE ? this . arcade = new b . Physics . Arcade ( this . game ) : a === b . Physics . P2JS && ( this . p2 = new b . Physics . P2 ( this . game , this . config ) ) , a === b . Physics . NINJA ) this . ninja = new b . Physics . Ninja ( this . game ) ; else { if ( a === b . Physics . BOX2D && null === this . box2d ) throw new Error ( "The Box2D physics system has not been implemented yet." ) ; if ( a === b . Physics . CHIPMUNK && null === this . chipmunk ) throw new Error ( "The Chipmunk physics system has not been implemented yet." ) } } , enable : function ( a , c , d ) { "undefined" == typeof c && ( c = b . Physics . ARCADE ) , "undefined" == typeof d && ( d = ! 1 ) , c === b . Physics . ARCADE ? this . arcade . enable ( a ) : c === b . Physics . P2JS && this . p2 ? this . p2 . enable ( a , d ) : c === b . Physics . NINJA && this . ninja && this . ninja . enableAABB ( a ) } , preUpdate : function ( ) { this . p2 && this . p2 . preUpdate ( ) } , update : function ( ) { this . p2 && this . p2 . update ( ) } , setBoundsToWorld : function ( ) { this . arcade && this . arcade . setBoundsToWorld ( ) , this . ninja && this . ninja . setBoundsToWorld ( ) , this . p2 && this . p2 . setBoundsToWorld ( ) } , clear : function ( ) { this . p2 && this . p2 . clear ( ) } , destroy : function ( ) { this . p2
} , b . Particles . Arcade . Emitter . prototype . setSize = function ( a , b ) { this . area . width = a , this . area . height = b } , b . Particles . Arcade . Emitter . prototype . setXSpeed = function ( a , b ) { a = a || 0 , b = b || 0 , this . minParticleSpeed . x = a , this . maxParticleSpeed . x = b } , b . Particles . Arcade . Emitter . prototype . setYSpeed = function ( a , b ) { a = a || 0 , b = b || 0 , this . minParticleSpeed . y = a , this . maxParticleSpeed . y = b } , b . Particles . Arcade . Emitter . prototype . setRotation = function ( a , b ) { a = a || 0 , b = b || 0 , this . minRotation = a , this . maxRotation = b } , b . Particles . Arcade . Emitter . prototype . setAlpha = function ( a , c , d , e , f ) { if ( "undefined" == typeof a && ( a = 1 ) , "undefined" == typeof c && ( c = 1 ) , "undefined" == typeof d && ( d = 0 ) , "undefined" == typeof e && ( e = b . Easing . Linear . None ) , "undefined" == typeof f && ( f = ! 1 ) , this . minParticleAlpha = a , this . maxParticleAlpha = c , this . autoAlpha = ! 1 , d > 0 && a !== c ) { var g = { v : a } , h = this . game . make . tween ( g ) . to ( { v : c } , d , e ) ; h . yoyo ( f ) , this . alphaData = h . generateData ( 60 ) , this . alphaData . reverse ( ) , this . autoAlpha = ! 0 } } , b . Particles . Arcade . Emitter . prototype . setScale = function ( a , c , d , e , f , g , h ) { if ( "undefined" == typeof a && ( a = 1 ) , "undefined" == typeof c && ( c = 1 ) , "undefined" == typeof d && ( d = 1 ) , "undefined" == typeof e && ( e = 1 ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = b . Easing . Linear . None ) , "undefined" == typeof h && ( h = ! 1 ) , this . minParticleScale = 1 , this . maxParticleScale = 1 , this . _minParticleScale . set ( a , d ) , this . _maxParticleScale . set ( c , e ) , this . autoScale = ! 1 , f > 0 && a !== c || d !== e ) { var i = { x : a , y : d } , j = this . game . make . tween ( i ) . to ( { x : c , y : e } , f , g ) ; j . yoyo ( h ) , this . scaleData = j . generateData ( 60 ) , this . scaleData . reverse ( ) , this . autoScale = ! 0 } } , b . Particles . Arcade . Emitter . prototype . at = function ( a ) { a . center ? ( this . emitX = a . center . x , this . emitY = a . center . y ) : ( this . emitX = a . world . x + a . anchor . x * a . width , this . emitY = a . world . y + a . anchor . y * a . height ) } , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "width" , { get : function ( ) { return this . area . width } , set : function ( a ) { this . area . width = a } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "height" , { get : function ( ) { return this . area . height } , set : function ( a ) { this . area . height = a } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "x" , { get : function ( ) { return this . emitX } , set : function ( a ) { this . emitX = a } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "y" , { get : function ( ) { return this . emitY } , set : function ( a ) { this . emitY = a } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "left" , { get : function ( ) { return Math . floor ( this . x - this . area . width / 2 ) } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "right" , { get : function ( ) { return Math . floor ( this . x + this . area . width / 2 ) } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "top" , { get : function ( ) { return Math . floor ( this . y - this . area . height / 2 ) } } ) , Object . defineProperty ( b . Particles . Arcade . Emitter . prototype , "bottom" , { get : function ( ) { return Math . floor ( this . y + this . area . height / 2 ) } } ) , b . Tile = function ( a , b , c , d , e , f ) { this . layer = a , this . index = b , this . x = c , this . y = d , this . worldX = c * e , this . worldY = d * f , this . width = e , this . height = f , this . centerX = Math . abs ( e / 2 ) , this . centerY = Math . abs ( f / 2 ) , this . alpha = 1 , this . properties = { } , this . scanned = ! 1 , this . faceTop = ! 1 , this . faceBottom = ! 1 , this . faceLeft = ! 1 , this . faceRight = ! 1 , this . collideLeft = ! 1 , this . collideRight = ! 1 , this . collideUp = ! 1 , this . collideDown = ! 1 , this . collisionCallback = null , this . collisionCallbackContext = this } , b . Tile . prototype = { containsPoint : function ( a , b ) { return ! ( a < this . worldX || b < this . worldY || a > this . right || b > this . bottom ) } , intersects : function ( a , b , c , d ) { return c <= this . worldX ? ! 1 : d <= this . worldY ? ! 1 : a >= this . worldX + this . width ? ! 1 : b >= this . worldY + this . height ? ! 1 : ! 0 } , setCollisionCallback : function ( a , b ) { this . collisionCallback = a , this . collisionCallbackContext = b } , destroy : function ( ) { this . collisionCallback = null , this . collisionCallbackContext = null , this . properties = null } , setCollision : function ( a , b , c , d ) { this . collideLeft = a , this . collideRight = b , this . collideUp = c , this . collideDown = d , this . faceLeft = a , this . faceRight = b , this . faceTop = c , this . faceBottom = d } , resetCollision : function ( ) { this . collideLeft = ! 1 , this . collideRight = ! 1 , this . collideUp = ! 1 , this . collideDown = ! 1 , this . faceTop = ! 1 , this . faceBottom = ! 1 , this . faceLeft = ! 1 , this . faceRight = ! 1 } , isInteresting : function ( a , b ) { return a && b ? this . collideLeft || this . collideRig
for ( f = 0 ; f < d . layers . length ; f ++ ) for ( g = d . layers [ f ] , A = 0 ; A < g . data . length ; A ++ ) for ( i = g . data [ A ] , B = 0 ; B < i . length ; B ++ ) C = i [ B ] , C . index < 0 || ( D = d . tiles [ C . index ] [ 2 ] , p = d . tilesets [ D ] , p . tileProperties && p . tileProperties [ C . index - p . firstgid ] && ( C . properties = p . tileProperties [ C . index - p . firstgid ] ) ) ; return d } } , b . Tileset = function ( a , b , c , d , e , f , g ) { ( "undefined" == typeof c || 0 >= c ) && ( c = 32 ) , ( "undefined" == typeof d || 0 >= d ) && ( d = 32 ) , "undefined" == typeof e && ( e = 0 ) , "undefined" == typeof f && ( f = 0 ) , this . name = a , this . firstgid = b , this . tileWidth = c , this . tileHeight = d , this . tileMargin = e , this . tileSpacing = f , this . properties = g , this . image = null , this . rows = 0 , this . columns = 0 , this . total = 0 , this . drawCoords = [ ] } , b . Tileset . prototype = { draw : function ( a , b , c , d ) { this . image && this . drawCoords [ d ] && a . drawImage ( this . image , this . drawCoords [ d ] [ 0 ] , this . drawCoords [ d ] [ 1 ] , this . tileWidth , this . tileHeight , b , c , this . tileWidth , this . tileHeight ) } , setImage : function ( a ) { this . image = a , this . rows = Math . round ( ( a . height - this . tileMargin ) / ( this . tileHeight + this . tileSpacing ) ) , this . columns = Math . round ( ( a . width - this . tileMargin ) / ( this . tileWidth + this . tileSpacing ) ) , this . total = this . rows * this . columns , this . drawCoords . length = 0 ; for ( var b = this . tileMargin , c = this . tileMargin , d = this . firstgid , e = 0 ; e < this . rows ; e ++ ) { for ( var f = 0 ; f < this . columns ; f ++ ) this . drawCoords [ d ] = [ b , c ] , b += this . tileWidth + this . tileSpacing , d ++ ; b = this . tileMargin , c += this . tileHeight + this . tileSpacing } } , setSpacing : function ( a , b ) { this . tileMargin = a , this . tileSpacing = b , this . setImage ( this . image ) } } , b . Tileset . prototype . constructor = b . Tileset , "undefined" != typeof exports ? ( "undefined" != typeof module && module . exports && ( exports = module . exports = b ) , exports . Phaser = b ) : "undefined" != typeof define && define . amd ? define ( "Phaser" , function ( ) { return a . Phaser = b } ( ) ) : a . Phaser = b } . call ( this ) ;