2014-11-08 19:26:34 +00:00
/* Phaser v2.2.0 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */
2014-02-28 09:30:53 +00:00
2014-11-08 19:26:34 +00:00
( function ( ) { var a = this , b = b || { } ; b . WEBGL _RENDERER = 0 , b . CANVAS _RENDERER = 1 , b . VERSION = "v2.0.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 . _UID = 0 , "undefined" != typeof Float32Array ? ( b . Float32Array = Float32Array , b . Uint16Array = Uint16Array ) : ( b . Float32Array = Array , b . Uint16Array = Array ) , b . INTERACTION _FREQUENCY = 30 , b . AUTO _PREVENT _DEFAULT = ! 0 , b . PI _2 = 2 * Math . PI , b . RAD _TO _DEG = 180 / Math . PI , b . DEG _TO _RAD = Math . PI / 180 , b . RETINA _PREFIX = "@2x" , b . dontSayHello = ! 1 , b . defaultRenderOptions = { view : null , transparent : ! 1 , antialias : ! 1 , preserveDrawingBuffer : ! 1 , resolution : 1 , clearBeforeRender : ! 0 } , b . sayHello = function ( a ) { if ( ! b . dontSayHello ) { if ( navigator . userAgent . toLowerCase ( ) . indexOf ( "chrome" ) > - 1 ) { var c = [ "%c %c %c Pixi.js " + b . VERSION + " - " + a + " %c %c http://www.pixijs.com/ %c %c ♥%c♥%c♥ " , "background: #ff66a5" , "background: #ff66a5" , "color: #ff66a5; background: #030307;" , "background: #ff66a5" , "background: #ffc3dc" , "background: #ff66a5" , "color: #ff2424; background: #fff" , "color: #ff2424; background: #fff" , "color: #ff2424; background: #fff" ] ; console . log . apply ( console , c ) } else window . console && console . log ( "Pixi.js " + b . VERSION + " - http://www.pixijs.com/" ) ; b . dontSayHello = ! 0 } } , b . Polygon = function ( a ) { if ( a instanceof Array || ( a = Array . prototype . slice . call ( arguments ) ) , a [ 0 ] instanceof b . Point ) { for ( var c = [ ] , d = 0 , e = a . length ; e > d ; d ++ ) c . push ( a [ d ] . x , a [ d ] . y ) ; a = c } this . closed = ! 0 , this . points = a } , b . Polygon . prototype . clone = function ( ) { var a = this . points . slice ( ) ; return new b . Polygon ( a ) } , b . Polygon . prototype . contains = function ( a , b ) { for ( var c = ! 1 , d = this . points . length / 2 , e = 0 , f = d - 1 ; d > e ; f = e ++ ) { var g = this . points [ 2 * e ] , h = this . points [ 2 * e + 1 ] , i = this . points [ 2 * f ] , j = this . points [ 2 * f + 1 ] , k = h > b != j > b && ( i - g ) * ( b - h ) / ( j - h ) + g > a ; k && ( c = ! c ) } return c } , b . Polygon . prototype . constructor = b . Polygon , 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 b . Float32Array ( 9 ) ) ; var c = this . array ; return a ? ( c [ 0 ] = this . a , c [ 1 ] = this . b , c [ 2 ] = 0 , c [ 3 ] = this . c , c [ 4 ] = this . d , c [ 5 ] = 0 , c [ 6 ] = this . tx , c [ 7 ] = this . ty , c [ 8 ] = 1 ) : ( c [ 0 ] = this . a , c [ 1 ] = this . c , c [ 2 ] = this . tx , c [ 3 ] = this . b , c [ 4 ] = this . d , c [ 5 ] = this . ty , c [ 6 ] = 0 , c [ 7 ] = 0 , c [ 8 ] = 1 ) , c } , b . Matrix . prototype . apply = function ( a , c ) { return c = c || new b . Point , c . x = this . a * a . x + this . c * a . y + this . tx , c . y = this . b * a . x + this . d * a . y + this . ty , c } , b . Matrix . prototype . applyInverse = function ( a , c ) { c = c || new b . Point ; var d = 1 / ( this . a * this . d + this . c * - this . b ) ; return c . x = this . d * d * a . x + - this . c * d * a . y + ( this . ty * this . c - this . tx * this . d ) * d , c . y = this . a * d * a . y + - this . b * d * a . x + ( - this . ty * this . a + this . tx * this . b ) * d , c } , b . Matrix . prototype . translate = function ( a , b ) { return this . tx += a , this . ty += b , this } , b . Matrix . prototype . scale = function ( a , b ) { return this . a *= a , this . d *= b , this . c *= a , this . b *= b , this . tx *= a , this . ty *= b , this } , b . Matrix . prototype . rotate = function ( a ) { var b = Math . cos ( a ) , c = Math . sin ( a ) , d = this . a , e = this . c , f = this . tx ; return this . a = d * b - this . b * c , this . b = d * c + this . b * b , this . c = e * b - this . d * c , this . d = e * c + this . d * b , this . tx = f * b - this . ty * c , this . ty = f * c + this . ty * b , this } , b . Matrix . prototype . append = function ( a ) { var b = this . a , c = this . b , d = this . c , e = this . d ; return this . a = a . a * b + a . b * d , this . b = a . a * c + a . b * e , this . c = a . c * b + a . d * d , this . d = a . c * c + a . d * e , this . tx = a . tx * b + a . ty * d + this . tx , this . ty = a . tx * c + a . ty * e + this . ty , this } , b . Matrix . prototype . identity = function ( ) { return this . a = 1 , this . b = 0 , this . c = 0 , this . d = 1 , this . tx = 0 , this . ty = 0 , this } , b . identityMatrix = new b . Matrix , b . DisplayObject = function ( ) { this . position = new b . Point , this . scale = new b . Point ( 1 , 1 ) , this . transformCallback = null , this . transformCallbackContext = null , this . pivot = new b . Point ( 0 , 0 ) , this . rotation = 0 , this . alpha = 1 , this . visible = ! 0 , this . hitArea = null , this . 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 . _sr = 0 , this . _cr = 1 , this . filterArea = null , this . _bounds = new b . Rectangle ( 0 , 0 , 1 , 1 ) , this . _currentB
2014-11-11 01:10:47 +00:00
else if ( g ++ > 3 * h ) { if ( ! c ) return window . console . log ( "PIXI Warning: shape too complex to fill" ) , [ ] ; for ( e = [ ] , f = [ ] , g = 0 ; d > g ; g ++ ) f . push ( g ) ; g = 0 , h = d , c = ! 1 } } return e . push ( f [ 0 ] , f [ 1 ] , f [ 2 ] ) , e } , b . PolyK . _PointInTriangle = function ( a , b , c , d , e , f , g , h ) { var i = g - c , j = h - d , k = e - c , l = f - d , m = a - c , n = b - d , o = i * i + j * j , p = i * k + j * l , q = i * m + j * n , r = k * k + l * l , s = k * m + l * n , t = 1 / ( o * r - p * p ) , u = ( r * q - p * s ) * t , v = ( o * s - p * q ) * t ; return u >= 0 && v >= 0 && 1 > u + v } , b . PolyK . _convex = function ( a , b , c , d , e , f , g ) { return ( b - d ) * ( e - c ) + ( c - a ) * ( f - d ) >= 0 === g } , b . initDefaultShaders = function ( ) { } , b . CompileVertexShader = function ( a , c ) { return b . _CompileShader ( a , c , a . VERTEX _SHADER ) } , b . CompileFragmentShader = function ( a , c ) { return b . _CompileShader ( a , c , a . FRAGMENT _SHADER ) } , b . _CompileShader = function ( a , b , c ) { var d = b . join ( "\n" ) , e = a . createShader ( c ) ; return a . shaderSource ( e , d ) , a . compileShader ( e ) , a . getShaderParameter ( e , a . COMPILE _STATUS ) ? e : ( window . console . log ( a . getShaderInfoLog ( e ) ) , null ) } , b . compileProgram = function ( a , c , d ) { var e = b . CompileFragmentShader ( a , d ) , f = b . CompileVertexShader ( a , c ) , g = a . createProgram ( ) ; return a . attachShader ( g , f ) , a . attachShader ( g , e ) , a . linkProgram ( g ) , a . getProgramParameter ( g , a . LINK _STATUS ) || window . console . log ( "Could not initialise shaders" ) , g } , b . PixiShader = function ( a ) { this . _UID = b . _UID ++ , this . gl = a , this . program = null , this . fragmentSrc = [ "precision lowp float;" , "varying vec2 vTextureCoord;" , "varying vec4 vColor;" , "uniform sampler2D uSampler;" , "void main(void) {" , " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;" , "}" ] , this . textureCount = 0 , this . firstRun = ! 0 , this . dirty = ! 0 , this . attributes = [ ] , this . init ( ) } , b . PixiShader . prototype . constructor = b . PixiShader , b . PixiShader . prototype . init = function ( ) { var a = this . gl , c = b . compileProgram ( a , this . vertexSrc || b . PixiShader . defaultVertexSrc , 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 . aVertexPosition = a . getAttribLocation ( c , "aVertexPosition" ) , this . aTextureCoord = a . getAttribLocation ( c , "aTextureCoord" ) , this . colorAttribute = a . getAttribLocation ( c , "aColor" ) , - 1 === this . colorAttribute && ( this . colorAttribute = 2 ) , this . attributes = [ this . aVertexPosition , this . aTextureCoord , this . colorAttribute ] ; for ( var d in this . uniforms ) this . uniforms [ d ] . uniformLocation = a . getUniformLocation ( c , d ) ; this . initUniforms ( ) , this . program = c } , b . PixiShader . prototype . initUniforms = function ( ) { this . textureCount = 1 ; var a , b = this . gl ; for ( var c in this . uniforms ) { a = this . uniforms [ c ] ; var d = a . type ; "sampler2D" === d ? ( a . _init = ! 1 , null !== a . value && this . initSampler2D ( a ) ) : "mat2" === d || "mat3" === d || "mat4" === d ? ( a . glMatrix = ! 0 , a . glValueLength = 1 , "mat2" === d ? a . glFunc = b . uniformMatrix2fv : "mat3" === d ? a . glFunc = b . uniformMatrix3fv : "mat4" === d && ( a . glFunc = b . uniformMatrix4fv ) ) : ( a . glFunc = b [ "uniform" + d ] , a . glValueLength = "2f" === d || "2i" === d ? 2 : "3f" === d || "3i" === d ? 3 : "4f" === d || "4i" === d ? 4 : 1 ) } } , b . PixiShader . prototype . initSampler2D = function ( a ) { if ( a . value && a . value . baseTexture && a . value . baseTexture . hasLoaded ) { var b = this . gl ; if ( b . activeTexture ( b [ "TEXTURE" + this . textureCount ] ) , b . bindTexture ( b . TEXTURE _2D , a . value . baseTexture . _glTextures [ b . id ] ) , a . textureData ) { var c = a . textureData , d = c . magFilter ? c . magFilter : b . LINEAR , e = c . minFilter ? c . minFilter : b . LINEAR , f = c . wrapS ? c . wrapS : b . CLAMP _TO _EDGE , g = c . wrapT ? c . wrapT : b . CLAMP _TO _EDGE , h = c . luminance ? b . LUMINANCE : b . RGBA ; if ( c . repeat && ( f = b . REPEAT , g = b . REPEAT ) , b . pixelStorei ( b . UNPACK _FLIP _Y _WEBGL , ! ! c . flipY ) , c . width ) { var i = c . width ? c . width : 512 , j = c . height ? c . height : 2 , k = c . border ? c . border : 0 ; b . texImage2D ( b . TEXTURE _2D , 0 , h , i , j , k , h , b . UNSIGNED _BYTE , null ) } else b . texImage2D ( b . TEXTURE _2D , 0 , h , b . RGBA , b . UNSIGNED _BYTE , a . value . baseTexture . source ) ; b . texParameteri ( b . TEXTURE _2D , b . TEXTURE _MAG _FILTER , d ) , b . texParameteri ( b . TEXTURE _2D , b . TEXTURE _MIN _FILTER , e ) , b . texParameteri ( b . TEXTURE _2D , b . TEXTURE _WRAP _S , f ) , b . texParameteri ( b . TEXTURE _2D , b . TEXTURE _WRAP _T , g ) } b . uniform1i ( a . uniformLocation , this . textureCount ) , a . _init = ! 0 , this . textureCount ++ } } , b . PixiShader . prototype . syncUniforms = function ( ) { this . textureCount = 1 ; var a , c = this . gl ; for ( var d in this . uniforms ) a = this . uniforms [ d ] , 1 === a . glValueLength ? a . glMatrix === ! 0 ? a . glF
} , b . WebGLShaderManager . prototype . setAttribs = function ( a ) { var b ; for ( b = 0 ; b < this . tempAttribState . length ; b ++ ) this . tempAttribState [ b ] = ! 1 ; for ( b = 0 ; b < a . length ; b ++ ) { var c = a [ b ] ; this . tempAttribState [ c ] = ! 0 } var d = this . gl ; for ( b = 0 ; b < this . attribState . length ; b ++ ) this . attribState [ b ] !== this . tempAttribState [ b ] && ( this . attribState [ b ] = this . tempAttribState [ b ] , this . tempAttribState [ b ] ? d . enableVertexAttribArray ( b ) : d . disableVertexAttribArray ( b ) ) } , b . WebGLShaderManager . prototype . setShader = function ( a ) { return this . _currentId === a . _UID ? ! 1 : ( this . _currentId = a . _UID , this . currentShader = a , this . gl . useProgram ( a . program ) , this . setAttribs ( a . attributes ) , ! 0 ) } , b . WebGLShaderManager . prototype . destroy = function ( ) { this . attribState = null , this . tempAttribState = null , this . primitiveShader . destroy ( ) , this . complexPrimitiveShader . destroy ( ) , this . defaultShader . destroy ( ) , this . fastShader . destroy ( ) , this . stripShader . destroy ( ) , this . gl = null } , b . WebGLSpriteBatch = function ( ) { this . vertSize = 6 , this . size = 2e3 ; var a = 4 * this . size * this . vertSize , c = 6 * this . size ; this . vertices = new b . Float32Array ( a ) , this . indices = new b . Uint16Array ( c ) , this . lastIndexCount = 0 ; for ( var d = 0 , e = 0 ; c > d ; d += 6 , e += 4 ) this . indices [ d + 0 ] = e + 0 , this . indices [ d + 1 ] = e + 1 , this . indices [ d + 2 ] = e + 2 , this . indices [ d + 3 ] = e + 0 , this . indices [ d + 4 ] = e + 2 , this . indices [ d + 5 ] = e + 3 ; this . drawing = ! 1 , this . currentBatchSize = 0 , this . currentBaseTexture = null , this . dirty = ! 0 , this . textures = [ ] , this . blendModes = [ ] , this . shaders = [ ] , this . sprites = [ ] , this . defaultShader = new b . AbstractFilter ( [ "precision lowp float;" , "varying vec2 vTextureCoord;" , "varying vec4 vColor;" , "uniform sampler2D uSampler;" , "void main(void) {" , " gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;" , "}" ] ) } , b . WebGLSpriteBatch . prototype . setContext = function ( a ) { this . gl = a , this . vertexBuffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , this . indices , a . STATIC _DRAW ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . vertices , a . DYNAMIC _DRAW ) , this . currentBlendMode = 99999 ; var c = new b . PixiShader ( a ) ; c . fragmentSrc = this . defaultShader . fragmentSrc , c . uniforms = { } , c . init ( ) , this . defaultShader . shaders [ a . id ] = c } , b . WebGLSpriteBatch . prototype . begin = function ( a ) { this . renderSession = a , this . shader = this . renderSession . shaderManager . defaultShader , this . start ( ) } , b . WebGLSpriteBatch . prototype . end = function ( ) { this . flush ( ) } , b . WebGLSpriteBatch . prototype . render = function ( a ) { var b = a . texture ; this . currentBatchSize >= this . size && ( this . flush ( ) , this . currentBaseTexture = b . baseTexture ) ; var c = b . _uvs ; if ( c ) { var d , e , f , g , h = a . worldAlpha , i = a . tint , j = this . vertices , k = a . anchor . x , l = a . anchor . y ; if ( b . trim ) { var m = b . trim ; e = m . x - k * m . width , d = e + b . crop . width , g = m . y - l * m . height , f = g + b . crop . height } else d = b . frame . width * ( 1 - k ) , e = b . frame . width * - k , f = b . frame . height * ( 1 - l ) , g = b . frame . height * - l ; var n = 4 * this . currentBatchSize * this . vertSize , o = b . baseTexture . resolution , p = a . worldTransform , q = p . a / o , r = p . b / o , s = p . c / o , t = p . d / o , u = p . tx , v = p . ty ; j [ n ++ ] = q * e + s * g + u , j [ n ++ ] = t * g + r * e + v , j [ n ++ ] = c . x0 , j [ n ++ ] = c . y0 , j [ n ++ ] = h , j [ n ++ ] = i , j [ n ++ ] = q * d + s * g + u , j [ n ++ ] = t * g + r * d + v , j [ n ++ ] = c . x1 , j [ n ++ ] = c . y1 , j [ n ++ ] = h , j [ n ++ ] = i , j [ n ++ ] = q * d + s * f + u , j [ n ++ ] = t * f + r * d + v , j [ n ++ ] = c . x2 , j [ n ++ ] = c . y2 , j [ n ++ ] = h , j [ n ++ ] = i , j [ n ++ ] = q * e + s * f + u , j [ n ++ ] = t * f + r * e + v , j [ n ++ ] = c . x3 , j [ n ++ ] = c . y3 , j [ n ++ ] = h , j [ n ++ ] = i , this . sprites [ this . currentBatchSize ++ ] = a } } , b . WebGLSpriteBatch . prototype . renderTilingSprite = function ( a ) { var c = a . tilingTexture ; this . currentBatchSize >= this . size && ( this . flush ( ) , this . currentBaseTexture = c . baseTexture ) , a . _uvs || ( a . _uvs = new b . TextureUvs ) ; var d = a . _uvs ; a . tilePosition . x %= c . baseTexture . width * a . tileScaleOffset . x , a . tilePosition . y %= c . baseTexture . height * a . tileScaleOffset . y ; var e = a . tilePosition . x / ( c . baseTexture . width * a . tileScaleOffset . x ) , f = a . tilePosition . y / ( c . baseTexture . height * a . tileScaleOffset . y ) , g = a . width / c . baseTexture . width / ( a . tileScale . x * a . tileScaleOffset . x ) , h = a . height / c . baseTexture . height / ( a . tileScale . y * a . tileScaleOffset . y ) ; d . x0 = 0 - e , d . y0 = 0 - f , d . x1 = 1 * g - e , d . y1 = 0 - f , d . x2 = 1 * g - e , d . y2 = 1 * h - f , d . x3 = 0 - e , d . y3 = 1 * h - f ; var i = a . worldAlpha , j = a . tint , k = this . vertices , l = a . width , m = a . height , n = a . anchor . x , o = a . anchor . y , p = l * ( 1 - n ) , q = l * - n , r = m * ( 1 - o ) , s = m * - o , t = 4 * this . currentBatchSize * this . vertSize
} , b . Strip . prototype . _renderCanvas = function ( a ) { var b = a . context , c = this . worldTransform ; a . roundPixels ? b . setTransform ( c . a , c . b , c . c , c . d , 0 | c . tx , 0 | c . ty ) : b . setTransform ( c . a , c . b , c . c , c . d , c . tx , c . ty ) ; var d = this , e = d . verticies , f = d . uvs , g = e . length / 2 ; this . count ++ ; for ( var h = 0 ; g - 2 > h ; h ++ ) { var i = 2 * h , j = e [ i ] , k = e [ i + 2 ] , l = e [ i + 4 ] , m = e [ i + 1 ] , n = e [ i + 3 ] , o = e [ i + 5 ] ; if ( this . padding > 0 ) { var p = ( j + k + l ) / 3 , q = ( m + n + o ) / 3 , r = j - p , s = m - q , t = Math . sqrt ( r * r + s * s ) ; j = p + r / t * ( t + 3 ) , m = q + s / t * ( t + 3 ) , r = k - p , s = n - q , t = Math . sqrt ( r * r + s * s ) , k = p + r / t * ( t + 3 ) , n = q + s / t * ( t + 3 ) , r = l - p , s = o - q , t = Math . sqrt ( r * r + s * s ) , l = p + r / t * ( t + 3 ) , o = q + s / t * ( t + 3 ) } var u = f [ i ] * d . texture . width , v = f [ i + 2 ] * d . texture . width , w = f [ i + 4 ] * d . texture . width , x = f [ i + 1 ] * d . texture . height , y = f [ i + 3 ] * d . texture . height , z = f [ i + 5 ] * d . texture . height ; b . save ( ) , b . beginPath ( ) , b . moveTo ( j , m ) , b . lineTo ( k , n ) , b . lineTo ( l , o ) , b . closePath ( ) , b . clip ( ) ; var A = u * y + x * w + v * z - y * w - x * v - u * z , B = j * y + x * l + k * z - y * l - x * k - j * z , C = u * k + j * w + v * l - k * w - j * v - u * l , D = u * y * l + x * k * w + j * v * z - j * y * w - x * v * l - u * k * z , E = m * y + x * o + n * z - y * o - x * n - m * z , F = u * n + m * w + v * o - n * w - m * v - u * o , G = u * y * o + x * n * w + m * v * z - m * y * w - x * v * o - u * n * z ; b . transform ( B / A , E / A , C / A , F / A , D / A , G / A ) , b . drawImage ( d . texture . baseTexture . source , 0 , 0 ) , b . restore ( ) } } , b . Strip . prototype . renderStripFlat = function ( a ) { var b = this . context , c = a . verticies , d = c . length / 2 ; this . count ++ , b . beginPath ( ) ; for ( var e = 1 ; d - 2 > e ; e ++ ) { var f = 2 * e , g = c [ f ] , h = c [ f + 2 ] , i = c [ f + 4 ] , j = c [ f + 1 ] , k = c [ f + 3 ] , l = c [ f + 5 ] ; b . moveTo ( g , j ) , b . lineTo ( h , k ) , b . lineTo ( i , l ) } b . fillStyle = "#FF0000" , b . fill ( ) , b . closePath ( ) } , b . Strip . prototype . onTextureUpdate = function ( ) { this . updateFrame = ! 0 } , b . Rope = function ( a , c ) { b . Strip . call ( this , a ) , this . points = c , this . verticies = new b . Float32Array ( 4 * c . length ) , this . uvs = new b . Float32Array ( 4 * c . length ) , this . colors = new b . Float32Array ( 2 * c . length ) , this . indices = new b . Uint16Array ( 2 * c . length ) , this . refresh ( ) } , b . Rope . prototype = Object . create ( b . Strip . prototype ) , b . Rope . prototype . constructor = b . Rope , b . Rope . prototype . refresh = function ( ) { var a = this . points ; if ( ! ( a . length < 1 ) ) { var b = this . uvs , c = a [ 0 ] , d = this . indices , e = this . colors ; this . count -= . 2 , b [ 0 ] = 0 , b [ 1 ] = 0 , b [ 2 ] = 0 , b [ 3 ] = 1 , e [ 0 ] = 1 , e [ 1 ] = 1 , d [ 0 ] = 0 , d [ 1 ] = 1 ; for ( var f , g , h , i = a . length , j = 1 ; i > j ; j ++ ) f = a [ j ] , g = 4 * j , h = j / ( i - 1 ) , j % 2 ? ( b [ g ] = h , b [ g + 1 ] = 0 , b [ g + 2 ] = h , b [ g + 3 ] = 1 ) : ( b [ g ] = h , b [ g + 1 ] = 0 , b [ g + 2 ] = h , b [ g + 3 ] = 1 ) , g = 2 * j , e [ g ] = 1 , e [ g + 1 ] = 1 , g = 2 * j , d [ g ] = g , d [ g + 1 ] = g + 1 , c = f } } , b . Rope . prototype . updateTransform = function ( ) { var a = this . points ; if ( ! ( a . length < 1 ) ) { var c , d = a [ 0 ] , e = { x : 0 , y : 0 } ; this . count -= . 2 ; for ( var f , g , h , i , j , k = this . verticies , l = a . length , m = 0 ; l > m ; m ++ ) f = a [ m ] , g = 4 * m , c = m < a . length - 1 ? a [ m + 1 ] : f , e . y = - ( c . x - d . x ) , e . x = c . y - d . y , h = 10 * ( 1 - m / ( l - 1 ) ) , h > 1 && ( h = 1 ) , i = Math . sqrt ( e . x * e . x + e . y * e . y ) , j = this . texture . height / 2 , e . x /= i , e . y /= i , e . x *= j , e . y *= j , k [ g ] = f . x + e . x , k [ g + 1 ] = f . y + e . y , k [ g + 2 ] = f . x - e . x , k [ g + 3 ] = f . y - e . y , d = f ; b . DisplayObjectContainer . prototype . updateTransform . call ( this ) } } , b . Rope . prototype . setTexture = function ( a ) { this . texture = a } , b . TilingSprite = function ( a , c , d ) { b . Sprite . call ( this , a ) , this . _width = c || 100 , this . _height = d || 100 , this . tileScale = new b . Point ( 1 , 1 ) , this . tileScaleOffset = new b . Point ( 1 , 1 ) , this . tilePosition = new b . Point ( 0 , 0 ) , this . renderable = ! 0 , this . tint = 16777215 , this . blendMode = b . blendModes . NORMAL } , b . TilingSprite . prototype = Object . create ( b . Sprite . prototype ) , b . TilingSprite . prototype . constructor = b . TilingSprite , Object . defineProperty ( b . TilingSprite . prototype , "width" , { get : function ( ) { return this . _width } , set : function ( a ) { this . _width = a } } ) , Object . defineProperty ( b . TilingSprite . prototype , "height" , { get : function ( ) { return this . _height } , set : function ( a ) { this . _height = a } } ) , b . TilingSprite . prototype . setTexture = function ( a ) { this . texture !== a && ( this . texture = a , this . refreshTexture = ! 0 , this . cachedTint = 16777215 ) } , b . TilingSprite . prototype . _renderWebGL = function ( a ) { if ( this . visible !== ! 1 && 0 !== this . alpha ) { var c , d ; for ( this . _mask && ( a . spriteBatch . stop ( ) , a . maskManager . pushMask ( this . mask , a ) , a . spriteBatch . start ( ) ) , this . _filters && ( a . spriteBatch . flush ( ) , a . filterManager . pushFilter ( this . _filterBlock ) ) , ! this . tilingTexture || this . refreshTexture ? ( this . generateTilingTexture ( ! 0 ) , this . tilingTexture && this . tilingTexture . needsUpdate && ( b . updateWebGLTexture ( this . tilingTexture . baseTexture , a . gl ) , this . tilingTexture . needsUpdate = ! 1 ) ) : a . spriteBatch . renderTilingSprite ( this ) , c = 0 , d = this . children . length ; d > c ; c ++ ) this . children [ c ] . _renderWebGL ( a ) ; a . spriteBatc
} , set : function ( a ) { a >= this . bottom ? ( this . height = 0 , this . y = a ) : this . height = this . bottom - a } } ) , Object . defineProperty ( b . Rectangle . prototype , "topLeft" , { get : function ( ) { return new b . Point ( this . x , this . y ) } , set : function ( a ) { this . x = a . x , this . y = a . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "topRight" , { get : function ( ) { return new b . Point ( this . x + this . width , this . y ) } , set : function ( a ) { this . right = a . x , this . y = a . y } } ) , Object . defineProperty ( b . Rectangle . prototype , "empty" , { get : function ( ) { return ! this . width || ! this . height } , set : function ( a ) { a === ! 0 && this . setTo ( 0 , 0 , 0 , 0 ) } } ) , b . Rectangle . prototype . constructor = b . Rectangle , b . Rectangle . inflate = function ( a , b , c ) { return a . x -= b , a . width += 2 * b , a . y -= c , a . height += 2 * c , a } , b . Rectangle . inflatePoint = function ( a , c ) { return b . Rectangle . inflate ( a , c . x , c . y ) } , b . Rectangle . size = function ( a , c ) { return "undefined" == typeof c || null === c ? c = new b . Point ( a . width , a . height ) : c . setTo ( a . width , a . height ) , c } , b . Rectangle . clone = function ( a , c ) { return "undefined" == typeof c || null === c ? c = new b . Rectangle ( a . x , a . y , a . width , a . height ) : c . setTo ( a . x , a . y , a . width , a . height ) , c } , b . Rectangle . contains = function ( a , b , c ) { return a . width <= 0 || a . height <= 0 ? ! 1 : b >= a . x && b < a . right && c >= a . y && c < a . bottom } , b . Rectangle . containsRaw = function ( a , b , c , d , e , f ) { return e >= a && a + c > e && f >= b && b + d > f } , b . Rectangle . containsPoint = function ( a , c ) { return b . Rectangle . contains ( a , c . x , c . y ) } , b . Rectangle . containsRect = function ( a , b ) { return a . volume > b . volume ? ! 1 : a . x >= b . x && a . y >= b . y && a . right < b . right && a . bottom < b . bottom } , b . Rectangle . equals = function ( a , b ) { return a . x == b . x && a . y == b . y && a . width == b . width && a . height == b . height } , b . Rectangle . sameDimensions = function ( a , b ) { return a . width === b . width && a . height === b . height } , b . Rectangle . intersection = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Rectangle ) , b . Rectangle . intersects ( a , c ) && ( d . x = Math . max ( a . x , c . x ) , d . y = Math . max ( a . y , c . y ) , d . width = Math . min ( a . right , c . right ) - d . x , d . height = Math . min ( a . bottom , c . bottom ) - d . y ) , d } , b . Rectangle . intersects = function ( a , b ) { return a . width <= 0 || a . height <= 0 || b . width <= 0 || b . height <= 0 ? ! 1 : ! ( a . right < b . x || a . bottom < b . y || a . x > b . right || a . y > b . bottom ) } , b . Rectangle . intersectsRaw = function ( a , b , c , d , e , f ) { return "undefined" == typeof f && ( f = 0 ) , ! ( b > a . right + f || c < a . left - f || d > a . bottom + f || e < a . top - f ) } , b . Rectangle . union = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Rectangle ) , d . setTo ( Math . min ( a . x , c . x ) , Math . min ( a . y , c . y ) , Math . max ( a . right , c . right ) - Math . min ( a . left , c . left ) , Math . max ( a . bottom , c . bottom ) - Math . min ( a . top , c . top ) ) } , b . Rectangle . aabb = function ( a , c ) { "undefined" == typeof c && ( c = new b . Rectangle ) ; var d = Number . MIN _VALUE , e = Number . MAX _VALUE , f = Number . MIN _VALUE , g = Number . MAX _VALUE ; return a . forEach ( function ( a ) { a . x > d && ( d = a . x ) , a . x < e && ( e = a . x ) , a . y > f && ( f = a . y ) , a . y < g && ( g = a . y ) } ) , c . setTo ( e , g , d - e , f - g ) , c } , PIXI . Rectangle = b . Rectangle , PIXI . EmptyRectangle = new b . Rectangle ( 0 , 0 , 0 , 0 ) , b . Line = function ( a , c , d , e ) { a = a || 0 , c = c || 0 , d = d || 0 , e = e || 0 , this . start = new b . Point ( a , c ) , this . end = new b . Point ( d , e ) } , b . Line . prototype = { setTo : function ( a , b , c , d ) { return this . start . setTo ( a , b ) , this . end . setTo ( c , d ) , this } , fromSprite : function ( a , b , c ) { return "undefined" == typeof c && ( c = ! 1 ) , c ? this . setTo ( a . center . x , a . center . y , b . center . x , b . center . y ) : this . setTo ( a . x , a . y , b . x , b . y ) } , intersects : function ( a , c , d ) { return b . Line . intersectsPoints ( this . start , this . end , a . start , a . end , c , d ) } , pointOnLine : function ( a , b ) { return ( a - this . start . x ) * ( this . end . y - this . start . y ) === ( this . end . x - this . start . x ) * ( b - this . start . y ) } , pointOnSegment : function ( a , b ) { var c = Math . min ( this . start . x , this . end . x ) , d = Math . max ( this . start . x , this . end . x ) , e = Math . min ( this . start . y , this . end . y ) , f = Math . max ( this . start . y , this . end . y ) ; return this . pointOnLine ( a , b ) && a >= c && d >= a && b >= e && f >= b } , coordinatesOnLine : function ( a , b ) { "undefined" == typeof a && ( a = 1 ) , "undefined" == typeof b && ( b = [ ] ) ; var c = Math . round ( this . start . x ) , d = Math . round ( this . start . y ) , e = Math . round ( this . end . x ) , f = Math . round ( this . end . y ) , g = Math . abs ( e - c ) , h = Math . abs ( f - d ) , i = e > c ? 1 : - 1 , j = f > d ? 1 : - 1 , k = g - h ; b . push ( [ c , d ] ) ; for ( var l = 1 ; c != e || d != f ; ) { var m = k << 1 ; m > - h && ( k -= h , c += i ) , g > m && ( k += g , d += j ) , l % a === 0 && b . push ( [ c , d ] ) , l ++ } return b } , clone : function ( a ) { return "undefined" == typeof a || null === a ? a = new b . Line ( this . start . x , this . start . y , this . end . x , this . end . y ) : a . setTo ( this . start . x , this . start . y , this . end . x , this . end . y ) , a } } , Object . defi
} } } , b . LinkedList . prototype . constructor = b . LinkedList , b . ArrayList = function ( ) { this . total = 0 , this . position = 0 , this . list = [ ] } , b . ArrayList . prototype = { add : function ( a ) { return this . exists ( a ) || ( this . list . push ( a ) , this . total ++ ) , a } , getIndex : function ( a ) { return this . list . indexOf ( a ) } , exists : function ( a ) { return this . list . indexOf ( a ) > - 1 } , reset : function ( ) { this . list . length = 0 , this . total = 0 } , remove : function ( a ) { var b = this . list . indexOf ( a ) ; return b > - 1 ? ( this . list . splice ( b , 1 ) , this . total -- , a ) : void 0 } , setAll : function ( a , b ) { for ( var c = this . list . length ; c -- ; ) this . list [ c ] && this . list [ c ] [ a ] && ( this . list [ c ] [ a ] = b ) } , callAll : function ( a ) { for ( var b = Array . prototype . splice . call ( arguments , 1 ) , c = this . list . length ; c -- ; ) this . list [ c ] && this . list [ c ] [ a ] && this . list [ c ] [ a ] . apply ( this . list [ c ] , b ) } } , Object . defineProperty ( b . ArrayList . prototype , "first" , { get : function ( ) { return this . position = 0 , this . total > 0 ? this . list [ 0 ] : null } } ) , Object . defineProperty ( b . ArrayList . prototype , "next" , { get : function ( ) { return this . position < this . total ? ( this . position ++ , this . list [ this . position ] ) : null } } ) , b . ArrayList . prototype . constructor = b . ArrayList , b . Signal = function ( ) { this . _bindings = [ ] , this . _prevParams = null ; var a = this ; this . dispatch = function ( ) { b . Signal . prototype . dispatch . apply ( a , arguments ) } , this . memorize = ! 1 , this . _shouldPropagate = ! 0 , this . active = ! 0 } , b . Signal . prototype = { validateListener : function ( a , b ) { if ( "function" != typeof a ) throw new Error ( "Phaser.Signal: listener is a required param of {fn}() and should be a Function." . replace ( "{fn}" , b ) ) } , _registerListener : function ( a , c , d , e ) { var f , g = this . _indexOfListener ( a , d ) ; if ( - 1 !== g ) { if ( f = this . _bindings [ g ] , f . isOnce ( ) !== c ) throw new Error ( "You cannot add" + ( c ? "" : "Once" ) + "() then add" + ( c ? "Once" : "" ) + "() the same listener without removing the relationship first." ) } else f = new b . SignalBinding ( this , a , c , d , e ) , this . _addBinding ( f ) ; return this . memorize && this . _prevParams && f . execute ( this . _prevParams ) , f } , _addBinding : function ( a ) { var b = this . _bindings . length ; do b -- ; while ( this . _bindings [ b ] && a . _priority <= this . _bindings [ b ] . _priority ) ; this . _bindings . splice ( b + 1 , 0 , a ) } , _indexOfListener : function ( a , b ) { for ( var c , d = this . _bindings . length ; d -- ; ) if ( c = this . _bindings [ d ] , c . _listener === a && c . context === b ) return d ; return - 1 } , has : function ( a , b ) { return - 1 !== this . _indexOfListener ( a , b ) } , add : function ( a , b , c ) { return this . validateListener ( a , "add" ) , this . _registerListener ( a , ! 1 , b , c ) } , addOnce : function ( a , b , c ) { return this . validateListener ( a , "addOnce" ) , this . _registerListener ( a , ! 0 , b , c ) } , remove : function ( a , b ) { this . validateListener ( a , "remove" ) ; var c = this . _indexOfListener ( a , b ) ; return - 1 !== c && ( this . _bindings [ c ] . _destroy ( ) , this . _bindings . splice ( c , 1 ) ) , a } , removeAll : function ( a ) { "undefined" == typeof a && ( a = null ) ; for ( var b = this . _bindings . length ; b -- ; ) a ? this . _bindings [ b ] . context === a && ( this . _bindings [ b ] . _destroy ( ) , this . _bindings . splice ( b , 1 ) ) : this . _bindings [ b ] . _destroy ( ) ; a || ( this . _bindings . length = 0 ) } , getNumListeners : function ( ) { return this . _bindings . length } , halt : function ( ) { this . _shouldPropagate = ! 1 } , dispatch : function ( ) { if ( this . active ) { var a , b = Array . prototype . slice . call ( arguments ) , c = this . _bindings . length ; if ( this . memorize && ( this . _prevParams = b ) , c ) { a = this . _bindings . slice ( ) , this . _shouldPropagate = ! 0 ; do c -- ; while ( a [ c ] && this . _shouldPropagate && a [ c ] . execute ( b ) !== ! 1 ) } } } , forget : function ( ) { this . _prevParams = null } , dispose : function ( ) { this . removeAll ( ) , delete this . _bindings , delete this . _prevParams } , toString : function ( ) { return "[Phaser.Signal active:" + this . active + " numListeners:" + this . getNumListeners ( ) + "]" } } , b . Signal . prototype . constructor = b . Signal , b . SignalBinding = function ( a , b , c , d , e ) { this . _listener = b , this . _isOnce = c , this . context = d , this . _signal = a , this . _priority = e || 0 , this . callCount = 0 , this . active = ! 0 , this . params = null } , b . SignalBinding . prototype = { execute : function ( a ) { var b , c ; return this . active && this . _listener && ( c = this . params ? this . params . concat ( a ) : a , b = this . _listener . apply ( this . context , c ) , this . callCount ++ , this . _isOnce && this . detach ( ) ) , b } , detach : function ( ) { return this . isBound ( ) ? this . _signal . remove ( this . _listener , this . context ) : null } , isBound : function ( ) { return ! ! this . _signal && ! ! this . _listener } , isOnce : function ( ) { return this . _isOnce } , getListener : function ( ) { return this . _listener } , getSignal : function ( ) { return
} , b . ScaleManager = function ( a , c , d ) { this . game = a , this . grid = null , this . width = 0 , this . height = 0 , this . minWidth = null , this . maxWidth = null , this . minHeight = null , this . maxHeight = null , this . offset = new b . Point , this . forceLandscape = ! 1 , this . forcePortrait = ! 1 , this . incorrectOrientation = ! 1 , this . _pageAlignHorizontally = ! 1 , this . _pageAlignVertically = ! 1 , this . maxIterations = 5 , this . enterLandscape = new b . Signal , this . enterPortrait = new b . Signal , this . enterIncorrectOrientation = new b . Signal , this . leaveIncorrectOrientation = new b . Signal , this . fullScreenTarget = null , this . createFullScreenTarget = function ( ) { var a = document . createElement ( "div" ) ; return a . style . margin = "0" , a . style . padding = "0" , a . style . background = "#000" , a } , this . _createdFullScreenTarget = null , this . enterFullScreen = new b . Signal , this . leaveFullScreen = new b . Signal , this . fullScreenFailed = new b . Signal , this . orientation = 0 , window . orientation ? this . orientation = 0 | window . orientation : window . outerWidth > window . outerHeight && ( this . orientation = 90 ) , this . scaleFactor = new b . Point ( 1 , 1 ) , this . scaleFactorInversed = new b . Point ( 1 , 1 ) , this . margin = { left : 0 , top : 0 , right : 0 , bottom : 0 , x : 0 , y : 0 } , this . bounds = new b . Rectangle , this . aspectRatio = 0 , this . sourceAspectRatio = 0 , this . event = null , this . windowConstraints = { bottom : ! 0 , right : ! 0 } , this . compatibility = { supportsFullScreen : ! 1 , noMargins : ! 1 , scrollTo : null , forceMinimumDocumentHeight : ! 0 , showAllCanExpand : ! 0 } , this . _scaleMode = b . ScaleManager . NO _SCALE , this . _fullScreenScaleMode = b . ScaleManager . NO _SCALE , this . parentIsWindow = ! 1 , this . parentNode = null , this . parentScaleFactor = new b . Point ( 1 , 1 ) , this . trackParentInterval = 2e3 , this . onSizeChange = new b . Signal , this . onResize = null , this . onResizeContext = null , this . _fullScreenRestore = null , this . _gameSize = new b . Rectangle , this . _userScaleFactor = new b . Point ( 1 , 1 ) , this . _lastSizeCheck = 0 , this . _sizeThrottle = 0 , this . _sizeThrottleReset = 100 , this . _parentBounds = new b . Rectangle , this . _lastReportedCanvasSize = new b . Rectangle , this . _lastReportedGameSize = new b . Rectangle , a . config && this . parseConfig ( a . config ) , this . setupScale ( c , d ) } , b . ScaleManager . EXACT _FIT = 0 , b . ScaleManager . NO _SCALE = 1 , b . ScaleManager . SHOW _ALL = 2 , b . ScaleManager . RESIZE = 3 , b . ScaleManager . USER _SCALE = 4 , b . ScaleManager . prototype = { boot : function ( ) { var a = this . compatibility ; a . supportsFullScreen = this . game . device . fullscreen && ! this . game . device . cocoonJS , this . game . device . iPad || this . game . device . webApp || this . game . device . desktop || ( a . scrollTo = this . game . device . android && ! this . game . device . chrome ? new b . Point ( 0 , 1 ) : new b . Point ( 0 , 0 ) ) ; var c = this ; this . _orientationChange = function ( a ) { return c . orientationChange ( a ) } , this . _windowResize = function ( a ) { return c . windowResize ( a ) } , window . addEventListener ( "orientationchange" , this . _orientationChange , ! 1 ) , window . addEventListener ( "resize" , this . _windowResize , ! 1 ) , this . compatibility . supportsFullScreen && ( this . _fullScreenChange = function ( a ) { return c . fullScreenChange ( a ) } , this . _fullScreenError = function ( a ) { return c . fullScreenError ( a ) } , document . addEventListener ( "webkitfullscreenchange" , this . _fullScreenChange , ! 1 ) , document . addEventListener ( "mozfullscreenchange" , this . _fullScreenChange , ! 1 ) , document . addEventListener ( "MSFullscreenChange" , this . _fullScreenChange , ! 1 ) , document . addEventListener ( "fullscreenchange" , this . _fullScreenChange , ! 1 ) , document . addEventListener ( "webkitfullscreenerror" , this . _fullScreenError , ! 1 ) , document . addEventListener ( "mozfullscreenerror" , this . _fullScreenError , ! 1 ) , document . addEventListener ( "MSFullscreenError" , this . _fullScreenError , ! 1 ) , document . addEventListener ( "fullscreenerror" , this . _fullScreenError , ! 1 ) ) , b . Canvas . getOffset ( this . game . canvas , this . offset ) , this . bounds . setTo ( this . offset . x , this . offset . y , this . width , this . height ) , this . setGameSize ( this . game . width , this . game . height ) } , parseConfig : function ( a ) { a . scaleMode && ( this . scaleMode = a . scaleMode ) , a . fullScreenScaleMode && ( this . fullScreenScaleMode = a . fullScreenScaleMode ) , a . fullScreenTarget && ( this . fullScreenTarget = a . fullScreenTarget ) } , setupScale : function ( a , c ) { var d , e = new b . Rectangle ; "" !== this . game . parent && ( "string" == typeof this . game . parent ? d = document . getElementById ( this . game . parent ) : this . game . parent && 1 === this . game . parent . nodeType && ( d = this . game . parent ) ) , d ? ( this . parentNode = d , this . parentIsWindow = ! 1 , this . getParentBounds ( this . _p
this . speed . x = this . position . x - this . _oldPosition . x , this . speed . y = this . position . y - this . _oldPosition . y , this . _oldPosition . copyFrom ( this . position ) , this . mousePointer . update ( ) , this . gamepad . active && this . gamepad . update ( ) ; for ( var a = 0 ; a < this . pointers . length ; a ++ ) this . pointers [ a ] . update ( ) ; this . _pollCounter = 0 } , reset : function ( a ) { if ( this . game . isBooted && ! this . resetLocked ) { "undefined" == typeof a && ( a = ! 1 ) , this . keyboard . reset ( a ) , this . mousePointer . reset ( ) , this . gamepad . reset ( ) ; for ( var c = 0 ; c < this . pointers . length ; c ++ ) this . pointers [ c ] . reset ( ) ; this . currentPointers = 0 , "none" !== this . game . canvas . style . cursor && ( this . game . canvas . style . cursor = "inherit" ) , a && ( this . onDown . dispose ( ) , this . onUp . dispose ( ) , this . onTap . dispose ( ) , this . onHold . dispose ( ) , this . onDown = new b . Signal , this . onUp = new b . Signal , this . onTap = new b . Signal , this . onHold = new b . Signal , this . moveCallbacks = [ ] ) , this . _pollCounter = 0 } } , resetSpeed : function ( a , b ) { this . _oldPosition . setTo ( a , b ) , this . speed . setTo ( 0 , 0 ) } , startPointer : function ( a ) { if ( this . maxPointers >= 0 && this . countActivePointers ( this . maxPointers ) >= this . maxPointers ) return null ; if ( ! this . pointer1 . active ) return this . pointer1 . start ( a ) ; if ( ! this . pointer2 . active ) return this . pointer2 . start ( a ) ; for ( var b = 2 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( ! c . active ) return c . start ( a ) } return null } , updatePointer : function ( a ) { if ( this . pointer1 . active && this . pointer1 . identifier === a . identifier ) return this . pointer1 . move ( a ) ; if ( this . pointer2 . active && this . pointer2 . identifier === a . identifier ) return this . pointer2 . move ( a ) ; for ( var b = 2 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( c . active && c . identifier === a . identifier ) return c . move ( a ) } return null } , stopPointer : function ( a ) { if ( this . pointer1 . active && this . pointer1 . identifier === a . identifier ) return this . pointer1 . stop ( a ) ; if ( this . pointer2 . active && this . pointer2 . identifier === a . identifier ) return this . pointer2 . stop ( a ) ; for ( var b = 2 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( c . active && c . identifier === a . identifier ) return c . stop ( a ) } return null } , countActivePointers : function ( a ) { "undefined" == typeof a && ( a = this . pointers . length ) ; for ( var b = a , c = 0 ; c < this . pointers . length && b > 0 ; c ++ ) { var d = this . pointers [ c ] ; d . active && b -- } return this . currentPointers = a - b , a - b } , getPointer : function ( a ) { "undefined" == typeof a && ( a = ! 1 ) ; for ( var b = 0 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( c . active === a ) return c } return null } , getPointerFromIdentifier : function ( a ) { for ( var b = 0 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( c . identifier === a ) return c } return null } , getPointerFromId : function ( a ) { for ( var b = 0 ; b < this . pointers . length ; b ++ ) { var c = this . pointers [ b ] ; if ( c . pointerId === a ) return c } return null } , getLocalPosition : function ( a , c , d ) { "undefined" == typeof d && ( d = new b . Point ) ; var e = a . worldTransform , f = 1 / ( e . a * e . d + e . c * - e . b ) ; return d . setTo ( e . d * f * c . x + - e . c * f * c . y + ( e . ty * e . c - e . tx * e . d ) * f , e . a * f * c . y + - e . b * f * c . x + ( - e . ty * e . a + e . tx * e . b ) * f ) } , hitTest : function ( a , c , d ) { if ( ! a . worldVisible ) return ! 1 ; if ( this . getLocalPosition ( a , c , this . _localPoint ) , d . copyFrom ( this . _localPoint ) , a . hitArea && a . hitArea . contains ) return a . hitArea . contains ( this . _localPoint . x , this . _localPoint . y ) ; if ( a instanceof PIXI . Sprite ) { var e = a . texture . frame . width , f = a . texture . frame . height , g = - e * a . anchor . x ; if ( this . _localPoint . x >= g && this . _localPoint . x < g + e ) { var h = - f * a . anchor . y ; if ( this . _localPoint . y >= h && this . _localPoint . y < h + f ) return ! 0 } } else if ( a instanceof b . TileSprite ) { var e = a . width , f = a . height , g = - e * a . anchor . x ; if ( this . _localPoint . x >= g && this . _localPoint . x < g + e ) { var h = - f * a . anchor . y ; if ( this . _localPoint . y >= h && this . _localPoint . y < h + f ) return ! 0 } } else if ( a instanceof b . Graphics ) for ( var i = 0 ; i < a . graphicsData . length ; i ++ ) { var j = a . graphicsData [ i ] ; if ( j . fill && j . shape && j . shape . contains ( this . _localPoint . x , this . _localPoint . y ) ) return ! 0 } for ( var i = 0 , k = a . children . length ; k > i ; i ++ ) if ( this . hitTest ( a . children [ i ] , c , d ) ) return ! 0 ; return ! 1 } , onClickTrampoline : function ( ) { this . activePointer . processClickTrampolines ( ) } } , b . Input . prototype . constructor = b . Input , Object . defineProperty ( b . Input . prototype , "x" , { get : function ( ) { return this . _x } , set : function ( a ) { this . _x = Math . floor ( a ) } } ) , Object . defineProperty ( b . Input . prototype , "y" , { get : function ( ) { return this . _y } , set : function ( a ) { this . _y = Math . floor ( a )
} , b . Gamepad . prototype = { addCallbacks : function ( a , b ) { "undefined" != typeof b && ( this . onConnectCallback = "function" == typeof b . onConnect ? b . onConnect : this . onConnectCallback , this . onDisconnectCallback = "function" == typeof b . onDisconnect ? b . onDisconnect : this . onDisconnectCallback , this . onDownCallback = "function" == typeof b . onDown ? b . onDown : this . onDownCallback , this . onUpCallback = "function" == typeof b . onUp ? b . onUp : this . onUpCallback , this . onAxisCallback = "function" == typeof b . onAxis ? b . onAxis : this . onAxisCallback , this . onFloatCallback = "function" == typeof b . onFloat ? b . onFloat : this . onFloatCallback , this . callbackContext = a ) } , start : function ( ) { if ( ! this . _active ) { this . _active = ! 0 ; var a = this ; this . _onGamepadConnected = function ( b ) { return a . onGamepadConnected ( b ) } , this . _onGamepadDisconnected = function ( b ) { return a . onGamepadDisconnected ( b ) } , window . addEventListener ( "gamepadconnected" , this . _onGamepadConnected , ! 1 ) , window . addEventListener ( "gamepaddisconnected" , this . _onGamepadDisconnected , ! 1 ) } } , onGamepadConnected : function ( a ) { var b = a . gamepad ; this . _rawPads . push ( b ) , this . _gamepads [ b . index ] . connect ( b ) } , onGamepadDisconnected : function ( a ) { var b = a . gamepad ; for ( var c in this . _rawPads ) this . _rawPads [ c ] . index === b . index && this . _rawPads . splice ( c , 1 ) ; this . _gamepads [ b . index ] . disconnect ( ) } , update : function ( ) { this . _pollGamepads ( ) , this . pad1 . pollStatus ( ) , this . pad2 . pollStatus ( ) , this . pad3 . pollStatus ( ) , this . pad4 . pollStatus ( ) } , _pollGamepads : function ( ) { if ( navigator . getGamepads ) var a = navigator . getGamepads ( ) ; else if ( navigator . webkitGetGamepads ) var a = navigator . webkitGetGamepads ( ) ; else if ( navigator . webkitGamepads ) var a = 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 } , destroy : function ( ) { this . stop ( ) ; for ( var a = 0 ; a < this . _gamepads . length ; a ++ ) this . _gamepads [ a ] . destroy ( ) } } , b . Gamepad . prototype . constructor = b . Gamepad , Object . defineProperty ( b . Gamepad . prototype , "disabled" , { get : function ( ) { return ! this . enabled } , set : function ( a ) { this . enabled = ! a } } ) , 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
2014-11-08 19:11:28 +00:00
} , b . BitmapData . prototype = { add : function ( a ) { if ( Array . isArray ( a ) ) for ( var b = 0 ; b < a . length ; b ++ ) a [ b ] . loadTexture && a [ b ] . loadTexture ( this ) ; else a . loadTexture ( this ) ; return this } , load : function ( a ) { return "string" == typeof a && ( a = this . game . cache . getImage ( a ) ) , a ? ( this . resize ( a . width , a . height ) , this . cls ( ) , this . draw ( a ) , this . update ( ) , this ) : void 0 } , clear : function ( ) { return this . context . clearRect ( 0 , 0 , this . width , this . height ) , this . dirty = ! 0 , this } , fill : function ( a , b , c , d ) { return "undefined" == typeof d && ( d = 1 ) , this . context . fillStyle = "rgba(" + a + "," + b + "," + c + "," + d + ")" , this . context . fillRect ( 0 , 0 , this . width , this . height ) , this . dirty = ! 0 , this } , resize : function ( a , b ) { return ( a !== this . width || b !== this . height ) && ( this . width = a , this . height = b , this . canvas . width = a , this . canvas . height = b , this . baseTexture . width = a , this . baseTexture . height = b , this . textureFrame . width = a , this . textureFrame . height = b , this . texture . width = a , this . texture . height = b , this . texture . crop . width = a , this . texture . crop . height = b , this . update ( ) , this . dirty = ! 0 ) , this } , update : function ( a , b , c , d ) { return "undefined" == typeof a && ( a = 0 ) , "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = this . width ) , "undefined" == typeof d && ( d = this . height ) , this . imageData = this . context . getImageData ( a , b , c , d ) , this . data = this . imageData . data , this . imageData . data . buffer ? ( this . buffer = this . imageData . data . buffer , this . pixels = new Uint32Array ( this . buffer ) ) : window . ArrayBuffer ? ( this . buffer = new ArrayBuffer ( this . imageData . data . length ) , this . pixels = new Uint32Array ( this . buffer ) ) : this . pixels = this . imageData . data , this } , processPixelRGB : function ( a , c , d , e , f , g ) { "undefined" == typeof d && ( d = 0 ) , "undefined" == typeof e && ( e = 0 ) , "undefined" == typeof f && ( f = this . width ) , "undefined" == typeof g && ( g = this . height ) ; for ( var h = d + f , i = e + g , j = b . Color . createColor ( ) , k = { r : 0 , g : 0 , b : 0 , a : 0 } , l = ! 1 , m = e ; i > m ; m ++ ) for ( var n = d ; h > n ; n ++ ) b . Color . unpackPixel ( this . getPixel32 ( n , m ) , j ) , k = a . call ( c , j , n , m ) , k !== ! 1 && null !== k && void 0 !== k && ( this . setPixel32 ( n , m , k . r , k . g , k . b , k . a , ! 1 ) , l = ! 0 ) ; return l && ( this . context . putImageData ( this . imageData , 0 , 0 ) , this . dirty = ! 0 ) , this } , processPixel : function ( a , b , c , d , e , f ) { "undefined" == typeof c && ( c = 0 ) , "undefined" == typeof d && ( d = 0 ) , "undefined" == typeof e && ( e = this . width ) , "undefined" == typeof f && ( f = this . height ) ; for ( var g = c + e , h = d + f , i = 0 , j = 0 , k = ! 1 , l = d ; h > l ; l ++ ) for ( var m = c ; g > m ; m ++ ) i = this . getPixel32 ( m , l ) , j = a . call ( b , i , m , l ) , j !== i && ( this . pixels [ l * this . width + m ] = j , k = ! 0 ) ; return k && ( this . context . putImageData ( this . imageData , 0 , 0 ) , this . dirty = ! 0 ) , this } , replaceRGB : function ( a , c , d , e , f , g , h , i , j ) { var k = 0 , l = 0 , m = this . width , n = this . height , o = b . Color . packPixel ( a , c , d , e ) ; void 0 !== j && j instanceof b . Rectangle && ( k = j . x , l = j . y , m = j . width , n = j . height ) ; for ( var p = 0 ; n > p ; p ++ ) for ( var q = 0 ; m > q ; q ++ ) this . getPixel32 ( k + q , l + p ) === o && this . setPixel32 ( k + q , l + p , f , g , h , i , ! 1 ) ; return this . context . putImageData ( this . imageData , 0 , 0 ) , this . dirty = ! 0 , this } , setHSL : function ( a , c , d , e ) { if ( ( "undefined" == typeof a || null === a ) && ( a = ! 1 ) , ( "undefined" == typeof c || null === c ) && ( c = ! 1 ) , ( "undefined" == typeof d || null === d ) && ( d = ! 1 ) , a || c || d ) { "undefined" == typeof e && ( e = new b . Rectangle ( 0 , 0 , this . width , this . height ) ) ; for ( var f = b . Color . createColor ( ) , g = e . y ; g < e . bottom ; g ++ ) for ( var h = e . x ; h < e . right ; h ++ ) b . Color . unpackPixel ( this . getPixel32 ( h , g ) , f , ! 0 ) , a && ( f . h = a ) , c && ( f . s = c ) , d && ( f . l = d ) , b . Color . HSLtoRGB ( f . h , f . s , f . l , f ) , this . setPixel32 ( h , g , f . r , f . g , f . b , f . a , ! 1 ) ; return this . context . putImageData ( this . imageData , 0 , 0 ) , this . dirty = ! 0 , this } } , shiftHSL : function ( a , c , d , e ) { if ( ( "undefined" == typeof a || null === a ) && ( a = ! 1 ) , ( "undefined" == typeof c || null === c ) && ( c = ! 1 ) , ( "undefined" == typeof d || null === d ) && ( d = ! 1 ) , a || c || d ) { "undefined" == typeof e && ( e = new b . Rectangle ( 0 , 0 , this . width , this . height ) ) ; for ( var f = b . Color . createColor ( ) , g = e . y ; g < e . bottom ; g ++ ) for ( var h = e . x ; h < e . right ; h ++ ) b . Color . unpackPixel ( this . getPixel32 ( h , g ) , f , ! 0 ) , a && ( f . h = this . game . math . wrap ( f . h + a , 0 , 1 ) ) , c && ( f . s = this . game . math . limitValue ( f . s + c , 0 , 1 ) ) , d && ( f . l = this . game . math . limitValue ( f . l + d , 0 , 1 ) ) , b . Color . HSLtoRGB ( f . h , f . s , f . l , f ) , this . setPixel32 ( h , g , f . r , f . g , f . b , f . a , ! 1 ) ; return this . context . putImageData ( this . imageData , 0 , 0 ) , this . dirty = ! 0 , this } } , setPixel32 : function ( a , c , d , e , f , g , h ) { return "undefined" == typeof h && ( h = ! 0 ) , a >= 0 && a <= this . width && c >= 0 && c <= this . height && ( this . pixels [ c * this . width + a ] = b . Device . LITTLE _ENDIAN ? g << 24 | f << 16 | e <<
} , b . TileSprite . prototype = Object . create ( PIXI . TilingSprite . prototype ) , b . TileSprite . prototype . constructor = b . TileSprite , b . TileSprite . prototype . preUpdate = function ( ) { if ( 1 === this . _cache [ 4 ] && this . exists ) return this . world . setTo ( this . parent . position . x + this . position . x , this . parent . position . y + this . position . y ) , this . worldTransform . tx = this . world . x , this . worldTransform . ty = this . world . y , this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , this . body && this . body . preUpdate ( ) , this . _cache [ 4 ] = 0 , ! 1 ; if ( this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , ! this . exists || ! this . parent . exists ) return this . _cache [ 3 ] = - 1 , ! 1 ; ( this . autoCull || this . checkWorldBounds ) && this . _bounds . copyFrom ( this . getBounds ( ) ) , this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . _bounds ) ) , this . checkWorldBounds && ( 1 === this . _cache [ 5 ] && this . game . world . bounds . intersects ( this . _bounds ) ? ( this . _cache [ 5 ] = 0 , this . events . onEnterBounds . dispatch ( this ) ) : 0 !== this . _cache [ 5 ] || this . game . world . bounds . intersects ( this . _bounds ) || ( this . _cache [ 5 ] = 1 , this . events . onOutOfBounds . dispatch ( this ) ) ) , 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 ( ) , 0 !== this . _scroll . x && ( this . tilePosition . x += this . _scroll . x * this . game . time . physicsElapsed ) , 0 !== this . _scroll . y && ( this . tilePosition . y += this . _scroll . y * this . game . time . physicsElapsed ) , this . body && this . body . preUpdate ( ) ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , b . TileSprite . prototype . update = function ( ) { } , b . TileSprite . prototype . postUpdate = function ( ) { this . exists && this . body && this . body . postUpdate ( ) , 1 === this . _cache [ 7 ] && ( this . position . x = this . game . camera . view . x + this . cameraOffset . x , this . position . y = this . game . camera . view . y + this . cameraOffset . y ) ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . postUpdate ( ) } , b . TileSprite . prototype . autoScroll = function ( a , b ) { this . _scroll . set ( a , b ) } , b . TileSprite . prototype . stopScroll = function ( ) { this . _scroll . set ( 0 , 0 ) } , b . TileSprite . prototype . loadTexture = function ( a , c ) { c = c || 0 , this . key = a , a instanceof b . RenderTexture ? ( this . key = a . key , this . setTexture ( a ) ) : a instanceof b . BitmapData ? this . setTexture ( a . texture ) : a instanceof PIXI . Texture ? this . setTexture ( a ) : null === a || "undefined" == typeof a ? ( this . key = "__default" , this . setTexture ( PIXI . TextureCache [ this . key ] ) ) : "string" != typeof a || this . game . cache . checkImageKey ( a ) ? ( this . setTexture ( new PIXI . Texture ( PIXI . BaseTextureCache [ a ] ) ) , this . animations . loadFrameData ( this . game . cache . getFrameData ( a ) , c ) ) : ( console . warn ( "Texture with key '" + a + "' not found." ) , this . key = "__missing" , this . setTexture ( PIXI . TextureCache [ this . key ] ) ) , this . texture . baseTexture . dirty ( ) } , b . TileSprite . prototype . setFrame = function ( a ) { this . texture . frame . x = a . x , this . texture . frame . y = a . y , this . texture . frame . width = a . width , this . texture . frame . height = a . height , this . texture . crop . x = a . x , this . texture . crop . y = a . y , this . texture . crop . width = a . width , this . texture . crop . height = a . height , a . trimmed ? ( this . texture . trim ? ( this . texture . trim . x = a . spriteSourceSizeX , this . texture . trim . y = a . spriteSourceSizeY , this . texture . trim . width = a . sourceSizeW , this . texture . trim . height = a . sourceSizeH ) : this . texture . trim = { x : a . spriteSourceSizeX , y : a . spriteSourceSizeY , width : a . sourceSizeW , height : a . sourceSizeH } , this . texture . width = a . sourceSizeW , this . texture . height = a . sourceSizeH , this . texture . frame . width = a . sourceSizeW , this . texture . frame . height = a . sourceSizeH ) : ! a . trimmed && this . texture . trim && ( this . texture . trim = null ) , this . texture . _updateUvs ( ) } , b . TileSprite . prototype . destroy = function ( a ) { if ( null !== this . game && ! this . destroyPhase ) { "undefined" == typeof a && ( a = ! 0 ) , this . _cache [ 8 ] = 1 , this . events && this . events . onDestroy . dispatch ( this ) , this . filters && ( this . filters = null ) , this . parent && ( this . parent instanceof b . Group ? this . parent . remove ( this ) : this . parent . removeChild ( this ) ) , this . animations . destroy ( ) , 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 . exists = ! 1 , this . visible = ! 1 , this . alive = ! 1 , this . filters =
else for ( e = 0 ; e < c . length ; e ++ ) f . x = a [ 2 * c [ e ] ] , f . y = a [ 2 * c [ e ] + 1 ] , i . push ( f . copyTo ( { } ) ) , 3 === i . length && ( this . drawTriangle ( i , d ) , i = [ ] ) ; else if ( a [ 0 ] instanceof b . Point ) for ( e = 0 ; e < a . length / 3 ; e ++ ) this . drawTriangle ( [ a [ 3 * e ] , a [ 3 * e + 1 ] , a [ 3 * e + 2 ] ] , d ) ; else for ( e = 0 ; e < a . length / 6 ; e ++ ) f . x = a [ 6 * e + 0 ] , f . y = a [ 6 * e + 1 ] , g . x = a [ 6 * e + 2 ] , g . y = a [ 6 * e + 3 ] , h . x = a [ 6 * e + 4 ] , h . y = a [ 6 * e + 5 ] , this . drawTriangle ( [ f , g , h ] , d ) } , 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 } } ) , Object . defineProperty ( b . Graphics . prototype , "destroyPhase" , { get : function ( ) { return ! ! this . _cache [ 8 ] } } ) , b . RenderTexture = function ( a , c , d , e , f , g ) { "undefined" == typeof e && ( e = "" ) , "undefined" == typeof f && ( f = b . scaleModes . DEFAULT ) , "undefined" == typeof g && ( g = 1 ) , this . game = a , this . key = e , this . type = b . RENDERTEXTURE , this . matrix = new PIXI . Matrix , PIXI . RenderTexture . call ( this , c , d , this . game . renderer , f , g ) , this . render = b . RenderTexture . prototype . render } , b . RenderTexture . prototype = Object . create ( PIXI . RenderTexture . prototype ) , b . RenderTexture . prototype . constructor = b . RenderTexture , b . RenderTexture . prototype . renderXY = function ( a , b , c , d ) { this . matrix . tx = b , this . matrix . ty = c , this . renderer . type === PIXI . WEBGL _RENDERER ? this . renderWebGL ( a , this . matrix , d ) : this . renderCanvas ( a , this . matrix , d ) } , b . RenderTexture . prototype . render = function ( a , b , c ) { this . matrix . tx = b . x , this . matrix . ty = b . y , this . renderer . type === PIXI . WEBGL _RENDERER ? this . renderWebGL ( a , this . matrix , c ) : this . renderCanvas ( a , this . matrix , c ) } , b . SpriteBatch = function ( a , c , d , e ) { ( "undefined" == typeof c || null === c ) && ( c = a . world ) , 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 ) { if ( ! a . cache . checkImageKey ( c ) ) return ! 1 ; ( "undefined" == typeof g || null === g ) && ( g = a . cache . getImage ( c ) . width / d ) , 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 = [ ] , this . frameData = new b . FrameData ; for ( var l = this . offsetX , m = this . offsetY , n = 0 , o = 0 ; o < f . length ; o ++ ) { var p = a . rnd . uuid ( ) , q = this . frameData . addFrame ( new b . Frame ( o , l , m , this . characterWidth , this . characterHeight , "" , p ) ) ; this . grabData [ f . charCodeAt ( o ) ] = q . index , PIXI . TextureCache [ p ] = new PIXI . Texture ( PIXI . BaseTextureCache [ c ] , { x : l , y : m , width : this . characterWidth , height : this . characterHeight } ) , n ++ , n == this . characterPerRow ? ( n = 0 , l = this . offsetX , m += this . characterHeight + this . characterSpacingY ) : l += this . characterWidth + this . characterSpacingX } a . cache . updateFrameData ( c , this . frameData ) , this . stamp = new b . Image ( a , 0 , 0 , c , 0 ) , b . RenderTexture . call ( this , a , 100 , 100 , "" , b . scaleModes . NEAREST ) , this . type = b . RETROFONT } , b . RetroFont . prototype = Object . create ( b . RenderTexture . prototype ) , b . RetroFont . prototype . constructor = b . RetroFont , b . RetroFont . ALIGN _LEFT = "left" , b . RetroFont . ALIGN _RIGHT = "right" , b . RetroFont . ALIGN _CENTER = "center" , b . RetroFont . TEXT _SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" , b . RetroFont . TEXT _SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ" , b . RetroFont . TEXT _SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 " , b . RetroFont . TEXT _SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789" , b . RetroFont . TEXT _SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789" , b . RetroFont . TEXT _SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' " , b . RetroFont . TEXT _SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39" , b . RetroFont . TEXT _SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ" , b . RetroFont . TEXT _SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!" , b . RetroFont . TEXT _SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" , b . Ret
2014-11-10 01:41:41 +00:00
} } , b . Net . prototype . constructor = b . Net , b . TweenManager = function ( a ) { this . game = a , this . _tweens = [ ] , this . _add = [ ] , this . game . onPause . add ( this . _pauseAll , this ) , this . game . onResume . add ( this . _resumeAll , this ) } , b . TweenManager . prototype = { getAll : function ( ) { return this . _tweens } , removeAll : function ( ) { for ( var a = 0 ; a < this . _tweens . length ; a ++ ) this . _tweens [ a ] . pendingDelete = ! 0 ; this . _add = [ ] } , add : function ( a ) { a . _manager = this , this . _add . push ( a ) } , create : function ( a ) { return new b . Tween ( a , this . game , this ) } , remove : function ( a ) { var b = this . _tweens . indexOf ( a ) ; - 1 !== b ? this . _tweens [ b ] . pendingDelete = ! 0 : ( b = this . _add . indexOf ( a ) , - 1 !== b && ( this . _add [ b ] . pendingDelete = ! 0 ) ) } , update : function ( ) { var a = this . _add . length , b = this . _tweens . length ; if ( 0 === b && 0 === a ) return ! 1 ; for ( var c = 0 ; b > c ; ) this . _tweens [ c ] . update ( this . game . time . now ) ? c ++ : ( this . _tweens . splice ( c , 1 ) , b -- ) ; return a > 0 && ( this . _tweens = this . _tweens . concat ( this . _add ) , this . _add . length = 0 ) , ! 0 } , isTweening : function ( a ) { return this . _tweens . some ( function ( b ) { return b . _object === a } ) } , _pauseAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . _pause ( ) } , _resumeAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . _resume ( ) } , pauseAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . pause ( ) } , resumeAll : function ( ) { for ( var a = this . _tweens . length - 1 ; a >= 0 ; a -- ) this . _tweens [ a ] . resume ( ! 0 ) } } , b . TweenManager . prototype . constructor = b . TweenManager , b . Tween = function ( a , c , d ) { this . _object = a , this . game = c , this . _manager = d , this . _valuesStart = { } , this . _valuesEnd = { } , this . _valuesStartRepeat = { } , this . _duration = 1e3 , this . _repeat = 0 , this . _yoyo = ! 1 , this . _reversed = ! 1 , this . _delayTime = 0 , this . _startTime = null , this . _easingFunction = b . Easing . Default , this . _interpolationFunction = b . Math . linearInterpolation , this . _chainedTweens = [ ] , this . _onStartCallbackFired = ! 1 , this . _onUpdateCallback = null , this . _onUpdateCallbackContext = null , this . _paused = ! 1 , this . _pausedTime = 0 , this . _codePaused = ! 1 , this . pendingDelete = ! 1 , this . onStart = new b . Signal , this . onLoop = new b . Signal , this . onComplete = new b . Signal , this . isRunning = ! 1 } , 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 , g && 0 === f && ( f = 1 ) ; var h ; return this . _parent && this . _parent !== this ? ( 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 ) , h . _delayTime = e > 0 ? e : 0 , h . _yoyo = g , d ? this . start ( ) : this } , from : function ( a , b , c , d , e , f , g ) { var h = { } ; for ( var i in a ) h [ i ] = this . _object [ i ] , this . _object [ i ] = a [ i ] ; return this . to ( h , b , c , d , e , f , g ) } , 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 * this . game . time . slowMotion ; 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 = Math . floor ( 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 } var j = { } ; for ( c in this . _valuesEnd ) j [ c ] = this . _valuesEnd [ c ] ; if ( g . push ( j ) , this . _yoyo ) { var m = g . slice ( ) ; m . reverse ( ) , g = g . concat ( m ) } return "undefined" != typeof b ? b = b . concat ( g ) : g } , stop : function ( ) {
} return f } , XMLData : function ( a , c , d ) { if ( ! c . getElementsByTagName ( "TextureAtlas" ) ) return void console . warn ( "Phaser.AnimationParser.XMLData: Invalid Texture Atlas XML given, missing <TextureAtlas> tag" ) ; for ( var e , f , g , h , i , j , k , l , m , n , o , p , q = new b . FrameData , r = c . getElementsByTagName ( "SubTexture" ) , s = 0 ; s < r . length ; s ++ ) f = a . rnd . uuid ( ) , h = r [ s ] . attributes , g = h . name . value , i = parseInt ( h . x . value , 10 ) , j = parseInt ( h . y . value , 10 ) , k = parseInt ( h . width . value , 10 ) , l = parseInt ( h . height . value , 10 ) , m = null , n = null , h . frameX && ( m = Math . abs ( parseInt ( h . frameX . value , 10 ) ) , n = Math . abs ( parseInt ( h . frameY . value , 10 ) ) , o = parseInt ( h . frameWidth . value , 10 ) , p = parseInt ( h . frameHeight . value , 10 ) ) , e = q . addFrame ( new b . Frame ( s , i , j , k , l , g , f ) ) , PIXI . TextureCache [ f ] = new PIXI . Texture ( PIXI . BaseTextureCache [ d ] , { x : i , y : j , width : k , height : l } ) , ( null !== m || null !== n ) && e . setTrim ( ! 0 , k , l , m , n , o , p ) ; return q } } , b . Cache = function ( a ) { this . game = a , this . autoResolveURL = ! 1 , this . _canvases = { } , this . _images = { } , this . _textures = { } , this . _sounds = { } , this . _text = { } , this . _json = { } , this . _xml = { } , this . _physics = { } , this . _tilemaps = { } , this . _binary = { } , this . _bitmapDatas = { } , this . _bitmapFont = { } , this . _urlMap = { } , this . _urlResolver = new Image , this . _urlTemp = null , this . addDefaultImage ( ) , this . addMissingImage ( ) , this . onSoundUnlock = new b . Signal , this . _cacheMap = [ ] , this . _cacheMap [ b . Cache . CANVAS ] = this . _canvases , this . _cacheMap [ b . Cache . IMAGE ] = this . _images , this . _cacheMap [ b . Cache . TEXTURE ] = this . _textures , this . _cacheMap [ b . Cache . SOUND ] = this . _sounds , this . _cacheMap [ b . Cache . TEXT ] = this . _text , this . _cacheMap [ b . Cache . PHYSICS ] = this . _physics , this . _cacheMap [ b . Cache . TILEMAP ] = this . _tilemaps , this . _cacheMap [ b . Cache . BINARY ] = this . _binary , this . _cacheMap [ b . Cache . BITMAPDATA ] = this . _bitmapDatas , this . _cacheMap [ b . Cache . BITMAPFONT ] = this . _bitmapFont , this . _cacheMap [ b . Cache . JSON ] = this . _json , this . _cacheMap [ b . Cache . XML ] = this . _xml } , b . Cache . CANVAS = 1 , b . Cache . IMAGE = 2 , b . Cache . TEXTURE = 3 , b . Cache . SOUND = 4 , b . Cache . TEXT = 5 , b . Cache . PHYSICS = 6 , b . Cache . TILEMAP = 7 , b . Cache . BINARY = 8 , b . Cache . BITMAPDATA = 9 , b . Cache . BITMAPFONT = 10 , b . Cache . JSON = 11 , b . Cache . XML = 12 , b . Cache . prototype = { addCanvas : function ( a , b , c ) { this . _canvases [ a ] = { canvas : b , context : c } } , addBinary : function ( a , b ) { this . _binary [ a ] = b } , addBitmapData : function ( a , c , d ) { return c . key = a , "undefined" == typeof d && ( d = new b . FrameData , d . addFrame ( c . textureFrame ) ) , this . _bitmapDatas [ a ] = { data : c , frameData : d } , c } , addRenderTexture : function ( a , c ) { var d = new b . Frame ( 0 , 0 , 0 , c . width , c . height , "" , "" ) ; this . _textures [ a ] = { texture : c , frame : d } } , addSpriteSheet : function ( a , c , d , e , f , g , h , i ) { this . _images [ a ] = { url : c , data : d , frameWidth : e , frameHeight : f , margin : h , spacing : i } , PIXI . BaseTextureCache [ a ] = new PIXI . BaseTexture ( d ) , PIXI . TextureCache [ a ] = new PIXI . Texture ( PIXI . BaseTextureCache [ a ] ) , this . _images [ a ] . frameData = b . AnimationParser . spriteSheet ( this . game , a , e , f , g , h , i ) , this . _resolveURL ( c , this . _images [ a ] ) } , addTilemap : function ( a , b , c , d ) { this . _tilemaps [ a ] = { url : b , data : c , format : d } , this . _resolveURL ( b , this . _tilemaps [ a ] ) } , addTextureAtlas : function ( a , c , d , e , f ) { this . _images [ a ] = { url : c , data : d } , PIXI . BaseTextureCache [ a ] = new PIXI . BaseTexture ( d ) , PIXI . TextureCache [ a ] = new PIXI . Texture ( PIXI . BaseTextureCache [ a ] ) , f == b . Loader . TEXTURE _ATLAS _JSON _ARRAY ? this . _images [ a ] . frameData = b . AnimationParser . JSONData ( this . game , e , a ) : f == b . Loader . TEXTURE _ATLAS _JSON _HASH ? this . _images [ a ] . frameData = b . AnimationParser . JSONDataHash ( this . game , e , a ) : f == b . Loader . TEXTURE _ATLAS _XML _STARLING && ( this . _images [ a ] . frameData = b . AnimationParser . XMLData ( this . game , e , a ) ) , this . _resolveURL ( c , this . _images [ a ] ) } , addBitmapFont : function ( a , c , d , e , f , g ) { this . _images [ a ] = { url : c , data : d } , PIXI . BaseTextureCache [ a ] = new PIXI . BaseTexture ( d ) , PIXI . TextureCache [ a ] = new PIXI . Texture ( PIXI . BaseTextureCache [ a ] ) , b . LoaderParser . bitmapFont ( this . game , e , a , f , g ) , this . _bitmapFont [ a ] = PIXI . BitmapText . fonts [ a ] , this . _resolveURL ( c , this . _bitmapFont [ a ] ) } , addPhysicsData : function ( a , b , c , d ) { this . _physics [ a ] = { url : b , data : c , format : d } , this . _resolveURL ( b , this . _physics [ a ] ) } , addDefaultImage : function ( ) { var a = new Image ; a . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==" , this . _images . _ _default = { url : null , data : a } , this . _images . _ _def
2014-11-11 01:10:47 +00:00
d . loop ? e . addMarker ( c , d . start , d . end - d . start , null , ! 0 ) : e . addMarker ( c , d . start , d . end - d . start , null , ! 1 ) , this . sounds [ c ] = e } this . config . autoplay && ( this . autoplayKey = this . config . autoplay , this . play ( this . autoplayKey ) , this . autoplay = this . sounds [ this . autoplayKey ] ) } , b . AudioSprite . prototype = { play : function ( a , b ) { return "undefined" == typeof b && ( b = 1 ) , this . sounds [ a ] . play ( a , null , b ) } , stop : function ( a ) { if ( a ) this . sounds [ a ] . stop ( ) ; else for ( var b in this . sounds ) this . sounds [ b ] . stop ( ) } , get : function ( a ) { return this . sounds [ a ] } } , b . AudioSprite . prototype . constructor = b . AudioSprite , b . Sound = function ( a , c , d , e , f ) { "undefined" == typeof d && ( d = 1 ) , "undefined" == typeof e && ( e = ! 1 ) , "undefined" == typeof f && ( f = a . sound . connectToMaster ) , this . game = a , this . name = c , this . key = c , this . loop = e , this . volume = d , this . markers = { } , this . context = null , this . autoplay = ! 1 , this . totalDuration = 0 , this . startTime = 0 , this . currentTime = 0 , this . duration = 0 , this . durationMS = 0 , this . position = 0 , this . stopTime = 0 , this . paused = ! 1 , this . pausedPosition = 0 , this . pausedTime = 0 , this . isPlaying = ! 1 , this . currentMarker = "" , this . pendingPlayback = ! 1 , this . override = ! 1 , this . allowMultiple = ! 1 , this . usingWebAudio = this . game . sound . usingWebAudio , this . usingAudioTag = this . game . sound . usingAudioTag , this . externalNode = null , this . masterGainNode = null , this . gainNode = null , this . usingWebAudio ? ( this . context = this . game . sound . context , this . masterGainNode = this . game . sound . masterGain , this . gainNode = "undefined" == typeof this . context . createGain ? this . context . createGainNode ( ) : this . context . createGain ( ) , this . gainNode . gain . value = d * this . game . sound . volume , f && this . gainNode . connect ( this . masterGainNode ) ) : this . game . cache . getSound ( c ) && this . game . cache . isSoundReady ( c ) ? ( this . _sound = this . game . cache . getSoundData ( c ) , this . totalDuration = 0 , this . _sound . duration && ( this . totalDuration = this . _sound . duration ) ) : this . game . cache . onSoundUnlock . add ( this . soundHasUnlocked , this ) , this . onDecoded = new b . Signal , this . onPlay = new b . Signal , this . onPause = new b . Signal , this . onResume = new b . Signal , this . onLoop = new b . Signal , this . onStop = new b . Signal , this . onMute = new b . Signal , this . onMarkerComplete = new b . Signal , this . onFadeComplete = new b . Signal , this . _volume = d , this . _buffer = null , this . _muted = ! 1 , this . _tempMarker = 0 , this . _tempPosition = 0 , this . _tempVolume = 0 , this . _muteVolume = 0 , this . _tempLoop = 0 , this . _paused = ! 1 , this . _onDecodedEventDispatched = ! 1 } , b . Sound . prototype = { soundHasUnlocked : function ( a ) { a === this . key && ( this . _sound = this . game . cache . getSoundData ( this . key ) , this . totalDuration = this . _sound . duration ) } , addMarker : function ( a , b , c , d , e ) { "undefined" == typeof d && ( d = 1 ) , "undefined" == typeof e && ( e = ! 1 ) , this . markers [ a ] = { name : a , start : b , stop : b + c , volume : d , duration : c , durationMS : 1e3 * c , loop : e } } , removeMarker : function ( a ) { delete this . markers [ a ] } , update : function ( ) { this . isDecoded && ! this . _onDecodedEventDispatched && ( this . onDecoded . dispatch ( this ) , this . _onDecodedEventDispatched = ! 0 ) , this . pendingPlayback && this . game . cache . isSoundReady ( this . key ) && ( this . pendingPlayback = ! 1 , this . play ( this . _tempMarker , this . _tempPosition , this . _tempVolume , this . _tempLoop ) ) , this . isPlaying && ( this . currentTime = this . game . time . time - this . startTime , this . currentTime >= this . durationMS && ( this . usingWebAudio ? this . loop ? ( this . onLoop . dispatch ( this ) , "" === this . currentMarker ? ( this . currentTime = 0 , this . startTime = this . game . time . time ) : ( this . onMarkerComplete . dispatch ( this . currentMarker , this ) , this . play ( this . currentMarker , 0 , this . volume , ! 0 , ! 0 ) ) ) : this . stop ( ) : this . loop ? ( this . onLoop . dispatch ( this ) , this . play ( this . currentMarker , 0 , this . volume , ! 0 , ! 0 ) ) : this . stop ( ) ) ) } , play : function ( a , b , c , d , e ) { if ( "undefined" == typeof a && ( a = "" ) , "undefined" == typeof e && ( e = ! 0 ) , this . isPlaying && ! this . allowMultiple && ! e && ! this . override ) return this ; if ( this . isPlaying && ! this . allowMultiple && ( this . override || e ) && ( this . usingWebAudio ? "undefined" == typeof this . _sound . stop ? this . _sound . noteOff ( 0 ) : this . _sound . stop ( 0 ) : this . usingAudioTag && ( this . _sound . pause ( ) , this . _sound . currentTime = 0 ) ) , this . currentMarker = a , "" !== a ) { if ( ! this . markers [ a ] ) return console . warn ( "Phaser.Sound.play: audio marker " + a + " doesn't exist" ) , this ; this . position = this . markers [ a ] . start , this . volume = this . markers [ a ] . volume , this . loop = this . markers [ a ] . loop , this . duration = this . markers [ a ] . duration , this . durationMS = this . markers [ a ] . durati
2014-11-10 01:41:41 +00:00
} , b . Physics . Arcade . prototype . constructor = b . Physics . Arcade , b . Physics . Arcade . prototype = { 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 ) } , enable : function ( a , c ) { "undefined" == typeof c && ( c = ! 0 ) ; var d = 1 ; if ( Array . isArray ( a ) ) for ( d = a . length ; d -- ; ) a [ d ] instanceof b . Group ? this . enable ( a [ d ] . children , c ) : ( this . enableBody ( a [ d ] ) , c && a [ d ] . hasOwnProperty ( "children" ) && a [ d ] . children . length > 0 && this . enable ( a [ d ] , ! 0 ) ) ; else a instanceof b . Group ? this . enable ( a . children , c ) : ( this . enableBody ( a ) , c && a . hasOwnProperty ( "children" ) && a . children . length > 0 && this . enable ( a . children , ! 0 ) ) } , enableBody : function ( a ) { a . hasOwnProperty ( "body" ) && null === a . body && ( a . body = new b . Physics . Arcade . Body ( a ) ) } , updateMotion : function ( a ) { this . _velocityDelta = this . computeVelocity ( 0 , a , a . angularVelocity , a . angularAcceleration , a . angularDrag , a . maxAngular ) - a . angularVelocity , a . angularVelocity += this . _velocityDelta , a . rotation += a . angularVelocity * this . game . time . physicsElapsed , a . velocity . x = this . computeVelocity ( 1 , a , a . velocity . x , a . acceleration . x , a . drag . x , a . maxVelocity . x ) , a . velocity . y = this . computeVelocity ( 2 , a , a . velocity . y , a . acceleration . y , a . drag . y , a . maxVelocity . y ) } , computeVelocity : function ( a , b , c , d , e , f ) { return f = f || 1e4 , 1 == a && b . allowGravity ? c += ( this . gravity . x + b . gravity . x ) * this . game . time . physicsElapsed : 2 == a && b . allowGravity && ( c += ( this . gravity . y + b . gravity . y ) * this . game . time . physicsElapsed ) , d ? c += d * this . game . time . physicsElapsed : e && ( this . _drag = e * this . game . time . physicsElapsed , c - this . _drag > 0 ? c -= this . _drag : c + this . _drag < 0 ? c += this . _drag : c = 0 ) , c > f ? c = f : - f > c && ( c = - f ) , c } , 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 ( a ) && Array . isArray ( b ) ) for ( var f = 0 , g = b . length ; g > f ; f ++ ) this . collideHandler ( a , b [ f ] , c , d , e , ! 0 ) ; else if ( Array . isArray ( a ) && ! Array . isArray ( b ) ) for ( var f = 0 , g = a . length ; g > f ; f ++ ) this . collideHandler ( a [ f ] , b , c , d , e , ! 0 ) ; else if ( Array . isArray ( a ) && Array . isArray ( b ) ) for ( var f = 0 , g = a . length ; g > f ; f ++ ) for ( var h = 0 , i = b . length ; i > h ; h ++ ) this . collideHandler ( a [ f ] , b [ h ] , 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 ( a ) && Array . isArray ( b ) ) for ( var f = 0 , g = b . length ; g > f ; f ++ ) this . collideHandler ( a , b [ f ] , c , d , e , ! 1 ) ; else if ( Array . isArray ( a ) && ! Array . isArray ( b ) ) for ( var f = 0 , g = a . length ; g > f ; f ++ ) this . collideHandler ( a [ f ] , b , c , d , e , ! 1 ) ; else if ( Array . isArray ( a ) && Array . isArray ( b ) ) for ( var f = 0 , h = a . length ; h > f ; f ++ ) for ( var i = 0 , j = b . length ; j > i ; i ++ ) this . collideHandler ( a [ f ] , b [ i ] , c , d , e , ! 1 ) ; else this . collideHandler ( a , b , c , d , e , ! 1 ) ; return this . _total > 0 } , collideHandler : function ( a , c , d , e , f , g ) { return "undefined" != typeof c || a . type !== b . GROUP && a . type !== b . EMITTER ? void ( a && c && a . exists && c . exists && ( a . type == b . SPRITE || a . type == b . TILESPRITE ? c . type == b . SPRITE || c . type == b . TILESPRITE ? this . collideSpriteVsSprite ( a , c , d , e , f , g ) : c . type == b . GROUP || c . type == b . EMITTER ? this . collideSpriteVsGroup ( a , c , d , e , f , g ) : c . type == b . TILEMAPLAYER && this . collideSpriteVsTilemapLayer ( a , c , d , e , f ) : a . type == b . GROUP ? c . type == b . SPRITE || c . type == b . TILESPRITE ? this . collideSpriteVsGroup ( c , a , d , e , f , g ) : c . type == b . GROUP || c . type == b . EMITTER ? this . collideGroupVsGroup ( a , c , d , e , f , g ) : c . type == b . TILEMAPLAYER && this . collideGroupVsTilemapLayer ( a , c , d , e , f ) : a . type == b . TILEMAPLAYER ? c . type == b . SPRITE || c . type == b . TILESPRITE ? this . collideSpriteVsTilemapLayer ( c , a , d , e , f ) : ( c . type == b . GROUP || c . type == b . EMITTER ) && this . collideGroupVsTilemapLayer ( c , a , d , e , f ) : a . type == b . EMITTER && ( c . type == b . SPRITE || c . type == b . TILESPRITE ? this . collideSpriteVsGroup ( c , a , d , e , f , g ) : c . type == b . GROUP || c . type == b . EMITTER ? this . collideGroupVsGroup ( a , c , d , e , f , g ) : c . type == b . TILEMAPLAYER && this . collideGroupVsTilemapLayer ( a , c , d , e , f ) ) ) ) : void this . collideGroupVsSelf ( a , d , e , f , g ) } , collideSpriteVsSprite : function ( a , b , c , d , e , f ) { return a . body && b . body ? ( this . separate ( a . body , b . body , d , e , f ) && ( c && c . call ( e , a , b ) , this . _total ++ ) , ! 0 ) : ! 1 } , collideSpriteVsGroup : function ( a , b , c , d , e , f ) { if ( 0 !== b . length && a . body ) if ( a . body . skipQuadTree || this . skipQuadTree ) for ( var g = 0 , h = b . children . length ; h > g ; g ++ ) b . children [ g ] && b . children [ g ] . exis
2014-11-11 01:10:47 +00:00
} , isInteresting : function ( a , b ) { return a && b ? this . collideLeft || this . collideRight || this . collideUp || this . collideDown || this . faceTop || this . faceBottom || this . faceLeft || this . faceRight || this . collisionCallback : a ? this . collideLeft || this . collideRight || this . collideUp || this . collideDown : b ? this . faceTop || this . faceBottom || this . faceLeft || this . faceRight : ! 1 } , copy : function ( a ) { this . index = a . index , this . alpha = a . alpha , this . properties = a . properties , this . collideUp = a . collideUp , this . collideDown = a . collideDown , this . collideLeft = a . collideLeft , this . collideRight = a . collideRight , this . collisionCallback = a . collisionCallback , this . collisionCallbackContext = a . collisionCallbackContext } } , b . Tile . prototype . constructor = b . Tile , Object . defineProperty ( b . Tile . prototype , "collides" , { get : function ( ) { return this . collideLeft || this . collideRight || this . collideUp || this . collideDown } } ) , Object . defineProperty ( b . Tile . prototype , "canCollide" , { get : function ( ) { return this . collideLeft || this . collideRight || this . collideUp || this . collideDown || this . collisionCallback } } ) , Object . defineProperty ( b . Tile . prototype , "left" , { get : function ( ) { return this . worldX } } ) , Object . defineProperty ( b . Tile . prototype , "right" , { get : function ( ) { return this . worldX + this . width } } ) , Object . defineProperty ( b . Tile . prototype , "top" , { get : function ( ) { return this . worldY } } ) , Object . defineProperty ( b . Tile . prototype , "bottom" , { get : function ( ) { return this . worldY + this . height } } ) , b . Tilemap = function ( a , c , d , e , f , g ) { this . game = a , this . key = c ; var h = b . TilemapParser . parse ( this . game , c , d , e , f , g ) ; null !== h && ( this . width = h . width , this . height = h . height , this . tileWidth = h . tileWidth , this . tileHeight = h . tileHeight , this . orientation = h . orientation , this . format = h . format , this . version = h . version , this . properties = h . properties , this . widthInPixels = h . widthInPixels , this . heightInPixels = h . heightInPixels , this . layers = h . layers , this . tilesets = h . tilesets , this . tiles = h . tiles , this . objects = h . objects , this . collideIndexes = [ ] , this . collision = h . collision , this . images = h . images , this . currentLayer = 0 , this . debugMap = [ ] , this . _results = [ ] , this . _tempA = 0 , this . _tempB = 0 ) } , b . Tilemap . CSV = 0 , b . Tilemap . TILED _JSON = 1 , b . Tilemap . NORTH = 0 , b . Tilemap . EAST = 1 , b . Tilemap . SOUTH = 2 , b . Tilemap . WEST = 3 , b . Tilemap . prototype = { create : function ( a , b , c , d , e , f ) { return "undefined" == typeof f && ( f = this . game . world ) , this . width = b , this . height = c , this . setTileSize ( d , e ) , this . layers . length = 0 , this . createBlankLayer ( a , b , c , d , e , f ) } , setTileSize : function ( a , b ) { this . tileWidth = a , this . tileHeight = b , this . widthInPixels = this . width * a , this . heightInPixels = this . height * b } , addTilesetImage : function ( a , c , d , e , f , g , h ) { if ( "undefined" == typeof d && ( d = this . tileWidth ) , "undefined" == typeof e && ( e = this . tileHeight ) , "undefined" == typeof f && ( f = 0 ) , "undefined" == typeof g && ( g = 0 ) , "undefined" == typeof h && ( h = 0 ) , 0 === d && ( d = 32 ) , 0 === e && ( e = 32 ) , "undefined" == typeof c ) { if ( "string" != typeof a ) return null ; if ( c = a , ! this . game . cache . checkImageKey ( c ) ) return console . warn ( 'Phaser.Tilemap.addTilesetImage: Invalid image key given: "' + c + '"' ) , null } if ( "string" == typeof a && ( a = this . getTilesetIndex ( a ) , null === a && this . format === b . Tilemap . TILED _JSON ) ) return console . warn ( 'Phaser.Tilemap.addTilesetImage: No data found in the JSON matching the tileset name: "' + c + '"' ) , null ; if ( this . tilesets [ a ] ) return this . tilesets [ a ] . setImage ( this . game . cache . getImage ( c ) ) , this . tilesets [ a ] ; var i = new b . Tileset ( c , h , d , e , f , g , { } ) ; i . setImage ( this . game . cache . getImage ( c ) ) , this . tilesets . push ( i ) ; for ( var j = this . tilesets . length - 1 , k = f , l = f , m = 0 , n = 0 , o = 0 , p = h ; p < h + i . total && ( this . tiles [ p ] = [ k , l , j ] , k += d + g , m ++ , m !== i . total ) && ( n ++ , n !== i . columns || ( k = f , l += e + g , n = 0 , o ++ , o !== i . rows ) ) ; p ++ ) ; return i } , createFromObjects : function ( a , c , d , e , f , g , h , i , j ) { if ( "undefined" == typeof f && ( f = ! 0 ) , "undefined" == typeof g && ( g = ! 1 ) , "undefined" == typeof h && ( h = this . game . world ) , "undefined" == typeof i && ( i = b . Sprite ) , "undefined" == typeof j && ( j = ! 0 ) , ! this . objects [ a ] ) return void console . warn ( "Tilemap.createFromObjects: Invalid objectgroup name given: " + a ) ; for ( var k , l = 0 , m = this . objects [ a ] . length ; m > l ; l ++ ) if ( this . objects [ a ] [ l ] . gid === c ) { k = new i ( this . game , this . objects [ a ] [ l ] . x , this . objects [ a ] [ l ] . y , d , e ) , k . name = this . objects [ a ] [ l ] . name , k . visible = this . objects [ a ] [ l ] . visible , k . autoCull = g , k . exists = f , j && ( k . y -= k . height ) , h . add ( k ) ; for ( var n in this . objects [ a ] [ l ] . propertie
if ( ! i && j ) return j ( h , ! 0 ) ; if ( g ) return g ( h , ! 0 ) ; throw new Error ( "Cannot find module '" + h + "'" ) } var k = d [ h ] = { exports : { } } ; b [ h ] [ 0 ] . call ( k . exports , function ( a ) { var c = b [ h ] [ 1 ] [ a ] ; return f ( c ? c : a ) } , k , k . exports , c , b , d , e ) } return d [ h ] . exports } for ( var g = "function" == typeof a && a , h = 0 ; h < e . length ; h ++ ) f ( e [ h ] ) ; return f } ( { PcZj9L : [ function ( a , b , c ) { function d ( a , b ) { var c = typeof a ; if ( "base64" === b && "string" === c ) for ( a = ib ( a ) ; a . length % 4 !== 0 ; ) a += "=" ; var e ; if ( "number" === c ) e = nb ( a ) ; else if ( "string" === c ) e = d . byteLength ( a , b ) ; else { if ( "object" !== c ) throw new Error ( "First argument needs to be a number, array or string." ) ; e = nb ( a . length ) } var f = lb ( new Cb ( e ) ) ; if ( d . isBuffer ( a ) ) f . set ( a ) ; else if ( ob ( a ) ) for ( var g = 0 ; e > g ; g ++ ) f [ g ] = d . isBuffer ( a ) ? a . readUInt8 ( g ) : a [ g ] ; else "string" === c && f . write ( a , 0 , b ) ; return f } function e ( a , b , c , e ) { c = Number ( c ) || 0 ; var f = a . length - c ; e ? ( e = Number ( e ) , e > f && ( e = f ) ) : e = f ; var g = b . length ; if ( g % 2 !== 0 ) throw new Error ( "Invalid hex string" ) ; e > g / 2 && ( e = g / 2 ) ; for ( var h = 0 ; e > h ; h ++ ) { var i = parseInt ( b . substr ( 2 * h , 2 ) , 16 ) ; if ( isNaN ( i ) ) throw new Error ( "Invalid hex string" ) ; a [ c + h ] = i } return d . _charsWritten = 2 * h , h } function f ( a , b , c , e ) { return d . _charsWritten = tb ( qb ( b ) , a , c , e ) } function g ( a , b , c , e ) { return d . _charsWritten = tb ( rb ( b ) , a , c , e ) } function h ( a , b , c , d ) { return g ( a , b , c , d ) } function i ( a , b , c , e ) { return d . _charsWritten = tb ( sb ( b ) , a , c , e ) } function j ( a , b , c , d ) { if ( isFinite ( b ) ) isFinite ( c ) || ( d = c , c = void 0 ) ; else { var j = d ; d = b , b = c , c = j } b = Number ( b ) || 0 ; var k = this . length - b ; switch ( c ? ( c = Number ( c ) , c > k && ( c = k ) ) : c = k , d = String ( d || "utf8" ) . toLowerCase ( ) ) { case "hex" : return e ( this , a , b , c ) ; case "utf8" : case "utf-8" : return f ( this , a , b , c ) ; case "ascii" : return g ( this , a , b , c ) ; case "binary" : return h ( this , a , b , c ) ; case "base64" : return i ( this , a , b , c ) ; default : throw new Error ( "Unknown encoding" ) } } function k ( a , b , c ) { var d = this instanceof kb ? this . _proxy : this ; if ( a = String ( a || "utf8" ) . toLowerCase ( ) , b = Number ( b ) || 0 , c = void 0 !== c ? Number ( c ) : c = d . length , c === b ) return "" ; switch ( a ) { case "hex" : return r ( d , b , c ) ; case "utf8" : case "utf-8" : return o ( d , b , c ) ; case "ascii" : return p ( d , b , c ) ; case "binary" : return q ( d , b , c ) ; case "base64" : return n ( d , b , c ) ; default : throw new Error ( "Unknown encoding" ) } } function l ( ) { return { type : "Buffer" , data : Array . prototype . slice . call ( this , 0 ) } } function m ( a , b , c , d ) { var e = this ; if ( c || ( c = 0 ) , d || 0 === d || ( d = this . length ) , b || ( b = 0 ) , d !== c && 0 !== a . length && 0 !== e . length ) { if ( c > d ) throw new Error ( "sourceEnd < sourceStart" ) ; if ( 0 > b || b >= a . length ) throw new Error ( "targetStart out of bounds" ) ; if ( 0 > c || c >= e . length ) throw new Error ( "sourceStart out of bounds" ) ; if ( 0 > d || d > e . length ) throw new Error ( "sourceEnd out of bounds" ) ; d > this . length && ( d = this . length ) , a . length - b < d - c && ( d = a . length - b + c ) ; for ( var f = 0 ; d - c > f ; f ++ ) a [ f + b ] = this [ f + c ] } } function n ( b , c , d ) { var e = b . slice ( c , d ) ; return a ( "base64-js" ) . fromByteArray ( e ) } function o ( a , b , c ) { for ( var d = a . slice ( b , c ) , e = "" , f = "" , g = 0 ; g < d . length ; ) d [ g ] <= 127 ? ( e += ub ( f ) + String . fromCharCode ( d [ g ] ) , f = "" ) : f += "%" + d [ g ] . toString ( 16 ) , g ++ ; return e + ub ( f ) } function p ( a , b , c ) { for ( var d = a . slice ( b , c ) , e = "" , f = 0 ; f < d . length ; f ++ ) e += String . fromCharCode ( d [ f ] ) ; return e } function q ( a , b , c ) { return p ( a , b , c ) } function r ( a , b , c ) { var d = a . length ; ( ! b || 0 > b ) && ( b = 0 ) , ( ! c || 0 > c || c > d ) && ( c = d ) ; for ( var e = "" , f = b ; c > f ; f ++ ) e += pb ( a [ f ] ) ; return e } function s ( a , b ) { var c = this . length ; return a = mb ( a , c , 0 ) , b = mb ( b , c , c ) , lb ( this . subarray ( a , b ) ) } function t ( a , b ) { var c = this ; return b || ( yb ( void 0 !== a && null !== a , "missing offset" ) , yb ( a < c . length , "Trying to read beyond buffer length" ) ) , a >= c . length ? void 0 : c [ a ] } function u ( a , b , c , d ) { d || ( yb ( "boolean" == typeof c , "missing or invalid endian" ) , yb ( void 0 !== b && null !== b , "missing offset" ) , yb ( b + 1 < a . length , "Trying to read beyond buffer length" ) ) ; var e = a . length ; if ( ! ( b >= e ) ) { if ( b + 1 === e ) { var f = new Ab ( new Bb ( 2 ) ) ; return f . setUint8 ( 0 , a [ e - 1 ] ) , f . getUint16 ( 0 , c ) } return a . _dataview . getUint16 ( b , c ) } } function v ( a , b ) { return u ( this , a , ! 0 , b ) } function w ( a , b ) { return u ( this , a , ! 1 , b ) } function x ( a , b , c , d ) { d || ( yb ( "boolean" == typeof c , "missing or invalid endian" ) , yb ( void 0 !== b && null !== b , "missing offset" ) , yb ( b + 3 < a . length , "Trying to read beyond buffer length" ) ) ; var e = a . length ; if ( ! ( b >= e ) ) { if ( b + 3 >= e ) { for ( var f = new Ab ( new Bb ( 4 ) ) , g = 0 ; e > g + b ; g ++ ) f . setUint8 ( g , a [ g + b ] ) ; return f . getUint32 ( 0 , c ) } return a . _dataview . getUint32 ( b , c ) } } function y ( a , b ) { return x ( this , a ,
else { if ( r > q && ( q += this . vertices . length ) , p = Number . MAX _VALUE , r > q ) return a ; for ( var y = r ; q >= y ; ++ y ) f . leftOn ( v . at ( x - 1 ) , v . at ( x ) , v . at ( y ) ) && f . rightOn ( v . at ( x + 1 ) , v . at ( x ) , v . at ( y ) ) && ( o = f . sqdist ( v . at ( x ) , v . at ( y ) ) , p > o && ( p = o , s = y % this . vertices . length ) ) ; s > x ? ( t . append ( v , x , s + 1 ) , 0 != s && u . append ( v , s , w . length ) , u . append ( v , 0 , x + 1 ) ) : ( 0 != x && t . append ( v , x , w . length ) , t . append ( v , 0 , s + 1 ) , u . append ( v , s , x + 1 ) ) } return t . vertices . length < u . vertices . length ? ( t . quickDecomp ( a , b , e , g , h , i ) , u . quickDecomp ( a , b , e , g , h , i ) ) : ( u . quickDecomp ( a , b , e , g , h , i ) , t . quickDecomp ( a , b , e , g , h , i ) ) , a } return a . push ( this ) , a } , c . prototype . removeCollinearPoints = function ( a ) { for ( var b = 0 , c = this . vertices . length - 1 ; this . vertices . length > 3 && c >= 0 ; -- c ) f . collinear ( this . at ( c - 1 ) , this . at ( c ) , this . at ( c + 1 ) , a ) && ( this . vertices . splice ( c % this . vertices . length , 1 ) , c -- , b ++ ) ; return b } } , { "./Line" : 3 , "./Point" : 4 , "./Scalar" : 6 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 6 : [ function ( a , b ) { function c ( ) { } a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) ; b . exports = c , c . eq = function ( a , b , c ) { return c = c || 0 , Math . abs ( a - b ) < c } } , { _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 7 : [ function ( a , b ) { a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) ; b . exports = { Polygon : a ( "./Polygon" ) , Point : a ( "./Point" ) } } , { "./Point" : 4 , "./Polygon" : 5 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 8 : [ function ( a , b ) { a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) ; b . exports = { name : "p2" , version : "0.6.0" , description : "A JavaScript 2D physics engine." , author : "Stefan Hedman <schteppe@gmail.com> (http://steffe.se)" , keywords : [ "p2.js" , "p2" , "physics" , "engine" , "2d" ] , main : "./src/p2.js" , engines : { node : "*" } , repository : { type : "git" , url : "https://github.com/schteppe/p2.js.git" } , bugs : { url : "https://github.com/schteppe/p2.js/issues" } , licenses : [ { type : "MIT" } ] , devDependencies : { grunt : "~0.4.0" , "grunt-contrib-jshint" : "~0.9.2" , "grunt-contrib-nodeunit" : "~0.1.2" , "grunt-contrib-uglify" : "~0.4.0" , "grunt-contrib-watch" : "~0.5.0" , "grunt-browserify" : "~2.0.1" , "grunt-contrib-concat" : "^0.4.0" } , dependencies : { "poly-decomp" : "0.1.0" } } } , { _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 9 : [ function ( a , b ) { function c ( a ) { this . lowerBound = d . create ( ) , a && a . lowerBound && d . copy ( this . lowerBound , a . lowerBound ) , this . upperBound = d . create ( ) , a && a . upperBound && d . copy ( this . upperBound , a . upperBound ) } { var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "../math/vec2" ) ) ; a ( "../utils/Utils" ) } b . exports = c ; var e = d . create ( ) ; c . prototype . setFromPoints = function ( a , b , c , f ) { var g = this . lowerBound , h = this . upperBound ; "number" != typeof c && ( c = 0 ) , 0 !== c ? d . rotate ( g , a [ 0 ] , c ) : d . copy ( g , a [ 0 ] ) , d . copy ( h , g ) ; for ( var i = Math . cos ( c ) , j = Math . sin ( c ) , k = 1 ; k < a . length ; k ++ ) { var l = a [ k ] ; if ( 0 !== c ) { var m = l [ 0 ] , n = l [ 1 ] ; e [ 0 ] = i * m - j * n , e [ 1 ] = j * m + i * n , l = e } for ( var o = 0 ; 2 > o ; o ++ ) l [ o ] > h [ o ] && ( h [ o ] = l [ o ] ) , l [ o ] < g [ o ] && ( g [ o ] = l [ o ] ) } b && ( d . add ( this . lowerBound , this . lowerBound , b ) , d . add ( this . upperBound , this . upperBound , b ) ) , f && ( this . lowerBound [ 0 ] -= f , this . lowerBound [ 1 ] -= f , this . upperBound [ 0 ] += f , this . upperBound [ 1 ] += f ) } , c . prototype . copy = function ( a ) { d . copy ( this . lowerBound , a . lowerBound ) , d . copy ( this . upperBound , a . upperBound ) } , c . prototype . extend = function ( a ) { for ( var b = 2 ; b -- ; ) { var c = a . lowerBound [ b ] ; this . lowerBound [ b ] > c && ( this . lowerBound [ b ] = c ) ; var d = a . upperBound [ b ] ; this . upperBound [ b ] < d && ( this . upperBound [ b ] = d ) } } , c . prototype . overlaps = function ( a ) { var b = this . lowerBound , c = this . upperBound , d = a . lowerBound , e = a . upperBound ; return ( d [ 0 ] <= c [ 0 ] && c [ 0 ] <= e [ 0 ] || b [ 0 ] <= e [ 0 ] && e [ 0 ] <= c [ 0 ] ) && ( d [ 1 ] <= c [ 1 ] && c [ 1 ] <= e [ 1 ] || b [ 1 ] <= e [ 1 ] && e [ 1 ] <= c [ 1 ] ) } } , { "../math/vec2" : 31 , "../utils/Utils" : 50 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 10 : [ function ( a , b ) { function c ( a ) { this . type = a , this . result = [ ] , this . world = null , this . boundingVolumeType = c . AABB } var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "../math/vec2" ) ) , e = a ( "../objects/Body" ) ; b . exports = c , c . AABB = 1 , c . BOUNDING _CIRCLE = 2 , c . prototype . setWorld = function ( a ) { this . world = a } , c . prototype . getCollisionPairs = function ( ) { throw new Error ( "getCollisionPairs must be implemented in a subclass!" ) } ; var f = d . create ( ) ; c . boundingRadiusCheck = function ( a , b ) { d . sub ( f , a . position , b . position ) ; var c = d . squaredLength ( f ) , e = a . boundingRadius + b . boundingRadius ; return e * e >= c } , c . aabbCheck = function ( a , b ) { return a . getAABB ( ) . overlaps ( b . getAABB ( ) ) } , c
b . exports = c , c . prototype = new d ; var h = f . create ( ) , i = f . create ( ) , j = f . create ( ) ; c . prototype . update = function ( ) { var a = this . equations [ 0 ] , b = this . bodyA , c = this . bodyB , d = ( this . distance , b . position ) , e = c . position , g = this . equations [ 0 ] , k = a . G ; f . rotate ( i , this . localAnchorA , b . angle ) , f . rotate ( j , this . localAnchorB , c . angle ) , f . add ( h , e , j ) , f . sub ( h , h , i ) , f . sub ( h , h , d ) , this . position = f . length ( h ) ; var l = ! 1 ; if ( this . upperLimitEnabled && this . position > this . upperLimit && ( g . maxForce = 0 , g . minForce = - this . maxForce , this . distance = this . upperLimit , l = ! 0 ) , this . lowerLimitEnabled && this . position < this . lowerLimit && ( g . maxForce = this . maxForce , g . minForce = 0 , this . distance = this . lowerLimit , l = ! 0 ) , ( this . lowerLimitEnabled || this . upperLimitEnabled ) && ! l ) return void ( g . enabled = ! 1 ) ; g . enabled = ! 0 , f . normalize ( h , h ) ; var m = f . crossLength ( i , h ) , n = f . crossLength ( j , h ) ; k [ 0 ] = - h [ 0 ] , k [ 1 ] = - h [ 1 ] , k [ 2 ] = - m , k [ 3 ] = h [ 0 ] , k [ 4 ] = h [ 1 ] , k [ 5 ] = n } , c . prototype . setMaxForce = function ( a ) { var b = this . equations [ 0 ] ; b . minForce = - a , b . maxForce = a } , c . prototype . getMaxForce = function ( ) { var a = this . equations [ 0 ] ; return a . maxForce } } , { "../equations/Equation" : 23 , "../math/vec2" : 31 , "../utils/Utils" : 50 , "./Constraint" : 15 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 17 : [ function ( a , b ) { function c ( a , b , c ) { c = c || { } , d . call ( this , a , b , d . GEAR , c ) , this . ratio = "number" == typeof c . ratio ? c . ratio : 1 , this . angle = "number" == typeof c . angle ? c . angle : b . angle - this . ratio * a . angle , c . angle = this . angle , c . ratio = this . ratio , this . equations = [ new e ( a , b , c ) ] , "number" == typeof c . maxTorque && this . setMaxTorque ( c . maxTorque ) } { var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "./Constraint" ) ) , e = ( a ( "../equations/Equation" ) , a ( "../equations/AngleLockEquation" ) ) ; a ( "../math/vec2" ) } b . exports = c , c . prototype = new d , c . prototype . update = function ( ) { var a = this . equations [ 0 ] ; a . ratio !== this . ratio && a . setRatio ( this . ratio ) , a . angle = this . angle } , c . prototype . setMaxTorque = function ( a ) { this . equations [ 0 ] . setMaxTorque ( a ) } , c . prototype . getMaxTorque = function ( ) { return this . equations [ 0 ] . maxForce } } , { "../equations/AngleLockEquation" : 21 , "../equations/Equation" : 23 , "../math/vec2" : 31 , "./Constraint" : 15 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 18 : [ function ( a , b ) { function c ( a , b , c ) { c = c || { } , d . call ( this , a , b , d . LOCK , c ) ; var g = "undefined" == typeof c . maxForce ? Number . MAX _VALUE : c . maxForce , h = ( c . localAngleB || 0 , new f ( a , b , - g , g ) ) , i = new f ( a , b , - g , g ) , j = new f ( a , b , - g , g ) , k = e . create ( ) , l = e . create ( ) , m = this ; h . computeGq = function ( ) { return e . rotate ( k , m . localOffsetB , a . angle ) , e . sub ( l , b . position , a . position ) , e . sub ( l , l , k ) , l [ 0 ] } , i . computeGq = function ( ) { return e . rotate ( k , m . localOffsetB , a . angle ) , e . sub ( l , b . position , a . position ) , e . sub ( l , l , k ) , l [ 1 ] } ; var n = e . create ( ) , o = e . create ( ) ; j . computeGq = function ( ) { return e . rotate ( n , m . localOffsetB , b . angle - m . localAngleB ) , e . scale ( n , n , - 1 ) , e . sub ( l , a . position , b . position ) , e . add ( l , l , n ) , e . rotate ( o , n , - Math . PI / 2 ) , e . normalize ( o , o ) , e . dot ( l , o ) } , this . localOffsetB = e . create ( ) , c . localOffsetB ? e . copy ( this . localOffsetB , c . localOffsetB ) : ( e . sub ( this . localOffsetB , b . position , a . position ) , e . rotate ( this . localOffsetB , this . localOffsetB , - a . angle ) ) , this . localAngleB = 0 , this . localAngleB = "number" == typeof c . localAngleB ? c . localAngleB : b . angle - a . angle , this . equations . push ( h , i , j ) , this . setMaxForce ( g ) } var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "./Constraint" ) ) , e = a ( "../math/vec2" ) , f = a ( "../equations/Equation" ) ; b . exports = c , c . prototype = new d , c . prototype . setMaxForce = function ( a ) { for ( var b = this . equations , c = 0 ; c < this . equations . length ; c ++ ) b [ c ] . maxForce = a , b [ c ] . minForce = - a } , c . prototype . getMaxForce = function ( ) { return this . equations [ 0 ] . maxForce } ; var g = e . create ( ) , h = e . create ( ) , i = e . create ( ) , j = e . fromValues ( 1 , 0 ) , k = e . fromValues ( 0 , 1 ) ; c . prototype . update = function ( ) { var a = this . equations [ 0 ] , b = this . equations [ 1 ] , c = this . equations [ 2 ] , d = this . bodyA , f = this . bodyB ; e . rotate ( g , this . localOffsetB , d . angle ) , e . rotate ( h , this . localOffsetB , f . angle - this . localAngleB ) , e . scale ( h , h , - 1 ) , e . rotate ( i , h , Math . PI / 2 ) , e . normalize ( i , i ) , a . G [ 0 ] = - 1 , a . G [ 1 ] = 0 , a . G [ 2 ] = - e . crossLength ( g , j ) , a . G [ 3 ] = 1 , b . G [ 0 ] = 0 , b . G [ 1 ] = - 1 , b . G [ 2 ] = - e . crossLength ( g , k ) , b . G [ 4 ] = 1 , c . G [ 0 ] = - i [ 0 ] , c . G [ 1 ] = - i [ 1 ] , c . G [ 3 ] = i [ 0 ] , c . G [ 4 ] = i [ 1 ] , c . G [ 5 ] = e . crossLength ( h , i ) } } , { "../equations/Equation" : 23 , "../math/vec2" : 31 , "./Constraint" : 15 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 }
d . angularForce -= h , e . angularForce += h } } , { "../math/vec2" : 31 , "./Spring" : 35 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 35 : [ function ( a , b ) { function c ( a , b , c ) { c = d . defaults ( c , { stiffness : 100 , damping : 1 } ) , this . stiffness = c . stiffness , this . damping = c . damping , this . bodyA = a , this . bodyB = b } var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "../math/vec2" ) , a ( "../utils/Utils" ) ) ; b . exports = c , c . prototype . applyForce = function ( ) { } } , { "../math/vec2" : 31 , "../utils/Utils" : 50 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 36 : [ function ( a , b ) { a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) ; b . exports = { AABB : a ( "./collision/AABB" ) , AngleLockEquation : a ( "./equations/AngleLockEquation" ) , Body : a ( "./objects/Body" ) , Broadphase : a ( "./collision/Broadphase" ) , Capsule : a ( "./shapes/Capsule" ) , Circle : a ( "./shapes/Circle" ) , Constraint : a ( "./constraints/Constraint" ) , ContactEquation : a ( "./equations/ContactEquation" ) , ContactMaterial : a ( "./material/ContactMaterial" ) , Convex : a ( "./shapes/Convex" ) , DistanceConstraint : a ( "./constraints/DistanceConstraint" ) , Equation : a ( "./equations/Equation" ) , EventEmitter : a ( "./events/EventEmitter" ) , FrictionEquation : a ( "./equations/FrictionEquation" ) , GearConstraint : a ( "./constraints/GearConstraint" ) , GridBroadphase : a ( "./collision/GridBroadphase" ) , GSSolver : a ( "./solver/GSSolver" ) , Heightfield : a ( "./shapes/Heightfield" ) , Line : a ( "./shapes/Line" ) , LockConstraint : a ( "./constraints/LockConstraint" ) , Material : a ( "./material/Material" ) , Narrowphase : a ( "./collision/Narrowphase" ) , NaiveBroadphase : a ( "./collision/NaiveBroadphase" ) , Particle : a ( "./shapes/Particle" ) , Plane : a ( "./shapes/Plane" ) , RevoluteConstraint : a ( "./constraints/RevoluteConstraint" ) , PrismaticConstraint : a ( "./constraints/PrismaticConstraint" ) , Rectangle : a ( "./shapes/Rectangle" ) , RotationalVelocityEquation : a ( "./equations/RotationalVelocityEquation" ) , SAPBroadphase : a ( "./collision/SAPBroadphase" ) , Shape : a ( "./shapes/Shape" ) , Solver : a ( "./solver/Solver" ) , Spring : a ( "./objects/Spring" ) , LinearSpring : a ( "./objects/LinearSpring" ) , RotationalSpring : a ( "./objects/RotationalSpring" ) , Utils : a ( "./utils/Utils" ) , World : a ( "./world/World" ) , vec2 : a ( "./math/vec2" ) , version : a ( "../package.json" ) . version } } , { "../package.json" : 8 , "./collision/AABB" : 9 , "./collision/Broadphase" : 10 , "./collision/GridBroadphase" : 11 , "./collision/NaiveBroadphase" : 12 , "./collision/Narrowphase" : 13 , "./collision/SAPBroadphase" : 14 , "./constraints/Constraint" : 15 , "./constraints/DistanceConstraint" : 16 , "./constraints/GearConstraint" : 17 , "./constraints/LockConstraint" : 18 , "./constraints/PrismaticConstraint" : 19 , "./constraints/RevoluteConstraint" : 20 , "./equations/AngleLockEquation" : 21 , "./equations/ContactEquation" : 22 , "./equations/Equation" : 23 , "./equations/FrictionEquation" : 24 , "./equations/RotationalVelocityEquation" : 26 , "./events/EventEmitter" : 27 , "./material/ContactMaterial" : 28 , "./material/Material" : 29 , "./math/vec2" : 31 , "./objects/Body" : 32 , "./objects/LinearSpring" : 33 , "./objects/RotationalSpring" : 34 , "./objects/Spring" : 35 , "./shapes/Capsule" : 37 , "./shapes/Circle" : 38 , "./shapes/Convex" : 39 , "./shapes/Heightfield" : 40 , "./shapes/Line" : 41 , "./shapes/Particle" : 42 , "./shapes/Plane" : 43 , "./shapes/Rectangle" : 44 , "./shapes/Shape" : 45 , "./solver/GSSolver" : 46 , "./solver/Solver" : 47 , "./utils/Utils" : 50 , "./world/World" : 54 , _ _browserify _Buffer : 1 , _ _browserify _process : 2 } ] , 37 : [ function ( a , b ) { function c ( a , b ) { this . length = a || 1 , this . radius = b || 1 , d . call ( this , d . CAPSULE ) } var d = ( a ( "__browserify_process" ) , a ( "__browserify_Buffer" ) , a ( "./Shape" ) ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . computeMomentOfInertia = function ( a ) { var b = this . radius , c = this . length + b , d = 2 * b ; return a * ( d * d + c * c ) / 12 } , c . prototype . updateBoundingRadius = function ( ) { this . boundingRadius = this . radius + this . length / 2 } , c . prototype . updateArea = function ( ) { this . area = Math . PI * this . radius * this . radius + 2 * this . radius * this . length } ; var f = e . create ( ) ; c . prototype . computeAABB = function ( a , b , c ) { var d = this . radius ; e . set ( f , this . length / 2 , 0 ) , 0 !== c && e . rotate ( f , f , c ) , e . set ( a . upperBound , Math . max ( f [ 0 ] + d , - f [ 0 ] + d ) , Math . max ( f [ 1 ] + d , - f [ 1 ] + d ) ) , e . set ( a . lowerBound , Math . min ( f [ 0 ] - d , - f [ 0 ] - d ) , Math . min ( f [ 1 ] - d , - f [ 1 ] - d ) ) , e . add ( a . lowerBound , a . lowerBound , b ) , e . add ( a . upperBound , a . upperBound , b ) } } , { "../math/vec2" : 31 , "./Shape" :
r = c . type < h . type ? q . call ( a , b , c , v , n , g , h , w , o , s ) : q . call ( a , g , h , w , o , b , c , v , n , s ) ; var u = a . frictionEquations . length - t ; if ( r ) { if ( b . allowSleep && b . type === l . DYNAMIC && b . sleepState === l . SLEEPING && g . sleepState === l . AWAKE && g . type !== l . STATIC ) { var x = e . squaredLength ( g . velocity ) + Math . pow ( g . angularVelocity , 2 ) , y = Math . pow ( g . sleepSpeedLimit , 2 ) ; x >= 2 * y && ( b . _wakeUpAfterNarrowphase = ! 0 ) } if ( g . allowSleep && g . type === l . DYNAMIC && g . sleepState === l . SLEEPING && b . sleepState === l . AWAKE && b . type !== l . STATIC ) { var z = e . squaredLength ( b . velocity ) + Math . pow ( b . angularVelocity , 2 ) , A = Math . pow ( b . sleepSpeedLimit , 2 ) ; z >= 2 * A && ( g . _wakeUpAfterNarrowphase = ! 0 ) } if ( this . overlapKeeper . setOverlapping ( b , c , g , h ) , this . has ( "beginContact" ) && this . overlapKeeper . isNewOverlap ( c , h ) ) { var B = this . beginContactEvent ; if ( B . shapeA = c , B . shapeB = h , B . bodyA = b , B . bodyB = g , B . contactEquations . length = 0 , "number" == typeof r ) for ( var C = a . contactEquations . length - r ; C < a . contactEquations . length ; C ++ ) B . contactEquations . push ( a . contactEquations [ C ] ) ; this . emit ( B ) } if ( "number" == typeof r && u > 1 ) for ( var C = a . frictionEquations . length - u ; C < a . frictionEquations . length ; C ++ ) { var D = a . frictionEquations [ C ] ; D . setSlipForce ( D . getSlipForce ( ) / u ) } } } } } , c . prototype . addSpring = function ( a ) { this . springs . push ( a ) , this . addSpringEvent . spring = a , this . emit ( this . addSpringEvent ) } , c . prototype . removeSpring = function ( a ) { var b = this . springs . indexOf ( a ) ; - 1 !== b && q . splice ( this . springs , b , 1 ) } , c . prototype . addBody = function ( a ) { - 1 === this . bodies . indexOf ( a ) && ( this . bodies . push ( a ) , a . world = this , this . addBodyEvent . body = a , this . emit ( this . addBodyEvent ) ) } , c . prototype . removeBody = function ( a ) { if ( this . stepping ) this . bodiesToBeRemoved . push ( a ) ; else { a . world = null ; var b = this . bodies . indexOf ( a ) ; - 1 !== b && ( q . splice ( this . bodies , b , 1 ) , this . removeBodyEvent . body = a , a . resetConstraintVelocity ( ) , this . emit ( this . removeBodyEvent ) ) } } , c . prototype . getBodyById = function ( a ) { for ( var b = this . bodies , c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] ; if ( d . id === a ) return d } return ! 1 } , c . prototype . disableBodyCollision = function ( a , b ) { this . disabledBodyCollisionPairs . push ( a , b ) } , c . prototype . enableBodyCollision = function ( a , b ) { for ( var c = this . disabledBodyCollisionPairs , d = 0 ; d < c . length ; d += 2 ) if ( c [ d ] === a && c [ d + 1 ] === b || c [ d + 1 ] === a && c [ d ] === b ) return void c . splice ( d , 2 ) } , c . prototype . clear = function ( ) { this . time = 0 , this . fixedStepTime = 0 , this . solver && this . solver . equations . length && this . solver . removeAllEquations ( ) ; for ( var a = this . constraints , b = a . length - 1 ; b >= 0 ; b -- ) this . removeConstraint ( a [ b ] ) ; for ( var d = this . bodies , b = d . length - 1 ; b >= 0 ; b -- ) this . removeBody ( d [ b ] ) ; for ( var e = this . springs , b = e . length - 1 ; b >= 0 ; b -- ) this . removeSpring ( e [ b ] ) ; for ( var f = this . contactMaterials , b = f . length - 1 ; b >= 0 ; b -- ) this . removeContactMaterial ( f [ b ] ) ; c . apply ( this ) } , c . prototype . clone = function ( ) { var a = new c ; return a . fromJSON ( this . toJSON ( ) ) , a } ; var B = e . create ( ) , C = e . fromValues ( 0 , 0 ) , D = e . fromValues ( 0 , 0 ) ; c . prototype . hitTest = function ( a , b , c ) { c = c || 0 ; var d = new l ( { position : a } ) , k = new j , m = a , n = 0 , o = B , p = C , q = D ; d . addShape ( k ) ; for ( var r = this . narrowphase , s = [ ] , t = 0 , u = b . length ; t !== u ; t ++ ) for ( var v = b [ t ] , w = 0 , x = v . shapes . length ; w !== x ; w ++ ) { var y = v . shapes [ w ] , z = v . shapeOffsets [ w ] || p , A = v . shapeAngles [ w ] || 0 ; e . rotate ( o , z , v . angle ) , e . add ( o , o , v . position ) ; var E = A + v . angle ; ( y instanceof f && r . circleParticle ( v , y , o , E , d , k , m , n , ! 0 ) || y instanceof g && r . particleConvex ( d , k , m , n , v , y , o , E , ! 0 ) || y instanceof h && r . particlePlane ( d , k , m , n , v , y , o , E , ! 0 ) || y instanceof i && r . particleCapsule ( d , k , m , n , v , y , o , E , ! 0 ) || y instanceof j && e . squaredLength ( e . sub ( q , o , a ) ) < c * c ) && s . push ( v ) } return s } , c . prototype . setGlobalEquationParameters = function ( a ) { a = a || { } ; for ( var b = 0 ; b !== this . constraints . length ; b ++ ) for ( var c = this . constraints [ b ] , d = 0 ; d !== c . equations . length ; d ++ ) { var e = c . equations [ d ] ; "undefined" != typeof a . stiffness && ( e . stiffness = a . stiffness ) , "undefined" != typeof a . relaxation && ( e . relaxation = a . relaxation ) , e . needsUpdate = ! 0 } for ( var b = 0 ; b !== this . contactMaterials . length ; b ++ ) { var c = this . contactMaterials [ b ] ; "undefined" != typeof a . stiffness && ( c . stiffness = a . stiffness , c . frictionStiffness = a . stiffness ) , "undefined" != typeof a . relaxation && ( c . relaxation = a . relaxation , c . frictionRelaxation = a . relaxation ) } var c = this . defaultContactMaterial ; "undefined" != typeof a . stiffness && ( c . stiffness = a . stiffness , c . frictionStiffness = a . stiffness ) , "undefined" != typeof
if ( a . circle ) { var c = new p2 . Circle ( this . world . pxm ( a . circle . radius ) ) ; c . collisionGroup = a . filter . categoryBits , c . collisionMask = a . filter . maskBits , c . sensor = a . isSensor ; var d = p2 . vec2 . create ( ) ; d [ 0 ] = this . world . pxmi ( a . circle . position [ 0 ] - this . sprite . width / 2 ) , d [ 1 ] = this . world . pxmi ( a . circle . position [ 1 ] - this . sprite . height / 2 ) , this . data . addShape ( c , d ) , b . push ( c ) } else for ( var e = a . polygons , f = p2 . vec2 . create ( ) , g = 0 ; g < e . length ; g ++ ) { for ( var h = e [ g ] , i = [ ] , j = 0 ; j < h . length ; j += 2 ) i . push ( [ this . world . pxmi ( h [ j ] ) , this . world . pxmi ( h [ j + 1 ] ) ] ) ; for ( var c = new p2 . Convex ( i ) , k = 0 ; k !== c . vertices . length ; k ++ ) { var l = c . vertices [ k ] ; p2 . vec2 . sub ( l , l , c . centerOfMass ) } p2 . vec2 . scale ( f , c . centerOfMass , 1 ) , f [ 0 ] -= this . world . pxmi ( this . sprite . width / 2 ) , f [ 1 ] -= this . world . pxmi ( this . sprite . height / 2 ) , c . updateTriangles ( ) , c . updateCenterOfMass ( ) , c . updateBoundingRadius ( ) , c . collisionGroup = a . filter . categoryBits , c . collisionMask = a . filter . maskBits , c . sensor = a . isSensor , this . data . addShape ( c , f ) , b . push ( c ) } return b } , loadPolygon : function ( a , b ) { for ( var c = this . game . cache . getPhysicsData ( a , b ) , d = p2 . vec2 . create ( ) , e = 0 ; e < c . length ; e ++ ) { for ( var f = [ ] , g = 0 ; g < c [ e ] . shape . length ; g += 2 ) f . push ( [ this . world . pxmi ( c [ e ] . shape [ g ] ) , this . world . pxmi ( c [ e ] . shape [ g + 1 ] ) ] ) ; for ( var h = new p2 . Convex ( f ) , i = 0 ; i !== h . vertices . length ; i ++ ) { var j = h . vertices [ i ] ; p2 . vec2 . sub ( j , j , h . centerOfMass ) } p2 . vec2 . scale ( d , h . centerOfMass , 1 ) , d [ 0 ] -= this . world . pxmi ( this . sprite . width / 2 ) , d [ 1 ] -= this . world . pxmi ( this . sprite . height / 2 ) , h . updateTriangles ( ) , h . updateCenterOfMass ( ) , h . updateBoundingRadius ( ) , this . data . addShape ( h , d ) } return this . data . aabbNeedsUpdate = ! 0 , this . shapeChanged ( ) , ! 0 } } , Phaser . Physics . P2 . Body . prototype . constructor = Phaser . Physics . P2 . Body , Phaser . Physics . P2 . Body . DYNAMIC = 1 , Phaser . Physics . P2 . Body . STATIC = 2 , Phaser . Physics . P2 . Body . KINEMATIC = 4 , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "static" , { get : function ( ) { return this . data . type === Phaser . Physics . P2 . Body . STATIC } , set : function ( a ) { a && this . data . type !== Phaser . Physics . P2 . Body . STATIC ? ( this . data . type = Phaser . Physics . P2 . Body . STATIC , this . mass = 0 ) : a || this . data . type !== Phaser . Physics . P2 . Body . STATIC || ( this . data . type = Phaser . Physics . P2 . Body . DYNAMIC , 0 === this . mass && ( this . mass = 1 ) ) } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "dynamic" , { get : function ( ) { return this . data . type === Phaser . Physics . P2 . Body . DYNAMIC } , set : function ( a ) { a && this . data . type !== Phaser . Physics . P2 . Body . DYNAMIC ? ( this . data . type = Phaser . Physics . P2 . Body . DYNAMIC , 0 === this . mass && ( this . mass = 1 ) ) : a || this . data . type !== Phaser . Physics . P2 . Body . DYNAMIC || ( this . data . type = Phaser . Physics . P2 . Body . STATIC , this . mass = 0 ) } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "kinematic" , { get : function ( ) { return this . data . type === Phaser . Physics . P2 . Body . KINEMATIC } , set : function ( a ) { a && this . data . type !== Phaser . Physics . P2 . Body . KINEMATIC ? ( this . data . type = Phaser . Physics . P2 . Body . KINEMATIC , this . mass = 4 ) : a || this . data . type !== Phaser . Physics . P2 . Body . KINEMATIC || ( this . data . type = Phaser . Physics . P2 . Body . STATIC , this . mass = 0 ) } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "allowSleep" , { get : function ( ) { return this . data . allowSleep } , set : function ( a ) { a !== this . data . allowSleep && ( this . data . allowSleep = a ) } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "angle" , { get : function ( ) { return Phaser . Math . wrapAngle ( Phaser . Math . radToDeg ( this . data . angle ) ) } , set : function ( a ) { this . data . angle = Phaser . Math . degToRad ( Phaser . Math . wrapAngle ( a ) ) } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "angularDamping" , { get : function ( ) { return this . data . angularDamping } , set : function ( a ) { this . data . angularDamping = a } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "angularForce" , { get : function ( ) { return this . data . angularForce } , set : function ( a ) { this . data . angularForce = a } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "angularVelocity" , { get : function ( ) { return this . data . angularVelocity } , set : function ( a ) { this . data . angularVelocity = a } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "damping" , { get : function ( ) { return this . data . damping } , set : function ( a ) { this . data . damping = a } } ) , Object . defineProperty ( Phaser . Physics . P2 . Body . prototype , "fixedRotation" , { get : function ( ) { return this . data . fixedRotation } , set : function ( a ) { a !== this . d
2014-02-28 09:30:53 +00:00
//# sourceMappingURL=phaser.map