2014-02-18 03:01:51 +00:00
/*! Phaser v1.2 | (c) 2014 Photon Storm Ltd. */
2014-02-19 05:28:19 +00:00
! function ( a , b ) { "function" == typeof define && define . amd ? define ( b ) : "object" == typeof exports ? module . exports = b ( ) : a . Phaser = b ( ) } ( this , function ( ) { ! function ( a ) { "object" == typeof exports ? module . exports = a ( ) : "function" == typeof define && define . amd ? define ( a ) : "undefined" != typeof window ? window . p2 = a ( ) : "undefined" != typeof global ? self . p2 = a ( ) : "undefined" != typeof self && ( self . p2 = a ( ) ) } ( function ( ) { return function a ( b , c , d ) { function e ( g , h ) { if ( ! c [ g ] ) { if ( ! b [ g ] ) { var i = "function" == typeof require && require ; if ( ! h && i ) return i ( g , ! 0 ) ; if ( f ) return f ( g , ! 0 ) ; throw new Error ( "Cannot find module '" + g + "'" ) } var j = c [ g ] = { exports : { } } ; b [ g ] [ 0 ] . call ( j . exports , function ( a ) { var c = b [ g ] [ 1 ] [ a ] ; return e ( c ? c : a ) } , j , j . exports , a , b , c , d ) } return c [ g ] . exports } for ( var f = "function" == typeof require && require , g = 0 ; g < d . length ; g ++ ) e ( d [ g ] ) ; return e } ( { 1 : [ function ( a , b , c ) { var d = { } , e = new Float32Array ( [ 1 , 0 , 0 , 1 ] ) ; if ( ! f ) var f = 1e-6 ; d . create = function ( ) { return new Float32Array ( e ) } , d . clone = function ( a ) { var b = new Float32Array ( 4 ) ; return b [ 0 ] = a [ 0 ] , b [ 1 ] = a [ 1 ] , b [ 2 ] = a [ 2 ] , b [ 3 ] = a [ 3 ] , b } , d . copy = function ( a , b ) { return a [ 0 ] = b [ 0 ] , a [ 1 ] = b [ 1 ] , a [ 2 ] = b [ 2 ] , a [ 3 ] = b [ 3 ] , a } , d . identity = function ( a ) { return a [ 0 ] = 1 , a [ 1 ] = 0 , a [ 2 ] = 0 , a [ 3 ] = 1 , a } , d . transpose = function ( a , b ) { if ( a === b ) { var c = b [ 1 ] ; a [ 1 ] = b [ 2 ] , a [ 2 ] = c } else a [ 0 ] = b [ 0 ] , a [ 1 ] = b [ 2 ] , a [ 2 ] = b [ 1 ] , a [ 3 ] = b [ 3 ] ; return a } , d . invert = function ( a , b ) { var c = b [ 0 ] , d = b [ 1 ] , e = b [ 2 ] , f = b [ 3 ] , g = c * f - e * d ; return g ? ( g = 1 / g , a [ 0 ] = f * g , a [ 1 ] = - d * g , a [ 2 ] = - e * g , a [ 3 ] = c * g , a ) : null } , d . adjoint = function ( a , b ) { var c = b [ 0 ] ; return a [ 0 ] = b [ 3 ] , a [ 1 ] = - b [ 1 ] , a [ 2 ] = - b [ 2 ] , a [ 3 ] = c , a } , d . determinant = function ( a ) { return a [ 0 ] * a [ 3 ] - a [ 2 ] * a [ 1 ] } , d . multiply = function ( a , b , c ) { var d = b [ 0 ] , e = b [ 1 ] , f = b [ 2 ] , g = b [ 3 ] , h = c [ 0 ] , i = c [ 1 ] , j = c [ 2 ] , k = c [ 3 ] ; return a [ 0 ] = d * h + e * j , a [ 1 ] = d * i + e * k , a [ 2 ] = f * h + g * j , a [ 3 ] = f * i + g * k , a } , d . mul = d . multiply , d . rotate = function ( a , b , c ) { var d = b [ 0 ] , e = b [ 1 ] , f = b [ 2 ] , g = b [ 3 ] , h = Math . sin ( c ) , i = Math . cos ( c ) ; return a [ 0 ] = d * i + e * h , a [ 1 ] = d * - h + e * i , a [ 2 ] = f * i + g * h , a [ 3 ] = f * - h + g * i , a } , d . scale = function ( a , b , c ) { var d = b [ 0 ] , e = b [ 1 ] , f = b [ 2 ] , g = b [ 3 ] , h = c [ 0 ] , i = c [ 1 ] ; return a [ 0 ] = d * h , a [ 1 ] = e * i , a [ 2 ] = f * h , a [ 3 ] = g * i , a } , d . str = function ( a ) { return "mat2(" + a [ 0 ] + ", " + a [ 1 ] + ", " + a [ 2 ] + ", " + a [ 3 ] + ")" } , "undefined" != typeof c && ( c . mat2 = d ) } , { } ] , 2 : [ function ( a , b , c ) { var d = { } ; if ( ! e ) var e = 1e-6 ; d . create = function ( ) { return new Float32Array ( 2 ) } , d . clone = function ( a ) { var b = new Float32Array ( 2 ) ; return b [ 0 ] = a [ 0 ] , b [ 1 ] = a [ 1 ] , b } , d . fromValues = function ( a , b ) { var c = new Float32Array ( 2 ) ; return c [ 0 ] = a , c [ 1 ] = b , c } , d . copy = function ( a , b ) { return a [ 0 ] = b [ 0 ] , a [ 1 ] = b [ 1 ] , a } , d . set = function ( a , b , c ) { return a [ 0 ] = b , a [ 1 ] = c , a } , d . add = function ( a , b , c ) { return a [ 0 ] = b [ 0 ] + c [ 0 ] , a [ 1 ] = b [ 1 ] + c [ 1 ] , a } , d . subtract = function ( a , b , c ) { return a [ 0 ] = b [ 0 ] - c [ 0 ] , a [ 1 ] = b [ 1 ] - c [ 1 ] , a } , d . sub = d . subtract , d . multiply = function ( a , b , c ) { return a [ 0 ] = b [ 0 ] * c [ 0 ] , a [ 1 ] = b [ 1 ] * c [ 1 ] , a } , d . mul = d . multiply , d . divide = function ( a , b , c ) { return a [ 0 ] = b [ 0 ] / c [ 0 ] , a [ 1 ] = b [ 1 ] / c [ 1 ] , a } , d . div = d . divide , d . min = function ( a , b , c ) { return a [ 0 ] = Math . min ( b [ 0 ] , c [ 0 ] ) , a [ 1 ] = Math . min ( b [ 1 ] , c [ 1 ] ) , a } , d . max = function ( a , b , c ) { return a [ 0 ] = Math . max ( b [ 0 ] , c [ 0 ] ) , a [ 1 ] = Math . max ( b [ 1 ] , c [ 1 ] ) , a } , d . scale = function ( a , b , c ) { return a [ 0 ] = b [ 0 ] * c , a [ 1 ] = b [ 1 ] * c , a } , d . distance = function ( a , b ) { var c = b [ 0 ] - a [ 0 ] , d = b [ 1 ] - a [ 1 ] ; return Math . sqrt ( c * c + d * d ) } , d . dist = d . distance , d . squaredDistance = function ( a , b ) { var c = b [ 0 ] - a [ 0 ] , d = b [ 1 ] - a [ 1 ] ; return c * c + d * d } , d . sqrDist = d . squaredDistance , d . length = function ( a ) { var b = a [ 0 ] , c = a [ 1 ] ; return Math . sqrt ( b * b + c * c ) } , d . len = d . length , d . squaredLength = function ( a ) { var b = a [ 0 ] , c = a [ 1 ] ; return b * b + c * c } , d . sqrLen = d . squaredLength , d . negate = function ( a , b ) { return a [ 0 ] = - b [ 0 ] , a [ 1 ] = - b [ 1 ] , a } , d . normalize = function ( a , b ) { var c = b [ 0 ] , d = b [ 1 ] , e = c * c + d * d ; return e > 0 && ( e = 1 / Math . sqrt ( e ) , a [ 0 ] = b [ 0 ] * e , a [ 1 ] = b [ 1 ] * e ) , a } , d . dot = function ( a , b ) { return a [ 0 ] * b [ 0 ] + a [ 1 ] * b [ 1 ] } , d . cross = function ( a , b , c ) { var d = b [ 0 ] * c [ 1 ] - b [ 1 ] * c [ 0 ] ; return a [ 0 ] = a [ 1 ] = 0 , a [ 2 ] = d , a } , d . lerp = function ( a , b , c , d ) { var e = b [ 0 ] , f = b [ 1 ] ; return a [ 0 ] = e + d * ( c [ 0 ] - e ) , a [ 1 ] = f + d * ( c [ 1 ] - f ) , a } , d . transformMat2 = function ( a , b , c ) { var d = b [ 0 ] , e = b [ 1 ] ; return a [ 0 ] = d * c [ 0 ] + e * c [ 1 ] , a [ 1 ] = d * c [ 2 ] + e * c [ 3 ] , a } , d . forEach = function ( ) { var a = new Float32Array ( 2 ) ; return function ( b , c , d , e , f , g ) { var h , i ; for ( c || ( c = 2 ) , d || ( d = 0 ) , i = e ? Math . min ( e * c + d , b . length ) : b . length , h = d ; i > h ; h += c ) a [ 0 ] = b [ h ] , a [ 1 ] = b [ h + 1 ] , f ( a , a , g ) , b [ h ] = a [ 0 ] , b [ h + 1 ] = a [ 1 ] ; return b } } ( ) , d . str = function ( a ) { return "vec2(" + a [ 0 ] + ", " + a [ 1 ] + ")" } , "undefined" != typeof c && ( c . vec2 =
this . children . length = 0 } } , d . prototype . retrieve = function ( a ) { if ( this . nodes . length ) { var b = this . findIndex ( a ) ; return this . nodes [ b ] . retrieve ( a ) } return this . children } , d . prototype . findIndex = function ( a ) { var b = this . bounds , c = a . position [ 0 ] - a . boundingRadius > b . x + b . width / 2 ? ! 1 : ! 0 , e = a . position [ 1 ] - a . boundingRadius > b . y + b . height / 2 ? ! 1 : ! 0 ; a instanceof f && ( c = e = ! 1 ) ; var g = d . TOP _LEFT ; return c ? e || ( g = d . BOTTOM _LEFT ) : g = e ? d . TOP _RIGHT : d . BOTTOM _RIGHT , g } , d . prototype . subdivide = function ( ) { var a = this . depth + 1 , b = this . bounds . x , c = this . bounds . y , e = this . bounds . width / 2 , f = this . bounds . height / 2 , g = b + e , h = c + f ; this . nodes [ d . TOP _LEFT ] = new this . classConstructor ( { x : b , y : c , width : e , height : f } , a ) , this . nodes [ d . TOP _RIGHT ] = new this . classConstructor ( { x : g , y : c , width : e , height : f } , a ) , this . nodes [ d . BOTTOM _LEFT ] = new this . classConstructor ( { x : b , y : h , width : e , height : f } , a ) , this . nodes [ d . BOTTOM _RIGHT ] = new this . classConstructor ( { x : g , y : h , width : e , height : f } , a ) } , d . prototype . clear = function ( ) { this . children . length = 0 ; for ( var a = this . nodes . length , b = 0 ; a > b ; b ++ ) this . nodes [ b ] . clear ( ) ; this . nodes . length = 0 } , e . prototype = new d , e . prototype . classConstructor = e , e . prototype . stuckChildren = null , e . prototype . out = [ ] , e . prototype . insert = function ( a ) { if ( this . nodes . length ) { var b = this . findIndex ( a ) , c = this . nodes [ b ] ; return ! ( a instanceof f ) && a . position [ 0 ] - a . boundingRadius >= c . bounds . x && a . position [ 0 ] + a . boundingRadius <= c . bounds . x + c . bounds . width && a . position [ 1 ] - a . boundingRadius >= c . bounds . y && a . position [ 1 ] + a . boundingRadius <= c . bounds . y + c . bounds . height ? this . nodes [ b ] . insert ( a ) : this . stuckChildren . push ( a ) , void 0 } this . children . push ( a ) ; var d = this . children . length ; if ( this . depth < this . maxDepth && d > this . maxChildren ) { this . subdivide ( ) ; for ( var e = 0 ; d > e ; e ++ ) this . insert ( this . children [ e ] ) ; this . children . length = 0 } } , e . prototype . getChildren = function ( ) { return this . children . concat ( this . stuckChildren ) } , e . prototype . retrieve = function ( a ) { var b = this . out ; if ( b . length = 0 , this . nodes . length ) { var c = this . findIndex ( a ) ; b . push . apply ( b , this . nodes [ c ] . retrieve ( a ) ) } return b . push . apply ( b , this . stuckChildren ) , b . push . apply ( b , this . children ) , b } , e . prototype . clear = function ( ) { this . stuckChildren . length = 0 , this . children . length = 0 ; var a = this . nodes . length ; if ( a ) { for ( var b = 0 ; a > b ; b ++ ) this . nodes [ b ] . clear ( ) ; this . nodes . length = 0 } } } , { "../collision/Broadphase" : 10 , "../shapes/Plane" : 42 } ] , 15 : [ function ( a , b ) { function c ( ) { e . apply ( this ) , this . axisListX = [ ] , this . axisListY = [ ] , this . world = null ; var a = this . axisListX , b = this . axisListY ; this . _addBodyHandler = function ( c ) { a . push ( c . body ) , b . push ( c . body ) } , this . _removeBodyHandler = function ( c ) { var d = a . indexOf ( c . body ) ; - 1 !== d && a . splice ( d , 1 ) , d = b . indexOf ( c . body ) , - 1 !== d && b . splice ( d , 1 ) } } var d = ( a ( "../shapes/Circle" ) , a ( "../shapes/Plane" ) , a ( "../shapes/Shape" ) , a ( "../shapes/Particle" ) , a ( "../utils/Utils" ) ) , e = a ( "../collision/Broadphase" ) ; a ( "../math/vec2" ) , b . exports = c , c . prototype = new e , c . prototype . setWorld = function ( a ) { this . axisListX . length = this . axisListY . length = 0 , d . appendArray ( this . axisListX , a . bodies ) , d . appendArray ( this . axisListY , a . bodies ) , a . off ( "addBody" , this . _addBodyHandler ) . off ( "removeBody" , this . _removeBodyHandler ) , a . on ( "addBody" , this . _addBodyHandler ) . on ( "removeBody" , this . _removeBodyHandler ) , this . world = a } , c . sortAxisListX = function ( a ) { for ( var b = 1 , c = a . length ; c > b ; b ++ ) { for ( var d = a [ b ] , e = b - 1 ; e >= 0 && ! ( a [ e ] . aabb . lowerBound [ 0 ] <= d . aabb . lowerBound [ 0 ] ) ; e -- ) a [ e + 1 ] = a [ e ] ; a [ e + 1 ] = d } return a } , c . sortAxisListY = function ( a ) { for ( var b = 1 , c = a . length ; c > b ; b ++ ) { for ( var d = a [ b ] , e = b - 1 ; e >= 0 && ! ( a [ e ] . aabb . lowerBound [ 1 ] <= d . aabb . lowerBound [ 1 ] ) ; e -- ) a [ e + 1 ] = a [ e ] ; a [ e + 1 ] = d } return a } ; var f = { keys : [ ] } ; c . prototype . getCollisionPairs = function ( ) { var a , b , d = this . axisListX , g = this . axisListY , h = this . result ; for ( this . axisIndex , h . length = 0 , a = 0 ; a !== d . length ; a ++ ) { var i = d [ a ] ; i . aabbNeedsUpdate && i . updateAABB ( ) } for ( c . sortAxisListX ( d ) , c . sortAxisListY ( g ) , a = 0 , N = d . length ; a !== N ; a ++ ) { var j = d [ a ] ; for ( b = a + 1 ; N > b ; b ++ ) { var k = d [ b ] ; if ( ! c . checkBounds ( j , k , 0 ) ) break ; var l = j . id < k . id ? j . id + " " + k . id : k . id + " " + j . id ; f [ l ] = ! 0 , f . keys . push ( l ) } } for ( a = 0 , N = g . length ; a !== N ; a ++ ) { var j = g [ a ] ; for ( b = a + 1 ; N > b ; b ++ ) { var k = g [ b ] ; if ( ! c . checkBounds ( j , k , 1 ) ) break ; var l = j . id < k . id ? j . id + " " + k . id : k . id + " " + j . id ; f [ l ] && e . boundingRadiusCheck ( j , k ) && h . push ( j , k ) } } var m = f . keys ; for ( a = 0 , N = m . length ; a !== N ; a ++ ) delete f [ m [ a ] ] ; return
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 , 0 ) , 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" : 33 , "./Shape" : 44 } ] , 38 : [ function ( a , b ) { function c ( a ) { this . radius = a || 1 , d . call ( this , d . CIRCLE ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . computeMomentOfInertia = function ( a ) { var b = this . radius ; return a * b * b / 2 } , c . prototype . updateBoundingRadius = function ( ) { this . boundingRadius = this . radius } , c . prototype . updateArea = function ( ) { this . area = Math . PI * this . radius * this . radius } , c . prototype . computeAABB = function ( a , b ) { var c = this . radius ; e . set ( a . upperBound , c , c ) , e . set ( a . lowerBound , - c , - c ) , b && ( e . add ( a . lowerBound , a . lowerBound , b ) , e . add ( a . upperBound , a . upperBound , b ) ) } } , { "../math/vec2" : 33 , "./Shape" : 44 } ] , 39 : [ function ( a , b ) { function c ( a ) { this . vertices = a || [ ] ; for ( var b = 0 ; b < this . vertices . length ; b ++ ) { var c = e . fromValues ( ) ; e . copy ( c , this . vertices [ b ] ) , this . vertices [ b ] = c } if ( this . centerOfMass = e . fromValues ( 0 , 0 ) , this . triangles = [ ] , this . vertices . length && ( this . updateTriangles ( ) , this . updateCenterOfMass ( ) ) , this . boundingRadius = 0 , d . call ( this , d . CONVEX ) , this . updateBoundingRadius ( ) , this . updateArea ( ) , this . area < 0 ) throw new Error ( "Convex vertices must be given in conter-clockwise winding." ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) , f = a ( "../math/polyk" ) ; a ( "poly-decomp" ) , b . exports = c , c . prototype = new d , c . prototype . updateTriangles = function ( ) { this . triangles . length = 0 ; for ( var a = [ ] , b = 0 ; b < this . vertices . length ; b ++ ) { var c = this . vertices [ b ] ; a . push ( c [ 0 ] , c [ 1 ] ) } for ( var d = f . Triangulate ( a ) , b = 0 ; b < d . length ; b += 3 ) { var e = d [ b ] , g = d [ b + 1 ] , h = d [ b + 2 ] ; this . triangles . push ( [ e , g , h ] ) } } ; { var g = e . create ( ) , h = e . create ( ) , i = e . create ( ) , j = e . create ( ) , k = e . create ( ) ; e . create ( ) , e . create ( ) , e . create ( ) , e . create ( ) } c . prototype . updateCenterOfMass = function ( ) { var a = this . triangles , b = this . vertices , d = this . centerOfMass , f = g , l = i , m = j , n = k , o = h ; e . set ( d , 0 , 0 ) ; for ( var p = 0 , q = 0 ; q !== a . length ; q ++ ) { var r = a [ q ] , l = b [ r [ 0 ] ] , m = b [ r [ 1 ] ] , n = b [ r [ 2 ] ] ; e . centroid ( f , l , m , n ) ; var s = c . triangleArea ( l , m , n ) ; p += s , e . scale ( o , f , s ) , e . add ( d , d , o ) } e . scale ( d , d , 1 / p ) } , c . prototype . computeMomentOfInertia = function ( a ) { for ( var b = 0 , c = 0 , d = this . vertices . length , f = d - 1 , g = 0 ; d > g ; f = g , g ++ ) { var h = this . vertices [ f ] , i = this . vertices [ g ] , j = Math . abs ( e . crossLength ( h , i ) ) , k = e . dot ( i , i ) + e . dot ( i , h ) + e . dot ( h , h ) ; b += j * k , c += j } return a / 6 * ( b / c ) } , c . prototype . updateBoundingRadius = function ( ) { for ( var a = this . vertices , b = 0 , c = 0 ; c !== a . length ; c ++ ) { var d = e . squaredLength ( a [ c ] ) ; d > b && ( b = d ) } this . boundingRadius = Math . sqrt ( b ) } , c . triangleArea = function ( a , b , c ) { return . 5 * ( ( b [ 0 ] - a [ 0 ] ) * ( c [ 1 ] - a [ 1 ] ) - ( c [ 0 ] - a [ 0 ] ) * ( b [ 1 ] - a [ 1 ] ) ) } , c . prototype . updateArea = function ( ) { this . updateTriangles ( ) , this . area = 0 ; for ( var a = this . triangles , b = this . vertices , d = 0 ; d !== a . length ; d ++ ) { var e = a [ d ] , f = b [ e [ 0 ] ] , g = b [ e [ 1 ] ] , h = b [ e [ 2 ] ] , i = c . triangleArea ( f , g , h ) ; this . area += i } } , c . prototype . computeAABB = function ( a , b , c ) { a . setFromPoints ( this . vertices , b , c ) } } , { "../math/polyk" : 32 , "../math/vec2" : 33 , "./Shape" : 44 , "poly-decomp" : 7 } ] , 40 : [ function ( a , b ) { function c ( a ) { this . length = a , d . call ( this , d . LINE ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . computeMomentOfInertia = function ( a ) { return a * Math . pow ( this . length , 2 ) / 12 } , c . prototype . updateBoundingRadius = function ( ) { this . boundingRadius = this . length / 2 } ; var f = [ e . create ( ) , e . create ( ) ] ; c . prototype . computeAABB = function ( a , b , c ) { var d = this . length ; e . set ( f [ 0 ] , - d / 2 , 0 ) , e . set ( f [ 1 ] , d / 2 , 0 ) , a . setFromPoints ( f , b , c ) } } , { "../math/vec2" : 33 , "./Shape" : 44 } ] , 41 : [ function ( a , b ) { function c ( ) { d . call ( this , d . PARTICLE ) } var d = a ( "./Shape" ) , e = a ( "../math/vec2" ) ; b . exports = c , c . prototype = new d , c . prototype . computeMomentOfInertia = function ( ) { return 0 } , c . prototype . updateBoundingRadiu
} , set : function ( a ) { a > 0 && ( this . _diameter = a , this . _radius = . 5 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "radius" , { get : function ( ) { return this . _radius } , set : function ( a ) { a > 0 && ( this . _radius = a , this . _diameter = 2 * a ) } } ) , Object . defineProperty ( b . Circle . prototype , "left" , { get : function ( ) { return this . x - this . _radius } , set : function ( a ) { a > this . x ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = this . x - a } } ) , Object . defineProperty ( b . Circle . prototype , "right" , { get : function ( ) { return this . x + this . _radius } , set : function ( a ) { a < this . x ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = a - this . x } } ) , Object . defineProperty ( b . Circle . prototype , "top" , { get : function ( ) { return this . y - this . _radius } , set : function ( a ) { a > this . y ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = this . y - a } } ) , Object . defineProperty ( b . Circle . prototype , "bottom" , { get : function ( ) { return this . y + this . _radius } , set : function ( a ) { a < this . y ? ( this . _radius = 0 , this . _diameter = 0 ) : this . radius = a - this . y } } ) , Object . defineProperty ( b . Circle . prototype , "area" , { get : function ( ) { return this . _radius > 0 ? Math . PI * this . _radius * this . _radius : 0 } } ) , Object . defineProperty ( b . Circle . prototype , "empty" , { get : function ( ) { return 0 === this . _diameter } , set : function ( a ) { a === ! 0 && this . setTo ( 0 , 0 , 0 ) } } ) , b . Circle . contains = function ( a , b , c ) { if ( a . radius > 0 && b >= a . left && b <= a . right && c >= a . top && c <= a . bottom ) { var d = ( a . x - b ) * ( a . x - b ) , e = ( a . y - c ) * ( a . y - c ) ; return d + e <= a . radius * a . radius } return ! 1 } , b . Circle . equals = function ( a , b ) { return a . x == b . x && a . y == b . y && a . diameter == b . diameter } , b . Circle . intersects = function ( a , c ) { return b . Math . distance ( a . x , a . y , c . x , c . y ) <= a . radius + c . radius } , b . Circle . circumferencePoint = function ( a , c , d , e ) { return "undefined" == typeof d && ( d = ! 1 ) , "undefined" == typeof e && ( e = new b . Point ) , d === ! 0 && ( c = b . Math . radToDeg ( c ) ) , e . x = a . x + a . radius * Math . cos ( c ) , e . y = a . y + a . radius * Math . sin ( c ) , e } , b . Circle . intersectsRectangle = function ( a , b ) { var c = Math . abs ( a . x - b . x - b . halfWidth ) , d = b . halfWidth + a . radius ; if ( c > d ) return ! 1 ; var e = Math . abs ( a . y - b . y - b . halfHeight ) , f = b . halfHeight + a . radius ; if ( e > f ) return ! 1 ; if ( c <= b . halfWidth || e <= b . halfHeight ) return ! 0 ; var g = c - b . halfWidth , h = e - b . halfHeight , i = g * g , j = h * h , k = a . radius * a . radius ; return k >= i + j } , a . Circle = b . Circle , b . Point = function ( a , b ) { a = a || 0 , b = b || 0 , this . x = a , this . y = b } , b . Point . prototype = { copyFrom : function ( a ) { return this . setTo ( a . x , a . y ) } , invert : function ( ) { return this . setTo ( this . y , this . x ) } , setTo : function ( a , b ) { return this . x = a || 0 , this . y = b || ( 0 !== b ? this . x : 0 ) , this } , set : function ( a , b ) { return this . x = a || 0 , this . y = b || ( 0 !== b ? this . x : 0 ) , this } , add : function ( a , b ) { return this . x += a , this . y += b , this } , subtract : function ( a , b ) { return this . x -= a , this . y -= b , this } , multiply : function ( a , b ) { return this . x *= a , this . y *= b , this } , divide : function ( a , b ) { return this . x /= a , this . y /= b , this } , clampX : function ( a , c ) { return this . x = b . Math . clamp ( this . x , a , c ) , this } , clampY : function ( a , c ) { return this . y = b . Math . clamp ( this . y , a , c ) , this } , clamp : function ( a , c ) { return this . x = b . Math . clamp ( this . x , a , c ) , this . y = b . Math . clamp ( this . y , a , c ) , this } , clone : function ( a ) { return "undefined" == typeof a ? a = new b . Point ( this . x , this . y ) : a . setTo ( this . x , this . y ) , a } , copyTo : function ( a ) { return a . x = this . x , a . y = this . y , a } , distance : function ( a , c ) { return b . Point . distance ( this , a , c ) } , equals : function ( a ) { return a . x == this . x && a . y == this . y } , rotate : function ( a , c , d , e , f ) { return b . Point . rotate ( this , a , c , d , e , f ) } , getMagnitude : function ( ) { return Math . sqrt ( this . x * this . x + this . y * this . y ) } , setMagnitude : function ( a ) { return this . normalize ( ) . multiply ( a , a ) } , normalize : function ( ) { if ( ! this . isZero ( ) ) { var a = this . getMagnitude ( ) ; this . x /= a , this . y /= a } return this } , isZero : function ( ) { return 0 === this . x && 0 === this . y } , toString : function ( ) { return "[{Point (x=" + this . x + " y=" + this . y + ")}]" } } , b . Point . prototype . constructor = b . Point , b . Point . add = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Point ) , d . x = a . x + c . x , d . y = a . y + c . y , d } , b . Point . subtract = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Point ) , d . x = a . x - c . x , d . y = a . y - c . y , d } , b . Point . multiply = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Point ) , d . x = a . x * c . x , d . y = a . y * c . y , d } , b . Point . divide = function ( a , c , d ) { return "undefined" == typeof d && ( d = new b . Point ) , d . x = a . x / c . x , d . y = a . y / c . y , d } , b . Point . equals = function ( a , b ) { return a . x == b . x && a . y == b . y } , b . Point . distance = function ( a , c , d ) { return "undefined" == typeof d && ( d = ! 1 )
for ( j = 0 ; p > j ; j ++ ) { var r = o > j ? this . children [ j ] : this . _pool . pop ( ) ; r ? r . setTexture ( e [ j ] . texture ) : r = new a . Sprite ( e [ j ] . texture ) , r . position . x = ( e [ j ] . position . x + m [ e [ j ] . line ] ) * i , r . position . y = e [ j ] . position . y * i , r . scale . x = r . scale . y = i , r . tint = q , r . parent || this . addChild ( r ) } for ( ; this . children . length > p ; ) { var s = this . getChildAt ( this . children . length - 1 ) ; this . _pool . push ( s ) , this . removeChild ( s ) } this . textWidth = f * i , this . textHeight = ( c . y + b . lineHeight ) * i } , a . BitmapText . prototype . updateTransform = function ( ) { this . dirty && ( this . updateText ( ) , this . dirty = ! 1 ) , a . DisplayObjectContainer . prototype . updateTransform . call ( this ) } , a . BitmapText . fonts = { } , a . Stage = function ( b ) { a . DisplayObjectContainer . call ( this ) , this . worldTransform = new a . Matrix , this . interactive = ! 0 , this . interactionManager = new a . InteractionManager ( this ) , this . dirty = ! 0 , this . stage = this , this . stage . hitArea = new a . Rectangle ( 0 , 0 , 1e5 , 1e5 ) , this . setBackgroundColor ( b ) } , a . Stage . prototype = Object . create ( a . DisplayObjectContainer . prototype ) , a . Stage . prototype . constructor = a . Stage , a . Stage . prototype . setInteractionDelegate = function ( a ) { this . interactionManager . setTargetDomElement ( a ) } , a . Stage . prototype . updateTransform = function ( ) { this . worldAlpha = 1 ; for ( var a = 0 , b = this . children . length ; b > a ; a ++ ) this . children [ a ] . updateTransform ( ) ; this . dirty && ( this . dirty = ! 1 , this . interactionManager . dirty = ! 0 ) , this . interactive && this . interactionManager . update ( ) } , a . Stage . prototype . setBackgroundColor = function ( b ) { this . backgroundColor = b || 0 , this . backgroundColorSplit = a . hex2rgb ( this . backgroundColor ) ; var c = this . backgroundColor . toString ( 16 ) ; c = "000000" . substr ( 0 , 6 - c . length ) + c , this . backgroundColorString = "#" + c } , a . Stage . prototype . getMousePosition = function ( ) { return this . interactionManager . mouse . global } , a . EventTarget = function ( ) { var a = { } ; this . addEventListener = this . on = function ( b , c ) { void 0 === a [ b ] && ( a [ b ] = [ ] ) , - 1 === a [ b ] . indexOf ( c ) && a [ b ] . push ( c ) } , this . dispatchEvent = this . emit = function ( b ) { if ( a [ b . type ] && a [ b . type ] . length ) for ( var c = 0 , d = a [ b . type ] . length ; d > c ; c ++ ) a [ b . type ] [ c ] ( b ) } , this . removeEventListener = this . off = function ( b , c ) { var d = a [ b ] . indexOf ( c ) ; - 1 !== d && a [ b ] . splice ( d , 1 ) } , this . removeAllEventListeners = function ( b ) { var c = a [ b ] ; c && ( c . length = 0 ) } } , a . PolyK = { } , a . PolyK . Triangulate = function ( b ) { var c = ! 0 , d = b . length >> 1 ; if ( 3 > d ) return [ ] ; for ( var e = [ ] , f = [ ] , g = 0 ; d > g ; g ++ ) f . push ( g ) ; g = 0 ; for ( var h = d ; h > 3 ; ) { var i = f [ ( g + 0 ) % h ] , j = f [ ( g + 1 ) % h ] , k = f [ ( g + 2 ) % h ] , l = b [ 2 * i ] , m = b [ 2 * i + 1 ] , n = b [ 2 * j ] , o = b [ 2 * j + 1 ] , p = b [ 2 * k ] , q = b [ 2 * k + 1 ] , r = ! 1 ; if ( a . PolyK . _convex ( l , m , n , o , p , q , c ) ) { r = ! 0 ; for ( var s = 0 ; h > s ; s ++ ) { var t = f [ s ] ; if ( t !== i && t !== j && t !== k && a . PolyK . _PointInTriangle ( b [ 2 * t ] , b [ 2 * t + 1 ] , l , m , n , o , p , q ) ) { r = ! 1 ; break } } } if ( r ) e . push ( i , j , k ) , f . splice ( ( g + 1 ) % h , 1 ) , h -- , g = 0 ; 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 } , a . 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 } , a . PolyK . _convex = function ( a , b , c , d , e , f , g ) { return ( b - d ) * ( e - c ) + ( c - a ) * ( f - d ) >= 0 === g } , a . initDefaultShaders = function ( ) { } , a . CompileVertexShader = function ( b , c ) { return a . _CompileShader ( b , c , b . VERTEX _SHADER ) } , a . CompileFragmentShader = function ( b , c ) { return a . _CompileShader ( b , c , b . FRAGMENT _SHADER ) } , a . _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 ) } , a . compileProgram = function ( b , c , d ) { var e = a . CompileFragmentShader ( b , d ) , f = a . CompileVertexShader ( b , c ) , g = b . createProgram ( ) ; return b . attachShader ( g , f ) , b . attachShader ( g , e ) , b . linkProgram ( g ) , b . getProgramParameter ( g , b . LINK _STATUS ) || window . console . log ( "Could not initialise shaders" ) , g } , a . PixiShader = function ( a ) { 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 . attributes = [ ] , this . init ( ) } , a . PixiShader . prototype . init = function ( ) { var b = this . gl , c =
} , a . WebGLSpriteBatch . prototype . start = function ( ) { var b = this . gl ; b . activeTexture ( b . TEXTURE0 ) , b . bindBuffer ( b . ARRAY _BUFFER , this . vertexBuffer ) , b . bindBuffer ( b . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) ; var c = this . renderSession . projection ; b . uniform2f ( this . shader . projectionVector , c . x , c . y ) ; var d = 4 * this . vertSize ; b . vertexAttribPointer ( this . shader . aVertexPosition , 2 , b . FLOAT , ! 1 , d , 0 ) , b . vertexAttribPointer ( this . shader . aTextureCoord , 2 , b . FLOAT , ! 1 , d , 8 ) , b . vertexAttribPointer ( this . shader . colorAttribute , 2 , b . FLOAT , ! 1 , d , 16 ) , this . currentBlendMode !== a . blendModes . NORMAL && this . setBlendMode ( a . blendModes . NORMAL ) } , a . WebGLSpriteBatch . prototype . setBlendMode = function ( b ) { this . flush ( ) , this . currentBlendMode = b ; var c = a . blendModesWebGL [ this . currentBlendMode ] ; this . gl . blendFunc ( c [ 0 ] , c [ 1 ] ) } , a . WebGLSpriteBatch . prototype . destroy = function ( ) { this . vertices = null , this . indices = null , this . gl . deleteBuffer ( this . vertexBuffer ) , this . gl . deleteBuffer ( this . indexBuffer ) , this . currentBaseTexture = null , this . gl = null } , a . WebGLFastSpriteBatch = function ( a ) { this . vertSize = 10 , this . maxSize = 6e3 , this . size = this . maxSize ; var b = 4 * this . size * this . vertSize , c = 6 * this . maxSize ; this . vertices = new Float32Array ( b ) , this . indices = new Uint16Array ( c ) , this . vertexBuffer = null , this . indexBuffer = null , this . lastIndexCount = 0 ; for ( var d = 0 , e = 0 ; c > d ; d += 6 , e += 4 ) this . indices [ d + 0 ] = e + 0 , this . indices [ d + 1 ] = e + 1 , this . indices [ d + 2 ] = e + 2 , this . indices [ d + 3 ] = e + 0 , this . indices [ d + 4 ] = e + 2 , this . indices [ d + 5 ] = e + 3 ; this . drawing = ! 1 , this . currentBatchSize = 0 , this . currentBaseTexture = null , this . currentBlendMode = 0 , this . renderSession = null , this . shader = null , this . matrix = null , this . setContext ( a ) } , a . WebGLFastSpriteBatch . prototype . setContext = function ( a ) { this . gl = a , this . vertexBuffer = a . createBuffer ( ) , this . indexBuffer = a . createBuffer ( ) , a . bindBuffer ( a . ELEMENT _ARRAY _BUFFER , this . indexBuffer ) , a . bufferData ( a . ELEMENT _ARRAY _BUFFER , this . indices , a . STATIC _DRAW ) , a . bindBuffer ( a . ARRAY _BUFFER , this . vertexBuffer ) , a . bufferData ( a . ARRAY _BUFFER , this . vertices , a . DYNAMIC _DRAW ) , this . currentBlendMode = 99999 } , a . WebGLFastSpriteBatch . prototype . begin = function ( a , b ) { this . renderSession = b , this . shader = this . renderSession . shaderManager . fastShader , this . matrix = a . worldTransform . toArray ( ! 0 ) , this . start ( ) } , a . WebGLFastSpriteBatch . prototype . end = function ( ) { this . flush ( ) } , a . WebGLFastSpriteBatch . prototype . render = function ( a ) { var b = a . children , c = b [ 0 ] ; if ( c . texture . _uvs ) { this . currentBaseTexture = c . texture . baseTexture , c . blendMode !== this . currentBlendMode && this . setBlendMode ( c . blendMode ) ; for ( var d = 0 , e = b . length ; e > d ; d ++ ) this . renderSprite ( b [ d ] ) ; this . flush ( ) } } , a . WebGLFastSpriteBatch . prototype . renderSprite = function ( a ) { if ( a . texture . baseTexture === this . currentBaseTexture || ( this . flush ( ) , this . currentBaseTexture = a . texture . baseTexture , a . texture . _uvs ) ) { var b , c , d , e , f , g , h , i , j = this . vertices ; if ( b = a . texture . _uvs , c = a . texture . frame . width , d = a . texture . frame . height , a . texture . trim ) { var k = a . texture . trim ; f = k . x - a . anchor . x * k . width , e = f + a . texture . frame . width , h = k . y - a . anchor . y * k . height , g = h + a . texture . frame . height } else e = a . texture . frame . width * ( 1 - a . anchor . x ) , f = a . texture . frame . width * - a . anchor . x , g = a . texture . frame . height * ( 1 - a . anchor . y ) , h = a . texture . frame . height * - a . anchor . y ; i = 4 * this . currentBatchSize * this . vertSize , j [ i ++ ] = f , j [ i ++ ] = h , j [ i ++ ] = a . position . x , j [ i ++ ] = a . position . y , j [ i ++ ] = a . scale . x , j [ i ++ ] = a . scale . y , j [ i ++ ] = a . rotation , j [ i ++ ] = b . x0 , j [ i ++ ] = b . y1 , j [ i ++ ] = a . alpha , j [ i ++ ] = e , j [ i ++ ] = h , j [ i ++ ] = a . position . x , j [ i ++ ] = a . position . y , j [ i ++ ] = a . scale . x , j [ i ++ ] = a . scale . y , j [ i ++ ] = a . rotation , j [ i ++ ] = b . x1 , j [ i ++ ] = b . y1 , j [ i ++ ] = a . alpha , j [ i ++ ] = e , j [ i ++ ] = g , j [ i ++ ] = a . position . x , j [ i ++ ] = a . position . y , j [ i ++ ] = a . scale . x , j [ i ++ ] = a . scale . y , j [ i ++ ] = a . rotation , j [ i ++ ] = b . x2 , j [ i ++ ] = b . y2 , j [ i ++ ] = a . alpha , j [ i ++ ] = f , j [ i ++ ] = g , j [ i ++ ] = a . position . x , j [ i ++ ] = a . position . y , j [ i ++ ] = a . scale . x , j [ i ++ ] = a . scale . y , j [ i ++ ] = a . rotation , j [ i ++ ] = b . x3 , j [ i ++ ] = b . y3 , j [ i ++ ] = a . alpha , this . currentBatchSize ++ , this . currentBatchSize >= this . size && this . flush ( ) } } , a . WebGLFastSpriteBatch . prototype . flush = function ( ) { if ( 0 !== this . currentBatchSize ) { var b = this . gl ; if ( this . currentBaseTexture . _glTextures [ b . id ] || a . createWebGLTexture ( this . currentBaseTexture , b ) , b . bindTexture ( b . TEXTURE _2D , this . currentBaseTexture . _glTextures [ b . id ] ) , this . currentBatchSize > . 5 * this . size ) b . bufferSubData ( b . ARRA
var e = this . tilePosition , f = this . tileScale ; e . x %= this . tilingTexture . baseTexture . width , e . y %= this . tilingTexture . baseTexture . height , c . scale ( f . x , f . y ) , c . translate ( e . x , e . y ) , c . fillStyle = this . _ _tilePattern , c . fillRect ( - e . x , - e . y , this . width / f . x , this . height / f . y ) , c . scale ( 1 / f . x , 1 / f . y ) , c . translate ( - e . x , - e . y ) , c . closePath ( ) , this . _mask && b . maskManager . popMask ( b . context ) } } , a . TilingSprite . prototype . getBounds = function ( ) { var a = this . _width , b = this . _height , c = a * ( 1 - this . anchor . x ) , d = a * - this . anchor . x , e = b * ( 1 - this . anchor . y ) , f = b * - this . anchor . y , g = this . worldTransform , h = g . a , i = g . c , j = g . b , k = g . d , l = g . tx , m = g . ty , n = h * d + j * f + l , o = k * f + i * d + m , p = h * c + j * f + l , q = k * f + i * c + m , r = h * c + j * e + l , s = k * e + i * c + m , t = h * d + j * e + l , u = k * e + i * d + m , v = - 1 / 0 , w = - 1 / 0 , x = 1 / 0 , y = 1 / 0 ; x = x > n ? n : x , x = x > p ? p : x , x = x > r ? r : x , x = x > t ? t : x , y = y > o ? o : y , y = y > q ? q : y , y = y > s ? s : y , y = y > u ? u : y , v = n > v ? n : v , v = p > v ? p : v , v = r > v ? r : v , v = t > v ? t : v , w = o > w ? o : w , w = q > w ? q : w , w = s > w ? s : w , w = u > w ? u : w ; var z = this . _bounds ; return z . x = x , z . width = v - x , z . y = y , z . height = w - y , this . _currentBounds = z , z } , a . TilingSprite . prototype . generateTilingTexture = function ( b ) { var c = this . texture ; if ( c . baseTexture . hasLoaded ) { var d , e , f = c . baseTexture , g = c . frame , h = g . width !== f . width || g . height !== f . height , i = ! 1 ; if ( b ? ( d = a . getNextPowerOfTwo ( g . width ) , e = a . getNextPowerOfTwo ( g . height ) , g . width !== d && g . height !== e && ( i = ! 0 ) ) : h && ( c . trim ? ( d = c . trim . width , e = c . trim . height ) : ( d = g . width , e = g . height ) , i = ! 0 ) , i ) { var j ; this . tilingTexture && this . tilingTexture . isTiling ? ( j = this . tilingTexture . canvasBuffer , j . resize ( d , e ) , this . tilingTexture . baseTexture . width = d , this . tilingTexture . baseTexture . height = e , this . tilingTexture . needsUpdate = ! 0 ) : ( j = new a . CanvasBuffer ( d , e ) , this . tilingTexture = a . Texture . fromCanvas ( j . canvas ) , this . tilingTexture . canvasBuffer = j , this . tilingTexture . isTiling = ! 0 ) , j . context . drawImage ( c . baseTexture . source , g . x , g . y , g . width , g . height , 0 , 0 , d , e ) , this . tileScaleOffset . x = g . width / d , this . tileScaleOffset . y = g . height / e } else this . tilingTexture && this . tilingTexture . isTiling && this . tilingTexture . destroy ( ! 0 ) , this . tileScaleOffset . x = 1 , this . tileScaleOffset . y = 1 , this . tilingTexture = c ; this . refreshTexture = ! 1 , this . tilingTexture . baseTexture . _powerOf2 = ! 0 } } , a . BaseTextureCache = { } , a . texturesToUpdate = [ ] , a . texturesToDestroy = [ ] , a . BaseTextureCacheIdGenerator = 0 , a . BaseTexture = function ( b , c ) { if ( a . EventTarget . call ( this ) , this . width = 100 , this . height = 100 , this . scaleMode = c || a . scaleModes . DEFAULT , this . hasLoaded = ! 1 , this . source = b , this . id = a . BaseTextureCacheIdGenerator ++ , this . _glTextures = [ ] , b ) { if ( this . source . complete || this . source . getContext ) this . hasLoaded = ! 0 , this . width = this . source . width , this . height = this . source . height , a . texturesToUpdate . push ( this ) ; else { var d = this ; this . source . onload = function ( ) { d . hasLoaded = ! 0 , d . width = d . source . width , d . height = d . source . height , a . texturesToUpdate . push ( d ) , d . dispatchEvent ( { type : "loaded" , content : d } ) } } this . imageUrl = null , this . _powerOf2 = ! 1 } } , a . BaseTexture . prototype . constructor = a . BaseTexture , a . BaseTexture . prototype . destroy = function ( ) { this . imageUrl && ( delete a . BaseTextureCache [ this . imageUrl ] , this . imageUrl = null , this . source . src = null ) , this . source = null , a . texturesToDestroy . push ( this ) } , a . BaseTexture . prototype . updateSourceImage = function ( a ) { this . hasLoaded = ! 1 , this . source . src = null , this . source . src = a } , a . BaseTexture . fromImage = function ( b , c , d ) { var e = a . BaseTextureCache [ b ] ; if ( c = ! c , ! e ) { var f = new Image ; c && ( f . crossOrigin = "" ) , f . src = b , e = new a . BaseTexture ( f , d ) , e . imageUrl = b , a . BaseTextureCache [ b ] = e } return e } , a . BaseTexture . fromCanvas = function ( b , c ) { b . _pixiId || ( b . _pixiId = "canvas_" + a . TextureCacheIdGenerator ++ ) ; var d = a . BaseTextureCache [ b . _pixiId ] ; return d || ( d = new a . BaseTexture ( b , c ) , a . BaseTextureCache [ b . _pixiId ] = d ) , d } , a . TextureCache = { } , a . FrameCache = { } , a . TextureCacheIdGenerator = 0 , a . Texture = function ( b , c ) { if ( a . EventTarget . call ( this ) , c || ( this . noFrame = ! 0 , c = new a . Rectangle ( 0 , 0 , 1 , 1 ) ) , b instanceof a . Texture && ( b = b . baseTexture ) , this . baseTexture = b , this . frame = c , this . trim = null , this . scope = this , this . _uvs = null , b . hasLoaded ) this . noFrame && ( c = new a . Rectangle ( 0 , 0 , b . width , b . height ) ) , this . setFrame ( c ) ; else { var d = this ; b . addEventListener ( "loaded" , function ( ) { d . onBaseTextureLoaded ( ) } ) } } , a . Texture . prototype . constructor = a . Texture , a . Texture . prototype . onBaseTextureLoaded = function ( ) { var b = this . baseTexture ; b . removeEventListener ( "loaded" , this . onL
} , b . Group . prototype . callbackFromArray = function ( a , b , c ) { if ( 1 == c ) { if ( a [ b [ 0 ] ] ) return a [ b [ 0 ] ] } else if ( 2 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] } else if ( 3 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] } else if ( 4 == c ) { if ( a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] ) return a [ b [ 0 ] ] [ b [ 1 ] ] [ b [ 2 ] ] [ b [ 3 ] ] } else if ( a [ b ] ) return a [ b ] ; return ! 1 } , b . Group . prototype . callAll = function ( a , b ) { if ( "undefined" != typeof a ) { a = a . split ( "." ) ; var c = a . length ; if ( "undefined" == typeof b ) b = null ; else if ( "string" == typeof b ) { b = b . split ( "." ) ; var d = b . length } for ( var e = Array . prototype . splice . call ( arguments , 2 ) , f = null , g = null , h = 0 , i = this . children . length ; i > h ; h ++ ) f = this . callbackFromArray ( this . children [ h ] , a , c ) , b && f ? ( g = this . callbackFromArray ( this . children [ h ] , b , d ) , f && f . apply ( g , e ) ) : f && f . apply ( this . children [ h ] , e ) } } , b . Group . prototype . preUpdate = function ( ) { if ( ! this . exists || ! this . parent . exists ) return this . renderOrderID = - 1 , ! 1 ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] . preUpdate ( ) ; return ! 0 } , b . Group . prototype . update = function ( ) { for ( var a = this . children . length ; a -- ; ) this . children [ a ] . update ( ) } , b . Group . prototype . postUpdate = function ( ) { 1 === this . _cache [ 7 ] && ( this . x = this . game . camera . view . x + this . cameraOffset . x , this . y = this . game . camera . view . y + this . cameraOffset . y ) ; for ( var a = this . children . length ; a -- ; ) this . children [ a ] . postUpdate ( ) } , b . Group . prototype . forEach = function ( a , b , c ) { "undefined" == typeof c && ( c = ! 1 ) ; var d = Array . prototype . splice . call ( arguments , 3 ) ; d . unshift ( null ) ; for ( var e = 0 , f = this . children . length ; f > e ; e ++ ) ( ! c || c && this . children [ e ] . exists ) && ( d [ 0 ] = this . children [ e ] , a . apply ( b , d ) ) } , b . Group . prototype . forEachExists = function ( a , c ) { var d = Array . prototype . splice . call ( arguments , 2 ) ; d . unshift ( null ) , this . iterate ( "exists" , ! 0 , b . Group . RETURN _TOTAL , a , c , d ) } , b . Group . prototype . forEachAlive = function ( a , c ) { var d = Array . prototype . splice . call ( arguments , 2 ) ; d . unshift ( null ) , this . iterate ( "alive" , ! 0 , b . Group . RETURN _TOTAL , a , c , d ) } , b . Group . prototype . forEachDead = function ( a , c ) { var d = Array . prototype . splice . call ( arguments , 2 ) ; d . unshift ( null ) , this . iterate ( "alive" , ! 1 , b . Group . RETURN _TOTAL , a , c , d ) } , b . Group . prototype . sort = function ( a , c ) { "undefined" == typeof a && ( a = "y" ) , "undefined" == typeof c && ( c = b . Group . SORT _ASCENDING ) } , b . Group . prototype . sortHandler = function ( ) { } , b . Group . prototype . iterate = function ( a , c , d , e , f , g ) { if ( d === b . Group . RETURN _TOTAL && 0 === this . children . length ) return 0 ; "undefined" == typeof e && ( e = ! 1 ) ; for ( var h = 0 , i = 0 , j = this . children . length ; j > i ; i ++ ) if ( this . children [ i ] [ a ] === c && ( h ++ , e && ( g [ 0 ] = this . children [ i ] , e . apply ( f , g ) ) , d === b . Group . RETURN _CHILD ) ) return this . children [ i ] ; return d === b . Group . RETURN _TOTAL ? h : d === b . Group . RETURN _CHILD ? null : void 0 } , b . Group . prototype . getFirstExists = function ( a ) { return "boolean" != typeof a && ( a = ! 0 ) , this . iterate ( "exists" , a , b . Group . RETURN _CHILD ) } , b . Group . prototype . getFirstAlive = function ( ) { return this . iterate ( "alive" , ! 0 , b . Group . RETURN _CHILD ) } , b . Group . prototype . getFirstDead = function ( ) { return this . iterate ( "alive" , ! 1 , b . Group . RETURN _CHILD ) } , b . Group . prototype . countLiving = function ( ) { return this . iterate ( "alive" , ! 0 , b . Group . RETURN _TOTAL ) } , b . Group . prototype . countDead = function ( ) { return this . iterate ( "alive" , ! 1 , b . Group . RETURN _TOTAL ) } , b . Group . prototype . getRandom = function ( a , b ) { return 0 === this . children . length ? null : ( a = a || 0 , b = b || this . children . length , this . game . math . getRandom ( this . children , a , b ) ) } , b . Group . prototype . remove = function ( a ) { return 0 !== this . children . length ? ( a . events && a . events . onRemovedFromGroup . dispatch ( a , this ) , this . removeChild ( a ) , this . cursor === a && this . next ( ) , ! 0 ) : void 0 } , b . Group . prototype . removeAll = function ( ) { if ( 0 !== this . children . length ) { do this . children [ 0 ] . events && this . children [ 0 ] . events . onRemovedFromGroup . dispatch ( this . children [ 0 ] , this ) , this . removeChild ( this . children [ 0 ] ) ; while ( this . children . length > 0 ) ; this . cursor = null } } , b . Group . prototype . removeBetween = function ( a , b ) { if ( 0 !== this . children . length ) { if ( a > b || 0 > a || b > this . children . length ) return ! 1 ; for ( var c = a ; b > c ; c ++ ) this . children [ c ] . events && this . children [ c ] . events . onRemovedFromGroup . dispatch ( this . children [ c ] , this ) , this . removeChild ( this . children [ c ] ) , this . cursor === child && ( this . cursor = null ) } } , b . Group . prototype . destroy = function ( a ) { if ( "undefined" == typeof a && ( a = ! 1 ) , a ) { if ( this . children . length > 0 ) do this . children [ 0 ] . group &&
} , update : function ( ) { this . active && ( this . _holdSent === ! 1 && this . duration >= this . game . input . holdRate && ( ( this . game . input . multiInputOverride == b . Input . MOUSE _OVERRIDES _TOUCH || this . game . input . multiInputOverride == b . Input . MOUSE _TOUCH _COMBINE || this . game . input . multiInputOverride == b . Input . TOUCH _OVERRIDES _MOUSE && 0 === this . game . input . currentPointers ) && this . game . input . onHold . dispatch ( this ) , this . _holdSent = ! 0 ) , this . game . input . recordPointerHistory && this . game . time . now >= this . _nextDrop && ( this . _nextDrop = this . game . time . now + this . game . input . recordRate , this . _history . push ( { x : this . position . x , y : this . position . y } ) , this . _history . length > this . game . input . recordLimit && this . _history . shift ( ) ) ) } , move : function ( a , c ) { if ( ! this . game . input . pollLocked ) { if ( "undefined" == typeof c && ( c = ! 1 ) , "undefined" != typeof a . button && ( this . button = a . button ) , this . clientX = a . clientX , this . clientY = a . clientY , this . pageX = a . pageX , this . pageY = a . pageY , this . screenX = a . screenX , this . screenY = a . screenY , this . x = ( this . pageX - this . game . stage . offset . x ) * this . game . input . scale . x , this . y = ( this . pageY - this . game . stage . offset . y ) * this . game . input . scale . y , this . position . setTo ( this . x , this . y ) , this . circle . x = this . x , this . circle . y = this . y , ( this . game . input . multiInputOverride == b . Input . MOUSE _OVERRIDES _TOUCH || this . game . input . multiInputOverride == b . Input . MOUSE _TOUCH _COMBINE || this . game . input . multiInputOverride == b . Input . TOUCH _OVERRIDES _MOUSE && 0 === this . game . input . currentPointers ) && ( this . game . input . activePointer = this , this . game . input . x = this . x , this . game . input . y = this . y , this . game . input . position . setTo ( this . game . input . x , this . game . input . y ) , this . game . input . circle . x = this . game . input . x , this . game . input . circle . y = this . game . input . y ) , this . game . paused ) return this ; if ( this . game . input . moveCallback && this . game . input . moveCallback . call ( this . game . input . moveCallbackContext , this , this . x , this . y ) , null !== this . targetObject && this . targetObject . isDragged === ! 0 ) return this . targetObject . update ( this ) === ! 1 && ( this . targetObject = null ) , this ; if ( this . _highestRenderOrderID = - 1 , this . _highestRenderObject = null , this . _highestInputPriorityID = - 1 , this . game . input . interactiveItems . total > 0 ) { var d = this . game . input . interactiveItems . next ; do ( d . pixelPerfectClick || d . pixelPerfectOver || d . priorityID > this . _highestInputPriorityID || d . priorityID === this . _highestInputPriorityID && d . sprite . renderOrderID > this . _highestRenderOrderID ) && ( ! c && d . checkPointerOver ( this ) || c && d . checkPointerDown ( this ) ) && ( this . _highestRenderOrderID = d . sprite . renderOrderID , this . _highestInputPriorityID = d . priorityID , this . _highestRenderObject = d ) , d = d . next ; while ( null != d ) } return null === this . _highestRenderObject ? this . targetObject && ( this . targetObject . _pointerOutHandler ( this ) , this . targetObject = null ) : null === this . targetObject ? ( this . targetObject = this . _highestRenderObject , this . _highestRenderObject . _pointerOverHandler ( this ) ) : this . targetObject === this . _highestRenderObject ? this . _highestRenderObject . update ( this ) === ! 1 && ( this . targetObject = null ) : ( this . targetObject . _pointerOutHandler ( this ) , this . targetObject = this . _highestRenderObject , this . targetObject . _pointerOverHandler ( this ) ) , this } } , leave : function ( a ) { this . withinGame = ! 1 , this . move ( a , ! 1 ) } , stop : function ( a ) { if ( this . _stateReset ) return a . preventDefault ( ) , void 0 ; if ( this . timeUp = this . game . time . now , ( this . game . input . multiInputOverride == b . Input . MOUSE _OVERRIDES _TOUCH || this . game . input . multiInputOverride == b . Input . MOUSE _TOUCH _COMBINE || this . game . input . multiInputOverride == b . Input . TOUCH _OVERRIDES _MOUSE && 0 === this . game . input . currentPointers ) && ( this . game . input . onUp . dispatch ( this , a ) , this . duration >= 0 && this . duration <= this . game . input . tapRate && ( this . timeUp - this . previousTapTime < this . game . input . doubleTapRate ? this . game . input . onTap . dispatch ( this , ! 0 ) : this . game . input . onTap . dispatch ( this , ! 1 ) , this . previousTapTime = this . timeUp ) ) , this . id > 0 && ( this . active = ! 1 ) , this . withinGame = ! 1 , this . isDown = ! 1 , this . isUp = ! 0 , this . isMouse === ! 1 && this . game . input . currentPointers -- , this . game . input . interactiveItems . total > 0 ) { var c = this . game . input . interactiveItems . next ; do c && c . _releasedHandler ( this ) , c = c . next ; while ( null != c ) } return this . targetObject && this . targetObject . _releasedHandler ( this ) , this . targetObject = null , this } , justPressed : function ( a ) { return a = a || this . game . input . justPressedRate , this
2014-02-18 03:01:51 +00:00
} } , b . InputHandler . prototype . constructor = b . InputHandler , b . Events = function ( a ) { this . parent = a , this . onAddedToGroup = new b . Signal , this . onRemovedFromGroup = new b . Signal , this . onKilled = new b . Signal , this . onRevived = new b . Signal , this . onOutOfBounds = new b . Signal , this . onInputOver = null , this . onInputOut = null , this . onInputDown = null , this . onInputUp = null , this . onDragStart = null , this . onDragStop = null , this . onAnimationStart = null , this . onAnimationComplete = null , this . onAnimationLoop = null } , b . Events . prototype = { destroy : function ( ) { this . parent = null , this . onAddedToGroup . dispose ( ) , this . onRemovedFromGroup . dispose ( ) , this . onKilled . dispose ( ) , this . onRevived . dispose ( ) , this . onOutOfBounds . dispose ( ) , this . onInputOver && ( this . onInputOver . dispose ( ) , this . onInputOut . dispose ( ) , this . onInputDown . dispose ( ) , this . onInputUp . dispose ( ) , this . onDragStart . dispose ( ) , this . onDragStop . dispose ( ) ) , this . onAnimationStart && ( this . onAnimationStart . dispose ( ) , this . onAnimationComplete . dispose ( ) , this . onAnimationLoop . dispose ( ) ) } } , b . Events . prototype . constructor = b . Events , b . GameObjectFactory = function ( a ) { this . game = a , this . world = this . game . world } , b . GameObjectFactory . prototype = { existing : function ( a ) { return this . world . add ( a ) } , image : function ( a , c , d , e , f ) { return "undefined" == typeof f && ( f = this . world ) , f . add ( new b . Image ( this . game , a , c , d , e ) ) } , sprite : function ( a , b , c , d , e ) { return "undefined" == typeof e && ( e = this . world ) , e . create ( a , b , c , d ) } , tween : function ( a ) { return this . game . tweens . create ( a ) } , group : function ( a , c , d ) { return "undefined" == typeof c && ( c = "group" ) , "undefined" == typeof d && ( d = ! 1 ) , new b . Group ( this . game , a , c , d ) } , spriteBatch : function ( a , c , d ) { return "undefined" == typeof c && ( c = "group" ) , "undefined" == typeof d && ( d = ! 1 ) , new b . SpriteBatch ( this . game , a , c , d ) } , audio : function ( a , b , c , d ) { return this . game . sound . add ( a , b , c , d ) } , sound : function ( a , b , c , d ) { return this . game . sound . add ( a , b , c , d ) } , tileSprite : function ( a , c , d , e , f , g , h ) { return "undefined" == typeof h && ( h = this . world ) , h . add ( new b . TileSprite ( this . game , a , c , d , e , f , g ) ) } , text : function ( a , c , d , e , f ) { return "undefined" == typeof f && ( f = this . world ) , f . add ( new b . Text ( this . game , a , c , d , e ) ) } , button : function ( a , c , d , e , f , g , h , i , j , k ) { return "undefined" == typeof k && ( k = this . world ) , k . add ( new b . Button ( this . game , a , c , d , e , f , g , h , i , j ) ) } , graphics : function ( a , c , d ) { return "undefined" == typeof d && ( d = this . world ) , d . add ( new b . Graphics ( this . game , a , c ) ) } , emitter : function ( a , c , d ) { return this . game . particles . add ( new b . Particles . Arcade . Emitter ( this . game , a , c , d ) ) } , bitmapFont : function ( a , c , d , e , f , g , h , i , j ) { return new b . BitmapFont ( this . game , a , c , d , e , f , g , h , i , j ) } , bitmapText : function ( a , c , d , e , f , g ) { return "undefined" == typeof g && ( g = this . world ) , g . add ( new b . BitmapText ( this . game , a , c , d , e , f ) ) } , tilemap : function ( a , c ) { return new b . Tilemap ( this . game , a , c ) } , renderTexture : function ( a , c , d , e ) { ( "undefined" == typeof d || "" === d ) && ( d = this . game . rnd . uuid ( ) ) , "undefined" == typeof e && ( e = ! 1 ) ; var f = new b . RenderTexture ( this . game , a , c , d ) ; return e && this . game . cache . addRenderTexture ( d , f ) , f } , bitmapData : function ( a , c , d ) { "undefined" == typeof d && ( d = ! 1 ) , ( "undefined" == typeof key || "" === key ) && ( key = this . game . rnd . uuid ( ) ) ; var e = new b . BitmapData ( this . game , key , a , c ) ; return d && this . game . cache . addBitmapData ( key , e ) , e } , filter : function ( a ) { var c = Array . prototype . splice . call ( arguments , 1 ) , a = new b . Filter [ a ] ( this . game ) ; return a . init . apply ( a , c ) , a } } , b . GameObjectFactory . prototype . constructor = b . GameObjectFactory , b . BitmapData = function ( c , d , e , f ) { "undefined" == typeof e && ( e = 100 ) , "undefined" == typeof f && ( f = 100 ) , this . game = c , this . key = d , this . width = e , this . height = f , this . canvas = b . Canvas . create ( e , f ) , this . context = this . canvas . getContext ( "2d" ) , this . ctx = this . context , this . imageData = this . context . getImageData ( 0 , 0 , e , f ) , this . pixels = this . imageData . data . buffer ? this . imageData . data . buffer : this . imageData . data , this . baseTexture = new a . BaseTexture ( this . canvas ) , this . texture = new a . Texture ( this . baseTexture ) , this . textureFrame = new b . Frame ( 0 , 0 , 0 , e , f , "bitmapData" , c . rnd . uuid ( ) ) , this . type = b . BITMAPDATA , this . _dirty = ! 1 } , 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 ) } , clear : function ( ) { this . context . clearRect ( 0 , 0 , this . width , this . height ) , this . _dirty = ! 0 } , resize : function ( a , b ) { ( a !== this . widt
2014-02-19 05:28:19 +00:00
} , b . Button . prototype = Object . create ( b . Image . prototype ) , b . Button . prototype . constructor = b . Button , b . Button . prototype . clearFrames = function ( ) { this . _onOverFrameName = null , this . _onOverFrameID = null , this . _onOutFrameName = null , this . _onOutFrameID = null , this . _onDownFrameName = null , this . _onDownFrameID = null , this . _onUpFrameName = null , this . _onUpFrameID = null } , b . Button . prototype . setFrames = function ( a , b , c , d ) { this . clearFrames ( ) , null !== a && ( "string" == typeof a ? ( this . _onOverFrameName = a , this . input . pointerOver ( ) && ( this . frameName = a ) ) : ( this . _onOverFrameID = a , this . input . pointerOver ( ) && ( this . frame = a ) ) ) , null !== b && ( "string" == typeof b ? ( this . _onOutFrameName = b , this . input . pointerOver ( ) === ! 1 && ( this . frameName = b ) ) : ( this . _onOutFrameID = b , this . input . pointerOver ( ) === ! 1 && ( this . frame = b ) ) ) , null !== c && ( "string" == typeof c ? ( this . _onDownFrameName = c , this . input . pointerDown ( ) && ( this . frameName = c ) ) : ( this . _onDownFrameID = c , this . input . pointerDown ( ) && ( this . frame = c ) ) ) , null !== d && ( "string" == typeof d ? ( this . _onUpFrameName = d , this . input . pointerUp ( ) && ( this . frameName = d ) ) : ( this . _onUpFrameID = d , this . input . pointerUp ( ) && ( this . frame = d ) ) ) } , b . Button . prototype . setSounds = function ( a , b , c , d , e , f , g , h ) { this . setOverSound ( a , b ) , this . setOutSound ( e , f ) , this . setDownSound ( c , d ) , this . setUpSound ( g , h ) } , b . Button . prototype . setOverSound = function ( a , c ) { this . onOverSound = null , this . onOverSoundMarker = "" , a instanceof b . Sound && ( this . onOverSound = a ) , "string" == typeof c && ( this . onOverSoundMarker = c ) } , b . Button . prototype . setOutSound = function ( a , c ) { this . onOutSound = null , this . onOutSoundMarker = "" , a instanceof b . Sound && ( this . onOutSound = a ) , "string" == typeof c && ( this . onOutSoundMarker = c ) } , b . Button . prototype . setDownSound = function ( a , c ) { this . onDownSound = null , this . onDownSoundMarker = "" , a instanceof b . Sound && ( this . onDownSound = a ) , "string" == typeof c && ( this . onDownSoundMarker = c ) } , b . Button . prototype . setUpSound = function ( a , c ) { this . onUpSound = null , this . onUpSoundMarker = "" , a instanceof b . Sound && ( this . onUpSound = a ) , "string" == typeof c && ( this . onUpSoundMarker = c ) } , b . Button . prototype . onInputOverHandler = function ( a , b ) { this . freezeFrames === ! 1 && this . setState ( 1 ) , this . onOverSound && this . onOverSound . play ( this . onOverSoundMarker ) , this . onInputOver && this . onInputOver . dispatch ( this , b ) } , b . Button . prototype . onInputOutHandler = function ( a , b ) { this . freezeFrames === ! 1 && this . setState ( 2 ) , this . onOutSound && this . onOutSound . play ( this . onOutSoundMarker ) , this . onInputOut && this . onInputOut . dispatch ( this , b ) } , b . Button . prototype . onInputDownHandler = function ( a , b ) { this . freezeFrames === ! 1 && this . setState ( 3 ) , this . onDownSound && this . onDownSound . play ( this . onDownSoundMarker ) , this . onInputDown && this . onInputDown . dispatch ( this , b ) } , b . Button . prototype . onInputUpHandler = function ( a , b , c ) { this . onUpSound && this . onUpSound . play ( this . onUpSoundMarker ) , this . onInputUp && this . onInputUp . dispatch ( this , b , c ) , this . freezeFrames || ( this . forceOut ? this . setState ( 2 ) : this . _onUpFrameName || this . _onUpFrameID ? this . setState ( 4 ) : c ? this . setState ( 1 ) : this . setState ( 2 ) ) } , b . Button . prototype . setState = function ( a ) { 1 === a ? null != this . _onOverFrameName ? this . frameName = this . _onOverFrameName : null != this . _onOverFrameID && ( this . frame = this . _onOverFrameID ) : 2 === a ? null != this . _onOutFrameName ? this . frameName = this . _onOutFrameName : null != this . _onOutFrameID && ( this . frame = this . _onOutFrameID ) : 3 === a ? null != this . _onDownFrameName ? this . frameName = this . _onDownFrameName : null != this . _onDownFrameID && ( this . frame = this . _onDownFrameID ) : 4 === a && ( null != this . _onUpFrameName ? this . frameName = this . _onUpFrameName : null != this . _onUpFrameID && ( this . frame = this . _onUpFrameID ) ) } , b . Graphics = function ( c , d , e ) { d = d || 0 , e = e || 0 , this . game = c , this . exists = ! 0 , this . name = "" , this . type = b . GRAPHICS , this . world = new b . Point ( d , e ) , this . cameraOffset = new b . Point , a . Graphics . call ( this ) , this . position . set ( d , e ) , this . _cache = new Int16Array ( [ 0 , 0 , 0 , 0 , 1 , 0 , 1 , 0 ] ) } , b . Graphics . prototype = Object . create ( a . Graphics . prototype ) , b . Graphics . prototype . constructor = b . Graphics , b . Graphics . prototype . preUpdate = function ( ) { return this . _cache [ 0 ] = this . world . x , this . _cache [ 1 ] = this . world . y , this . _cache [ 2 ] = this . rotation , this . exists && this . parent . exists ? ( this . autoCull && ( this . renderable = this . game . world . camera . screenView . intersects ( this . getBounds ( ) ) ) , this . world . setTo ( this . game . camera . x + this . worldTran
} , bezierInterpolation : function ( a , b ) { for ( var c = 0 , d = a . length - 1 , e = 0 ; d >= e ; e ++ ) c += Math . pow ( 1 - b , d - e ) * Math . pow ( b , e ) * a [ e ] * this . bernstein ( d , e ) ; return c } , catmullRomInterpolation : function ( a , b ) { var c = a . length - 1 , d = c * b , e = Math . floor ( d ) ; return a [ 0 ] === a [ c ] ? ( 0 > b && ( e = Math . floor ( d = c * ( 1 + b ) ) ) , this . catmullRom ( a [ ( e - 1 + c ) % c ] , a [ e ] , a [ ( e + 1 ) % c ] , a [ ( e + 2 ) % c ] , d - e ) ) : 0 > b ? a [ 0 ] - ( this . catmullRom ( a [ 0 ] , a [ 0 ] , a [ 1 ] , a [ 1 ] , - d ) - a [ 0 ] ) : b > 1 ? a [ c ] - ( this . catmullRom ( a [ c ] , a [ c ] , a [ c - 1 ] , a [ c - 1 ] , d - c ) - a [ c ] ) : this . catmullRom ( a [ e ? e - 1 : 0 ] , a [ e ] , a [ e + 1 > c ? c : e + 1 ] , a [ e + 2 > c ? c : e + 2 ] , d - e ) } , linear : function ( a , b , c ) { return ( b - a ) * c + a } , bernstein : function ( a , b ) { return this . factorial ( a ) / this . factorial ( b ) / this . factorial ( a - b ) } , catmullRom : function ( a , b , c , d , e ) { var f = . 5 * ( c - a ) , g = . 5 * ( d - b ) , h = e * e , i = e * h ; return ( 2 * b - 2 * c + f + g ) * i + ( - 3 * b + 3 * c - 2 * f - g ) * h + f * e + b } , difference : function ( a , b ) { return Math . abs ( a - b ) } , getRandom : function ( a , b , c ) { if ( "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 0 ) , null != a ) { var d = c ; if ( ( 0 === d || d > a . length - b ) && ( d = a . length - b ) , d > 0 ) return a [ b + Math . floor ( Math . random ( ) * d ) ] } return null } , floor : function ( a ) { var b = 0 | a ; return a > 0 ? b : b != a ? b - 1 : b } , ceil : function ( a ) { var b = 0 | a ; return a > 0 ? b != a ? b + 1 : b : b } , sinCosGenerator : function ( a , b , c , d ) { "undefined" == typeof b && ( b = 1 ) , "undefined" == typeof c && ( c = 1 ) , "undefined" == typeof d && ( d = 1 ) ; for ( var e = b , f = c , g = d * Math . PI / a , h = [ ] , i = [ ] , j = 0 ; a > j ; j ++ ) f -= e * g , e += f * g , h [ j ] = f , i [ j ] = e ; return { sin : i , cos : h , length : a } } , shift : function ( a ) { var b = a . shift ( ) ; return a . push ( b ) , b } , shuffleArray : function ( a ) { for ( var b = a . length - 1 ; b > 0 ; b -- ) { var c = Math . floor ( Math . random ( ) * ( b + 1 ) ) , d = a [ b ] ; a [ b ] = a [ c ] , a [ c ] = d } return a } , distance : function ( a , b , c , d ) { var e = a - c , f = b - d ; return Math . sqrt ( e * e + f * f ) } , distancePow : function ( a , b , c , d , e ) { return "undefined" == typeof e && ( e = 2 ) , Math . sqrt ( Math . pow ( c - a , e ) + Math . pow ( d - b , e ) ) } , distanceRounded : function ( a , c , d , e ) { return Math . round ( b . Math . distance ( a , c , d , e ) ) } , clamp : function ( a , b , c ) { return b > a ? b : a > c ? c : a } , clampBottom : function ( a , b ) { return b > a ? b : a } , within : function ( a , b , c ) { return Math . abs ( a - b ) <= c } , mapLinear : function ( a , b , c , d , e ) { return d + ( a - b ) * ( e - d ) / ( c - b ) } , smoothstep : function ( a , b , c ) { return b >= a ? 0 : a >= c ? 1 : ( a = ( a - b ) / ( c - b ) , a * a * ( 3 - 2 * a ) ) } , smootherstep : function ( a , b , c ) { return b >= a ? 0 : a >= c ? 1 : ( a = ( a - b ) / ( c - b ) , a * a * a * ( a * ( 6 * a - 15 ) + 10 ) ) } , sign : function ( a ) { return 0 > a ? - 1 : a > 0 ? 1 : 0 } , p2px : function ( a ) { return a *= - 20 } , px2p : function ( a ) { return a * - . 05 } , degToRad : function ( ) { var a = Math . PI / 180 ; return function ( b ) { return b * a } } ( ) , radToDeg : function ( ) { var a = 180 / Math . PI ; return function ( b ) { return b * a } } ( ) } , b . RandomDataGenerator = function ( a ) { "undefined" == typeof a && ( a = [ ] ) , this . c = 1 , this . s0 = 0 , this . s1 = 0 , this . s2 = 0 , this . sow ( a ) } , b . RandomDataGenerator . prototype = { rnd : function ( ) { var a = 2091639 * this . s0 + 2.3283064365386963 e - 10 * this . c ; return this . c = 0 | a , this . s0 = this . s1 , this . s1 = this . s2 , this . s2 = a - this . c , this . s2 } , sow : function ( a ) { "undefined" == typeof a && ( a = [ ] ) , this . s0 = this . hash ( " " ) , this . s1 = this . hash ( this . s0 ) , this . s2 = this . hash ( this . s1 ) , this . c = 1 ; for ( var b , c = 0 ; b = a [ c ++ ] ; ) this . s0 -= this . hash ( b ) , this . s0 += ~ ~ ( this . s0 < 0 ) , this . s1 -= this . hash ( b ) , this . s1 += ~ ~ ( this . s1 < 0 ) , this . s2 -= this . hash ( b ) , this . s2 += ~ ~ ( this . s2 < 0 ) } , hash : function ( a ) { var b , c , d ; for ( d = 4022871197 , a = a . toString ( ) , c = 0 ; c < a . length ; c ++ ) d += a . charCodeAt ( c ) , b = . 02519603282416938 * d , d = b >>> 0 , b -= d , b *= d , d = b >>> 0 , b -= d , d += 4294967296 * b ; return 2.3283064365386963 e - 10 * ( d >>> 0 ) } , integer : function ( ) { return 4294967296 * this . rnd . apply ( this ) } , frac : function ( ) { return this . rnd . apply ( this ) + 1.1102230246251565 e - 16 * ( 0 | 2097152 * this . rnd . apply ( this ) ) } , real : function ( ) { return this . integer ( ) + this . frac ( ) } , integerInRange : function ( a , b ) { return Math . floor ( this . realInRange ( a , b ) ) } , realInRange : function ( a , b ) { return this . frac ( ) * ( b - a ) + a } , normal : function ( ) { return 1 - 2 * this . frac ( ) } , uuid : function ( ) { var a = "" , b = "" ; for ( b = a = "" ; a ++ < 36 ; b += ~ a % 5 | 4 & 3 * a ? ( 15 ^ a ? 8 ^ this . frac ( ) * ( 20 ^ a ? 16 : 4 ) : 4 ) . toString ( 16 ) : "-" ) ; return b } , pick : function ( a ) { return a [ this . integerInRange ( 0 , a . length ) ] } , weightedPick : function ( a ) { return a [ ~ ~ ( Math . pow ( this . frac ( ) , 2 ) * a . length ) ] } , timestamp : function ( a , b ) { return this . realInRange ( a || 9466848e5 , b || 1577862e6 ) } , angle : function ( ) { return this . integerInRange ( - 180 , 180 ) } } , b . RandomDataGenerator . prototype . constructor = b . RandomDataGenerator , b . Net = function ( a ) { this . game = a } , b . Net . prototype = { getHostName : function ( ) { ret
} , addTilemap : function ( a , b , c , d ) { this . _tilemaps [ a ] = { url : b , data : c , format : d } } , addTextureAtlas : function ( c , d , e , f , g ) { this . _images [ c ] = { url : d , data : e , spriteSheet : ! 0 } , a . BaseTextureCache [ c ] = new a . BaseTexture ( e ) , a . TextureCache [ c ] = new a . Texture ( a . BaseTextureCache [ c ] ) , g == b . Loader . TEXTURE _ATLAS _JSON _ARRAY ? this . _images [ c ] . frameData = b . AnimationParser . JSONData ( this . game , f , c ) : g == b . Loader . TEXTURE _ATLAS _JSON _HASH ? this . _images [ c ] . frameData = b . AnimationParser . JSONDataHash ( this . game , f , c ) : g == b . Loader . TEXTURE _ATLAS _XML _STARLING && ( this . _images [ c ] . frameData = b . AnimationParser . XMLData ( this . game , f , c ) ) } , addBitmapFont : function ( c , d , e , f , g , h ) { this . _images [ c ] = { url : d , data : e , spriteSheet : ! 0 } , a . BaseTextureCache [ c ] = new a . BaseTexture ( e ) , a . TextureCache [ c ] = new a . Texture ( a . BaseTextureCache [ c ] ) , b . LoaderParser . bitmapFont ( this . game , f , c , g , h ) } , addPhysicsData : function ( a , b , c , d ) { this . _physics [ a ] = { url : b , data : c , format : d } } , addDefaultImage : function ( ) { var c = new Image ; c . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg==" , this . _images . _ _default = { url : null , data : c , spriteSheet : ! 1 } , this . _images . _ _default . frame = new b . Frame ( 0 , 0 , 0 , 32 , 32 , "" , "" ) , a . BaseTextureCache . _ _default = new a . BaseTexture ( c ) , a . TextureCache . _ _default = new a . Texture ( a . BaseTextureCache . _ _default ) } , addMissingImage : function ( ) { var c = new Image ; c . src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg==" , this . _images . _ _missing = { url : null , data : c , spriteSheet : ! 1 } , this . _images . _ _missing . frame = new b . Frame ( 0 , 0 , 0 , 32 , 32 , "" , "" ) , a . BaseTextureCache . _ _missing = new a . BaseTexture ( c ) , a . TextureCache . _ _missing = new a . Texture ( a . BaseTextureCache . _ _missing ) } , addText : function ( a , b , c ) { this . _text [ a ] = { url : b , data : c } } , addImage : function ( c , d , e ) { this . _images [ c ] = { url : d , data : e , spriteSheet : ! 1 } , this . _images [ c ] . frame = new b . Frame ( 0 , 0 , 0 , e . width , e . height , c , this . game . rnd . uuid ( ) ) , a . BaseTextureCache [ c ] = new a . BaseTexture ( e ) , a . TextureCache [ c ] = new a . Texture ( a . BaseTextureCache [ c ] ) } , addSound : function ( a , b , c , d , e ) { d = d || ! 0 , e = e || ! 1 ; var f = ! 1 ; e && ( f = ! 0 ) , this . _sounds [ a ] = { url : b , data : c , isDecoding : ! 1 , decoded : f , webAudio : d , audioTag : e , locked : this . game . sound . touchLocked } } , reloadSound : function ( a ) { var b = this ; this . _sounds [ a ] && ( this . _sounds [ a ] . data . src = this . _sounds [ a ] . url , this . _sounds [ a ] . data . addEventListener ( "canplaythrough" , function ( ) { return b . reloadSoundComplete ( a ) } , ! 1 ) , this . _sounds [ a ] . data . load ( ) ) } , reloadSoundComplete : function ( a ) { this . _sounds [ a ] && ( this . _sounds [ a ] . locked = ! 1 , this . onSoundUnlock . dispatch ( a ) ) } , updateSound : function ( a , b , c ) { this . _sounds [ a ] && ( this . _sounds [ a ] [ b ] = c ) } , decodedSound : function ( a , b ) { this . _sounds [ a ] . data = b , this . _sounds [ a ] . decoded = ! 0 , this . _sounds [ a ] . isDecoding = ! 1 } , getCanvas : function ( a ) { return this . _canvases [ a ] ? this . _canvases [ a ] . canvas : ( console . warn ( 'Phaser.Cache.getCanvas: Invalid key: "' + a + '"' ) , void 0 ) } , getBitmapData : function ( a ) { return this . _bitmapDatas [ a ] ? this . _bitmapDatas [ a ] : ( console . warn ( 'Phaser.Cache.getBitmapData: Invalid key: "' + a + '"' ) , void 0 ) } , getBitmapFont : function ( a ) { return this . _bitmapFont [ a ] ? this . _bitmapFont [ a ] : ( console . warn ( 'Phaser.Cache.getBitmapFont: Invalid key: "' + a + '"' ) , void 0 ) } , getPhysicsData : function ( a , b ) { if ( "undefined" == typeof b || null === b ) { if ( this . _physics [ a ] ) return this . _physics [ a ] . data ; console . warn ( 'Phaser.Cache.getPhysicsData: Invalid key: "' + a + '"' ) } else { if ( this . _physics [ a ] && this . _physics [ a ] . data [ b ] ) return this . _physics [ a ] . data [ b ] [ 0 ] ; console . warn ( 'Phaser.Cache.getPhysicsData: Invalid key/object: "' + a + " / " + b + '"' ) } return null } , checkImageKey : function ( a ) { return this . _images [ a ] ? ! 0 : ! 1 } , getImage : function ( a ) { return this . _images [ a ] ? this . _images [ a ] . data : ( console . warn ( 'Phaser.Cache.getImage: Invalid key: "' + a + '"' ) , void 0 ) } , getTilemapData : function ( a ) { return this . _tilemaps [ a ] ? this . _tilemaps [ a ] : ( console . warn ( ' Phaser . Cache . getTilemapData : Invalid
var e = this . add ( a , b , c ) ; return e . play ( ) , e } } , b . SoundManager . prototype . constructor = b . SoundManager , Object . defineProperty ( b . SoundManager . prototype , "mute" , { get : function ( ) { return this . _muted } , set : function ( a ) { if ( a = a || null ) { if ( this . _muted ) return ; this . _muted = ! 0 , this . usingWebAudio && ( this . _muteVolume = this . masterGain . gain . value , this . masterGain . gain . value = 0 ) ; for ( var b = 0 ; b < this . _sounds . length ; b ++ ) this . _sounds [ b ] . usingAudioTag && ( this . _sounds [ b ] . mute = ! 0 ) } else { if ( this . _muted === ! 1 ) return ; this . _muted = ! 1 , this . usingWebAudio && ( this . masterGain . gain . value = this . _muteVolume ) ; for ( var b = 0 ; b < this . _sounds . length ; b ++ ) this . _sounds [ b ] . usingAudioTag && ( this . _sounds [ b ] . mute = ! 1 ) } } } ) , Object . defineProperty ( b . SoundManager . prototype , "volume" , { get : function ( ) { return this . usingWebAudio ? this . masterGain . gain . value : this . _volume } , set : function ( a ) { a = this . game . math . clamp ( a , 1 , 0 ) , this . _volume = a , this . usingWebAudio && ( this . masterGain . gain . value = a ) ; for ( var b = 0 ; b < this . _sounds . length ; b ++ ) this . _sounds [ b ] . usingAudioTag && ( this . _sounds [ b ] . volume = this . _sounds [ b ] . volume * a ) } } ) , b . Utils . Debug = function ( a ) { this . game = a , this . context = a . context , this . font = "14px Courier" , this . columnWidth = 100 , this . lineHeight = 16 , this . renderShadow = ! 0 , this . currentX = 0 , this . currentY = 0 , this . currentAlpha = 1 } , b . Utils . Debug . prototype = { start : function ( a , b , c , d ) { null != this . context && ( "number" != typeof a && ( a = 0 ) , "number" != typeof b && ( b = 0 ) , c = c || "rgb(255,255,255)" , "undefined" == typeof d && ( d = 0 ) , this . currentX = a , this . currentY = b , this . currentColor = c , this . currentAlpha = this . context . globalAlpha , this . columnWidth = d , this . context . save ( ) , this . context . setTransform ( 1 , 0 , 0 , 1 , 0 , 0 ) , this . context . strokeStyle = c , this . context . fillStyle = c , this . context . font = this . font , this . context . globalAlpha = 1 ) } , stop : function ( ) { this . context . restore ( ) , this . context . globalAlpha = this . currentAlpha } , line : function ( a , b , c ) { null != this . context && ( "undefined" != typeof b && ( this . currentX = b ) , "undefined" != typeof c && ( this . currentY = c ) , this . renderShadow && ( this . context . fillStyle = "rgb(0,0,0)" , this . context . fillText ( a , this . currentX + 1 , this . currentY + 1 ) , this . context . fillStyle = this . currentColor ) , this . context . fillText ( a , this . currentX , this . currentY ) , this . currentY += this . lineHeight ) } , splitline : function ( ) { if ( null != this . context ) { for ( var a = this . currentX , b = 0 ; b < arguments . length ; b ++ ) this . renderShadow && ( this . context . fillStyle = "rgb(0,0,0)" , this . context . fillText ( arguments [ b ] , a + 1 , this . currentY + 1 ) , this . context . fillStyle = this . currentColor ) , this . context . fillText ( arguments [ b ] , a , this . currentY ) , a += this . columnWidth ; this . currentY += this . lineHeight } } , renderQuadTree : function ( a , b ) { b = b || "rgba(255,0,0,0.3)" , this . start ( ) ; var c = a . bounds ; if ( 0 === a . nodes . length ) { this . context . strokeStyle = b , this . context . strokeRect ( c . x , c . y , c . width , c . height ) , this . renderText ( a . ID + " / " + a . objects . length , c . x + 4 , c . y + 16 , "rgb(0,200,0)" , "12px Courier" ) , this . context . strokeStyle = "rgb(0,255,0)" ; for ( var d = 0 ; d < a . objects . length ; d ++ ) this . context . strokeRect ( a . objects [ d ] . x , a . objects [ d ] . y , a . objects [ d ] . width , a . objects [ d ] . height ) } else for ( var d = 0 ; d < a . nodes . length ; d ++ ) this . renderQuadTree ( a . nodes [ d ] ) ; this . stop ( ) } , renderSoundInfo : function ( a , b , c , d ) { null != this . context && ( d = d || "rgb(255,255,255)" , this . start ( b , c , d ) , this . line ( "Sound: " + a . key + " Locked: " + a . game . sound . touchLocked ) , this . line ( "Is Ready?: " + this . game . cache . isSoundReady ( a . key ) + " Pending Playback: " + a . pendingPlayback ) , this . line ( "Decoded: " + a . isDecoded + " Decoding: " + a . isDecoding ) , this . line ( "Total Duration: " + a . totalDuration + " Playing: " + a . isPlaying ) , this . line ( "Time: " + a . currentTime ) , this . line ( "Volume: " + a . volume + " Muted: " + a . mute ) , this . line ( "WebAudio: " + a . usingWebAudio + " Audio: " + a . usingAudioTag ) , "" !== a . currentMarker && ( this . line ( "Marker: " + a . currentMarker + " Duration: " + a . duration ) , this . line ( "Start: " + a . markers [ a . currentMarker ] . start + " Stop: " + a . markers [ a . currentMarker ] . stop ) , this . line ( "Position: " + a . position ) ) , this . stop ( ) ) } , renderCameraInfo : function ( a , b , c , d ) { null != this . context && ( d = d || "rgb(255,255,255)" , this . start ( b , c , d ) , this . line ( "Camera (" + a . width + " x " + a . height + ")" ) , this . line ( "X: " + a . x + " Y: " + a . y ) , this . line ( "Bounds x: " + a . bounds . x + " Y: " + a . bounds . y + " w: " + a . bounds . width + " h: " + a . bounds . height ) , this . line ( "View x: " + a . view . x + " Y :
} } ) , Object . defineProperty ( b . Physics . Body . prototype , "x" , { get : function ( ) { return this . p2px ( this . data . position [ 0 ] ) } , set : function ( a ) { this . data . position [ 0 ] = this . px2p ( a ) } } ) , Object . defineProperty ( b . Physics . Body . prototype , "y" , { get : function ( ) { return this . p2px ( this . data . position [ 1 ] ) } , set : function ( a ) { this . data . position [ 1 ] = this . px2p ( a ) } } ) , b . Physics . Spring = function ( a , b , c , d , e , f , g , h , i , j ) { this . game = a , "undefined" == typeof d && ( d = 1 ) , "undefined" == typeof e && ( e = 100 ) , "undefined" == typeof f && ( f = 1 ) ; var k = { restLength : d , stiffness : e , damping : f } ; "undefined" != typeof g && null !== g && ( k . worldAnchorA = [ a . math . px2p ( g [ 0 ] ) , a . math . px2p ( g [ 1 ] ) ] ) , "undefined" != typeof h && null !== h && ( k . worldAnchorB = [ a . math . px2p ( h [ 0 ] ) , a . math . px2p ( h [ 1 ] ) ] ) , "undefined" != typeof i && null !== i && ( k . localAnchorA = [ a . math . px2p ( i [ 0 ] ) , a . math . px2p ( i [ 1 ] ) ] ) , "undefined" != typeof j && null !== j && ( k . localAnchorB = [ a . math . px2p ( j [ 0 ] ) , a . math . px2p ( j [ 1 ] ) ] ) , p2 . Spring . call ( this , b , c , k ) } , b . Physics . Spring . prototype = Object . create ( p2 . Spring . prototype ) , b . Physics . Spring . prototype . constructor = b . Physics . Spring , b . Physics . Material = function ( a ) { this . name = a , p2 . Material . call ( this ) } , b . Physics . Material . prototype = Object . create ( p2 . Material . prototype ) , b . Physics . Material . prototype . constructor = b . Physics . Material , b . Physics . ContactMaterial = function ( a , b , c ) { p2 . ContactMaterial . call ( this , a , b , c ) } , b . Physics . ContactMaterial . prototype = Object . create ( p2 . ContactMaterial . prototype ) , b . Physics . ContactMaterial . prototype . constructor = b . Physics . ContactMaterial , b . Physics . CollisionGroup = function ( a ) { this . mask = a } , b . Particles = function ( a ) { this . game = a , this . emitters = { } , this . ID = 0 } , b . Particles . prototype = { add : function ( a ) { return this . emitters [ a . name ] = a , a } , remove : function ( a ) { delete this . emitters [ a . name ] } , update : function ( ) { for ( var a in this . emitters ) this . emitters [ a ] . exists && this . emitters [ a ] . update ( ) } } , b . Particles . prototype . constructor = b . Particles , b . Particles . Arcade = { } , b . Particles . Arcade . Emitter = function ( a , c , d , e ) { this . maxParticles = e || 50 , b . Group . call ( this , a ) , this . name = "emitter" + this . game . particles . ID ++ , this . type = b . EMITTER , this . x = 0 , this . y = 0 , this . width = 1 , this . height = 1 , this . minParticleSpeed = new b . Point ( - 100 , - 100 ) , this . maxParticleSpeed = new b . Point ( 100 , 100 ) , this . minParticleScale = 1 , this . maxParticleScale = 1 , this . minRotation = - 360 , this . maxRotation = 360 , this . gravity = 100 , this . particleClass = null , this . particleFriction = 0 , this . angularDrag = 0 , this . frequency = 100 , this . lifespan = 2e3 , this . bounce = new b . Point , this . _quantity = 0 , this . _timer = 0 , this . _counter = 0 , this . _explode = ! 0 , this . on = ! 1 , this . exists = ! 0 , this . emitX = c , this . emitY = d } , b . Particles . Arcade . Emitter . prototype = Object . create ( b . Group . prototype ) , b . Particles . Arcade . Emitter . prototype . constructor = b . Particles . Arcade . Emitter , b . Particles . Arcade . Emitter . prototype . update = function ( ) { if ( this . on ) if ( this . _explode ) { this . _counter = 0 ; do this . emitParticle ( ) , this . _counter ++ ; while ( this . _counter < this . _quantity ) ; this . on = ! 1 } else this . game . time . now >= this . _timer && ( this . emitParticle ( ) , this . _counter ++ , this . _quantity > 0 && this . _counter >= this . _quantity && ( this . on = ! 1 ) , this . _timer = this . game . time . now + this . frequency ) } , b . Particles . Arcade . Emitter . prototype . makeParticles = function ( a , c , d , e , f ) { "undefined" == typeof c && ( c = 0 ) , "undefined" == typeof d && ( d = this . maxParticles ) , "undefined" == typeof e && ( e = ! 1 ) , "undefined" == typeof f && ( f = ! 1 ) ; for ( var g , h = 0 , i = a , j = c ; d > h ; ) null === this . particleClass && ( "object" == typeof a && ( i = this . game . rnd . pick ( a ) ) , "object" == typeof c && ( j = this . game . rnd . pick ( c ) ) , g = new b . Sprite ( this . game , 0 , 0 , i , j ) ) , e ? ( g . body . checkCollision . any = ! 0 , g . body . checkCollision . none = ! 1 ) : g . body . checkCollision . none = ! 0 , g . body . collideWorldBounds = f , g . exists = ! 1 , g . visible = ! 1 , g . anchor . setTo ( . 5 , . 5 ) , this . add ( g ) , h ++ ; return this } , b . Particles . Arcade . Emitter . prototype . kill = function ( ) { this . on = ! 1 , this . alive = ! 1 , this . exists = ! 1 } , b . Particles . Arcade . Emitter . prototype . revive = function ( ) { this . alive = ! 0 , this . exists = ! 0 } , b . Particles . Arcade . Emitter . prototype . start = function ( a , b , c , d ) { "undefined" == typeof a && ( a = ! 0 ) , "undefined" == typeof b && ( b = 0 ) , "undefined" == typeof c && ( c = 250 ) , "undefined" == typeof d && ( d = 0 ) , this . revive ( ) , this . visible = ! 0 , this . on = ! 0 , this . _explode = a , this . lifespan = b , this . frequency = c , a ? this . _quantity = d : this . _quantity += d , this . _counter = 0 , this . _