2014-03-17 21:18:02 +00:00
/* Phaser v2.0.1 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */
2014-02-28 09:30:53 +00:00
2014-03-10 03:06:28 +00:00
( function ( ) { var a = this , b = b || { } ; b . WEBGL _RENDERER = 0 , b . CANVAS _RENDERER = 1 , b . VERSION = "v1.5.0" , 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 . INTERACTION _FREQUENCY = 30 , b . AUTO _PREVENT _DEFAULT = ! 0 , b . RAD _TO _DEG = 180 / Math . PI , b . DEG _TO _RAD = Math . PI / 180 , b . Point = function ( a , b ) { this . x = a || 0 , this . y = b || 0 } , b . Point . prototype . clone = function ( ) { return new b . Point ( this . x , this . y ) } , b . Point . prototype . constructor = b . Point , b . Point . prototype . set = function ( a , b ) { this . x = a || 0 , this . y = b || ( 0 !== b ? this . x : 0 ) } , b . Rectangle = function ( a , b , c , d ) { this . x = a || 0 , this . y = b || 0 , this . width = c || 0 , this . height = d || 0 } , b . Rectangle . prototype . clone = function ( ) { return new b . Rectangle ( this . x , this . y , this . width , this . height ) } , b . Rectangle . prototype . contains = function ( a , b ) { if ( this . width <= 0 || this . height <= 0 ) return ! 1 ; var c = this . x ; if ( a >= c && a <= c + this . width ) { var d = this . y ; if ( b >= d && b <= d + this . height ) return ! 0 } return ! 1 } , b . Rectangle . prototype . constructor = b . Rectangle , b . EmptyRectangle = new b . Rectangle ( 0 , 0 , 0 , 0 ) , b . Polygon = function ( a ) { if ( a instanceof Array || ( a = Array . prototype . slice . call ( arguments ) ) , "number" == typeof a [ 0 ] ) { for ( var c = [ ] , d = 0 , e = a . length ; e > d ; d += 2 ) c . push ( new b . Point ( a [ d ] , a [ d + 1 ] ) ) ; a = c } this . points = a } , b . Polygon . prototype . clone = function ( ) { for ( var a = [ ] , c = 0 ; c < this . points . length ; c ++ ) a . push ( this . points [ c ] . clone ( ) ) ; return new b . Polygon ( a ) } , b . Polygon . prototype . contains = function ( a , b ) { for ( var c = ! 1 , d = 0 , e = this . points . length - 1 ; d < this . points . length ; e = d ++ ) { var f = this . points [ d ] . x , g = this . points [ d ] . y , h = this . points [ e ] . x , i = this . points [ e ] . y , j = g > b != i > b && ( h - f ) * ( b - g ) / ( i - g ) + f > a ; j && ( c = ! c ) } return c } , b . Polygon . prototype . constructor = b . Polygon , b . Circle = function ( a , b , c ) { this . x = a || 0 , this . y = b || 0 , this . radius = c || 0 } , b . Circle . prototype . clone = function ( ) { return new b . Circle ( this . x , this . y , this . radius ) } , b . Circle . prototype . contains = function ( a , b ) { if ( this . radius <= 0 ) return ! 1 ; var c = this . x - a , d = this . y - b , e = this . radius * this . radius ; return c *= c , d *= d , e >= c + d } , b . Circle . prototype . constructor = b . Circle , b . Ellipse = function ( a , b , c , d ) { this . x = a || 0 , this . y = b || 0 , this . width = c || 0 , this . height = d || 0 } , b . Ellipse . prototype . clone = function ( ) { return new b . Ellipse ( this . x , this . y , this . width , this . height ) } , b . Ellipse . prototype . contains = function ( a , b ) { if ( this . width <= 0 || this . height <= 0 ) return ! 1 ; var c = ( a - this . x ) / this . width , d = ( b - this . y ) / this . height ; return c *= c , d *= d , 1 >= c + d } , b . Ellipse . prototype . getBounds = function ( ) { return new b . Rectangle ( this . x , this . y , this . width , this . height ) } , b . Ellipse . prototype . constructor = b . Ellipse , b . determineMatrixArrayType = function ( ) { return "undefined" != typeof Float32Array ? Float32Array : Array } , b . Matrix2 = b . determineMatrixArrayType ( ) , 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 ? ( this . array [ 0 ] = this . a , this . array [ 1 ] = this . c , this . array [ 2 ] = 0 , this . array [ 3 ] = this . b , this . array [ 4 ] = this . d , this . array [ 5 ] = 0 , this . array [ 6 ] = this . tx , this . array [ 7 ] = this . ty , this . array [ 8 ] = 1 ) : ( this . array [ 0 ] = this . a , this . array [ 1 ] = this . b , this . array [ 2 ] = this . tx , this . array [ 3 ] = this . c , this . array [ 4 ] = this . d , this . array [ 5 ] = this . ty , this . array [ 6 ] = 0 , this . array [ 7 ] = 0 , this . array [ 8 ] = 1 ) , b } , b . identityMatrix = new b . Matrix , 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 = new b . Rectangle ( 0 , 0 , 1 , 1 ) , 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 =
2014-03-04 01:29:04 +00:00
} , 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 ( ) { this . program = null , this . fragmentSrc = [ "precision mediump float;" , "varying vec2 vTextureCoord;" , "varying float vColor;" , "uniform float alpha;" , "uniform sampler2D uSampler;" , "void main(void) {" , " gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));" , " gl_FragColor = gl_FragColor * alpha;" , "}" ] , this . vertexSrc = [ "attribute vec2 aVertexPosition;" , "attribute vec2 aTextureCoord;" , "attribute float aColor;" , "uniform mat3 translationMatrix;" , "uniform vec2 projectionVector;" , "varying vec2 vTextureCoord;" , "uniform vec2 offsetVector;" , "varying float vColor;" , "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;" , " vColor = aColor;" , "}" ] } , b . StripShader . prototype . init = function ( ) { var a = b . 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" ) , this . translationMatrix = a . getUniformLocation ( c , "translationMatrix" ) , this . alpha = a . getUniformLocation ( c , "alpha" ) , this . program = c } , b . PrimitiveShader = function ( a ) { this . gl = a , this . program = null , this . fragmentSrc = [ "precision mediump float;" , "varying vec4 vColor;" , "void main(void) {" , " gl_FragColor = vColor;" , "}" ] , this . vertexSrc = [ "attribute vec2 aVertexPosition;" , "attribute vec4 aColor;" , "uniform mat3 translationMatrix;" , "uniform vec2 projectionVector;" , "uniform vec2 offsetVector;" , "uniform float alpha;" , "uniform vec3 tint;" , "varying vec4 vColor;" , "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);" , " vColor = aColor * vec4(tint * alpha, alpha);" , "}" ] , this . init ( ) } , b . PrimitiveShader . prototype . init = function ( ) { var a = this . gl , c = b . compileProgram ( a , this . vertexSrc , this . fragmentSrc ) ; a . useProgram ( c ) , this . projectionVector = a . getUniformLocation ( c , "projectionVector" ) , this . offsetVector = a . getUniformLocation ( c , "offsetVector" ) , this . tintColor = a . getUniformLocation ( c , "tint" ) , this . aVertexPosition = a . getAttribLocation ( c , "aVertexPosition" ) , this . colorAttribute = a . getAttribLocation ( c , "aColor" ) , this . attributes = [ this . aVertexPosition , this . colorAttribute ] , this . translationMatrix = a . getUniformLocation ( c , "translationMatrix" ) , this . alpha = a . getUniformLocation ( c , "alpha" ) , this . program = c } , b . PrimitiveShader . prototype . destroy = function ( ) { this . gl . deleteProgram ( this . program ) , this . uniforms = null , this . gl = null , this . attribute = null } , b . WebGLGraphics = function ( ) { } , b . WebGLGraphics . renderGraphics = function ( a , c ) { var d = c . gl , e = c . projection , f = c . offset , g = c . shaderManager . primitiveShader ; a . _w
2014-03-17 21:18:02 +00:00
} , b . WebGLFilterManager . prototype . applyFilterPass = function ( a , c , d , e ) { var f = this . gl , g = a . shaders [ f . id ] ; g || ( g = new b . PixiShader ( f ) , g . fragmentSrc = a . fragmentSrc , g . uniforms = a . uniforms , g . init ( ) , a . shaders [ f . id ] = g ) , f . useProgram ( g . program ) , f . uniform2f ( g . projectionVector , d / 2 , - e / 2 ) , f . uniform2f ( g . offsetVector , 0 , 0 ) , a . uniforms . dimensions && ( a . uniforms . dimensions . value [ 0 ] = this . width , a . uniforms . dimensions . value [ 1 ] = this . height , a . uniforms . dimensions . value [ 2 ] = this . vertexArray [ 0 ] , a . uniforms . dimensions . value [ 3 ] = this . vertexArray [ 5 ] ) , g . syncUniforms ( ) , f . bindBuffer ( f . ARRAY _BUFFER , this . vertexBuffer ) , f . vertexAttribPointer ( g . aVertexPosition , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ARRAY _BUFFER , this . uvBuffer ) , f . vertexAttribPointer ( g . aTextureCoord , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ARRAY _BUFFER , this . colorBuffer ) , f . vertexAttribPointer ( g . colorAttribute , 2 , f . FLOAT , ! 1 , 0 , 0 ) , f . bindBuffer ( f . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , f . drawElements ( f . TRIANGLES , 6 , f . UNSIGNED _SHORT , 0 ) , this . renderSession . drawCount ++ } , b . WebGLFilterManager . prototype . initShaderBuffers = function ( ) { var a = this . gl ; this . vertexBuffer = a . createBuffer ( ) , this . uvBuffer = a . createBuffer ( ) , this . colorBuffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , this . vertexArray = new Float32Array ( [ 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . vertexArray , a . STATIC _DRAW ) , this . uvArray = new Float32Array ( [ 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . uvBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . uvArray , a . STATIC _DRAW ) , this . colorArray = new Float32Array ( [ 1 , 16777215 , 1 , 16777215 , 1 , 16777215 , 1 , 16777215 ] ) , a . bindBuffer ( a . ARRAY _BUFFER , this . colorBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . colorArray , a . STATIC _DRAW ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , new Uint16Array ( [ 0 , 1 , 2 , 1 , 3 , 2 ] ) , a . STATIC _DRAW ) } , b . WebGLFilterManager . prototype . destroy = function ( ) { var a = this . gl ; this . filterStack = null , this . offsetX = 0 , this . offsetY = 0 ; for ( var b = 0 ; b < this . texturePool . length ; b ++ ) this . texturePool . destroy ( ) ; this . texturePool = null , a . deleteBuffer ( this . vertexBuffer ) , a . deleteBuffer ( this . uvBuffer ) , a . deleteBuffer ( this . colorBuffer ) , a . deleteBuffer ( this . indexBuffer ) } , b . FilterTexture = function ( a , b , c ) { this . gl = a , this . frameBuffer = a . createFramebuffer ( ) , this . texture = a . createTexture ( ) , a . bindTexture ( a . TEXTURE _2D , this . texture ) , a . texParameteri ( a . TEXTURE _2D , a . TEXTURE _MAG _FILTER , a . LINEAR ) , a . texParameteri ( a . TEXTURE _2D , a . TEXTURE _MIN _FILTER , a . LINEAR ) , a . texParameteri ( a . TEXTURE _2D , a . TEXTURE _WRAP _S , a . CLAMP _TO _EDGE ) , a . texParameteri ( a . TEXTURE _2D , a . TEXTURE _WRAP _T , a . CLAMP _TO _EDGE ) , a . bindFramebuffer ( a . FRAMEBUFFER , this . framebuffer ) , a . bindFramebuffer ( a . FRAMEBUFFER , this . frameBuffer ) , a . framebufferTexture2D ( a . FRAMEBUFFER , a . COLOR _ATTACHMENT0 , a . TEXTURE _2D , this . texture , 0 ) , this . resize ( b , c ) } , b . FilterTexture . prototype . clear = function ( ) { var a = this . gl ; a . clearColor ( 0 , 0 , 0 , 0 ) , a . clear ( a . COLOR _BUFFER _BIT ) } , b . FilterTexture . prototype . resize = function ( a , b ) { if ( this . width !== a || this . height !== b ) { this . width = a , this . height = b ; var c = this . gl ; c . bindTexture ( c . TEXTURE _2D , this . texture ) , c . texImage2D ( c . TEXTURE _2D , 0 , c . RGBA , a , b , 0 , c . RGBA , c . UNSIGNED _BYTE , null ) } } , b . FilterTexture . prototype . destroy = function ( ) { var a = this . gl ; a . deleteFramebuffer ( this . frameBuffer ) , a . deleteTexture ( this . texture ) , this . frameBuffer = null , this . texture = null } , b . CanvasMaskManager = function ( ) { } , b . CanvasMaskManager . prototype . pushMask = function ( a , c ) { c . save ( ) ; var d = a . alpha , e = a . worldTransform ; c . setTransform ( e . a , e . c , e . b , e . d , e . tx , e . ty ) , b . CanvasGraphics . renderGraphicsMask ( a , c ) , c . clip ( ) , a . worldAlpha = d } , b . CanvasMaskManager . prototype . popMask = function ( a ) { a . restore ( ) } , b . CanvasTinter = function ( ) { } , b . CanvasTinter . getTintedTexture = function ( a , c ) { var d = a . texture ; c = b . CanvasTinter . roundColor ( c ) ; var e = "#" + ( "00000" + ( 0 | c ) . toString ( 16 ) ) . substr ( - 6 ) ; if ( d . tintCache = d . tintCache || { } , d . tintCache [ e ] ) return d . tintCache [ e ] ; var f = b . CanvasTinter . canvas || document . createElement ( "canvas" ) ; if ( b . CanvasTinter . tintMethod ( d , c , f ) , b . CanvasTinter . convertTintToImage ) { var g = new Image ; g . src = f . toDataURL ( ) , d . tintCache [ e ] = g } else d . tintCache [ e ] = f , b . CanvasTinter . canvas = null ; return f } , b . CanvasTinter . tintWithMultiply = function ( a , b , c ) { v
2014-03-19 13:23:46 +00:00
a = Array ( g + 1 ) . join ( c ) + a + Array ( f + 1 ) . join ( c ) ; break ; default : a += Array ( b + 1 - a . length ) . join ( c ) } return a } , isPlainObject : function ( a ) { if ( "object" != typeof a || a . nodeType || a === a . window ) return ! 1 ; try { if ( a . constructor && ! hasOwn . call ( a . constructor . prototype , "isPrototypeOf" ) ) return ! 1 } catch ( b ) { return ! 1 } return ! 0 } , extend : function ( ) { var a , c , d , e , f , g , h = arguments [ 0 ] || { } , i = 1 , j = arguments . length , k = ! 1 ; for ( "boolean" == typeof h && ( k = h , h = arguments [ 1 ] || { } , i = 2 ) , j === i && ( h = this , -- i ) ; j > i ; i ++ ) if ( null != ( a = arguments [ i ] ) ) for ( c in a ) d = h [ c ] , e = a [ c ] , h !== e && ( k && e && ( b . Utils . isPlainObject ( e ) || ( f = Array . isArray ( e ) ) ) ? ( f ? ( f = ! 1 , g = d && Array . isArray ( d ) ? d : [ ] ) : g = d && b . Utils . isPlainObject ( d ) ? d : { } , h [ c ] = b . Utils . extend ( k , g , e ) ) : void 0 !== e && ( h [ c ] = e ) ) ; return h } } , "function" != typeof Function . prototype . bind && ( Function . prototype . bind = function ( ) { var a = Array . prototype . slice ; return function ( b ) { function c ( ) { var f = e . concat ( a . call ( arguments ) ) ; d . apply ( this instanceof c ? this : b , f ) } var d = this , e = a . call ( arguments , 1 ) ; if ( "function" != typeof d ) throw new TypeError ; return c . prototype = function f ( a ) { return a && ( f . prototype = a ) , this instanceof f ? void 0 : new f } ( d . prototype ) , c } } ( ) ) , Array . isArray || ( Array . isArray = function ( a ) { return "[object Array]" == Object . prototype . toString . call ( a ) } ) , b . Circle = function ( a , b , c ) { a = a || 0 , b = b || 0 , c = c || 0 , this . x = a , this . y = b , this . _diameter = c , this . _radius = c > 0 ? . 5 * c : 0 } , b . Circle . prototype = { circumference : function ( ) { return 2 * Math . PI * this . _radius } , setTo : function ( a , b , c ) { return this . x = a , this . y = b , this . _diameter = c , this . _radius = . 5 * c , this } , copyFrom : function ( a ) { return this . setTo ( a . x , a . y , a . diameter ) } , copyTo : function ( a ) { return a . x = this . x , a . y = this . y , a . diameter = this . _diameter , a } , distance : function ( a , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? b . Math . distanceRound ( this . x , this . y , a . x , a . y ) : b . Math . distance ( this . x , this . y , a . x , a . y ) } , clone : function ( a ) { return "undefined" == typeof a ? a = new b . Circle ( this . x , this . y , this . diameter ) : a . setTo ( this . x , this . y , this . diameter ) , a } , contains : function ( a , c ) { return b . Circle . contains ( this , a , c ) } , circumferencePoint : function ( a , c , d ) { return b . Circle . circumferencePoint ( this , a , c , d ) } , offset : function ( a , b ) { return this . x += a , this . y += b , this } , offsetPoint : function ( a ) { return this . offset ( a . x , a . y ) } , toString : function ( ) { return "[{Phaser.Circle (x=" + this . x + " y=" + this . y + " diameter=" + this . diameter + " radius=" + this . radius + ")}]" } } , b . Circle . prototype . constructor = b . Circle , Object . defineProperty ( b . Circle . prototype , "diameter" , { get : function ( ) { return this . _diameter } , set : function ( a ) { a > 0 && ( this . _diameter = a , this . _radius = . 5 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "radius" , { get : function ( ) { return this . _radius } , set : function ( a ) { a > 0 && ( this . _radius = a , this . _diameter = 2 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "left" , { get : function ( ) { return this . x - this . _radius } , set : function ( a ) { a > this . x ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = this . x - a } } ) , Object . defineProperty ( b . Circle . prototype , "right" , { get : function ( ) { return this . x + this . _radius } , set : function ( a ) { a < this . x ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = a - this . x } } ) , Object . defineProperty ( b . Circle . prototype , "top" , { get : function ( ) { return this . y - this . _radius } , set : function ( a ) { a > this . y ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = this . y - a } } ) , Object . defineProperty ( b . Circle . prototype , "bottom" , { get : function ( ) { return this . y + this . _radius } , set : function ( a ) { a < this . y ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = a - this . y } } ) , Object . defineProperty ( b . Circle . prototype , "area" , { get : function ( ) { return this . _radius > 0 ? Math . PI * this . _radius * this . _radius : 0 } } ) , Object . defineProperty ( b . Circle . prototype , "empty" , { get : function ( ) { return 0 === this . _diameter } , set : function ( a ) { a === ! 0 && this . setTo ( 0 , 0 , 0 ) } } ) , b . Circle . contains = function ( a , b , c ) { if ( a . radius > 0 && b >= a . left && b <= a . right && c >= a . top && c <= a . bottom ) { var d = ( a . x - b ) * ( a . x - b ) , e = ( a . y - c ) * ( a . y - c ) ; return d + e <= a . radius * a . radius } return ! 1 } , b . Circle . equals = function ( a , b ) { return a . x == b . x && a . y == b . y && a . diameter == b . diameter } , b . Circle . intersects = function ( a , c ) { return b . Math . distance ( a . x , a . y , c . x , c . y ) <= a . radius + c . radius } , b . Circle . circumferencePoint = function ( a , c , d , e ) { return "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = new b . Point ) , d === ! 0 && ( c = b . Math . degToRad ( c ) ) , e . x = a . x + a . radius * Math . cos ( c ) , e
} } ) , b . Plugin = function ( a , b ) { "undefined" == typeof b && ( b = null ) , this . game = a , this . parent = b , this . active = ! 1 , this . visible = ! 1 , this . hasPreUpdate = ! 1 , this . hasUpdate = ! 1 , this . hasPostUpdate = ! 1 , this . hasRender = ! 1 , this . hasPostRender = ! 1 } , b . Plugin . prototype = { preUpdate : function ( ) { } , update : function ( ) { } , render : function ( ) { } , postRender : function ( ) { } , destroy : function ( ) { this . game = null , this . parent = null , this . active = ! 1 , this . visible = ! 1 } } , b . Plugin . prototype . constructor = b . Plugin , b . PluginManager = function ( a , b ) { this . game = a , this . _parent = b , this . plugins = [ ] , this . _pluginsLength = 0 } , b . PluginManager . prototype = { add : function ( a ) { var b = ! 1 ; return "function" == typeof a ? a = new a ( this . game , this . _parent ) : ( a . game = this . game , a . parent = this . _parent ) , "function" == typeof a . preUpdate && ( a . hasPreUpdate = ! 0 , b = ! 0 ) , "function" == typeof a . update && ( a . hasUpdate = ! 0 , b = ! 0 ) , "function" == typeof a . postUpdate && ( a . hasPostUpdate = ! 0 , b = ! 0 ) , "function" == typeof a . render && ( a . hasRender = ! 0 , b = ! 0 ) , "function" == typeof a . postRender && ( a . hasPostRender = ! 0 , b = ! 0 ) , b ? ( ( a . hasPreUpdate || a . hasUpdate || a . hasPostUpdate ) && ( a . active = ! 0 ) , ( a . hasRender || a . hasPostRender ) && ( a . visible = ! 0 ) , this . _pluginsLength = this . plugins . push ( a ) , "function" == typeof a . init && a . init ( ) , a ) : null } , remove : function ( a ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) if ( this . plugins [ this . _p ] === a ) return a . destroy ( ) , this . plugins . splice ( this . _p , 1 ) , void this . _pluginsLength -- } , removeAll : function ( ) { for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . destroy ( ) ; this . plugins . length = 0 , this . _pluginsLength = 0 } , preUpdate : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasPreUpdate && this . plugins [ this . _p ] . preUpdate ( ) } , update : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasUpdate && this . plugins [ this . _p ] . update ( ) } , postUpdate : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . active && this . plugins [ this . _p ] . hasPostUpdate && this . plugins [ this . _p ] . postUpdate ( ) } , render : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . visible && this . plugins [ this . _p ] . hasRender && this . plugins [ this . _p ] . render ( ) } , postRender : function ( ) { if ( 0 !== this . _pluginsLength ) for ( this . _p = 0 ; this . _p < this . _pluginsLength ; this . _p ++ ) this . plugins [ this . _p ] . visible && this . plugins [ this . _p ] . hasPostRender && this . plugins [ this . _p ] . postRender ( ) } , destroy : function ( ) { this . plugins . length = 0 , this . _pluginsLength = 0 , this . game = null , this . _parent = null } } , b . PluginManager . prototype . constructor = b . PluginManager , b . Stage = function ( a , c , d ) { this . game = a , this . offset = new b . Point , PIXI . Stage . call ( this , 0 , ! 1 ) , this . name = "_stage_root" , this . interactive = ! 1 , this . disableVisibilityChange = ! 1 , this . checkOffsetInterval = 2500 , this . exists = ! 0 , this . currentRenderOrderID = 0 , this . _hiddenVar = "hidden" , this . _nextOffsetCheck = 0 , this . _backgroundColor = 0 , a . config ? this . parseConfig ( a . config ) : ( this . game . canvas = b . Canvas . create ( c , d ) , this . game . canvas . style [ "-webkit-full-screen" ] = "width: 100%; height: 100%" ) } , b . Stage . prototype = Object . create ( PIXI . Stage . prototype ) , b . Stage . prototype . constructor = b . Stage , 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 ( ) } this . checkOffsetInterval !== ! 1 && this . game . time . now > this . _nextOffsetCheck && ( b . Canvas . getOffset ( this . game . canvas , this . offset ) , this . _nextOffsetCheck = this . game . time . now + this . checkOffsetInterval ) } , b . Stage . prototype . parseConfig = function ( a ) { this . game . canvas = a . canvasID ? b
2014-03-19 13:22:04 +00:00
} , setUpRenderer : function ( ) { if ( this . device . trident && ( this . renderType = b . CANVAS ) , this . renderType === b . HEADLESS || this . renderType === b . CANVAS || this . renderType === b . AUTO && this . device . webGL === ! 1 ) { if ( ! this . device . canvas ) throw new Error ( "Phaser.Game - cannot create Canvas or WebGL context, aborting." ) ; this . renderType === b . AUTO && ( this . renderType = b . CANVAS ) , this . renderer = new PIXI . CanvasRenderer ( this . width , this . height , this . canvas , this . transparent ) , this . context = this . renderer . context } else this . renderType = b . WEBGL , this . renderer = new PIXI . WebGLRenderer ( this . width , this . height , this . canvas , this . transparent , this . antialias ) , this . context = null ; this . renderType !== b . HEADLESS && ( this . stage . smoothed = this . antialias , b . Canvas . addToDOM ( this . canvas , this . parent , ! 0 ) , b . Canvas . setTouchAction ( this . canvas ) ) } , update : function ( a ) { this . time . update ( a ) , this . _paused || this . pendingStep ? this . debug . preUpdate ( ) : ( this . stepping && ( this . pendingStep = ! 0 ) , this . debug . preUpdate ( ) , this . physics . preUpdate ( ) , this . state . preUpdate ( ) , this . plugins . preUpdate ( ) , this . stage . preUpdate ( ) , this . stage . update ( ) , this . tweens . update ( ) , this . sound . update ( ) , this . input . update ( ) , this . state . update ( ) , this . physics . update ( ) , this . particles . update ( ) , this . plugins . update ( ) , this . stage . postUpdate ( ) , this . plugins . postUpdate ( ) ) , this . renderType != b . HEADLESS && ( this . renderer . render ( this . stage ) , this . plugins . render ( ) , this . state . render ( ) , this . plugins . postRender ( ) ) } , enableStep : function ( ) { this . stepping = ! 0 , this . pendingStep = ! 1 , this . stepCount = 0 } , disableStep : function ( ) { this . stepping = ! 1 , this . pendingStep = ! 1 } , step : function ( ) { this . pendingStep = ! 1 , this . stepCount ++ } , destroy : function ( ) { this . raf . stop ( ) , this . input . destroy ( ) , this . state . destroy ( ) , this . physics . destroy ( ) , this . state = null , this . cache = null , this . input = null , this . load = null , this . sound = null , this . stage = null , this . time = null , this . world = null , this . isBooted = ! 1 } , gamePaused : function ( a ) { this . _paused || ( this . _paused = ! 0 , this . time . gamePaused ( ) , this . sound . setMute ( ) , this . onPause . dispatch ( a ) ) } , gameResumed : function ( a ) { this . _paused && ! this . _codePaused && ( this . _paused = ! 1 , this . time . gameResumed ( ) , this . input . reset ( ) , this . sound . unsetMute ( ) , this . onResume . dispatch ( a ) ) } , focusLoss : function ( a ) { this . onBlur . dispatch ( a ) , this . gamePaused ( a ) } , focusGain : function ( a ) { this . onFocus . dispatch ( a ) , this . gameResumed ( a ) } } , b . Game . prototype . constructor = b . Game , Object . defineProperty ( b . Game . prototype , "paused" , { get : function ( ) { return this . _paused } , set : function ( a ) { a === ! 0 ? this . _paused === ! 1 && ( this . _paused = ! 0 , this . _codePaused = ! 0 , this . sound . mute = ! 0 , this . time . gamePaused ( ) , this . onPause . dispatch ( this ) ) : this . _paused && ( this . _paused = ! 1 , this . _codePaused = ! 1 , this . input . reset ( ) , this . sound . mute = ! 1 , this . time . gameResumed ( ) , this . onResume . dispatch ( this ) ) } } ) , b . Input = function ( a ) { this . game = a , this . hitCanvas = null , this . hitContext = null , this . moveCallback = null , this . moveCallbackContext = this , this . pollRate = 0 , this . disabled = ! 1 , this . multiInputOverride = b . Input . MOUSE _TOUCH _COMBINE , this . position = null , this . speed = null , this . circle = null , this . scale = null , this . maxPointers = 10 , this . currentPointers = 0 , this . tapRate = 200 , this . doubleTapRate = 300 , this . holdRate = 2e3 , this . justPressedRate = 200 , this . justReleasedRate = 200 , this . recordPointerHistory = ! 1 , this . recordRate = 100 , this . recordLimit = 100 , this . pointer1 = null , this . pointer2 = null , this . pointer3 = null , this . pointer4 = null , this . pointer5 = null , this . pointer6 = null , this . pointer7 = null , this . pointer8 = null , this . pointer9 = null , this . pointer10 = null , this . activePointer = null , this . mousePointer = null , this . mouse = null , this . keyboard = null , this . touch = null , this . mspointer = null , this . gamepad = null , this . onDown = null , this . onUp = null , this . onTap = null , this . onHold = null , this . interactiveItems = new b . LinkedList , this . _localPoint = new b . Point , this . _pollCounter = 0 , this . _oldPosition = null , this . _x = 0 , this . _y = 0 } , b . Input . MOUSE _OVERRIDES _TOUCH = 0 , b . Input . TOUCH _OVERRIDES _MOUSE = 1 , b . Input . MOUSE _TOUCH _COMBINE = 2 , b . Input . prototype = { boot : function ( ) { this . mousePointer = new b . Pointer ( this . game , 0 ) , this . pointer1 = new b . Pointer ( this . game , 1 ) , this . pointer2 = new b . Pointer ( this . game , 2 ) , this . mouse = new b . Mouse ( this . game ) , this . keyboard = new b . Keyboard ( this . game ) , this . touch = new b . Touch ( this . game ) , this . mspointer = new b . MSPointer ( this . game ) , this . ga
2014-03-20 03:48:54 +00:00
} , start : function ( ) { if ( ! this . _active ) { this . _active = ! 0 ; var a = this ; this . _ongamepadconnected = function ( b ) { var c = b . gamepad ; a . _rawPads . push ( c ) , a . _gamepads [ c . index ] . connect ( c ) } , window . addEventListener ( "gamepadconnected" , this . _ongamepadconnected , ! 1 ) , this . _ongamepaddisconnected = function ( b ) { var c = b . gamepad ; for ( var d in a . _rawPads ) a . _rawPads [ d ] . index === c . index && a . _rawPads . splice ( d , 1 ) ; a . _gamepads [ c . index ] . disconnect ( ) } , window . addEventListener ( "gamepaddisconnected" , this . _ongamepaddisconnected , ! 1 ) } } , update : function ( ) { this . _pollGamepads ( ) ; for ( var a = 0 ; a < this . _gamepads . length ; a ++ ) this . _gamepads [ a ] . _connected && this . _gamepads [ a ] . pollStatus ( ) } , _pollGamepads : function ( ) { var a = navigator . getGamepads || navigator . webkitGetGamepads && navigator . webkitGetGamepads ( ) || navigator . webkitGamepads ; if ( a ) { this . _rawPads = [ ] ; for ( var b = ! 1 , c = 0 ; c < a . length && ( typeof a [ c ] !== this . _prevRawGamepadTypes [ c ] && ( b = ! 0 , this . _prevRawGamepadTypes [ c ] = typeof a [ c ] ) , a [ c ] && this . _rawPads . push ( a [ c ] ) , 3 !== c ) ; c ++ ) ; if ( b ) { for ( var d , e = { rawIndices : { } , padIndices : { } } , f = 0 ; f < this . _gamepads . length ; f ++ ) if ( d = this . _gamepads [ f ] , d . connected ) for ( var g = 0 ; g < this . _rawPads . length ; g ++ ) this . _rawPads [ g ] . index === d . index && ( e . rawIndices [ d . index ] = ! 0 , e . padIndices [ f ] = ! 0 ) ; for ( var h = 0 ; h < this . _gamepads . length ; h ++ ) if ( d = this . _gamepads [ h ] , ! e . padIndices [ h ] ) { this . _rawPads . length < 1 && d . disconnect ( ) ; for ( var i = 0 ; i < this . _rawPads . length && ! e . padIndices [ h ] ; i ++ ) { var j = this . _rawPads [ i ] ; if ( j ) { if ( e . rawIndices [ j . index ] ) { d . disconnect ( ) ; continue } d . connect ( j ) , e . rawIndices [ j . index ] = ! 0 , e . padIndices [ h ] = ! 0 } else d . disconnect ( ) } } } } } , setDeadZones : function ( a ) { for ( var b = 0 ; b < this . _gamepads . length ; b ++ ) this . _gamepads [ b ] . deadZone = a } , stop : function ( ) { this . _active = ! 1 , window . removeEventListener ( "gamepadconnected" , this . _ongamepadconnected ) , window . removeEventListener ( "gamepaddisconnected" , this . _ongamepaddisconnected ) } , reset : function ( ) { this . update ( ) ; for ( var a = 0 ; a < this . _gamepads . length ; a ++ ) this . _gamepads [ a ] . reset ( ) } , justPressed : function ( a , b ) { for ( var c = 0 ; c < this . _gamepads . length ; c ++ ) if ( this . _gamepads [ c ] . justPressed ( a , b ) === ! 0 ) return ! 0 ; return ! 1 } , justReleased : function ( a , b ) { for ( var c = 0 ; c < this . _gamepads . length ; c ++ ) if ( this . _gamepads [ c ] . justReleased ( a , b ) === ! 0 ) return ! 0 ; return ! 1 } , isDown : function ( a ) { for ( var b = 0 ; b < this . _gamepads . length ; b ++ ) if ( this . _gamepads [ b ] . isDown ( a ) === ! 0 ) return ! 0 ; return ! 1 } } , b . Gamepad . prototype . constructor = b . Gamepad , Object . defineProperty ( b . Gamepad . prototype , "active" , { get : function ( ) { return this . _active } } ) , Object . defineProperty ( b . Gamepad . prototype , "supported" , { get : function ( ) { return this . _gamepadSupportAvailable } } ) , Object . defineProperty ( b . Gamepad . prototype , "padsConnected" , { get : function ( ) { return this . _rawPads . length } } ) , Object . defineProperty ( b . Gamepad . prototype , "pad1" , { get : function ( ) { return this . _gamepads [ 0 ] } } ) , Object . defineProperty ( b . Gamepad . prototype , "pad2" , { get : function ( ) { return this . _gamepads [ 1 ] } } ) , Object . defineProperty ( b . Gamepad . prototype , "pad3" , { get : function ( ) { return this . _gamepads [ 2 ] } } ) , Object . defineProperty ( b . Gamepad . prototype , "pad4" , { get : function ( ) { return this . _gamepads [ 3 ] } } ) , b . Gamepad . BUTTON _0 = 0 , b . Gamepad . BUTTON _1 = 1 , b . Gamepad . BUTTON _2 = 2 , b . Gamepad . BUTTON _3 = 3 , b . Gamepad . BUTTON _4 = 4 , b . Gamepad . BUTTON _5 = 5 , b . Gamepad . BUTTON _6 = 6 , b . Gamepad . BUTTON _7 = 7 , b . Gamepad . BUTTON _8 = 8 , b . Gamepad . BUTTON _9 = 9 , b . Gamepad . BUTTON _10 = 10 , b . Gamepad . BUTTON _11 = 11 , b . Gamepad . BUTTON _12 = 12 , b . Gamepad . BUTTON _13 = 13 , b . Gamepad . BUTTON _14 = 14 , b . Gamepad . BUTTON _15 = 15 , b . Gamepad . AXIS _0 = 0 , b . Gamepad . AXIS _1 = 1 , b . Gamepad . AXIS _2 = 2 , b . Gamepad . AXIS _3 = 3 , b . Gamepad . AXIS _4 = 4 , b . Gamepad . AXIS _5 = 5 , b . Gamepad . AXIS _6 = 6 , b . Gamepad . AXIS _7 = 7 , b . Gamepad . AXIS _8 = 8 , b . Gamepad . AXIS _9 = 9 , b . Gamepad . XBOX360 _A = 0 , b . Gamepad . XBOX360 _B = 1 , b . Gamepad . XBOX360 _X = 2 , b . Gamepad . XBOX360 _Y = 3 , b . Gamepad . XBOX360 _LEFT _BUMPER = 4 , b . Gamepad . XBOX360 _RIGHT _BUMPER = 5 , b . Gamepad . XBOX360 _LEFT _TRIGGER = 6 , b . Gamepad . XBOX360 _RIGHT _TRIGGER = 7 , b . Gamepad . XBOX360 _BACK = 8 , b . Gamepad . XBOX360 _START = 9 , b . Gamepad . XBOX360 _STICK _LEFT _BUTTON = 10 , b . Gamepad . XBOX360 _STICK _RIGHT _BUTTON = 11 , b . Gamepad . XBOX360 _DPAD _LEFT = 14 , b . Gamepad . XBOX360 _DPAD _RIGHT = 15 , b . Gamepad . XBOX360 _DPAD _UP = 12 , b . Gamepad . XBOX360 _DPAD _DOWN = 13 , b . Gamepad . XBOX360 _STICK _LEFT _X = 0 , b . Gamepad . XBOX360 _STICK _LEFT _Y = 1 , b . Gamepad . XBOX360 _S
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 ; if ( this . lifespan > 0 && ( this . lifespan -= this . game . time . elapsed , this . lifespan <= 0 ) ) return this . kill ( ) , ! 1 ; if ( ( this . autoCull || this . checkWorldBounds ) && this . _bounds . copyFrom ( this . getBounds ( ) ) , this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . _bounds ) ) , this . checkWorldBounds ) if ( 1 === this . _cache [ 5 ] && this . game . world . bounds . intersects ( this . _bounds ) ) this . _cache [ 5 ] = 0 , this . events . onEnterBounds . dispatch ( this ) ; else if ( 0 === this . _cache [ 5 ] && ! this . game . world . bounds . intersects ( this . _bounds ) && ( this . _cache [ 5 ] = 1 , this . events . onOutOfBounds . dispatch ( this ) , this . outOfBoundsKill ) ) return this . kill ( ) , ! 1 ; 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 ++ ) , this . animations . update ( ) , this . body && this . body . preUpdate ( ) ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , b . Sprite . prototype . update = function ( ) { } , b . Sprite . prototype . postUpdate = function ( ) { this . key instanceof b . BitmapData && this . key . _dirty && this . key . render ( ) , this . exists && this . body && this . body . postUpdate ( ) , 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 . Sprite . prototype . loadTexture = function ( a , c ) { return c = c || 0 , a instanceof b . RenderTexture ? ( this . key = a . key , void this . setTexture ( a ) ) : a instanceof b . BitmapData ? ( this . key = a . key , void this . setTexture ( a . texture ) ) : a instanceof PIXI . Texture ? ( this . key = a , void this . setTexture ( a ) ) : null === a || "undefined" == typeof a ? ( this . key = "__default" , void this . setTexture ( PIXI . TextureCache [ this . key ] ) ) : "string" != typeof a || this . game . cache . checkImageKey ( a ) ? this . game . cache . isSpriteSheet ( a ) ? ( this . key = a , this . animations . loadFrameData ( this . game . cache . getFrameData ( a ) ) , "string" == typeof c ? this . frameName = c : this . frame = c , void 0 ) : ( this . key = a , void this . setTexture ( PIXI . TextureCache [ a ] ) ) : ( this . key = "__missing" , void this . setTexture ( PIXI . TextureCache [ this . key ] ) ) } , b . Sprite . prototype . crop = function ( a ) { if ( "undefined" == typeof a || null === a ) this . texture . hasOwnProperty ( "sourceWidth" ) && this . texture . setFrame ( new b . Rectangle ( 0 , 0 , this . texture . sourceWidth , this . texture . sourceHeight ) ) ; else if ( this . texture instanceof PIXI . Texture ) { var c = { } ; b . Utils . extend ( ! 0 , c , this . texture ) , c . sourceWidth = c . width , c . sourceHeight = c . height , c . frame = a , c . width = a . width , c . height = a . height , this . texture = c , this . texture . updateFrame = ! 0 , PIXI . Texture . frameUpdates . push ( this . texture ) } else this . texture . setFrame ( a ) } , b . Sprite . prototype . revive = function ( a ) { return "undefined" == typeof a && ( a = 1 ) , this . alive = ! 0 , this . exists = ! 0 , this . visible = ! 0 , this . health = a , this . events && this . events . onRevived . dispatch ( this ) , this } , 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 ) { "undefined" == typeof a && ( a = ! 0 ) , 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 . alive = ! 1 , this . exists = ! 1 , this . visible = ! 1 , this . filters = null , this . mask = null , this . game = null } } , 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
} , b . Button . prototype . onInputDownHandler = function ( a , b ) { this . freezeFrames === ! 1 && this . setState ( 3 ) , this . onDownSound && this . onDownSound . play ( this . onDownSoundMarker ) , this . onInputDown && this . onInputDown . dispatch ( this , b ) } , b . Button . prototype . onInputUpHandler = function ( a , b , c ) { this . onUpSound && this . onUpSound . play ( this . onUpSoundMarker ) , this . onInputUp && this . onInputUp . dispatch ( this , b , c ) , this . freezeFrames || this . setState ( this . forceOut ? 2 : null !== this . _onUpFrameName || null !== this . _onUpFrameID ? 4 : c ? 1 : 2 ) } , b . Button . prototype . setState = function ( a ) { 1 === a ? null != this . _onOverFrameName ? this . frameName = this . _onOverFrameName : null != this . _onOverFrameID && ( this . frame = this . _onOverFrameID ) : 2 === a ? null != this . _onOutFrameName ? this . frameName = this . _onOutFrameName : null != this . _onOutFrameID && ( this . frame = this . _onOutFrameID ) : 3 === a ? null != this . _onDownFrameName ? this . frameName = this . _onDownFrameName : null != this . _onDownFrameID && ( this . frame = this . _onDownFrameID ) : 4 === a && ( null != this . _onUpFrameName ? this . frameName = this . _onUpFrameName : null != this . _onUpFrameID && ( this . frame = this . _onUpFrameID ) ) } , b . Graphics = function ( a , c , d ) { c = c || 0 , d = d || 0 , this . game = a , this . exists = ! 0 , this . name = "" , this . type = b . GRAPHICS , this . z = 0 , this . world = new b . Point ( c , d ) , this . cameraOffset = new b . Point , PIXI . Graphics . call ( this ) , this . position . set ( c , d ) , this . _cache = [ 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 ] } , b . Graphics . prototype = Object . create ( PIXI . Graphics . prototype ) , b . Graphics . prototype . constructor = b . Graphics , b . Graphics . 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 [ 2 ] , this . game . camera . y + this . worldTransform [ 5 ] ) , this . visible && ( this . _cache [ 3 ] = this . game . stage . currentRenderOrderID ++ ) , ! 0 ) : ( this . renderOrderID = - 1 , ! 1 ) } , b . Graphics . prototype . update = function ( ) { } , b . Graphics . 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 . Graphics . prototype . destroy = function ( a ) { "undefined" == typeof a && ( a = ! 0 ) , this . clear ( ) , 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 ( a ) ; else for ( ; c -- ; ) this . removeChild ( this . children [ c ] ) ; this . exists = ! 1 , this . visible = ! 1 , this . game = null } , b . Graphics . prototype . drawPolygon = function ( a ) { this . moveTo ( a . points [ 0 ] . x , a . points [ 0 ] . y ) ; for ( var b = 1 ; b < a . points . length ; b += 1 ) this . lineTo ( a . points [ b ] . x , a . points [ b ] . y ) ; this . lineTo ( a . points [ 0 ] . x , a . points [ 0 ] . y ) } , Object . defineProperty ( b . Graphics . prototype , "angle" , { get : function ( ) { return b . Math . radToDeg ( this . rotation ) } , set : function ( a ) { this . rotation = b . Math . degToRad ( a ) } } ) , Object . defineProperty ( b . Graphics . 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 } } ) , b . RenderTexture = function ( a , c , d , e ) { this . game = a , this . key = e , this . type = b . RENDERTEXTURE , this . _temp = new b . Point , PIXI . RenderTexture . call ( this , c , d ) } , b . RenderTexture . prototype = Object . create ( PIXI . RenderTexture . prototype ) , b . RenderTexture . prototype . constructor = b . RenderTexture , b . RenderTexture . prototype . renderXY = function ( a , b , c , d ) { this . _temp . set ( b , c ) , this . render ( a , this . _temp , d ) } , b . SpriteBatch = function ( a , c , d , e ) { PIXI . SpriteBatch . call ( this ) , b . Group . call ( this , a , c , d , e ) , this . type = b . SPRITEBATCH } , b . SpriteBatch . prototype = b . Utils . extend ( ! 0 , b . SpriteBatch . prototype , b . Group . prototype , PIXI . SpriteBatch . prototype ) , b . SpriteBatch . prototype . constructor = b . SpriteBatch , b . RetroFont = function ( a , c , d , e , f , g , h , i , j , k ) { this . characterWidth = d , this . characterHeight = e , this . characterSpacingX = h || 0 , this . characterSpacingY = i || 0 , this . characterPerRow = g , this . offsetX = j || 0 , this . offsetY = k || 0 , this . align = "left" , this . multiLine = ! 1 , this . autoUpperCase = ! 0 , this . customSpacingX = 0 , this . customSpacingY = 0 , this . fixedWidth = 0 , this . fontSet = a . cache . getImage ( c ) , this . _text = "" , this . grabData = [ ] ; for ( var l = this . offset
} , b . Tween . prototype = { to : function ( a , b , c , d , e , f , g ) { b = b || 1e3 , c = c || null , d = d || ! 1 , e = e || 0 , f = f || 0 , g = g || ! 1 ; var h ; return this . _parent ? ( h = this . _manager . create ( this . _object ) , this . _lastChild . chain ( h ) , this . _lastChild = h ) : ( h = this , this . _parent = this , this . _lastChild = this ) , h . _repeat = f , h . _duration = b , h . _valuesEnd = a , null !== c && ( h . _easingFunction = c ) , e > 0 && ( h . _delayTime = e ) , h . _yoyo = g , d ? this . start ( ) : this } , start : function ( ) { if ( null !== this . game && null !== this . _object ) { this . _manager . add ( this ) , this . isRunning = ! 0 , this . _onStartCallbackFired = ! 1 , this . _startTime = this . game . time . now + this . _delayTime ; for ( var a in this . _valuesEnd ) { if ( Array . isArray ( this . _valuesEnd [ a ] ) ) { if ( 0 === this . _valuesEnd [ a ] . length ) continue ; this . _valuesEnd [ a ] = [ this . _object [ a ] ] . concat ( this . _valuesEnd [ a ] ) } this . _valuesStart [ a ] = this . _object [ a ] , Array . isArray ( this . _valuesStart [ a ] ) || ( this . _valuesStart [ a ] *= 1 ) , this . _valuesStartRepeat [ a ] = this . _valuesStart [ a ] || 0 } return this } } , generateData : function ( a , b ) { if ( null === this . game || null === this . _object ) return null ; this . _startTime = 0 ; for ( var c in this . _valuesEnd ) { if ( Array . isArray ( this . _valuesEnd [ c ] ) ) { if ( 0 === this . _valuesEnd [ c ] . length ) continue ; this . _valuesEnd [ c ] = [ this . _object [ c ] ] . concat ( this . _valuesEnd [ c ] ) } this . _valuesStart [ c ] = this . _object [ c ] , Array . isArray ( this . _valuesStart [ c ] ) || ( this . _valuesStart [ c ] *= 1 ) , this . _valuesStartRepeat [ c ] = this . _valuesStart [ c ] || 0 } for ( var d = 0 , e = a * ( this . _duration / 1e3 ) , f = this . _duration / e , g = [ ] ; e -- ; ) { var c , h = ( d - this . _startTime ) / this . _duration ; h = h > 1 ? 1 : h ; var i = this . _easingFunction ( h ) , j = { } ; for ( c in this . _valuesEnd ) { var k = this . _valuesStart [ c ] || 0 , l = this . _valuesEnd [ c ] ; l instanceof Array ? j [ c ] = this . _interpolationFunction ( l , i ) : ( "string" == typeof l && ( l = k + parseFloat ( l , 10 ) ) , "number" == typeof l && ( j [ c ] = k + ( l - k ) * i ) ) } g . push ( j ) , d += f } if ( this . _yoyo ) { var m = g . slice ( ) ; m . reverse ( ) , g = g . concat ( m ) } return "undefined" != typeof b ? b = b . concat ( g ) : g } , stop : function ( ) { return this . isRunning = ! 1 , this . _onUpdateCallback = null , this . _manager . remove ( this ) , this } , delay : function ( a ) { return this . _delayTime = a , this } , repeat : function ( a ) { return this . _repeat = a , this } , yoyo : function ( a ) { return this . _yoyo = a , this } , easing : function ( a ) { return this . _easingFunction = a , this } , interpolation : function ( a ) { return this . _interpolationFunction = a , this } , chain : function ( ) { return this . _chainedTweens = arguments , this } , loop : function ( ) { return this . _lastChild . chain ( this ) , this } , onUpdateCallback : function ( a , b ) { return this . _onUpdateCallback = a , this . _onUpdateCallbackContext = b , this } , pause : function ( ) { this . _codePaused = ! 0 , this . _paused = ! 0 , this . _pausedTime = this . game . time . now } , _pause : function ( ) { this . _codePaused || ( this . _paused = ! 0 , this . _pausedTime = this . game . time . now ) } , resume : function ( ) { this . _paused && ( this . _paused = ! 1 , this . _codePaused = ! 1 , this . _startTime += this . game . time . now - this . _pausedTime ) } , _resume : function ( ) { this . _codePaused || ( this . _startTime += this . game . time . pauseDuration , this . _paused = ! 1 ) } , update : function ( a ) { if ( this . pendingDelete ) return ! 1 ; if ( this . _paused || a < this . _startTime ) return ! 0 ; var b ; if ( a < this . _startTime ) return ! 0 ; this . _onStartCallbackFired === ! 1 && ( this . onStart . dispatch ( this . _object ) , this . _onStartCallbackFired = ! 0 ) ; var c = ( a - this . _startTime ) / this . _duration ; c = c > 1 ? 1 : c ; var d = this . _easingFunction ( c ) ; for ( b in this . _valuesEnd ) { var e = this . _valuesStart [ b ] || 0 , f = this . _valuesEnd [ b ] ; f instanceof Array ? this . _object [ b ] = this . _interpolationFunction ( f , d ) : ( "string" == typeof f && ( f = e + parseFloat ( f , 10 ) ) , "number" == typeof f && ( this . _object [ b ] = e + ( f - e ) * d ) ) } if ( null !== this . _onUpdateCallback && this . _onUpdateCallback . call ( this . _onUpdateCallbackContext , this , d ) , 1 == c ) { if ( this . _repeat > 0 ) { isFinite ( this . _repeat ) && this . _repeat -- ; for ( b in this . _valuesStartRepeat ) { if ( "string" == typeof this . _valuesEnd [ b ] && ( this . _valuesStartRepeat [ b ] = this . _valuesStartRepeat [ b ] + parseFloat ( this . _valuesEnd [ b ] , 10 ) ) , this . _yoyo ) { var g = this . _valuesStartRepeat [ b ] ; this . _valuesStartRepeat [ b ] = this . _valuesEnd [ b ] , this . _valuesEnd [ b ] = g , this . _reversed = ! this . _reversed } this . _valuesStart [ b ] = this . _valuesStartRepeat [ b ] } return this . _startTime = a + this . _delayTime , this . onLoop . dispatch ( this . _object ) , ! 0 } this . isRunning = ! 1 , this . onComplete . dispatch ( this . _object ) ; for ( var h = 0 , i = this . _chainedTweens . length ; i > h ; h ++ ) this . _chainedTweens [ h ] . start ( a ) ; return ! 1
} , getTilemapData : function ( a ) { return this . _tilemaps [ a ] ? this . _tilemaps [ a ] : void console . warn ( 'Phaser.Cache.getTilemapData: Invalid key: "' + a + '"' ) } , getFrameData : function ( a ) { return this . _images [ a ] && this . _images [ a ] . frameData ? this . _images [ a ] . frameData : null } , updateFrameData : function ( a , b ) { this . _images [ a ] && ( this . _images [ a ] . spriteSheet = ! 0 , this . _images [ a ] . frameData = b ) } , getFrameByIndex : function ( a , b ) { return this . _images [ a ] && this . _images [ a ] . frameData ? this . _images [ a ] . frameData . getFrame ( b ) : null } , getFrameByName : function ( a , b ) { return this . _images [ a ] && this . _images [ a ] . frameData ? this . _images [ a ] . frameData . getFrameByName ( b ) : null } , getFrame : function ( a ) { return this . _images [ a ] && this . _images [ a ] . spriteSheet === ! 1 ? this . _images [ a ] . frame : null } , getTextureFrame : function ( a ) { return this . _textures [ a ] ? this . _textures [ a ] . frame : null } , getTexture : function ( a ) { return this . _textures [ a ] ? this . _textures [ a ] : void console . warn ( 'Phaser.Cache.getTexture: Invalid key: "' + a + '"' ) } , getSound : function ( a ) { return this . _sounds [ a ] ? this . _sounds [ a ] : void console . warn ( 'Phaser.Cache.getSound: Invalid key: "' + a + '"' ) } , getSoundData : function ( a ) { return this . _sounds [ a ] ? this . _sounds [ a ] . data : void console . warn ( 'Phaser.Cache.getSoundData: Invalid key: "' + a + '"' ) } , isSoundDecoded : function ( a ) { return this . _sounds [ a ] ? this . _sounds [ a ] . decoded : void 0 } , isSoundReady : function ( a ) { return this . _sounds [ a ] && this . _sounds [ a ] . decoded && this . game . sound . touchLocked === ! 1 } , isSpriteSheet : function ( a ) { return this . _images [ a ] ? this . _images [ a ] . spriteSheet : ! 1 } , getText : function ( a ) { return this . _text [ a ] ? this . _text [ a ] . data : void console . warn ( 'Phaser.Cache.getText: Invalid key: "' + a + '"' ) } , getJSON : function ( a ) { return this . _json [ a ] ? this . _json [ a ] . data : void console . warn ( 'Phaser.Cache.getJSON: Invalid key: "' + a + '"' ) } , getBinary : function ( a ) { return this . _binary [ a ] ? this . _binary [ a ] : void console . warn ( 'Phaser.Cache.getBinary: Invalid key: "' + a + '"' ) } , getKeys : function ( a ) { var c = null ; switch ( a ) { case b . Cache . CANVAS : c = this . _canvases ; break ; case b . Cache . IMAGE : c = this . _images ; break ; case b . Cache . TEXTURE : c = this . _textures ; break ; case b . Cache . SOUND : c = this . _sounds ; break ; case b . Cache . TEXT : c = this . _text ; break ; case b . Cache . PHYSICS : c = this . _physics ; break ; case b . Cache . TILEMAP : c = this . _tilemaps ; break ; case b . Cache . BINARY : c = this . _binary ; break ; case b . Cache . BITMAPDATA : c = this . _bitmapDatas ; break ; case b . Cache . BITMAPFONT : c = this . _bitmapFont ; break ; case b . Cache . JSON : c = this . _json } if ( c ) { var d = [ ] ; for ( var e in c ) "__default" !== e && "__missing" !== e && d . push ( e ) ; return d } } , removeCanvas : function ( a ) { delete this . _canvases [ a ] } , removeImage : function ( a ) { delete this . _images [ a ] } , removeSound : function ( a ) { delete this . _sounds [ a ] } , removeText : function ( a ) { delete this . _text [ a ] } , removeJSON : function ( a ) { delete this . _json [ a ] } , removePhysics : function ( a ) { delete this . _physics [ a ] } , removeTilemap : function ( a ) { delete this . _tilemaps [ a ] } , removeBinary : function ( a ) { delete this . _binary [ a ] } , removeBitmapData : function ( a ) { delete this . _bitmapDatas [ a ] } , removeBitmapFont : function ( a ) { delete this . _bitmapFont [ a ] } , destroy : function ( ) { for ( var a in this . _canvases ) delete this . _canvases [ a ] ; for ( var a in this . _images ) "__default" !== a && "__missing" !== a && delete this . _images [ a ] ; for ( var a in this . _sounds ) delete this . _sounds [ a ] ; for ( var a in this . _text ) delete this . _text [ a ] ; for ( var a in this . _json ) delete this . _json [ a ] ; for ( var a in this . _textures ) delete this . _textures [ a ] ; for ( var a in this . _physics ) delete this . _physics [ a ] ; for ( var a in this . _tilemaps ) delete this . _tilemaps [ a ] ; for ( var a in this . _binary ) delete this . _binary [ a ] ; for ( var a in this . _bitmapDatas ) delete this . _bitmapDatas [ a ] ; for ( var a in this . _bitmapFont ) delete this . _bitmapFont [ a ] } } , b . Cache . prototype . constructor = b . Cache , b . Loader = function ( a ) { this . game = a , this . _fileList = [ ] , this . _fileIndex = 0 , this . _progressChunk = 0 , this . _xhr = new XMLHttpRequest , this . isLoading = ! 1 , this . hasLoaded = ! 1 , this . progress = 0 , this . progressFloat = 0 , this . preloadSprite = null , this . crossOrigin = ! 1 , this . baseURL = "" , this . onFileComplete = new b . Signal , this . onFileError = new b . Signal , this . onLoadStart = new b . Signal , this . onLoadComplete = new b . Signal } , b . Loader . TEXTURE _ATLAS _JSON _ARRAY = 0 , b . Loader . TEXTURE _ATLAS _JSON _HASH = 1 , b . Loader . TEXTURE _ATLAS _XML _STARLING = 2 , b . Loader
this . currentY += this . lineHeight } , soundInfo : function ( a , b , c , d ) { this . start ( b , c , d ) , this . line ( "Sound: " + a . key + " Locked: " + a . game . sound . touchLocked ) , this . line ( "Is Ready?: " + this . game . cache . isSoundReady ( a . key ) + " Pending Playback: " + a . pendingPlayback ) , this . line ( "Decoded: " + a . isDecoded + " Decoding: " + a . isDecoding ) , this . line ( "Total Duration: " + a . totalDuration + " Playing: " + a . isPlaying ) , this . line ( "Time: " + a . currentTime ) , this . line ( "Volume: " + a . volume + " Muted: " + a . mute ) , this . line ( "WebAudio: " + a . usingWebAudio + " Audio: " + a . usingAudioTag ) , "" !== a . currentMarker && ( this . line ( "Marker: " + a . currentMarker + " Duration: " + a . duration ) , this . line ( "Start: " + a . markers [ a . currentMarker ] . start + " Stop: " + a . markers [ a . currentMarker ] . stop ) , this . line ( "Position: " + a . position ) ) , this . stop ( ) } , cameraInfo : function ( a , b , c , d ) { this . start ( b , c , d ) , this . line ( "Camera (" + a . width + " x " + a . height + ")" ) , this . line ( "X: " + a . x + " Y: " + a . y ) , this . line ( "Bounds x: " + a . bounds . x + " Y: " + a . bounds . y + " w: " + a . bounds . width + " h: " + a . bounds . height ) , this . line ( "View x: " + a . view . x + " Y: " + a . view . y + " w: " + a . view . width + " h: " + a . view . height ) , this . stop ( ) } , pointer : function ( a , b , c , d , e ) { null != a && ( "undefined" == typeof b && ( b = ! 1 ) , c = c || "rgba(0,255,0,0.5)" , d = d || "rgba(255,0,0,0.5)" , ( b !== ! 0 || a . isUp !== ! 0 ) && ( this . start ( a . x , a . y - 100 , e ) , this . context . beginPath ( ) , this . context . arc ( a . x , a . y , a . circle . radius , 0 , 2 * Math . PI ) , this . context . fillStyle = a . active ? c : d , this . context . fill ( ) , this . context . closePath ( ) , this . context . beginPath ( ) , this . context . moveTo ( a . positionDown . x , a . positionDown . y ) , this . context . lineTo ( a . position . x , a . position . y ) , this . context . lineWidth = 2 , this . context . stroke ( ) , this . context . closePath ( ) , this . line ( "ID: " + a . id + " Active: " + a . active ) , this . line ( "World X: " + a . worldX + " World Y: " + a . worldY ) , this . line ( "Screen X: " + a . x + " Screen Y: " + a . y ) , this . line ( "Duration: " + a . duration + " ms" ) , this . line ( "is Down: " + a . isDown + " is Up: " + a . isUp ) , this . stop ( ) ) ) } , spriteInputInfo : function ( a , b , c , d ) { this . start ( b , c , d ) , this . line ( "Sprite Input: (" + a . width + " x " + a . height + ")" ) , this . line ( "x: " + a . input . pointerX ( ) . toFixed ( 1 ) + " y: " + a . input . pointerY ( ) . toFixed ( 1 ) ) , this . line ( "over: " + a . input . pointerOver ( ) + " duration: " + a . input . overDuration ( ) . toFixed ( 0 ) ) , this . line ( "down: " + a . input . pointerDown ( ) + " duration: " + a . input . downDuration ( ) . toFixed ( 0 ) ) , this . line ( "just over: " + a . input . justOver ( ) + " just out: " + a . input . justOut ( ) ) , this . stop ( ) } , key : function ( a , b , c , d ) { this . start ( b , c , d , 150 ) , this . line ( "Key:" , a . keyCode , "isDown:" , a . isDown ) , this . line ( "justPressed:" , a . justPressed ( ) , "justReleased:" , a . justReleased ( ) ) , this . line ( "Time Down:" , a . timeDown . toFixed ( 0 ) , "duration:" , a . duration . toFixed ( 0 ) ) , this . stop ( ) } , 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 ) } , 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 . fillSt
} , 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 . name ] = a , a } , remove : function ( a ) { delete this . emitters [ a . name ] } , update : function ( ) { for ( var a in this . emitters ) this . emitters [ a ] . exists && this . emitters [ a ] . update ( ) } } , b . Particles . prototype . constructor = b . Particles , b . Particles . Arcade = { } , b . Particles . Arcade . Emitter = function ( a , c , d , e ) { this . maxParticles = e || 50 , b . Group . call ( this , a ) , this . name = "emitter" + this . game . particles . ID ++ , this . type = b . EMITTER , this . x = 0 , this . y = 0 , this . width = 1 , this . height = 1 , this . minParticleSpeed = new b . Point ( - 100 , - 100 ) , this . maxParticleSpeed = new b . Point ( 100 , 100 ) , this . minParticleScale = 1 , this . maxParticleScale = 1 , this . minRotation = - 360 , this . maxRotation = 360 , this . gravity = 100 , this . particleClass = b . Sprite , this . particleDrag = new b . Point , this . angularDrag = 0 , this . frequency = 100 , this . lifespan = 2e3 , this . bounce = new b . Point , this . _quantity = 0 , this . _timer = 0 , this . _counter = 0 , this . _explode = ! 0 , this . _frames = null , this . on = ! 1 , this . exists = ! 0 , this . emitX = c , this . emitY = d } , b . Particles . Arcade . Emitter . prototype = Object . create ( b . Group . prototype ) , b . Particles . Arcade . Emitter . prototype . constructor = b . Particles . Arcade . Emitter , b . Particles . Arcade . Emitter . prototype . update = function ( ) { if ( this . on ) if ( this . _explode ) { this . _counter = 0 ; do this . emitParticle ( ) , this . _counter ++ ; while ( this . _counter < this . _quantity ) ; this . on = ! 1 } else this . game . time . now >= this . _timer && ( this . emitParticle ( ) , this . _counter ++ , this . _quantity > 0 && this . _counter >= this . _quantity && ( this . on = ! 1 ) , this . _timer = this . game . time . now + this . frequency ) } , b . Particles . Arcade . Emitter . prototype . makeParticles = function ( a , b , c , d , e ) { "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = this . maxParticles ) , "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = ! 1 ) ; var f , g = 0 , h = a , i = b ; for ( this . _frames = b ; c > g ; ) "object" == typeof a && ( h = this . game . rnd . pick ( a ) ) , "object" == typeof b && ( i = this . game . rnd . pick ( b ) ) , f = new this . particleClass ( this . game , 0 , 0 , h , i ) , game . physics . arcade . enable ( f , ! 1 ) , d ? ( f . body . checkCollision . any = ! 0 , f . body . checkCollision . none = ! 1 ) : f . body . checkCollision . none = ! 0 , f . body . collideWorldBounds = e , f . exists = ! 1 , f . visible = ! 1 , f . anchor . set ( . 5 ) , this . add ( f ) , g ++ ; return this } , b . Particles . Arcade . Emitter . prototype . kill = function ( ) { this . on = ! 1 , this . alive = ! 1 , this . exists = ! 1 } , b . Particles . Arcade . Emitter . prototype . revive = function ( ) { this . alive = ! 0 , this . exists = ! 0 } , b . Particles . Arcade . Emitter . prototype . start = function ( a , b , c , d ) { "undefined" == typeof a && ( a = ! 0 ) , "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 250 ) , "undefined" == typeof d && ( d = 0 ) , this . revive ( ) , this . visible = ! 0 , this . on = ! 0 , this . _explode = a , this . lifespan = b , this . frequency = c , a ? this . _quantity = d : this . _quantity += d , this . _counter = 0 , this . _timer = this . game . time . now + c } , b . Particles . Arcade . Emitter . prototype . emitParticle = function ( ) { var a = this . getFirstExists ( ! 1 ) ; null != a && ( a . angle = 0 , a . bringToTop ( ) , ( 1 !== this . minParticleScale || 1 !== this . maxParticleScale ) && a . scale . set ( this . game . rnd . realInRange ( this . minParticleScale , this . maxParticleScale ) ) , this . width > 1 || this . height > 1 ? a . reset ( this . game . rnd . integerInRange ( this . left , this . right ) , this . game . rnd . integerInRange ( this . top , this . bottom ) ) : a . reset ( this . emitX , this . emitY ) , a . lifespan = this . lifespan , a . body . bounce . setTo ( this . bounce . x , this . bounce . y ) , a . body . velocity . x = this . minParticleSpeed . x !== this . maxParticleSpeed . x ? this . game . rnd . integerInRange ( this . minParticleSpeed . x , this . maxParticleSpeed . x ) : this . minParticleSpeed . x , a . body . velocity . y = this . minParticleSpeed . y !== this . maxParticleSpeed . y ? this . game . rnd . integerInRange ( this . minParticleSpeed . y , this . maxParticleSpeed . y ) : this . minParticleSpeed . y , this . minRotation !== this . maxRotation ? a . body . angularVelocity = this . game . rnd . integerInRange ( this . minRotation , this . maxRotation ) : 0 !== this . minRotation && ( a . body . angularVelocity = this . minRotation ) , a . frame = "object" == typeof this . _frames ? this . game . rnd . pick ( this . _frames ) : this . _frames , a . body . gravity . y = this . gravity , a . body . drag . x = this . particleDrag . x , a . body . drag . y = this . particleDrag . y , a . body . angularDrag = this . angularDrag ) } , b . Particles . Arcade . Emitter . prototype . setSize = function ( a , b ) { this . width = a , this . height = b } , b
} ( ) ) : a . Phaser = b } . call ( this ) , Phaser . Physics . Ninja = function ( a ) { this . game = a , this . time = this . game . time , this . gravity = . 2 , this . bounds = new Phaser . Rectangle ( 0 , 0 , a . world . width , a . world . height ) , this . maxObjects = 10 , this . maxLevels = 4 , this . quadTree = new Phaser . QuadTree ( this . game . world . bounds . x , this . game . world . bounds . y , this . game . world . bounds . width , this . game . world . bounds . height , this . maxObjects , this . maxLevels ) } , Phaser . Physics . Ninja . prototype . constructor = Phaser . Physics . Ninja , Phaser . Physics . Ninja . prototype = { enableAABB : function ( a , b ) { this . enable ( a , 1 , 0 , 0 , b ) } , enableCircle : function ( a , b , c ) { this . enable ( a , 2 , 0 , b , c ) } , enableTile : function ( a , b , c ) { this . enable ( a , 3 , b , 0 , c ) } , enable : function ( a , b , c , d , e ) { if ( "undefined" == typeof b && ( b = 1 ) , "undefined" == typeof c && ( c = 1 ) , "undefined" == typeof d && ( d = 0 ) , "undefined" == typeof e && ( e = ! 0 ) , Array . isArray ( a ) ) for ( i = a . length ; i -- ; ) a [ i ] instanceof Phaser . Group ? this . enable ( a [ i ] . children , b , c , d , e ) : ( this . enableBody ( a [ i ] , b , c , d ) , e && a [ i ] . hasOwnProperty ( "children" ) && a [ i ] . children . length > 0 && this . enable ( a [ i ] , b , c , d , ! 0 ) ) ; else a instanceof Phaser . Group ? this . enable ( a . children , b , c , d , e ) : ( this . enableBody ( a , b , c , d ) , e && a . hasOwnProperty ( "children" ) && a . children . length > 0 && this . enable ( a . children , b , c , d , ! 0 ) ) } , enableBody : function ( a , b , c , d ) { a . hasOwnProperty ( "body" ) && null === a . body && ( a . body = new Phaser . Physics . Ninja . Body ( this , a , b , c , d ) , a . anchor . set ( . 5 ) ) } , setBounds : function ( a , b , c , d ) { this . bounds . setTo ( a , b , c , d ) } , setBoundsToWorld : function ( ) { this . bounds . setTo ( this . game . world . bounds . x , this . game . world . bounds . y , this . game . world . bounds . width , this . game . world . bounds . height ) } , clearTilemapLayerBodies : function ( a , b ) { b = a . getLayer ( b ) ; for ( var c = a . layers [ b ] . bodies . length ; c -- ; ) a . layers [ b ] . bodies [ c ] . destroy ( ) ; a . layers [ b ] . bodies . length = [ ] } , convertTilemap : function ( a , b , c ) { b = a . getLayer ( b ) , "undefined" == typeof addToWorld && ( addToWorld = ! 0 ) , "undefined" == typeof optimize && ( optimize = ! 0 ) , this . clearTilemapLayerBodies ( a , b ) ; for ( var d = 0 , e = a . layers [ b ] . height ; e > d ; d ++ ) for ( var f = 0 , g = a . layers [ b ] . width ; g > f ; f ++ ) { var h = a . layers [ b ] . data [ d ] [ f ] ; if ( h && c . hasOwnProperty ( h . index ) ) { var i = new Phaser . Physics . Ninja . Body ( this , null , 3 , c [ h . index ] , 0 , h . worldX + h . centerX , h . worldY + h . centerY , h . width , h . height ) ; a . layers [ b ] . bodies . push ( i ) } } return a . layers [ b ] . bodies } , overlap : function ( a , b , c , d , e ) { if ( c = c || null , d = d || null , e = e || c , this . _result = ! 1 , this . _total = 0 , Array . isArray ( b ) ) for ( var f = 0 , g = b . length ; g > f ; f ++ ) this . collideHandler ( a , b [ f ] , c , d , e , ! 0 ) ; else this . collideHandler ( a , b , c , d , e , ! 0 ) ; return this . _total > 0 } , collide : function ( a , b , c , d , e ) { if ( c = c || null , d = d || null , e = e || c , this . _result = ! 1 , this . _total = 0 , Array . isArray ( b ) ) for ( var f = 0 , g = b . length ; g > f ; f ++ ) this . collideHandler ( a , b [ f ] , c , d , e , ! 1 ) ; else this . collideHandler ( a , b , c , d , e , ! 1 ) ; return this . _total > 0 } , collideHandler : function ( a , b , c , d , e , f ) { return "undefined" != typeof b || a . type !== Phaser . GROUP && a . type !== Phaser . EMITTER ? void ( a && b && a . exists && b . exists && ( a . type == Phaser . SPRITE || a . type == Phaser . TILESPRITE ? b . type == Phaser . SPRITE || b . type == Phaser . TILESPRITE ? this . collideSpriteVsSprite ( a , b , c , d , e , f ) : b . type == Phaser . GROUP || b . type == Phaser . EMITTER ? this . collideSpriteVsGroup ( a , b , c , d , e , f ) : b . type == Phaser . TILEMAPLAYER && this . collideSpriteVsTilemapLayer ( a , b , c , d , e ) : a . type == Phaser . GROUP ? b . type == Phaser . SPRITE || b . type == Phaser . TILESPRITE ? this . collideSpriteVsGroup ( b , a , c , d , e , f ) : b . type == Phaser . GROUP || b . type == Phaser . EMITTER ? this . collideGroupVsGroup ( a , b , c , d , e , f ) : b . type == Phaser . TILEMAPLAYER && this . collideGroupVsTilemapLayer ( a , b , c , d , e ) : a . type == Phaser . TILEMAPLAYER ? b . type == Phaser . SPRITE || b . type == Phaser . TILESPRITE ? this . collideSpriteVsTilemapLayer ( b , a , c , d , e ) : ( b . type == Phaser . GROUP || b . type == Phaser . EMITTER ) && this . collideGroupVsTilemapLayer ( b , a , c , d , e ) : a . type == Phaser . EMITTER && ( b . type == Phaser . SPRITE || b . type == Phaser . TILESPRITE ? this . collideSpriteVsGroup ( b , a , c , d , e , f ) : b . type == Phaser . GROUP || b . type == Phaser . EMITTER ? this . collideGroupVsGroup ( a , b , c , d , e , f ) : b . type == Phaser . TILEMAPLAYER && this . collideGroupVsTilemapLayer ( a , b , c , d , e ) ) ) ) : void this . collideGroupVsSelf ( a , c , d , e , f ) } , collideSpriteVsSprite : function ( a , b , c , d , e , f ) { this . separate ( a . body , b . body , d , e , f ) && ( c && c . call ( e , a , b ) , this . _total ++ ) } , collideSpriteVsGroup : function ( a , b , c , d , e , f ) { if ( 0 !== b . length ) for ( var g = 0 , h = b . children . length ; h > g ; g ++ ) b .
var j = f . sx , k = f . sy , l = e . pos . x - ( f . pos . x + c * f . xw ) , m = e . pos . y - ( f . pos . y - i * f . yw ) , p = l * - k + m * j ; if ( 0 > p * h * i ) { var q = Math . sqrt ( l * l + m * m ) , r = e . radius - q ; if ( r > 0 ) return l /= q , m /= q , e . reportCollisionVsWorld ( l * r , m * r , l , m , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else { var n = l * j + m * k , r = e . radius - Math . abs ( n ) ; if ( r > 0 ) return e . reportCollisionVsWorld ( j * r , k * r , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } } else { if ( h * c + i * d > 0 ) return Phaser . Physics . Ninja . Circle . COL _NONE ; var s = f . pos . x + c * f . xw , t = f . pos . y + d * f . yw , u = e . pos . x - s , v = e . pos . y - t , q = Math . sqrt ( u * u + v * v ) , r = e . radius - q ; if ( r > 0 ) return 0 == q ? ( u = c / Math . SQRT2 , v = d / Math . SQRT2 ) : ( u /= q , v /= q ) , e . reportCollisionVsWorld ( u * r , v * r , u , v , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } return Phaser . Physics . Ninja . Circle . COL _NONE } , projCircle _Concave : function ( a , b , c , d , e , f ) { var g , h = f . signx , i = f . signy ; if ( 0 == c ) { if ( 0 == d ) { var j = f . pos . x + h * f . xw - e . pos . x , k = f . pos . y + i * f . yw - e . pos . y , l = 2 * f . xw , m = Math . sqrt ( l * l + 0 ) , n = Math . sqrt ( j * j + k * k ) , o = n + e . radius - m ; return o > 0 ? ( b > a ? ( g = a , b = 0 , e . pos . x - f . pos . x < 0 && ( a *= - 1 ) ) : ( g = b , a = 0 , e . pos . y - f . pos . y < 0 && ( b *= - 1 ) ) , o > g ? ( e . reportCollisionVsWorld ( a , b , a / g , b / g , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ) : ( j /= n , k /= n , e . reportCollisionVsWorld ( j * o , k * o , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER ) ) : Phaser . Physics . Ninja . Circle . COL _NONE } if ( 0 > i * d ) return e . reportCollisionVsWorld ( 0 , b * d , 0 , d , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ; var p = f . pos . x - h * f . xw , q = f . pos . y + d * f . yw , r = e . pos . x - p , s = e . pos . y - q , n = Math . sqrt ( r * r + s * s ) , o = e . radius - n ; if ( o > 0 ) return 0 == n ? ( r = 0 , s = d ) : ( r /= n , s /= n ) , e . reportCollisionVsWorld ( r * o , s * o , r , s , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else if ( 0 == d ) { if ( 0 > h * c ) return e . reportCollisionVsWorld ( a * c , 0 , c , 0 , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ; var p = f . pos . x + c * f . xw , q = f . pos . y - i * f . yw , r = e . pos . x - p , s = e . pos . y - q , n = Math . sqrt ( r * r + s * s ) , o = e . radius - n ; if ( o > 0 ) return 0 == n ? ( r = c , s = 0 ) : ( r /= n , s /= n ) , e . reportCollisionVsWorld ( r * o , s * o , r , s , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else { if ( h * c + i * d > 0 ) return Phaser . Physics . Ninja . Circle . COL _NONE ; var p = f . pos . x + c * f . xw , q = f . pos . y + d * f . yw , r = e . pos . x - p , s = e . pos . y - q , n = Math . sqrt ( r * r + s * s ) , o = e . radius - n ; if ( o > 0 ) return 0 == n ? ( r = c / Math . SQRT2 , s = d / Math . SQRT2 ) : ( r /= n , s /= n ) , e . reportCollisionVsWorld ( r * o , s * o , r , s , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } return Phaser . Physics . Ninja . Circle . COL _NONE } , projCircle _Convex : function ( a , b , c , d , e , f ) { var g , h = f . signx , i = f . signy ; if ( 0 == c ) if ( 0 == d ) { var j = e . pos . x - ( f . pos . x - h * f . xw ) , k = e . pos . y - ( f . pos . y - i * f . yw ) , l = 2 * f . xw , m = Math . sqrt ( l * l + 0 ) , n = Math . sqrt ( j * j + k * k ) , o = m + e . radius - n ; if ( o > 0 ) return b > a ? ( g = a , b = 0 , e . pos . x - f . pos . x < 0 && ( a *= - 1 ) ) : ( g = b , a = 0 , e . pos . y - f . pos . y < 0 && ( b *= - 1 ) ) , o > g ? ( e . reportCollisionVsWorld ( a , b , a / g , b / g , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ) : ( j /= n , k /= n , e . reportCollisionVsWorld ( j * o , k * o , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER ) } else { if ( 0 > i * d ) return e . reportCollisionVsWorld ( 0 , b * d , 0 , d , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ; var j = e . pos . x - ( f . pos . x - h * f . xw ) , k = e . pos . y - ( f . pos . y - i * f . yw ) , l = 2 * f . xw , m = Math . sqrt ( l * l + 0 ) , n = Math . sqrt ( j * j + k * k ) , o = m + e . radius - n ; if ( o > 0 ) return j /= n , k /= n , e . reportCollisionVsWorld ( j * o , k * o , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else if ( 0 == d ) { if ( 0 > h * c ) return e . reportCollisionVsWorld ( a * c , 0 , c , 0 , f ) , Phaser . Physics . Ninja . Circle . COL _AXIS ; var j = e . pos . x - ( f . pos . x - h * f . xw ) , k = e . pos . y - ( f . pos . y - i * f . yw ) , l = 2 * f . xw , m = Math . sqrt ( l * l + 0 ) , n = Math . sqrt ( j * j + k * k ) , o = m + e . radius - n ; if ( o > 0 ) return j /= n , k /= n , e . reportCollisionVsWorld ( j * o , k * o , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else if ( h * c + i * d > 0 ) { var j = e . pos . x - ( f . pos . x - h * f . xw ) , k = e . pos . y - ( f . pos . y - i * f . yw ) , l = 2 * f . xw , m = Math . sqrt ( l * l + 0 ) , n = Math . sqrt ( j * j + k * k ) , o = m + e . radius - n ; if ( o > 0 ) return j /= n , k /= n , e . reportCollisionVsWorld ( j * o , k * o , j , k , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } else { var p = f . pos . x + c * f . xw , q = f . pos . y + d * f . yw , r = e . pos . x - p , s = e . pos . y - q , n = Math . sqrt ( r * r + s * s ) , o = e . radius - n ; if ( o > 0 ) return 0 == n ? ( r = c / Math . SQRT2 , s = d / Math . SQRT2 ) : ( r /= n , s /= n ) , e . reportCollisionVsWorld ( r * o , s * o , r , s , f ) , Phaser . Physics . Ninja . Circle . COL _OTHER } return Phaser . Physics . Ninja . Circle . COL _NONE } , projCircle _Half : function ( a , b , c , d , e , f ) { var g = f . signx , h = f . signy , i = c * g + d * h ; if ( i > 0 ) return Phaser . Physics . Ninja . Circle . COL _NONE ; if ( 0 == c ) if ( 0 == d ) { var j = e . radius , k = e . pos . x - g * j - f . pos . x , l = e . pos . y - h * j - f . pos . y , m = g , n = h , o = k * m + l * n ; if ( 0 > o ) { m *= - o , n *= - o ; var p = Math . sqrt ( m * m + n
} , c . prototype . createFrictionEquation = function ( a , b , c , d ) { var e = this . reusableFrictionEquations . length ? this . reusableFrictionEquations . pop ( ) : new m ( a , b ) ; return e . bi = a , e . bj = b , e . shapeA = c , e . shapeB = d , e . setSlipForce ( this . slipForce ) , e . frictionCoefficient = this . frictionCoefficient , e . relativeVelocity = this . surfaceVelocity , e . enabled = ! 0 , e . frictionStiffness = this . frictionStiffness , e . frictionRelaxation = this . frictionRelaxation , e } , c . prototype . createFrictionFromContact = function ( a ) { var b = this . createFrictionEquation ( a . bi , a . bj , a . shapeA , a . shapeB ) ; return g . copy ( b . ri , a . ri ) , g . copy ( b . rj , a . rj ) , g . rotate ( b . t , a . ni , - Math . PI / 2 ) , b . contactEquation = a , b } , c . prototype [ o . LINE | o . CONVEX ] = c . prototype . convexLine = function ( a , b , c , d , e , f , g , h , i ) { return i ? ! 1 : 0 } , c . prototype [ o . LINE | o . RECTANGLE ] = c . prototype . lineRectangle = function ( a , b , c , d , e , f , g , h , i ) { return i ? ! 1 : 0 } ; var L = new q ( 1 , 1 ) , M = g . create ( ) ; c . prototype [ o . CAPSULE | o . CONVEX ] = c . prototype [ o . CAPSULE | o . RECTANGLE ] = c . prototype . convexCapsule = function ( a , b , c , d , f , h , i , j , k ) { var l = M ; g . set ( l , h . length / 2 , 0 ) , g . rotate ( l , l , j ) , g . add ( l , l , i ) ; var m = this . circleConvex ( f , h , l , j , a , b , c , d , k , h . radius ) ; g . set ( l , - h . length / 2 , 0 ) , g . rotate ( l , l , j ) , g . add ( l , l , i ) ; var n = this . circleConvex ( f , h , l , j , a , b , c , d , k , h . radius ) ; if ( k && ( m || n ) ) return ! 0 ; var o = L ; e ( o , h ) ; var p = this . convexConvex ( a , b , c , d , f , o , i , j , k ) ; return p + m + n } , c . prototype [ o . CAPSULE | o . LINE ] = c . prototype . lineCapsule = function ( a , b , c , d , e , f , g , h , i ) { return i ? ! 1 : 0 } ; var N = g . create ( ) , O = g . create ( ) , P = new q ( 1 , 1 ) ; c . prototype [ o . CAPSULE | o . CAPSULE ] = c . prototype . capsuleCapsule = function ( a , b , c , d , f , h , i , j , k ) { for ( var l = N , m = O , n = 0 , o = 0 ; 2 > o ; o ++ ) { g . set ( l , ( 0 == o ? - 1 : 1 ) * b . length / 2 , 0 ) , g . rotate ( l , l , d ) , g . add ( l , l , c ) ; for ( var p = 0 ; 2 > p ; p ++ ) { g . set ( m , ( 0 == p ? - 1 : 1 ) * h . length / 2 , 0 ) , g . rotate ( m , m , j ) , g . add ( m , m , i ) ; var q = this . circleCircle ( a , b , l , d , f , h , m , j , k , b . radius , h . radius ) ; if ( k && q ) return ! 0 ; n += q } } var r = P ; e ( r , b ) ; var s = this . convexCapsule ( a , r , c , d , f , h , i , j , k ) ; if ( k && s ) return ! 0 ; n += s , e ( r , h ) ; var t = this . convexCapsule ( f , r , i , j , a , b , c , d , k ) ; return k && t ? ! 0 : n += t } , c . prototype [ o . LINE | o . LINE ] = c . prototype . lineLine = function ( a , b , c , d , e , f , g , h , i ) { return i ? ! 1 : 0 } , c . prototype [ o . PLANE | o . LINE ] = c . prototype . planeLine = function ( a , b , c , d , e , f , k , l , m ) { var n = s , o = t , p = u , q = v , B = w , C = x , D = y , E = z , F = A , G = K ; numContacts = 0 , g . set ( n , - f . length / 2 , 0 ) , g . set ( o , f . length / 2 , 0 ) , g . rotate ( p , n , l ) , g . rotate ( q , o , l ) , i ( p , p , k ) , i ( q , q , k ) , g . copy ( n , p ) , g . copy ( o , q ) , h ( B , o , n ) , g . normalize ( C , B ) , g . rotate ( F , C , - Math . PI / 2 ) , g . rotate ( E , r , d ) , G [ 0 ] = n , G [ 1 ] = o ; for ( var H = 0 ; H < G . length ; H ++ ) { var I = G [ H ] ; h ( D , I , c ) ; var J = j ( D , E ) ; if ( 0 > J ) { if ( m ) return ! 0 ; var L = this . createContactEquation ( a , e , b , f ) ; numContacts ++ , g . copy ( L . ni , E ) , g . normalize ( L . ni , L . ni ) , g . scale ( D , E , J ) , h ( L . ri , I , D ) , h ( L . ri , L . ri , a . position ) , h ( L . rj , I , k ) , i ( L . rj , L . rj , k ) , h ( L . rj , L . rj , e . position ) , this . contactEquations . push ( L ) , this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( L ) ) } } return numContacts } , c . prototype [ o . PARTICLE | o . CAPSULE ] = c . prototype . particleCapsule = function ( a , b , c , d , e , f , g , h , i ) { return this . circleLine ( a , b , c , d , e , f , g , h , i , f . radius , 0 ) } , c . prototype [ o . CIRCLE | o . LINE ] = c . prototype . circleLine = function ( a , b , c , d , e , f , k , l , m , n , o ) { var p = f , q = l , r = e , G = k , H = c , I = a , J = b , n = n || 0 , o = "undefined" != typeof o ? o : J . radius , L = s , M = t , N = u , O = v , P = w , Q = x , R = y , S = z , T = A , U = B , V = C , W = D , X = E , Y = F , Z = K ; g . set ( S , - p . length / 2 , 0 ) , g . set ( T , p . length / 2 , 0 ) , g . rotate ( U , S , q ) , g . rotate ( V , T , q ) , i ( U , U , G ) , i ( V , V , G ) , g . copy ( S , U ) , g . copy ( T , V ) , h ( Q , T , S ) , g . normalize ( R , Q ) , g . rotate ( P , R , - Math . PI / 2 ) , h ( W , H , S ) ; var $ = j ( W , P ) ; if ( h ( O , S , G ) , h ( X , H , G ) , Math . abs ( $ ) < o + n ) { g . scale ( L , P , $ ) , h ( N , H , L ) , g . scale ( M , P , j ( P , X ) ) , g . normalize ( M , M ) , g . scale ( M , M , n ) , i ( N , N , M ) ; var _ = j ( R , N ) , ab = j ( R , S ) , bb = j ( R , T ) ; if ( _ > ab && bb > _ ) { if ( m ) return ! 0 ; var cb = this . createContactEquation ( I , r , b , f ) ; return g . scale ( cb . ni , L , - 1 ) , g . normalize ( cb . ni , cb . ni ) , g . scale ( cb . ri , cb . ni , o ) , i ( cb . ri , cb . ri , H ) , h ( cb . ri , cb . ri , I . position ) , h ( cb . rj , N , G ) , i ( cb . rj , cb . rj , G ) , h ( cb . rj , cb . rj , r . position ) , this . contactEquations . push ( cb ) , this . enableFriction && this . frictionEquations . push ( this . createFrictionFromContact ( cb ) ) , 1 } } Z [ 0 ] = S , Z [ 1 ] = T ; for ( var db = 0 ; db < Z . length ; db ++ ) { var eb = Z [ db ] ; if ( h ( W , eb , H ) , g . squaredLength ( W ) < ( o + n ) * ( o + n ) ) { if ( m ) return ! 0 ; var cb = this . createContactEquation ( I , r , b , f ) ; return g . copy ( cb . ni , W ) , g . normalize ( cb . ni , cb . ni ) , g . scale ( cb . ri , cb . ni , o ) , i ( cb . ri , cb . ri , H ) , h ( cb . ri , c
return d ( a , e , g , f , h ) } ; var j = e . create ( ) , k = e . create ( ) ; c . prototype . computeGiMf = function ( ) { var a = this . bi , b = this . bj , c = a . force , d = a . angularForce , f = b . force , g = b . angularForce , h = a . invMass , i = b . invMass , l = a . invInertia , m = b . invInertia , n = this . G ; return e . scale ( j , c , h ) , e . scale ( k , f , i ) , this . transformedGmult ( n , j , d * l , k , g * m ) } , c . prototype . computeGiMGt = function ( ) { var a = this . bi , b = this . bj , c = a . invMass , d = b . invMass , e = a . invInertia , f = b . invInertia , g = this . G ; return g [ 0 ] * g [ 0 ] * c + g [ 1 ] * g [ 1 ] * c + g [ 2 ] * g [ 2 ] * e + g [ 3 ] * g [ 3 ] * d + g [ 4 ] * g [ 4 ] * d + g [ 5 ] * g [ 5 ] * f } ; { var l = e . create ( ) , m = e . create ( ) , n = e . create ( ) ; e . create ( ) , e . create ( ) , e . create ( ) , f . create ( ) , f . create ( ) } c . prototype . addToWlambda = function ( a ) { var b = this . bi , c = this . bj , d = l , f = m , g = n , h = this . G ; f [ 0 ] = h [ 0 ] , f [ 1 ] = h [ 1 ] , g [ 0 ] = h [ 3 ] , g [ 1 ] = h [ 4 ] , e . scale ( d , f , b . invMass * a ) , e . add ( b . vlambda , b . vlambda , d ) , e . scale ( d , g , c . invMass * a ) , e . add ( c . vlambda , c . vlambda , d ) , b . wlambda += b . invInertia * h [ 2 ] * a , c . wlambda += c . invInertia * h [ 5 ] * a } , c . prototype . computeInvC = function ( a ) { return 1 / ( this . computeGiMGt ( ) + a ) } } , { "../math/mat2" : 31 , "../math/vec2" : 33 , "../utils/Utils" : 50 } ] , 25 : [ function ( a , b ) { function c ( a , b , c ) { e . call ( this , a , b , - c , c ) , this . ri = d . create ( ) , this . rj = d . create ( ) , this . t = d . create ( ) , this . contactEquation = null , this . shapeA = null , this . shapeB = null , this . frictionCoefficient = . 3 } { var d = ( a ( "../math/mat2" ) , a ( "../math/vec2" ) ) , e = a ( "./Equation" ) ; a ( "../utils/Utils" ) } b . exports = c , c . prototype = new e , c . prototype . constructor = c , c . prototype . setSlipForce = function ( a ) { this . maxForce = a , this . minForce = - a } , c . prototype . computeB = function ( a , b , c ) { var e = ( this . bi , this . bj , this . ri ) , f = this . rj , g = this . t , h = this . G ; h [ 0 ] = - g [ 0 ] , h [ 1 ] = - g [ 1 ] , h [ 2 ] = - d . crossLength ( e , g ) , h [ 3 ] = g [ 0 ] , h [ 4 ] = g [ 1 ] , h [ 5 ] = d . crossLength ( f , g ) ; var i = this . computeGW ( ) , j = this . computeGiMf ( ) , k = - i * b - c * j ; return k } } , { "../math/mat2" : 31 , "../math/vec2" : 33 , "../utils/Utils" : 50 , "./Equation" : 24 } ] , 26 : [ function ( a , b ) { function c ( a , b , c ) { c = c || { } , d . call ( this , a , b , - Number . MAX _VALUE , Number . MAX _VALUE ) , this . angle = c . angle || 0 ; var e = this . G ; e [ 2 ] = 1 , e [ 5 ] = - 1 } var d = a ( "./Equation" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . constructor = c ; var f = e . create ( ) , g = e . create ( ) , h = e . fromValues ( 1 , 0 ) , i = e . fromValues ( 0 , 1 ) ; c . prototype . computeGq = function ( ) { return e . rotate ( f , h , this . bi . angle + this . angle ) , e . rotate ( g , i , this . bj . angle ) , e . dot ( f , g ) } } , { "../math/vec2" : 33 , "./Equation" : 24 } ] , 27 : [ function ( a , b ) { function c ( a , b ) { d . call ( this , a , b , - Number . MAX _VALUE , Number . MAX _VALUE ) , this . relativeVelocity = 1 , this . ratio = 1 } { var d = a ( "./Equation" ) ; a ( "../math/vec2" ) } b . exports = c , c . prototype = new d , c . prototype . constructor = c , c . prototype . computeB = function ( a , b , c ) { var d = this . G ; d [ 2 ] = - 1 , d [ 5 ] = this . ratio ; var e = this . computeGiMf ( ) , f = this . computeGW ( ) , g = - f * b - c * e ; return g } } , { "../math/vec2" : 33 , "./Equation" : 24 } ] , 28 : [ function ( a , b ) { var c = function ( ) { } ; b . exports = c , c . prototype = { constructor : c , on : function ( a , b , c ) { b . context = c || this , void 0 === this . _listeners && ( this . _listeners = { } ) ; var d = this . _listeners ; return void 0 === d [ a ] && ( d [ a ] = [ ] ) , - 1 === d [ a ] . indexOf ( b ) && d [ a ] . push ( b ) , this } , has : function ( a , b ) { if ( void 0 === this . _listeners ) return ! 1 ; var c = this . _listeners ; return void 0 !== c [ a ] && - 1 !== c [ a ] . indexOf ( b ) ? ! 0 : ! 1 } , off : function ( a , b ) { if ( void 0 === this . _listeners ) return this ; var c = this . _listeners , d = c [ a ] . indexOf ( b ) ; return - 1 !== d && c [ a ] . splice ( d , 1 ) , this } , emit : function ( a ) { if ( void 0 === this . _listeners ) return this ; var b = this . _listeners , c = b [ a . type ] ; if ( void 0 !== c ) { a . target = this ; for ( var d = 0 , e = c . length ; e > d ; d ++ ) { var f = c [ d ] ; f . call ( f . context , a ) } } return this } } } , { } ] , 29 : [ function ( a , b ) { function c ( a , b , e ) { if ( e = e || { } , ! ( a instanceof d && b instanceof d ) ) throw new Error ( "First two arguments must be Material instances." ) ; this . id = c . idCounter ++ , this . materialA = a , this . materialB = b , this . friction = "undefined" != typeof e . friction ? Number ( e . friction ) : . 3 , this . restitution = "undefined" != typeof e . restitution ? Number ( e . restitution ) : 0 , this . stiffness = "undefined" != typeof e . stiffness ? Number ( e . stiffness ) : 1e7 , this . relaxation = "undefined" != typeof e . relaxation ? Number ( e . relaxation ) : 3 , this . frictionStiffness = "undefined" != typeof e . frictionStiffness ? Number ( e . frictionStiffness ) : 1e7 , this . frictionRelaxation = "undefined" != typeof e . frictionRelaxation ? Number ( e . frictionRelaxation ) : 3 , this . surfaceVelocity = "undefined" != typeof e . surfaceVelocity ?
b . exports = c ; var z = w . version . split ( "." ) . slice ( 0 , 2 ) . join ( "." ) ; if ( "undefined" == typeof performance && ( performance = { } ) , ! performance . now ) { var A = Date . now ( ) ; performance . timing && performance . timing . navigationStart && ( A = performance . timing . navigationStart ) , performance . now = function ( ) { return Date . now ( ) - A } } c . prototype = new Object ( n . prototype ) , c . prototype . addConstraint = function ( a ) { this . constraints . push ( a ) } , c . prototype . addContactMaterial = function ( a ) { this . contactMaterials . push ( a ) } , c . prototype . removeContactMaterial = function ( a ) { var b = this . contactMaterials . indexOf ( a ) ; - 1 !== b && y . splice ( this . contactMaterials , b , 1 ) } , c . prototype . getContactMaterial = function ( a , b ) { for ( var c = this . contactMaterials , d = 0 , e = c . length ; d !== e ; d ++ ) { var f = c [ d ] ; if ( f . materialA === a && f . materialB === b || f . materialA === b && f . materialB === a ) return f } return ! 1 } , c . prototype . removeConstraint = function ( a ) { var b = this . constraints . indexOf ( a ) ; - 1 !== b && y . splice ( this . constraints , b , 1 ) } ; { var B = ( f . create ( ) , f . create ( ) , f . create ( ) , f . create ( ) , f . create ( ) , f . create ( ) , f . create ( ) ) , C = f . fromValues ( 0 , 0 ) , D = f . fromValues ( 0 , 0 ) ; f . fromValues ( 0 , 0 ) } c . prototype . step = function ( a , b , c ) { if ( c = c || 10 , b = b || 0 , 0 == b ) this . internalStep ( a ) , this . time += a ; else { var d = Math . floor ( ( this . time + b ) / a ) - Math . floor ( this . time / a ) ; d = Math . min ( d , c ) ; for ( var e = 0 ; d > e ; e ++ ) this . internalStep ( a ) ; this . time += b , this . fixedStepTime += d * a ; for ( var f = this . time - this . fixedStepTime - a , g = 0 ; g !== this . bodies . length ; g ++ ) { var h = this . bodies [ g ] ; h . interpolatedPosition [ 0 ] = h . position [ 0 ] + h . velocity [ 0 ] * f , h . interpolatedPosition [ 1 ] = h . position [ 1 ] + h . velocity [ 1 ] * f } } } , c . prototype . internalStep = function ( a ) { { var b , d , e = this , g = this . doProfiling , h = this . springs . length , i = this . springs , j = this . bodies , k = this . gravity , l = this . solver , m = this . bodies . length , n = this . broadphase , p = this . narrowphase , q = this . constraints , r = B , s = ( f . scale , f . add ) ; f . rotate } this . lastTimeStep = a , g && ( b = performance . now ( ) ) ; var t = f . length ( this . gravity ) ; if ( this . applyGravity ) for ( var u = 0 ; u !== m ; u ++ ) { var v = j [ u ] , w = v . force ; v . motionState == o . DYNAMIC && ( f . scale ( r , k , v . mass * v . gravityScale ) , s ( w , w , r ) ) } if ( this . applySpringForces ) for ( var u = 0 ; u !== h ; u ++ ) { var x = i [ u ] ; x . applyForce ( ) } if ( this . applyDamping ) for ( var u = 0 ; u !== m ; u ++ ) { var v = j [ u ] ; v . motionState == o . DYNAMIC && v . applyDamping ( a ) } var y = n . getCollisionPairs ( this ) ; this . postBroadphaseEvent . pairs = y , this . emit ( this . postBroadphaseEvent ) , p . reset ( this ) ; for ( var u = 0 , z = y . length ; u !== z ; u += 2 ) for ( var A = y [ u ] , C = y [ u + 1 ] , D = 0 , E = A . shapes . length ; D !== E ; D ++ ) for ( var F = A . shapes [ D ] , G = A . shapeOffsets [ D ] , H = A . shapeAngles [ D ] , I = 0 , J = C . shapes . length ; I !== J ; I ++ ) { var K = C . shapes [ I ] , L = C . shapeOffsets [ I ] , M = C . shapeAngles [ I ] , N = this . defaultContactMaterial ; if ( F . material && K . material ) { var O = this . getContactMaterial ( F . material , K . material ) ; O && ( N = O ) } this . runNarrowphase ( p , A , F , G , H , C , K , L , M , N , t ) } for ( var P = this . overlappingShapesLastState , u = 0 ; u !== P . keys . length ; u ++ ) { var Q = P . keys [ u ] ; if ( P [ Q ] === ! 0 && ! this . overlappingShapesCurrentState [ Q ] ) { var R = this . endContactEvent ; R . shapeA = P [ Q + "_shapeA" ] , R . shapeB = P [ Q + "_shapeB" ] , R . bodyA = P [ Q + "_bodyA" ] , R . bodyB = P [ Q + "_bodyB" ] , this . emit ( R ) } } for ( var u = 0 ; u !== P . keys . length ; u ++ ) delete P [ P . keys [ u ] ] ; P . keys . length = 0 ; for ( var S = this . overlappingShapesCurrentState , u = 0 ; u !== S . keys . length ; u ++ ) P [ S . keys [ u ] ] = S [ S . keys [ u ] ] , P . keys . push ( S . keys [ u ] ) ; for ( var u = 0 ; u !== S . keys . length ; u ++ ) delete S [ S . keys [ u ] ] ; S . keys . length = 0 ; var T = this . preSolveEvent ; T . contactEquations = p . contactEquations , T . frictionEquations = p . frictionEquations , this . emit ( T ) , l . addEquations ( p . contactEquations ) , l . addEquations ( p . frictionEquations ) ; var U = q . length ; for ( u = 0 ; u !== U ; u ++ ) { var V = q [ u ] ; V . update ( ) , l . addEquations ( V . equations ) } this . solveConstraints && l . solve ( a , this ) , l . removeAllEquations ( ) ; for ( var u = 0 ; u !== m ; u ++ ) { var W = j [ u ] ; W . sleepState !== o . SLEEPING && W . motionState != o . STATIC && c . integrateBody ( W , a ) } for ( var u = 0 ; u !== m ; u ++ ) j [ u ] . setZeroForce ( ) ; if ( g && ( d = performance . now ( ) , e . lastStepTime = d - b ) , this . emitImpactEvent ) for ( var X = this . impactEvent , u = 0 ; u !== p . contactEquations . length ; u ++ ) { var Y = p . contactEquations [ u ] ; Y . firstImpact && ( X . bodyA = Y . bi , X . bodyB = Y . bj , X . shapeA = Y . shapeA , X . shapeB = Y . shapeB , X . contactEquation = Y , this . emit ( X ) ) } if ( this . enableBodySleeping ) for ( u = 0 ; u !== m ; u ++ ) j [ u ] . sleepTick ( this . time ) ; this . emit ( this . postStepEvent ) } ; var E = f . create ( ) , F = f . create ( )
else - 1 === this . collidesWith . indexOf ( a ) && ( this . collidesWith . push ( a ) , b && this . createGroupCallback ( a , b , c ) ) ; var f = this . getCollisionMask ( ) ; if ( "undefined" == typeof d ) for ( var e = this . data . shapes . length - 1 ; e >= 0 ; e -- ) this . data . shapes [ e ] . collisionMask = f ; else d . collisionMask = f } , adjustCenterOfMass : function ( ) { this . data . adjustCenterOfMass ( ) } , applyDamping : function ( a ) { this . data . applyDamping ( a ) } , applyForce : function ( a , b , c ) { this . data . applyForce ( a , [ this . world . pxm ( b ) , this . world . pxm ( c ) ] ) } , setZeroForce : function ( ) { this . data . setZeroForce ( ) } , setZeroRotation : function ( ) { this . data . angularVelocity = 0 } , setZeroVelocity : function ( ) { this . data . velocity [ 0 ] = 0 , this . data . velocity [ 1 ] = 0 } , setZeroDamping : function ( ) { this . data . damping = 0 , this . data . angularDamping = 0 } , toLocalFrame : function ( a , b ) { return this . data . toLocalFrame ( a , b ) } , toWorldFrame : function ( a , b ) { return this . data . toWorldFrame ( a , b ) } , rotateLeft : function ( a ) { this . data . angularVelocity = this . world . pxm ( - a ) } , rotateRight : function ( a ) { this . data . angularVelocity = this . world . pxm ( a ) } , moveForward : function ( a ) { var b = this . world . pxmi ( - a ) , c = this . data . angle + Math . PI / 2 ; this . data . velocity [ 0 ] = b * Math . cos ( c ) , this . data . velocity [ 1 ] = b * Math . sin ( c ) } , moveBackward : function ( a ) { var b = this . world . pxmi ( - a ) , c = this . data . angle + Math . PI / 2 ; this . data . velocity [ 0 ] = - ( b * Math . cos ( c ) ) , this . data . velocity [ 1 ] = - ( b * Math . sin ( c ) ) } , thrust : function ( a ) { var b = this . world . pxmi ( - a ) , c = this . data . angle + Math . PI / 2 ; this . data . force [ 0 ] += b * Math . cos ( c ) , this . data . force [ 1 ] += b * Math . sin ( c ) } , reverse : function ( a ) { var b = this . world . pxmi ( - a ) , c = this . data . angle + Math . PI / 2 ; this . data . force [ 0 ] -= b * Math . cos ( c ) , this . data . force [ 1 ] -= b * Math . sin ( c ) } , moveLeft : function ( a ) { this . data . velocity [ 0 ] = this . world . pxmi ( - a ) } , moveRight : function ( a ) { this . data . velocity [ 0 ] = this . world . pxmi ( a ) } , moveUp : function ( a ) { this . data . velocity [ 1 ] = this . world . pxmi ( - a ) } , moveDown : function ( a ) { this . data . velocity [ 1 ] = this . world . pxmi ( a ) } , preUpdate : function ( ) { this . removeNextStep && ( this . removeFromWorld ( ) , this . removeNextStep = ! 1 ) } , postUpdate : function ( ) { this . sprite . x = this . world . mpxi ( this . data . position [ 0 ] ) , this . sprite . y = this . world . mpxi ( this . data . position [ 1 ] ) , this . fixedRotation || ( this . sprite . rotation = this . data . angle ) } , reset : function ( a , b , c , d ) { "undefined" == typeof c && ( c = ! 1 ) , "undefined" == typeof d && ( d = ! 1 ) , this . setZeroForce ( ) , this . setZeroVelocity ( ) , this . setZeroRotation ( ) , c && this . setZeroDamping ( ) , d && ( this . mass = 1 ) , this . x = a , this . y = b } , addToWorld : function ( ) { this . data . world !== this . game . physics . p2 . world && this . game . physics . p2 . addBody ( this ) } , removeFromWorld : function ( ) { this . data . world === this . game . physics . p2 . world && this . game . physics . p2 . removeBodyNextStep ( this ) } , destroy : function ( ) { this . removeFromWorld ( ) , this . clearShapes ( ) , this . _bodyCallbacks = { } , this . _bodyCallbackContext = { } , this . _groupCallbacks = { } , this . _groupCallbackContext = { } , this . debugBody && this . debugBody . destroy ( ) , this . debugBody = null , this . sprite = null } , clearShapes : function ( ) { for ( var a = this . data . shapes . length ; a -- ; ) this . data . removeShape ( this . data . shapes [ a ] ) ; this . shapeChanged ( ) } , addShape : function ( a , b , c , d ) { return "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 0 ) , "undefined" == typeof d && ( d = 0 ) , this . data . addShape ( a , [ this . world . pxmi ( b ) , this . world . pxmi ( c ) ] , d ) , this . shapeChanged ( ) , a } , addCircle : function ( a , b , c , d ) { var e = new p2 . Circle ( this . world . pxm ( a ) ) ; return this . addShape ( e , b , c , d ) } , addRectangle : function ( a , b , c , d , e ) { var f = new p2 . Rectangle ( this . world . pxm ( a ) , this . world . pxm ( b ) ) ; return this . addShape ( f , c , d , e ) } , addPlane : function ( a , b , c ) { var d = new p2 . Plane ; return this . addShape ( d , a , b , c ) } , addParticle : function ( a , b , c ) { var d = new p2 . Particle ; return this . addShape ( d , a , b , c ) } , addLine : function ( a , b , c , d ) { var e = new p2 . Line ( this . world . pxm ( a ) ) ; return this . addShape ( e , b , c , d ) } , addCapsule : function ( a , b , c , d , e ) { var f = new p2 . Capsule ( this . world . pxm ( a ) , b ) ; return this . addShape ( f , c , d , e ) } , addPolygon : function ( a , b ) { a = a || { } , b = Array . prototype . slice . call ( arguments , 1 ) ; var c = [ ] ; if ( 1 === b . length && Array . isArray ( b [ 0 ] ) ) c = b [ 0 ] . slice ( 0 ) ; else if ( Array . isArray ( b [ 0 ] ) ) c = b [ 0 ] . slice ( 0 ) ; else if ( "number" == typeof b [ 0 ] ) for ( var d = 0 , e = b . length ; e > d ; d += 2 ) c . push ( [ b [ d ] , b [ d + 1 ] ] ) ; var f = c . length - 1 ; c [ f ] [ 0 ] === c [ 0 ] [ 0 ] && c [ f ] [ 1 ] === c [ 0 ] [ 1 ] && c . pop ( ) ; for ( var g = 0 ; g < c . length ; g ++ ) c [ g ] [ 0 ] = this . world . pxmi ( c [ g ] [ 0 ] ) , c [ g ] [
2014-02-28 09:30:53 +00:00
//# sourceMappingURL=phaser.map