diff --git a/Gruntfile.js b/Gruntfile.js index 555bc4b548..8ab1841fec 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -390,7 +390,8 @@ module.exports = function (grunt) { '!src/Intro.js', '!src/Outro.js', '!src/pixi/**/*', - '!src/physics/p2/p2.js' + '!src/physics/p2/p2.js', + '!plugins/AStar.js' ], options: { jshintrc: '.jshintrc' } }, diff --git a/README.md b/README.md index f011bfbc25..427b05fec1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Phaser 2.0.2 Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses [Pixi.js](https://github.com/GoodBoyDigital/pixi.js/) internally for fast 2D Canvas and WebGL rendering. -Version: 2.0.2 "Ghealdan" - Released: -in active development- +Version: 2.0.2 "Ghealdan" - Released: 28th March 2014 By Richard Davey, [Photon Storm](http://www.photonstorm.com) @@ -25,6 +25,9 @@ By Richard Davey, [Photon Storm](http://www.photonstorm.com) What's new in 2.0.2? -------------------- +The great thing about running an open source project are all the awesome contributions from the community, and this release reflects that. Aside from a raft of small but important ArcadePhysics fixes we've also had the entirely library jshinted and tidied up by xtian. We have had jshint configs in place for a while now, but he's forced us to make them part of the build process and helped tidy-up a number of things that had crept in. + +We've also updated the included tutorial (and the web version) so it's now fully compatible with Phaser 2 and re-published and updated all of the API documentation, which you'll find in the docs folder in this release. Welcome to Phaser @@ -58,12 +61,17 @@ There is also an [un-official Getting Started Guide](http://www.antonoffplus.com Change Log ---------- -Version 2.0.2 - "Ghealdan" - -in active development- +Version 2.0.2 - "Ghealdan" - 28th March 2014 Bug Fixes +* Sprite would glitch if it had an ArcadePhysics Body that was re-positioned out of loop. +* Sprite would "fly off" if it had an ArcadePhysics Body that was re-positioned during an input handler. * Tween.generateData would enter an eternal loop if the total resulted in a float. Now wrapped in Math.floor. * ArcadePhysics.Body preUpdate has been modified to stop Sprites with non-1 scaling from gaining delta and moving off the screen (fix #644). +* ArcadePhysics.Body deltaMaxY wasn't being correctly applied. +* P2.World - Removing tilemap layer retrieval for object layers in convertCollisionObjects() (thanks bmceldowney, fix #653) +* Calling Keyboard.stop() wouldn't let you call Keyboard.start() later on in the same game Updated @@ -72,11 +80,13 @@ Updated * Line.fromSprite now sets "fromCenter" to false by default as Sprite.center is deprecated in 2.x. Documentation and Examples updated to reflect this. * All the documentation has been re-published for 2.0.2. * Lots of ArcadePhysics.World methods have been marked as private where they shouldn't be called directly (separateX, etc) +* xtian jshint fixed nearly every single file in the repository! New Features * Sprite.overlap lets you quickly check to see if the bounds of two display objects are intersecting or not, without having to use a physics system. +* Keyboard.destroy will now clear all event listeners and any custom set callbacks or Keys. There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system. diff --git a/build/custom/ninja.js b/build/custom/ninja.js index f737bc1d3f..e3db4b0052 100644 --- a/build/custom/ninja.js +++ b/build/custom/ninja.js @@ -28,7 +28,7 @@ * @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Ninja = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -136,7 +136,7 @@ Phaser.Physics.Ninja.prototype = { if (Array.isArray(object)) { - i = object.length; + var i = object.length; while (i--) { @@ -264,9 +264,6 @@ Phaser.Physics.Ninja.prototype = { layer = map.getLayer(layer); - if (typeof addToWorld === 'undefined') { addToWorld = true; } - if (typeof optimize === 'undefined') { optimize = true; } - // If the bodies array is already populated we need to nuke it this.clearTilemapLayerBodies(map, layer); @@ -570,11 +567,9 @@ Phaser.Physics.Ninja.prototype = { * @method Phaser.Physics.Ninja#separate * @param {Phaser.Physics.Ninja.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Ninja.Body} body2 - The Body object to separate. - * @param {function} [processCallback=null] - UN-USED: A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. - * @param {object} [callbackContext] - UN-USED: The context in which to run the process callback. * @returns {boolean} Returns true if the bodies collided, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { + separate: function (body1, body2) { if (body1.type !== Phaser.Physics.NINJA || body2.type !== Phaser.Physics.NINJA) { @@ -1053,7 +1048,7 @@ Phaser.Physics.Ninja.Body.prototype = { * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "x", { - + get: function () { return this.shape.pos.x; }, @@ -1069,7 +1064,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "y", { - + get: function () { return this.shape.pos.y; }, @@ -1086,7 +1081,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "width", { - + get: function () { return this.shape.width; } @@ -1099,7 +1094,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "width", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "height", { - + get: function () { return this.shape.height; } @@ -1112,7 +1107,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "height", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "bottom", { - + get: function () { return this.shape.pos.y + this.shape.yw; } @@ -1125,7 +1120,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "right", { - + get: function () { return this.shape.pos.x + this.shape.xw; } @@ -1138,7 +1133,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "speed", { - + get: function () { return Math.sqrt(this.shape.velocity.x * this.shape.velocity.x + this.shape.velocity.y * this.shape.velocity.y); } @@ -1151,7 +1146,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "speed", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { - + get: function () { return Math.atan2(this.shape.velocity.y, this.shape.velocity.x); } @@ -1159,6 +1154,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { }); +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -1179,7 +1175,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { * @param {number} height - The height of this AABB. */ Phaser.Physics.Ninja.AABB = function (body, x, y, width, height) { - + /** * @property {Phaser.Physics.Ninja.Body} system - A reference to the body that owns this shape. */ @@ -1296,7 +1292,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this AABB collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -1405,16 +1401,6 @@ Phaser.Physics.Ninja.AABB.prototype = { var vx1 = this.pos.x - this.oldpos.x; // Calc velocity of this object var vy1 = this.pos.y - this.oldpos.y; var dp1 = (vx1 * dx + vy1 * dy); // Find component of velocity parallel to collision normal - var nx1 = dp1 * dx; // Project velocity onto collision normal - var ny1 = dp1 * dy; // nx, ny is normal velocity - - var dx2 = dx * -1; - var dy2 = dy * -1; - var vx2 = obj.pos.x - obj.oldpos.x; // Calc velocity of colliding object - var vy2 = obj.pos.y - obj.oldpos.y; - var dp2 = (vx2 * dx2 + vy2 * dy2); // Find component of velocity parallel to collision normal - var nx2 = dp2 * dx2; // Project velocity onto collision normal - var ny2 = dp2 * dy2; // nx, ny is normal velocity // We only want to apply collision response forces if the object is travelling into, and not out of, the collision if (this.body.immovable && obj.body.immovable) @@ -1695,16 +1681,16 @@ Phaser.Physics.Ninja.AABB.prototype = { projAABB_Half: function (x, y, obj, t) { //signx or signy must be 0; the other must be -1 or 1 - //calculate the projection vector for the half-edge, and then + //calculate the projection vector for the half-edge, and then //(if collision is occuring) pick the minimum - + var sx = t.signx; var sy = t.signy; - + var ox = (obj.pos.x - (sx*obj.xw)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*obj.yw)) - t.pos.y;//point on the AABB, relative to the tile center - //we perform operations analogous to the 45deg tile, except we're using + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope @@ -1715,11 +1701,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { //project along axis; note that we're assuming that this tile is horizontal OR vertical @@ -1729,14 +1715,14 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { //note that we could use -= instead of -dp obj.reportCollisionVsWorld(sx,sy,t.signx, t.signy, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1761,7 +1747,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var sx = t.sx; var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1770,8 +1756,8 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1790,7 +1776,7 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1805,7 +1791,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @return {number} The result of the collision. */ projAABB_22DegS: function (x, y, obj, t) { - + var signx = t.signx; var signy = t.signy; @@ -1818,10 +1804,10 @@ Phaser.Physics.Ninja.AABB.prototype = { { var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1830,11 +1816,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + var aY = Math.abs(penY); if (lenP < lenN) @@ -1842,13 +1828,13 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aY < lenP) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -1857,7 +1843,7 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aY < lenN) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else @@ -1869,7 +1855,7 @@ Phaser.Physics.Ninja.AABB.prototype = { } } } - + //if we've reached this point, no collision has occured return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1891,10 +1877,10 @@ Phaser.Physics.Ninja.AABB.prototype = { var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1903,7 +1889,7 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1911,18 +1897,18 @@ Phaser.Physics.Ninja.AABB.prototype = { if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } - + } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1952,7 +1938,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need to project it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1961,7 +1947,7 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1973,13 +1959,13 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aX < lenP) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -1988,11 +1974,11 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aX < lenN) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.AABB.COL_OTHER; @@ -2000,9 +1986,9 @@ Phaser.Physics.Ninja.AABB.prototype = { } } } - + //if we've reached this point, no collision has occured - return Phaser.Physics.Ninja.AABB.COL_NONE; + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -2020,13 +2006,13 @@ Phaser.Physics.Ninja.AABB.prototype = { var signx = t.signx; var signy = t.signy; - + var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -2035,11 +2021,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); @@ -2047,14 +2033,14 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - - return Phaser.Physics.Ninja.AABB.COL_NONE; + + return Phaser.Physics.Ninja.AABB.COL_NONE; }, /** @@ -2091,7 +2077,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var lenP = Math.sqrt(x * x + y * y); obj.reportCollisionVsWorld(x, y, x / lenP, y / lenP, t); - return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report + return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report } else if (0 < pen) { @@ -2162,7 +2148,7 @@ Phaser.Physics.Ninja.AABB.prototype = { } return Phaser.Physics.Ninja.AABB.COL_NONE; - + }, /** @@ -2175,8 +2161,9 @@ Phaser.Physics.Ninja.AABB.prototype = { this.system = null; } -} +}; +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -2188,7 +2175,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * A Tile is defined by its width, height and type. It's type can include slope data, such as 45 degree slopes, or convex slopes. * Understand that for any type including a slope (types 2 to 29) the Tile must be SQUARE, i.e. have an equal width and height. * Also note that as Tiles are primarily used for levels they have gravity disabled and world bounds collision disabled by default. -* +* * Note: This class could be massively optimised and reduced in size. I leave that challenge up to you. * * @class Phaser.Physics.Ninja.Tile @@ -2202,7 +2189,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @param {number} [type=1] - The type of Ninja shape to create. 1 = AABB, 2 = Circle or 3 = Tile. */ Phaser.Physics.Ninja.Tile = function (body, x, y, width, height, type) { - + if (typeof type === 'undefined') { type = Phaser.Physics.Ninja.Tile.EMPTY; } /** @@ -2380,8 +2367,7 @@ Phaser.Physics.Ninja.Tile.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this Tile collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { - + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -2532,28 +2518,28 @@ Phaser.Physics.Ninja.Tile.prototype = { this.signx = 1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnn) { this.signx = -1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnp) { this.signx = -1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGpp) { this.signx = 1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else { @@ -2844,14 +2830,14 @@ Phaser.Physics.Ninja.Tile.prototype = { } } -} +}; /** * @name Phaser.Physics.Ninja.Tile#x * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "x", { - + get: function () { return this.pos.x - this.xw; }, @@ -2867,7 +2853,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "y", { - + get: function () { return this.pos.y - this.yw; }, @@ -2884,7 +2870,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "bottom", { - + get: function () { return this.pos.y + this.yw; } @@ -2897,7 +2883,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "right", { - + get: function () { return this.pos.x + this.xw; } @@ -2950,6 +2936,7 @@ Phaser.Physics.Ninja.Tile.TYPE_67DEGs = 22; Phaser.Physics.Ninja.Tile.TYPE_67DEGb = 26; Phaser.Physics.Ninja.Tile.TYPE_HALF = 30; +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -3051,7 +3038,7 @@ Phaser.Physics.Ninja.Circle = function (body, x, y, radius) { this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb] = this.projCircle_67DegB; this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF] = this.projCircle_Half; -} +}; Phaser.Physics.Ninja.Circle.prototype.constructor = Phaser.Physics.Ninja.Circle; @@ -3091,7 +3078,7 @@ Phaser.Physics.Ninja.Circle.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this Circle collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -3304,9 +3291,9 @@ Phaser.Physics.Ninja.Circle.prototype = { //if we're colliding vs. horiz. or vert. neighb, we simply project horiz/vert //if we're colliding diagonally, we need to collide vs. tile corner - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //collision with current cell if (x < y) @@ -3314,7 +3301,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //penetration in x is smaller; project in x var dx = obj.pos.x - t.pos.x;//get sign for projection along x-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dx < 0) { obj.reportCollisionVsWorld(-x, 0, -1, 0, t); @@ -3328,10 +3315,10 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - //penetration in y is smaller; project in y + //penetration in y is smaller; project in y var dy = obj.pos.y - t.pos.y;//get sign for projection along y-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dy < 0) { obj.reportCollisionVsWorld(0, -y, 0, -1, t); @@ -3352,7 +3339,7 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_AXIS; } } - else if (oV == 0) + else if (oV === 0) { //collision with horizontal neighbor obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t); @@ -3366,7 +3353,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -3375,7 +3362,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -3422,9 +3409,9 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile @@ -3432,7 +3419,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = (obj.pos.x - (sx * obj.radius)) - t.pos.x;//this gives is the coordinates of the innermost - var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center + var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center //if the dotprod of (ox,oy) and (sx,sy) is negative, the innermost point is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) @@ -3451,7 +3438,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -3463,7 +3450,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -3506,13 +3493,13 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronoi region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronoi region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if (0 < (perp * signx * signy)) { @@ -3551,7 +3538,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -3570,7 +3557,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = obj.pos.x - (t.pos.x + (oH * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) @@ -3580,8 +3567,8 @@ Phaser.Physics.Ninja.Circle.prototype = { // for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if ((perp * signx * signy) < 0) { @@ -3636,7 +3623,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -3644,7 +3631,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -3692,13 +3679,13 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to + var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to var oy = (t.pos.y + (signy * t.yw)) - obj.pos.y;//tile-circle's center var twid = t.xw * 2; @@ -3717,7 +3704,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -3729,7 +3716,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -3780,7 +3767,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x - (signx * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -3788,7 +3775,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out vertically dx = 0; @@ -3807,7 +3794,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -3825,7 +3812,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y - (signy * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -3833,7 +3820,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out horizontally dx = oH; @@ -3868,7 +3855,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -3876,7 +3863,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -3926,14 +3913,14 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -3952,7 +3939,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -3964,7 +3951,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -3980,7 +3967,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //projeciton by an axis shoudl always be shorter, and we should //never arrive here ox /= len; @@ -4008,7 +3995,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -4021,7 +4008,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -4033,7 +4020,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -4048,7 +4035,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -4061,7 +4048,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -4080,7 +4067,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in diag neighb cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -4093,7 +4080,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -4110,7 +4097,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -4118,7 +4105,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -4173,85 +4160,84 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var celldp = (oH*signx + oV*signy);//this tells us about the configuration of cell-offset relative to tile normal - if(0 < celldp) + if (0 < celldp) { //obj is in "far" (pointed-at-by-normal) neighbor of halffull tile, and will never hit return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile var r = obj.radius; var ox = (obj.pos.x - (signx*r)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*r)) - t.pos.y;//point on the circle, relative to the tile center - - - //we perform operations analogous to the 45deg tile, except we're using + + + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. var sx = signx; var sy = signy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - if(dp < 0) + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - - + sy *= -dp; + + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP,t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.signx,t.signy); return Phaser.Physics.Ninja.Circle.COL_OTHER; } return true; - } - + } + } else { //colliding vertically - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dx = obj.pos.x - t.pos.x; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dx*signx) < 0) + if ((dx*signx) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dy = obj.pos.y - (t.pos.y + oV*t.yw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -4262,12 +4248,12 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else @@ -4276,41 +4262,40 @@ Phaser.Physics.Ninja.Circle.prototype = { //we can only collide with the cell edge //collision with vertical neighbor obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } - + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dy = obj.pos.y - t.pos.y; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dy*signy) < 0) + if ((dy*signy) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(x*oH,0,oH,0,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dx = obj.pos.x - (t.pos.x + oH*t.xw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -4321,25 +4306,25 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else - { + { //due to the first conditional (celldp >0), we know w're in the cell "opposite" the normal, and so //we can only collide with the cell edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } else - { + { //colliding diagonally; we know, due to the initial (celldp >0) test which has failed //if we've reached this point, that we're in a diagonal neighbor on the non-normal side, so //we could only be colliding with the cell vertex, if at all. @@ -4347,16 +4332,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -4369,14 +4354,14 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } - + return Phaser.Physics.Ninja.Circle.COL_NONE; - + }, /** @@ -4392,7 +4377,7 @@ Phaser.Physics.Ninja.Circle.prototype = { * @return {number} The result of the collision. */ projCircle_22DegS: function (x,y,oH,oV,obj,t) { - + //if the object is in a cell pointed at by signy, no collision will ever occur //otherwise, // @@ -4401,115 +4386,116 @@ Phaser.Physics.Ninja.Circle.prototype = { //if obj is in this tile: collide vs slope or vertex //if obj is horiz neighb in direction of slope: collide vs. slope or vertex //if obj is horiz neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is vert neighb against direction of slope: collide vs. face + var lenP; var signx = t.signx; var signy = t.signy; - if(0 < (signy*oV)) + if (0 < (signy*oV)) { //object will never collide vs tile, it can't reach that far - + return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner - + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal or axially. - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronio region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.Circle.COL_OTHER; } - + } } - + } else { @@ -4517,42 +4503,42 @@ Phaser.Physics.Ninja.Circle.prototype = { //due to the first conditional far above obj.reportCollisionVsWorld(0,y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if((signx*oH) < 0) + if ((signx*oH) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x - (signx*t.xw); var vy = t.pos.y; - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dy*signy) < 0) + + if ((dy*signy) < 0) { //colliding vs face obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -4565,7 +4551,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -4574,13 +4560,13 @@ Phaser.Physics.Ninja.Circle.prototype = { { //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x + (oH*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal, otherwise by the vertex. @@ -4589,41 +4575,41 @@ Phaser.Physics.Ninja.Circle.prototype = { // for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -4639,16 +4625,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -4661,7 +4647,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -4696,81 +4682,82 @@ Phaser.Physics.Ninja.Circle.prototype = { // //if obj is vert neighb in direction of slope: collide vs. slope or vertex + var lenP; var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x, y, x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - } + } + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -4780,77 +4767,77 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen,sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert - - if((oy*signy) < 0) + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert + + if ((oy*signy) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -4858,79 +4845,79 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope //we should really precalc this at compile time, but for now, fuck it var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*1) / slen;//get slope _unit_ normal; var sy = (signy*2) / slen;//raw RH normal is (1,-2) - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } return Phaser.Physics.Ninja.Circle.COL_NONE; @@ -4940,16 +4927,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -4965,10 +4952,10 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -4994,47 +4981,48 @@ Phaser.Physics.Ninja.Circle.prototype = { //if obj is in this tile: collide vs slope or vertex or axis //if obj is vert neighb in direction of slope: collide vs. slope or vertex //if obj is vert neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is horiz neighb against direction of slope: collide vs. face var signx = t.signx; var signy = t.signy; - if(0 < (signx*oH)) + if (0 < (signx*oH)) { //object will never collide vs tile, it can't reach that far return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal or axis, otherwise by the corner/vertex - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronoi region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; @@ -5042,99 +5030,99 @@ Phaser.Physics.Ninja.Circle.prototype = { obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } } - + } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x; var vy = t.pos.y - (signy*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dx*signx) < 0) - { + + if ((dx*signx) < 0) + { //colliding vs face obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -5145,9 +5133,9 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -5156,68 +5144,68 @@ Phaser.Physics.Ninja.Circle.prototype = { { //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally; we can assume that (signy*oV) < 0 //due to the first conditional far above - obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { //colliding diagonally; due to the first conditional above, //obj is vertically offset against slope, and offset in either direction horizontally @@ -5225,16 +5213,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -5247,7 +5235,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -5285,75 +5273,76 @@ Phaser.Physics.Ninja.Circle.prototype = { var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); @@ -5363,16 +5352,16 @@ Phaser.Physics.Ninja.Circle.prototype = { else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert - - if((ox*signx) < 0) + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + + if ((ox*signx) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - return Phaser.Physics.Ninja.Circle.COL_AXIS; + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -5380,60 +5369,60 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the slope. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -5444,47 +5433,47 @@ Phaser.Physics.Ninja.Circle.prototype = { var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*2) / slen;//get slope _unit_ normal; var sy = (signy*1) / slen;//raw RH normal is (1,-2) - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -5493,27 +5482,27 @@ Phaser.Physics.Ninja.Circle.prototype = { else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); @@ -5524,20 +5513,20 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - + //collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -5553,10 +5542,10 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -5570,4 +5559,4 @@ Phaser.Physics.Ninja.Circle.prototype = { this.system = null; } -} +}; diff --git a/build/custom/ninja.min.js b/build/custom/ninja.min.js index 0180b64eac..27f501bbbe 100644 --- a/build/custom/ninja.min.js +++ b/build/custom/ninja.min.js @@ -1,3 +1,3 @@ /* Ninja Physics for Phaser v2.0.2 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */ -Phaser.Physics.Ninja=function(a){this.game=a,this.time=this.game.time,this.gravity=.2,this.bounds=new Phaser.Rectangle(0,0,a.world.width,a.world.height),this.maxObjects=10,this.maxLevels=4,this.quadTree=new Phaser.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels)},Phaser.Physics.Ninja.prototype.constructor=Phaser.Physics.Ninja,Phaser.Physics.Ninja.prototype={enableAABB:function(a,b){this.enable(a,1,0,0,b)},enableCircle:function(a,b,c){this.enable(a,2,0,b,c)},enableTile:function(a,b,c){this.enable(a,3,b,0,c)},enable:function(a,b,c,d,e){if("undefined"==typeof b&&(b=1),"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=!0),Array.isArray(a))for(i=a.length;i--;)a[i]instanceof Phaser.Group?this.enable(a[i].children,b,c,d,e):(this.enableBody(a[i],b,c,d),e&&a[i].hasOwnProperty("children")&&a[i].children.length>0&&this.enable(a[i],b,c,d,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c,d,e):(this.enableBody(a,b,c,d),e&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,c,d,!0))},enableBody:function(a,b,c,d){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.Ninja.Body(this,a,b,c,d),a.anchor.set(.5))},setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c){b=a.getLayer(b),"undefined"==typeof addToWorld&&(addToWorld=!0),"undefined"==typeof optimize&&(optimize=!0),this.clearTilemapLayerBodies(a,b);for(var d=0,e=a.layers[b].height;e>d;d++)for(var f=0,g=a.layers[b].width;g>f;f++){var h=a.layers[b].data[d][f];if(h&&c.hasOwnProperty(h.index)){var i=new Phaser.Physics.Ninja.Body(this,null,3,c[h.index],0,h.worldX+h.centerX,h.worldY+h.centerY,h.width,h.height);a.layers[b].bodies.push(i)}}return a.layers[b].bodies},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,b,c,d,e,f){return"undefined"!=typeof b||a.type!==Phaser.GROUP&&a.type!==Phaser.EMITTER?void(a&&b&&a.exists&&b.exists&&(a.type==Phaser.SPRITE||a.type==Phaser.TILESPRITE?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsSprite(a,b,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideSpriteVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,c,d,e):a.type==Phaser.GROUP?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e):a.type==Phaser.TILEMAPLAYER?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,c,d,e):(b.type==Phaser.GROUP||b.type==Phaser.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,c,d,e):a.type==Phaser.EMITTER&&(b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e)))):void this.collideGroupVsSelf(a,c,d,e,f)},collideSpriteVsSprite:function(a,b,c,d,e,f){this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++)},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length)for(var g=0,h=b.children.length;h>g;g++)b.children[g].exists&&b.children[g].body&&this.separate(a.body,b.children[g].body,d,e,f)&&(c&&c.call(e,a,b.children[g]),this._total++)},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},separate:function(a,b){return a.type!==Phaser.Physics.NINJA||b.type!==Phaser.Physics.NINJA?!1:a.aabb&&b.aabb?a.aabb.collideAABBVsAABB(b.aabb):a.aabb&&b.tile?a.aabb.collideAABBVsTile(b.tile):a.tile&&b.aabb?b.aabb.collideAABBVsTile(a.tile):a.circle&&b.tile?a.circle.collideCircleVsTile(b.tile):a.tile&&b.circle?b.circle.collideCircleVsTile(a.tile):void 0}},Phaser.Physics.Ninja.Body=function(a,b,c,d,e,f,g,h,i){b=b||null,"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=16),this.sprite=b,this.game=a.game,this.type=Phaser.Physics.NINJA,this.system=a,this.aabb=null,this.tile=null,this.circle=null,this.shape=null,this.drag=1,this.friction=.05,this.gravityScale=1,this.bounce=.3,this.velocity=new Phaser.Point,this.facing=Phaser.NONE,this.immovable=!1,this.collideWorldBounds=!0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.maxSpeed=8,b&&(f=b.x,g=b.y,h=b.width,i=b.height,0===b.anchor.x&&(f+=.5*b.width),0===b.anchor.y&&(g+=.5*b.height)),1===c?(this.aabb=new Phaser.Physics.Ninja.AABB(this,f,g,h,i),this.shape=this.aabb):2===c?(this.circle=new Phaser.Physics.Ninja.Circle(this,f,g,e),this.shape=this.circle):3===c&&(this.tile=new Phaser.Physics.Ninja.Tile(this,f,g,h,i,d),this.shape=this.tile)},Phaser.Physics.Ninja.Body.prototype={preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.shape.integrate(),this.collideWorldBounds&&this.shape.collideWorldBounds()},postUpdate:function(){this.sprite&&(this.sprite.type===Phaser.TILESPRITE?(this.sprite.x=this.shape.pos.x-this.shape.xw,this.sprite.y=this.shape.pos.y-this.shape.yw):(this.sprite.x=this.shape.pos.x,this.sprite.y=this.shape.pos.y)),this.velocity.x<0?this.facing=Phaser.LEFT:this.velocity.x>0&&(this.facing=Phaser.RIGHT),this.velocity.y<0?this.facing=Phaser.UP:this.velocity.y>0&&(this.facing=Phaser.DOWN)},setZeroVelocity:function(){this.shape.oldpos.x=this.shape.pos.x,this.shape.oldpos.y=this.shape.pos.y},moveTo:function(a,b){var c=a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveFrom:function(a,b){var c=-a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveLeft:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveRight:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveUp:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},moveDown:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},reset:function(){this.velocity.set(0),this.shape.pos.x=this.sprite.x,this.shape.pos.y=this.sprite.y,this.shape.oldpos.copyFrom(this.shape.pos)},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.shape.pos.x-this.shape.oldpos.x},deltaY:function(){return this.shape.pos.y-this.shape.oldpos.y},destroy:function(){this.sprite=null,this.system=null,this.aabb=null,this.tile=null,this.circle=null,this.shape.destroy(),this.shape=null}},Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"x",{get:function(){return this.shape.pos.x},set:function(a){this.shape.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"y",{get:function(){return this.shape.pos.y},set:function(a){this.shape.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"width",{get:function(){return this.shape.width}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"height",{get:function(){return this.shape.height}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"bottom",{get:function(){return this.shape.pos.y+this.shape.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"right",{get:function(){return this.shape.pos.x+this.shape.xw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"speed",{get:function(){return Math.sqrt(this.shape.velocity.x*this.shape.velocity.x+this.shape.velocity.y*this.shape.velocity.y)}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"angle",{get:function(){return Math.atan2(this.shape.velocity.y,this.shape.velocity.x)}}),Phaser.Physics.Ninja.AABB=function(a,b,c,d,e){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.aabbTileProjections={},this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projAABB_Full,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projAABB_45Deg,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projAABB_Concave,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projAABB_Convex,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projAABB_22DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projAABB_22DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projAABB_67DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projAABB_67DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projAABB_Half},Phaser.Physics.Ninja.AABB.prototype.constructor=Phaser.Physics.Ninja.AABB,Phaser.Physics.Ninja.AABB.COL_NONE=0,Phaser.Physics.Ninja.AABB.COL_AXIS=1,Phaser.Physics.Ninja.AABB.COL_OTHER=2,Phaser.Physics.Ninja.AABB.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},reverse:function(){var a=this.pos.x-this.oldpos.x,b=this.pos.y-this.oldpos.y;this.oldpos.xthis.pos.x&&(this.oldpos.x=this.pos.x-a),this.oldpos.ythis.pos.y&&(this.oldpos.y=this.pos.y-b)},reportCollisionVsBody:function(a,b,c,d,e){{var f=this.pos.x-this.oldpos.x,g=this.pos.y-this.oldpos.y,h=f*c+g*d;e.pos.x-e.oldpos.x,e.pos.y-e.oldpos.y}return this.body.immovable&&e.body.immovable?(a*=.5,b*=.5,this.pos.add(a,b),this.oldpos.set(this.pos.x,this.pos.y),e.pos.subtract(a,b),void e.oldpos.set(e.pos.x,e.pos.y)):void(this.body.immovable||e.body.immovable?this.body.immovable?e.body.immovable||(e.pos.subtract(a,b),0>h&&e.reverse()):(this.pos.subtract(a,b),0>h&&this.reverse()):(a*=.5,b*=.5,this.pos.add(a,b),e.pos.subtract(a,b),0>h&&(this.reverse(),e.reverse())))},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideAABBVsAABB:function(a){var b=this.pos,c=a,d=c.pos.x,e=c.pos.y,f=c.xw,g=c.yw,h=b.x-d,i=f+this.xw-Math.abs(h);if(i>0){var j=b.y-e,k=g+this.yw-Math.abs(j);if(k>0){k>i?0>h?(i*=-1,k=0):k=0:0>j?(i=0,k*=-1):i=0;var l=Math.sqrt(i*i+k*k);return this.reportCollisionVsBody(i,k,i/l,k/l,c),Phaser.Physics.Ninja.AABB.COL_AXIS}}return!1},collideAABBVsTile:function(a){var b=this.pos.x-a.pos.x,c=a.xw+this.xw-Math.abs(b);if(c>0){var d=this.pos.y-a.pos.y,e=a.yw+this.yw-Math.abs(d);if(e>0)return e>c?0>b?(c*=-1,e=0):e=0:0>d?(c=0,e*=-1):c=0,this.resolveTile(c,e,this,a)}return!1},resolveTile:function(a,b,c,d){return 0i){e*=-i,f*=-i;var j=Math.sqrt(e*e+f*f),k=Math.sqrt(a*a+b*b);return j>k?(c.reportCollisionVsWorld(a,b,a/k,b/k,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(e,f,d.signx,d.signy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_45Deg:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.y-f*c.yw,h=d.pos.y-g;if(h*f>0){var i=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw,h=d.pos.x-g;if(h*e>0){var i=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Convex:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=Math.sqrt(g*g+h*h),j=2*d.xw,k=Math.sqrt(j*j+0),l=k-i;if(0>e*g||0>f*h){var m=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS}return l>0?(g/=i,h/=i,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER):Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Concave:function(a,b,c,d){var e=d.signx,f=d.signy,g=d.pos.x+e*d.xw-(c.pos.x-e*c.xw),h=d.pos.y+f*d.yw-(c.pos.y-f*c.yw),i=2*d.xw,j=Math.sqrt(i*i+0),k=Math.sqrt(g*g+h*h),l=k-j;if(l>0){var m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(g/=k,h/=k,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},destroy:function(){this.body=null,this.system=null}},Phaser.Physics.Ninja.Tile=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Phaser.Physics.Ninja.Tile.EMPTY),this.body=a,this.system=a.system,this.id=f,this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.id>1&&this.id<30&&(e=d),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.velocity=new Phaser.Point,this.signx=0,this.signy=0,this.sx=0,this.sy=0,this.body.gravityScale=0,this.body.collideWorldBounds=!1,this.id>0&&this.setType(this.id)},Phaser.Physics.Ninja.Tile.prototype.constructor=Phaser.Physics.Ninja.Tile,Phaser.Physics.Ninja.Tile.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},setType:function(a){return a===Phaser.Physics.Ninja.Tile.EMPTY?this.clear():(this.id=a,this.updateType()),this},clear:function(){this.id=Phaser.Physics.Ninja.Tile.EMPTY,this.updateType()},destroy:function(){this.body=null,this.system=null},updateType:function(){if(0===this.id)return this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.signx=0,this.signy=0,this.sx=0,this.sy=0,!0;if(this.idn?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.radius);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.radius-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.radius);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.radius-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideCircleVsTile:function(a){var b=this.pos,c=this.radius,d=a,e=d.pos.x,f=d.pos.y,g=d.xw,h=d.yw,i=b.x-e,j=g+c-Math.abs(i);if(j>0){var k=b.y-f,l=h+c-Math.abs(k);if(l>0)return this.oH=0,this.oV=0,-g>i?this.oH=-1:i>g&&(this.oH=1),-h>k?this.oV=-1:k>h&&(this.oV=1),this.resolveCircleTile(j,l,this.oH,this.oV,this,d)}},resolveCircleTile:function(a,b,c,d,e,f){return 0a){var g=e.pos.x-f.pos.x;return 0>g?(e.reportCollisionVsWorld(-a,0,-1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(a,0,1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}var h=e.pos.y-f.pos.y;return 0>h?(e.reportCollisionVsWorld(0,-b,0,-1,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(0,b,0,1,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS}if(0==d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.pos.x+c*f.xw,j=f.pos.y+d*f.yw,g=e.pos.x-i,h=e.pos.y-j,k=Math.sqrt(g*g+h*h),l=e.radius-k;return l>0?(0==k?(g=c/Math.SQRT2,h=d/Math.SQRT2):(g/=k,h/=k),e.reportCollisionVsWorld(g*l,h*l,g,h,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_45Deg:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c)if(0==d){var j=f.sx,k=f.sy,l=e.pos.x-j*e.radius-f.pos.x,m=e.pos.y-k*e.radius-f.pos.y,n=l*j+m*k;if(0>n){j*=-n,k*=-n,b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1));var o=Math.sqrt(j*j+k*k);return o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x-h*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),p=l*-k+m*j;if(p*h*i>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS; -var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-i*f.yw),p=l*-k+m*j;if(0>p*h*i){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,q=Math.sqrt(u*u+v*v),r=e.radius-q;if(r>0)return 0==q?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=q,v/=q),e.reportCollisionVsWorld(u*r,v*r,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Concave:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c){if(0==d){var j=f.pos.x+h*f.xw-e.pos.x,k=f.pos.y+i*f.yw-e.pos.y,l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=n+e.radius-m;return o>0?(b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)):Phaser.Physics.Ninja.Circle.COL_NONE}if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x-h*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=0,s=d):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x+c*f.xw,q=f.pos.y-i*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c,s=0):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Convex:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c)if(0==d){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(h*c+i*d>0){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Half:function(a,b,c,d,e,f){var g=f.signx,h=f.signy,i=c*g+d*h;if(i>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c)if(0==d){var j=e.radius,k=e.pos.x-g*j-f.pos.x,l=e.pos.y-h*j-f.pos.y,m=g,n=h,o=k*m+l*n;if(0>o){m*=-o,n*=-o;var p=Math.sqrt(m*m+n*n),q=Math.sqrt(a*a+b*b);return p>q?(e.reportCollisionVsWorld(a,b,a/q,b/q,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(m,n,f.signx,f.signy),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0!=i)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.radius,r=e.pos.x-f.pos.x;if(0>r*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-(f.pos.y+d*f.yw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0!=i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.radius,s=e.pos.y-f.pos.y;if(0>s*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-(f.pos.x+c*f.xw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var v=f.pos.x+c*f.xw,w=f.pos.y+d*f.yw,r=e.pos.x-v,s=e.pos.y-w,t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(h*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c){if(0!=d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-f.pos.y,n=l*-j+m*i;if(n*g*h>0){var o=Math.sqrt(l*l+m*m),p=k-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{l-=k*i,m-=k*j;var q=l*i+m*j;if(0>q){i*=-q,j*=-q;var r=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),r>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0==d)if(0>g*c){var s=f.pos.x-g*f.xw,t=f.pos.y,u=e.pos.x-s,v=e.pos.y-t;if(0>v*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-h*f.yw),n=l*-j+m*i;if(0>n*g*h){var o=Math.sqrt(l*l+m*m),p=e.radius-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var q=l*i+m*j,p=e.radius-Math.abs(q);if(p>0)return e.reportCollisionVsWorld(i*p,j*p,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x-g*f.xw),m=e.pos.y-j*k-(f.pos.y+h*f.yw),n=l*i+m*j;if(0>n){i*=-n,j*=-n;var o=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-(f.pos.y+h*f.yw),p=l*-j+m*i;if(p*g*h>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var l=e.pos.x-(f.pos.x+g*f.xw),m=e.pos.y-f.pos.y;if(0>m*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,p=l*-j+m*i;if(0>p*g*h){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var s=Math.sqrt(5),i=1*g/s,j=2*h/s,k=e.radius,l=e.pos.x-i*k-(f.pos.x-g*f.xw),m=e.pos.y-j*k-(f.pos.y+h*f.yw),n=l*i+m*j;return 0>n?(e.reportCollisionVsWorld(-i*n,-j*n,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,q=Math.sqrt(v*v+w*w),r=e.radius-q;if(r>0)return 0==q?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=q,w/=q),e.reportCollisionVsWorld(v*r,w*r,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(g*c>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-f.pos.x,m=e.pos.y-(f.pos.y-h*f.yw),n=l*-j+m*i;if(0>n*g*h){var o=Math.sqrt(l*l+m*m),p=k-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{l-=k*i,m-=k*j;var q=l*i+m*j;if(0>q){i*=-q,j*=-q;var r=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),r>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0>h*d){var s=f.pos.x,t=f.pos.y-h*f.yw,u=e.pos.x-s,v=e.pos.y-t;if(0>u*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),n=l*-j+m*i;if(n*g*h>0){var o=Math.sqrt(l*l+m*m),p=e.radius-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var q=l*i+m*j,p=e.radius-Math.abs(q);if(p>0)return e.reportCollisionVsWorld(i*p,j*p,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(0==d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x+g*f.xw),m=e.pos.y-j*k-(f.pos.y-h*f.yw),n=l*i+m*j;if(0>n){i*=-n,j*=-n;var o=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var l=e.pos.x-f.pos.x,m=e.pos.y-(f.pos.y+h*f.yw);if(0>l*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,p=l*-j+m*i;if(p*g*h>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=Math.sqrt(5),i=2*g/s,j=1*h/s,l=e.pos.x-(f.pos.x+g*f.xw),m=e.pos.y-(f.pos.y-h*f.yw),p=l*-j+m*i;if(0>p*g*h){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x+g*f.xw),m=e.pos.y-j*k-(f.pos.y-h*f.yw),n=l*i+m*j;return 0>n?(e.reportCollisionVsWorld(-i*n,-j*n,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,q=Math.sqrt(v*v+w*w),r=e.radius-q;if(r>0)return 0==q?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=q,w/=q),e.reportCollisionVsWorld(v*r,w*r,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},destroy:function(){this.body=null,this.system=null}}; \ No newline at end of file +Phaser.Physics.Ninja=function(a){this.game=a,this.time=this.game.time,this.gravity=.2,this.bounds=new Phaser.Rectangle(0,0,a.world.width,a.world.height),this.maxObjects=10,this.maxLevels=4,this.quadTree=new Phaser.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels)},Phaser.Physics.Ninja.prototype.constructor=Phaser.Physics.Ninja,Phaser.Physics.Ninja.prototype={enableAABB:function(a,b){this.enable(a,1,0,0,b)},enableCircle:function(a,b,c){this.enable(a,2,0,b,c)},enableTile:function(a,b,c){this.enable(a,3,b,0,c)},enable:function(a,b,c,d,e){if("undefined"==typeof b&&(b=1),"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=!0),Array.isArray(a))for(var f=a.length;f--;)a[f]instanceof Phaser.Group?this.enable(a[f].children,b,c,d,e):(this.enableBody(a[f],b,c,d),e&&a[f].hasOwnProperty("children")&&a[f].children.length>0&&this.enable(a[f],b,c,d,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c,d,e):(this.enableBody(a,b,c,d),e&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,c,d,!0))},enableBody:function(a,b,c,d){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.Ninja.Body(this,a,b,c,d),a.anchor.set(.5))},setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c){b=a.getLayer(b),this.clearTilemapLayerBodies(a,b);for(var d=0,e=a.layers[b].height;e>d;d++)for(var f=0,g=a.layers[b].width;g>f;f++){var h=a.layers[b].data[d][f];if(h&&c.hasOwnProperty(h.index)){var i=new Phaser.Physics.Ninja.Body(this,null,3,c[h.index],0,h.worldX+h.centerX,h.worldY+h.centerY,h.width,h.height);a.layers[b].bodies.push(i)}}return a.layers[b].bodies},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,b,c,d,e,f){return"undefined"!=typeof b||a.type!==Phaser.GROUP&&a.type!==Phaser.EMITTER?void(a&&b&&a.exists&&b.exists&&(a.type==Phaser.SPRITE||a.type==Phaser.TILESPRITE?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsSprite(a,b,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideSpriteVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,c,d,e):a.type==Phaser.GROUP?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e):a.type==Phaser.TILEMAPLAYER?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,c,d,e):(b.type==Phaser.GROUP||b.type==Phaser.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,c,d,e):a.type==Phaser.EMITTER&&(b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e)))):void this.collideGroupVsSelf(a,c,d,e,f)},collideSpriteVsSprite:function(a,b,c,d,e,f){this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++)},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length)for(var g=0,h=b.children.length;h>g;g++)b.children[g].exists&&b.children[g].body&&this.separate(a.body,b.children[g].body,d,e,f)&&(c&&c.call(e,a,b.children[g]),this._total++)},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},separate:function(a,b){return a.type!==Phaser.Physics.NINJA||b.type!==Phaser.Physics.NINJA?!1:a.aabb&&b.aabb?a.aabb.collideAABBVsAABB(b.aabb):a.aabb&&b.tile?a.aabb.collideAABBVsTile(b.tile):a.tile&&b.aabb?b.aabb.collideAABBVsTile(a.tile):a.circle&&b.tile?a.circle.collideCircleVsTile(b.tile):a.tile&&b.circle?b.circle.collideCircleVsTile(a.tile):void 0}},Phaser.Physics.Ninja.Body=function(a,b,c,d,e,f,g,h,i){b=b||null,"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=16),this.sprite=b,this.game=a.game,this.type=Phaser.Physics.NINJA,this.system=a,this.aabb=null,this.tile=null,this.circle=null,this.shape=null,this.drag=1,this.friction=.05,this.gravityScale=1,this.bounce=.3,this.velocity=new Phaser.Point,this.facing=Phaser.NONE,this.immovable=!1,this.collideWorldBounds=!0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.maxSpeed=8,b&&(f=b.x,g=b.y,h=b.width,i=b.height,0===b.anchor.x&&(f+=.5*b.width),0===b.anchor.y&&(g+=.5*b.height)),1===c?(this.aabb=new Phaser.Physics.Ninja.AABB(this,f,g,h,i),this.shape=this.aabb):2===c?(this.circle=new Phaser.Physics.Ninja.Circle(this,f,g,e),this.shape=this.circle):3===c&&(this.tile=new Phaser.Physics.Ninja.Tile(this,f,g,h,i,d),this.shape=this.tile)},Phaser.Physics.Ninja.Body.prototype={preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.shape.integrate(),this.collideWorldBounds&&this.shape.collideWorldBounds()},postUpdate:function(){this.sprite&&(this.sprite.type===Phaser.TILESPRITE?(this.sprite.x=this.shape.pos.x-this.shape.xw,this.sprite.y=this.shape.pos.y-this.shape.yw):(this.sprite.x=this.shape.pos.x,this.sprite.y=this.shape.pos.y)),this.velocity.x<0?this.facing=Phaser.LEFT:this.velocity.x>0&&(this.facing=Phaser.RIGHT),this.velocity.y<0?this.facing=Phaser.UP:this.velocity.y>0&&(this.facing=Phaser.DOWN)},setZeroVelocity:function(){this.shape.oldpos.x=this.shape.pos.x,this.shape.oldpos.y=this.shape.pos.y},moveTo:function(a,b){var c=a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveFrom:function(a,b){var c=-a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveLeft:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveRight:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveUp:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},moveDown:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},reset:function(){this.velocity.set(0),this.shape.pos.x=this.sprite.x,this.shape.pos.y=this.sprite.y,this.shape.oldpos.copyFrom(this.shape.pos)},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.shape.pos.x-this.shape.oldpos.x},deltaY:function(){return this.shape.pos.y-this.shape.oldpos.y},destroy:function(){this.sprite=null,this.system=null,this.aabb=null,this.tile=null,this.circle=null,this.shape.destroy(),this.shape=null}},Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"x",{get:function(){return this.shape.pos.x},set:function(a){this.shape.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"y",{get:function(){return this.shape.pos.y},set:function(a){this.shape.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"width",{get:function(){return this.shape.width}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"height",{get:function(){return this.shape.height}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"bottom",{get:function(){return this.shape.pos.y+this.shape.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"right",{get:function(){return this.shape.pos.x+this.shape.xw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"speed",{get:function(){return Math.sqrt(this.shape.velocity.x*this.shape.velocity.x+this.shape.velocity.y*this.shape.velocity.y)}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"angle",{get:function(){return Math.atan2(this.shape.velocity.y,this.shape.velocity.x)}}),Phaser.Physics.Ninja.AABB=function(a,b,c,d,e){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.aabbTileProjections={},this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projAABB_Full,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projAABB_45Deg,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projAABB_Concave,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projAABB_Convex,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projAABB_22DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projAABB_22DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projAABB_67DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projAABB_67DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projAABB_Half},Phaser.Physics.Ninja.AABB.prototype.constructor=Phaser.Physics.Ninja.AABB,Phaser.Physics.Ninja.AABB.COL_NONE=0,Phaser.Physics.Ninja.AABB.COL_AXIS=1,Phaser.Physics.Ninja.AABB.COL_OTHER=2,Phaser.Physics.Ninja.AABB.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},reverse:function(){var a=this.pos.x-this.oldpos.x,b=this.pos.y-this.oldpos.y;this.oldpos.xthis.pos.x&&(this.oldpos.x=this.pos.x-a),this.oldpos.ythis.pos.y&&(this.oldpos.y=this.pos.y-b)},reportCollisionVsBody:function(a,b,c,d,e){var f=this.pos.x-this.oldpos.x,g=this.pos.y-this.oldpos.y,h=f*c+g*d;return this.body.immovable&&e.body.immovable?(a*=.5,b*=.5,this.pos.add(a,b),this.oldpos.set(this.pos.x,this.pos.y),e.pos.subtract(a,b),void e.oldpos.set(e.pos.x,e.pos.y)):void(this.body.immovable||e.body.immovable?this.body.immovable?e.body.immovable||(e.pos.subtract(a,b),0>h&&e.reverse()):(this.pos.subtract(a,b),0>h&&this.reverse()):(a*=.5,b*=.5,this.pos.add(a,b),e.pos.subtract(a,b),0>h&&(this.reverse(),e.reverse())))},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideAABBVsAABB:function(a){var b=this.pos,c=a,d=c.pos.x,e=c.pos.y,f=c.xw,g=c.yw,h=b.x-d,i=f+this.xw-Math.abs(h);if(i>0){var j=b.y-e,k=g+this.yw-Math.abs(j);if(k>0){k>i?0>h?(i*=-1,k=0):k=0:0>j?(i=0,k*=-1):i=0;var l=Math.sqrt(i*i+k*k);return this.reportCollisionVsBody(i,k,i/l,k/l,c),Phaser.Physics.Ninja.AABB.COL_AXIS}}return!1},collideAABBVsTile:function(a){var b=this.pos.x-a.pos.x,c=a.xw+this.xw-Math.abs(b);if(c>0){var d=this.pos.y-a.pos.y,e=a.yw+this.yw-Math.abs(d);if(e>0)return e>c?0>b?(c*=-1,e=0):e=0:0>d?(c=0,e*=-1):c=0,this.resolveTile(c,e,this,a)}return!1},resolveTile:function(a,b,c,d){return 0i){e*=-i,f*=-i;var j=Math.sqrt(e*e+f*f),k=Math.sqrt(a*a+b*b);return j>k?(c.reportCollisionVsWorld(a,b,a/k,b/k,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(e,f,d.signx,d.signy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_45Deg:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.y-f*c.yw,h=d.pos.y-g;if(h*f>0){var i=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw,h=d.pos.x-g;if(h*e>0){var i=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Convex:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=Math.sqrt(g*g+h*h),j=2*d.xw,k=Math.sqrt(j*j+0),l=k-i;if(0>e*g||0>f*h){var m=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS}return l>0?(g/=i,h/=i,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER):Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Concave:function(a,b,c,d){var e=d.signx,f=d.signy,g=d.pos.x+e*d.xw-(c.pos.x-e*c.xw),h=d.pos.y+f*d.yw-(c.pos.y-f*c.yw),i=2*d.xw,j=Math.sqrt(i*i+0),k=Math.sqrt(g*g+h*h),l=k-j;if(l>0){var m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(g/=k,h/=k,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},destroy:function(){this.body=null,this.system=null}},Phaser.Physics.Ninja.Tile=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Phaser.Physics.Ninja.Tile.EMPTY),this.body=a,this.system=a.system,this.id=f,this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.id>1&&this.id<30&&(e=d),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.velocity=new Phaser.Point,this.signx=0,this.signy=0,this.sx=0,this.sy=0,this.body.gravityScale=0,this.body.collideWorldBounds=!1,this.id>0&&this.setType(this.id)},Phaser.Physics.Ninja.Tile.prototype.constructor=Phaser.Physics.Ninja.Tile,Phaser.Physics.Ninja.Tile.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},setType:function(a){return a===Phaser.Physics.Ninja.Tile.EMPTY?this.clear():(this.id=a,this.updateType()),this},clear:function(){this.id=Phaser.Physics.Ninja.Tile.EMPTY,this.updateType()},destroy:function(){this.body=null,this.system=null},updateType:function(){if(0===this.id)return this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.signx=0,this.signy=0,this.sx=0,this.sy=0,!0;if(this.idn?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.radius);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.radius-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.radius);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.radius-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideCircleVsTile:function(a){var b=this.pos,c=this.radius,d=a,e=d.pos.x,f=d.pos.y,g=d.xw,h=d.yw,i=b.x-e,j=g+c-Math.abs(i);if(j>0){var k=b.y-f,l=h+c-Math.abs(k);if(l>0)return this.oH=0,this.oV=0,-g>i?this.oH=-1:i>g&&(this.oH=1),-h>k?this.oV=-1:k>h&&(this.oV=1),this.resolveCircleTile(j,l,this.oH,this.oV,this,d)}},resolveCircleTile:function(a,b,c,d,e,f){return 0a){var g=e.pos.x-f.pos.x;return 0>g?(e.reportCollisionVsWorld(-a,0,-1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(a,0,1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}var h=e.pos.y-f.pos.y;return 0>h?(e.reportCollisionVsWorld(0,-b,0,-1,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(0,b,0,1,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS}if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.pos.x+c*f.xw,j=f.pos.y+d*f.yw,g=e.pos.x-i,h=e.pos.y-j,k=Math.sqrt(g*g+h*h),l=e.radius-k;return l>0?(0===k?(g=c/Math.SQRT2,h=d/Math.SQRT2):(g/=k,h/=k),e.reportCollisionVsWorld(g*l,h*l,g,h,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_45Deg:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.pos.x-j*e.radius-f.pos.x,m=e.pos.y-k*e.radius-f.pos.y,n=l*j+m*k;if(0>n){j*=-n,k*=-n,b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1));var o=Math.sqrt(j*j+k*k);return o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x-h*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),p=l*-k+m*j;if(p*h*i>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-i*f.yw),p=l*-k+m*j; +if(0>p*h*i){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,q=Math.sqrt(u*u+v*v),r=e.radius-q;if(r>0)return 0===q?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=q,v/=q),e.reportCollisionVsWorld(u*r,v*r,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Concave:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c){if(0===d){var j=f.pos.x+h*f.xw-e.pos.x,k=f.pos.y+i*f.yw-e.pos.y,l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=n+e.radius-m;return o>0?(b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)):Phaser.Physics.Ninja.Circle.COL_NONE}if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x-h*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=0,s=d):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x+c*f.xw,q=f.pos.y-i*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c,s=0):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Convex:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(h*c+i*d>0){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Half:function(a,b,c,d,e,f){var g=f.signx,h=f.signy,i=c*g+d*h;if(i>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var j=e.radius,k=e.pos.x-g*j-f.pos.x,l=e.pos.y-h*j-f.pos.y,m=g,n=h,o=k*m+l*n;if(0>o){m*=-o,n*=-o;var p=Math.sqrt(m*m+n*n),q=Math.sqrt(a*a+b*b);return p>q?(e.reportCollisionVsWorld(a,b,a/q,b/q,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(m,n,f.signx,f.signy),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0!==i)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-f.pos.x;if(0>r*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-(f.pos.y+d*f.yw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0!==i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-f.pos.y;if(0>s*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-(f.pos.x+c*f.xw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var v=f.pos.x+c*f.xw,w=f.pos.y+d*f.yw,r=e.pos.x-v,s=e.pos.y-w,t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegS:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c){if(0!==d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-f.pos.y,o=m*-k+n*j;if(o*h*i>0){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0===d)if(0>h*c){var t=f.pos.x-h*f.xw,u=f.pos.y,v=e.pos.x-t,w=e.pos.y-u;if(0>w*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x+c*f.xw),n=e.pos.y-(f.pos.y-i*f.yw),o=m*-k+n*j;if(0>o*h*i){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegB:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-(f.pos.y+i*f.yw),q=m*-k+n*j;if(q*h*i>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-(f.pos.x+h*f.xw),n=e.pos.y-f.pos.y;if(0>n*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(0>q*h*i){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0){var t=Math.sqrt(5),j=1*h/t,k=2*i/t,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(g*c>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y-h*f.yw),o=m*-k+n*j;if(0>o*g*h){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0>h*d){var t=f.pos.x,u=f.pos.y-h*f.yw,v=e.pos.x-t,w=e.pos.y-u;if(0>v*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-g*f.xw),n=e.pos.y-(f.pos.y+d*f.yw),o=m*-k+n*j;if(o*g*h>0){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y+h*f.yw);if(0>m*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(q*g*h>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=Math.sqrt(5),j=2*g/t,k=1*h/t,m=e.pos.x-(f.pos.x+g*f.xw),n=e.pos.y-(f.pos.y-h*f.yw),q=m*-k+n*j;if(0>q*g*h){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},destroy:function(){this.body=null,this.system=null}}; \ No newline at end of file diff --git a/build/custom/p2.js b/build/custom/p2.js index 3bbbcfb0ba..e13a3e6933 100644 --- a/build/custom/p2.js +++ b/build/custom/p2.js @@ -1,18 +1,18 @@ /** * The MIT License (MIT) - * + * * Copyright (c) 2013 p2.js authors - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -30,12 +30,12 @@ are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; @@ -131,7 +131,7 @@ mat2.transpose = function(out, a) { out[2] = a[1]; out[3] = a[3]; } - + return out; }; @@ -152,7 +152,7 @@ mat2.invert = function(out, a) { return null; } det = 1.0 / det; - + out[0] = a3 * det; out[1] = -a1 * det; out[2] = -a2 * det; @@ -273,12 +273,12 @@ are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; @@ -296,7 +296,7 @@ var vec2 = {}; if(!GLMAT_EPSILON) { var GLMAT_EPSILON = 0.000001; } - + /** * Creates a new, empty vec2 * @@ -667,7 +667,7 @@ vec2.forEach = (function() { if(!offset) { offset = 0; } - + if(count) { l = Math.min((count * stride) + offset, a.length); } else { @@ -679,7 +679,7 @@ vec2.forEach = (function() { fn(vec, vec, arg); a[i] = vec[0]; a[i+1] = vec[1]; } - + return a; }; })(); @@ -10715,6 +10715,7 @@ World.prototype.hitTest = function(worldPoint,bodies,precision){ (36) }); ; + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -10754,7 +10755,7 @@ Phaser.Physics.P2 = function (game, config) { * @property {number} frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property. * @default */ - this.frameRate = 1 / 60; + this.frameRate = 1 / 60; /** * @property {boolean} useElapsedTime - If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.physicsElapsed, which is a delta time value. @@ -10864,7 +10865,7 @@ Phaser.Physics.P2 = function (game, config) { * @property {array} _toRemove - Internal var used to hold references to bodies to remove from the world on the next step. */ this._toRemove = []; - + /** * @property {array} collisionGroups - Internal var. */ @@ -10996,7 +10997,7 @@ Phaser.Physics.P2.prototype = { if (object.hasOwnProperty('body') && object.body === null) { object.body = new Phaser.Physics.P2.Body(this.game, object, object.x, object.y, 1); - object.body.debug = debug + object.body.debug = debug; object.anchor.set(0.5); } @@ -11296,7 +11297,7 @@ Phaser.Physics.P2.prototype = { } else { - this.bounds = new p2.Body({ mass: 0, position:[this.pxmi(cx), this.pxmi(cy)] }); + this.bounds = new p2.Body({ mass: 0, position: [this.pxmi(cx), this.pxmi(cy)] }); } if (left) @@ -11308,7 +11309,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[0].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966); } if (right) @@ -11320,7 +11321,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[1].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966); } if (top) @@ -11332,7 +11333,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[2].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793 ); + this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793); } if (bottom) @@ -11344,7 +11345,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[3].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)] ); + this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)]); } this.world.addBody(this.bounds); @@ -12024,12 +12025,12 @@ Phaser.Physics.P2.prototype = { * @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {Phaser.Physics.P2.Body} The body */ @@ -12066,12 +12067,12 @@ Phaser.Physics.P2.prototype = { * @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. */ createParticle: function (x, y, mass, addToWorld, options, data) { @@ -12113,8 +12114,6 @@ Phaser.Physics.P2.prototype = { if (typeof addToWorld === 'undefined') { addToWorld = true; } - layer = map.getLayer(layer); - var output = []; for (var i = 0, len = map.collision[layer].length; i < len; i++) @@ -12258,7 +12257,7 @@ Phaser.Physics.P2.prototype = { * Convert p2 physics value (meters) to pixel scale. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpx * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -12273,7 +12272,7 @@ Phaser.Physics.P2.prototype = { * Convert pixel value to p2 physics scale (meters). * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxm * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -12288,7 +12287,7 @@ Phaser.Physics.P2.prototype = { * Convert p2 physics value (meters) to pixel scale and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpxi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -12303,7 +12302,7 @@ Phaser.Physics.P2.prototype = { * Convert pixel value to p2 physics scale (meters) and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxmi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -12321,7 +12320,7 @@ Phaser.Physics.P2.prototype = { * @property {number} friction - Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", { - + get: function () { return this.world.defaultFriction; @@ -12341,7 +12340,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", { * @property {number} restitution - Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "restituion", { - + get: function () { return this.world.defaultRestitution; @@ -12361,7 +12360,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "restituion", { * @property {boolean} applySpringForces - Enable to automatically apply spring forces each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applySpringForces", { - + get: function () { return this.world.applySpringForces; @@ -12381,7 +12380,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applySpringForces", { * @property {boolean} applyDamping - Enable to automatically apply body damping each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyDamping", { - + get: function () { return this.world.applyDamping; @@ -12401,7 +12400,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applyDamping", { * @property {boolean} applyGravity - Enable to automatically apply gravity each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyGravity", { - + get: function () { return this.world.applyGravity; @@ -12421,7 +12420,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applyGravity", { * @property {boolean} solveConstraints - Enable/disable constraint solving in each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "solveConstraints", { - + get: function () { return this.world.solveConstraints; @@ -12442,7 +12441,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "solveConstraints", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "time", { - + get: function () { return this.world.time; @@ -12456,7 +12455,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "time", { * @property {boolean} emitImpactEvent - Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance. */ Object.defineProperty(Phaser.Physics.P2.prototype, "emitImpactEvent", { - + get: function () { return this.world.emitImpactEvent; @@ -12476,7 +12475,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "emitImpactEvent", { * @property {boolean} enableBodySleeping - Enable / disable automatic body sleeping. */ Object.defineProperty(Phaser.Physics.P2.prototype, "enableBodySleeping", { - + get: function () { return this.world.enableBodySleeping; @@ -12497,7 +12496,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "enableBodySleeping", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "total", { - + get: function () { return this.world.bodies.length; @@ -12535,7 +12534,7 @@ Phaser.Physics.P2.PointProxy.prototype.constructor = Phaser.Physics.P2.PointProx * @property {number} x - The x property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -12555,7 +12554,7 @@ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "x", { * @property {number} y - The y property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -12599,7 +12598,7 @@ Phaser.Physics.P2.InversePointProxy.prototype.constructor = Phaser.Physics.P2.In * @property {number} x - The x property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -12619,7 +12618,7 @@ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { * @property {number} y - The y property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -12770,7 +12769,7 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) { /** * @property {Phaser.Physics.P2.BodyDebug} debugBody - Reference to the debug body. */ - this.debugBody = null + this.debugBody = null; // Set-up the default shape if (sprite) @@ -13399,7 +13398,7 @@ Phaser.Physics.P2.Body.prototype = { this.debugBody.destroy(); } - this.debugBody = null + this.debugBody = null; this.sprite = null; @@ -13563,12 +13562,12 @@ Phaser.Physics.P2.Body.prototype = { * This function expects the x.y values to be given in pixels. If you want to provide them at p2 world scales then call Body.data.fromPolygon directly. * * @method Phaser.Physics.P2.Body#addPolygon - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {boolean} True on success, else false. */ @@ -13601,7 +13600,7 @@ Phaser.Physics.P2.Body.prototype = { // top and tail var idx = path.length - 1; - if ( path[idx][0] === path[0][0] && path[idx][1] === path[0][1] ) + if (path[idx][0] === path[0][0] && path[idx][1] === path[0][1]) { path.pop(); } @@ -13716,7 +13715,7 @@ Phaser.Physics.P2.Body.prototype = { } }, - + /** * Updates the debug draw if any body shapes change. * @@ -13759,7 +13758,7 @@ Phaser.Physics.P2.Body.prototype = { return createdFixtures; }, - + /** * Add a polygon fixture. This is used during #loadPhaserPolygon. * @@ -13772,28 +13771,26 @@ Phaser.Physics.P2.Body.prototype = { if (fixtureData.circle) { - var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)) - shape.collisionGroup = fixtureData.filter.categoryBits - shape.collisionMask = fixtureData.filter.maskBits - shape.sensor = fixtureData.isSensor + var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)); + shape.collisionGroup = fixtureData.filter.categoryBits; + shape.collisionMask = fixtureData.filter.maskBits; + shape.sensor = fixtureData.isSensor; var offset = p2.vec2.create(); - offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2) - offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2) - + offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2); + offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2); + this.data.addShape(shape, offset); - generatedShapes.push(shape) + generatedShapes.push(shape); } else { - polygons = fixtureData.polygons; - + var polygons = fixtureData.polygons; var cm = p2.vec2.create(); for (var i = 0; i < polygons.length; i++) { - shapes = polygons[i]; - + var shapes = polygons[i]; var vertices = []; for (var s = 0; s < shapes.length; s += 2) @@ -13915,7 +13912,7 @@ Phaser.Physics.P2.Body.prototype = { * @method Phaser.Physics.P2.Body#loadPolygon * @param {string} key - The key of the Physics Data file as stored in Game.Cache. * @param {string} object - The key of the object within the Physics data file that you wish to load the shape data from. - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. @@ -13967,7 +13964,7 @@ Phaser.Physics.P2.Body.KINEMATIC = 4; * @property {boolean} static - Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.STATIC); @@ -14000,7 +13997,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", { * @property {boolean} dynamic - Returns true if the Body is dynamic. Setting Body.dynamic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC); @@ -14033,7 +14030,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", { * @property {boolean} kinematic - Returns true if the Body is kinematic. Setting Body.kinematic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC); @@ -14059,10 +14056,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", { /** * @name Phaser.Physics.P2.Body#allowSleep -* @property {boolean} allowSleep - +* @property {boolean} allowSleep - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "allowSleep", { - + get: function () { return this.data.allowSleep; @@ -14084,7 +14081,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "allowSleep", { * The angle of the Body in degrees from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement Body.angle = 450 is the same as Body.angle = 90. * If you wish to work in radians instead of degrees use the property Body.rotation instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#angle * @property {number} angle - The angle of this Body in degrees. */ @@ -14110,7 +14107,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angle", { * @property {number} angularDamping - The angular damping acting acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularDamping", { - + get: function () { return this.data.angularDamping; @@ -14130,7 +14127,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularDamping", { * @property {number} angularForce - The angular force acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularForce", { - + get: function () { return this.data.angularForce; @@ -14150,7 +14147,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularForce", { * @property {number} angularVelocity - The angular velocity of the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularVelocity", { - + get: function () { return this.data.angularVelocity; @@ -14171,7 +14168,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularVelocity", { * @property {number} damping - The linear damping acting on the body in the velocity direction. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "damping", { - + get: function () { return this.data.damping; @@ -14188,10 +14185,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "damping", { /** * @name Phaser.Physics.P2.Body#fixedRotation -* @property {boolean} fixedRotation - +* @property {boolean} fixedRotation - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "fixedRotation", { - + get: function () { return this.data.fixedRotation; @@ -14214,7 +14211,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "fixedRotation", { * @property {number} inertia - The inertia of the body around the Z axis.. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "inertia", { - + get: function () { return this.data.inertia; @@ -14231,10 +14228,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "inertia", { /** * @name Phaser.Physics.P2.Body#mass -* @property {number} mass - +* @property {number} mass - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "mass", { - + get: function () { return this.data.mass; @@ -14258,7 +14255,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "mass", { * @property {number} motionState - The type of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity). */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", { - + get: function () { return this.data.motionState; @@ -14279,7 +14276,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", { /** * The angle of the Body in radians. * If you wish to work in degrees instead of radians use the Body.angle property instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#rotation * @property {number} rotation - The angle of this Body in radians. */ @@ -14304,7 +14301,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "rotation", { * @property {number} sleepSpeedLimit - . */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "sleepSpeedLimit", { - + get: function () { return this.data.sleepSpeedLimit; @@ -14324,7 +14321,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "sleepSpeedLimit", { * @property {number} x - The x coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "x", { - + get: function () { return this.world.mpxi(this.data.position[0]); @@ -14344,7 +14341,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "x", { * @property {number} y - The y coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "y", { - + get: function () { return this.world.mpxi(this.data.position[1]); @@ -14365,7 +14362,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "id", { - + get: function () { return this.data.id; @@ -14379,7 +14376,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "id", { * @property {boolean} debug - Enable or disable debug drawing of this body */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { - + get: function () { return (!this.debugBody); @@ -14391,7 +14388,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { if (value && !this.debugBody) { // This will be added to the global space - this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data) + this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data); } else if (!value && this.debugBody) { @@ -14410,7 +14407,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { * @property {boolean} collideWorldBounds - Should the Body collide with the World bounds? */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "collideWorldBounds", { - + get: function () { return this._collideWorldBounds; @@ -14467,7 +14464,7 @@ Phaser.Physics.P2.BodyDebug = function(game, body, settings) { debugPolygons: false, lineWidth: 1, alpha: 0.5 - } + }; this.settings = Phaser.Utils.extend(defaultSettings, settings); @@ -14487,16 +14484,16 @@ Phaser.Physics.P2.BodyDebug = function(game, body, settings) { */ this.canvas = new Phaser.Graphics(game); - this.canvas.alpha = this.settings.alpha + this.canvas.alpha = this.settings.alpha; this.add(this.canvas); this.draw(); -} +}; -Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype) -Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug +Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype); +Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug; Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { @@ -14531,7 +14528,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { * @method Phaser.Physics.P2.BodyDebug#draw */ draw: function() { - + var angle, child, color, i, j, lineColor, lw, obj, offset, sprite, v, verts, vrot, _j, _ref1; obj = this.body; sprite = this.canvas; @@ -14542,10 +14539,10 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { if (obj instanceof p2.Body && obj.shapes.length) { - var l = obj.shapes.length + var l = obj.shapes.length; i = 0; - + while (i !== l) { child = obj.shapes[i]; @@ -14553,7 +14550,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { angle = obj.shapeAngles[i]; offset = offset || 0; angle = angle || 0; - + if (child instanceof p2.Circle) { this.drawCircle(sprite, offset[0] * this.ppu, offset[1] * this.ppu, angle, child.radius * this.ppu, color, lw); @@ -14585,7 +14582,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { this.drawRectangle(sprite, offset[0] * this.ppu, -offset[1] * this.ppu, angle, child.width * this.ppu, child.height * this.ppu, lineColor, color, lw); } - i++ + i++; } } @@ -14689,7 +14686,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { { colors = [0xff0000, 0x00ff00, 0x0000ff]; i = 0; - + while (i !== verts.length + 1) { v0 = verts[i % verts.length]; @@ -14860,7 +14857,8 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { } -}) +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -14930,7 +14928,7 @@ Phaser.Physics.P2.Spring = function (world, bodyA, bodyB, restLength, stiffness, p2.Spring.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.Spring.prototype = Object.create(p2.Spring.prototype); Phaser.Physics.P2.Spring.prototype.constructor = Phaser.Physics.P2.Spring; @@ -14958,7 +14956,7 @@ Phaser.Physics.P2.Material = function (name) { p2.Material.call(this); -} +}; Phaser.Physics.P2.Material.prototype = Object.create(p2.Material.prototype); Phaser.Physics.P2.Material.prototype.constructor = Phaser.Physics.P2.Material; @@ -15023,7 +15021,7 @@ Phaser.Physics.P2.ContactMaterial = function (materialA, materialB, options) { p2.ContactMaterial.call(this, materialA, materialB, options); -} +}; Phaser.Physics.P2.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype); Phaser.Physics.P2.ContactMaterial.prototype.constructor = Phaser.Physics.P2.ContactMaterial; @@ -15048,7 +15046,7 @@ Phaser.Physics.P2.CollisionGroup = function (bitmask) { */ this.mask = bitmask; -} +}; /** * @author Richard Davey @@ -15086,7 +15084,7 @@ Phaser.Physics.P2.DistanceConstraint = function (world, bodyA, bodyB, distance, p2.DistanceConstraint.call(this, bodyA, bodyB, distance, maxForce); -} +}; Phaser.Physics.P2.DistanceConstraint.prototype = Object.create(p2.DistanceConstraint.prototype); Phaser.Physics.P2.DistanceConstraint.prototype.constructor = Phaser.Physics.P2.DistanceConstraint; @@ -15128,7 +15126,7 @@ Phaser.Physics.P2.GearConstraint = function (world, bodyA, bodyB, angle, ratio) p2.GearConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.GearConstraint.prototype = Object.create(p2.GearConstraint.prototype); Phaser.Physics.P2.GearConstraint.prototype.constructor = Phaser.Physics.P2.GearConstraint; @@ -15174,7 +15172,7 @@ Phaser.Physics.P2.LockConstraint = function (world, bodyA, bodyB, offset, angle, p2.LockConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.LockConstraint.prototype = Object.create(p2.LockConstraint.prototype); Phaser.Physics.P2.LockConstraint.prototype.constructor = Phaser.Physics.P2.LockConstraint; @@ -15225,7 +15223,7 @@ Phaser.Physics.P2.PrismaticConstraint = function (world, bodyA, bodyB, lockRotat p2.PrismaticConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.PrismaticConstraint.prototype = Object.create(p2.PrismaticConstraint.prototype); Phaser.Physics.P2.PrismaticConstraint.prototype.constructor = Phaser.Physics.P2.PrismaticConstraint; @@ -15269,7 +15267,7 @@ Phaser.Physics.P2.RevoluteConstraint = function (world, bodyA, pivotA, bodyB, pi p2.RevoluteConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); -} +}; Phaser.Physics.P2.RevoluteConstraint.prototype = Object.create(p2.RevoluteConstraint.prototype); Phaser.Physics.P2.RevoluteConstraint.prototype.constructor = Phaser.Physics.P2.RevoluteConstraint; diff --git a/build/custom/p2.min.js b/build/custom/p2.min.js index fd36229573..420e987bd8 100644 --- a/build/custom/p2.min.js +++ b/build/custom/p2.min.js @@ -2,5 +2,5 @@ !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define("p2",function(){return this.p2=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;g0&&(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=d)},{}],3:[function(a,b){function c(){}var d=a("./Scalar");b.exports=c,c.lineInt=function(a,b,c){c=c||0;var e,f,g,h,i,j,k,l=[0,0];return e=a[1][1]-a[0][1],f=a[0][0]-a[1][0],g=e*a[0][0]+f*a[0][1],h=b[1][1]-b[0][1],i=b[0][0]-b[1][0],j=h*b[0][0]+i*b[0][1],k=e*i-h*f,d.eq(k,0,c)||(l[0]=(i*g-f*j)/k,l[1]=(e*j-h*g)/k),l},c.segmentsIntersect=function(a,b,c,d){var e=b[0]-a[0],f=b[1]-a[1],g=d[0]-c[0],h=d[1]-c[1];if(g*f-h*e==0)return!1;var i=(e*(c[1]-a[1])+f*(a[0]-c[0]))/(g*f-h*e),j=(g*(a[1]-c[1])+h*(c[0]-a[0]))/(h*e-g*f);return i>=0&&1>=i&&j>=0&&1>=j}},{"./Scalar":6}],4:[function(a,b){function c(){}b.exports=c,c.area=function(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])},c.left=function(a,b,d){return c.area(a,b,d)>0},c.leftOn=function(a,b,d){return c.area(a,b,d)>=0},c.right=function(a,b,d){return c.area(a,b,d)<0},c.rightOn=function(a,b,d){return c.area(a,b,d)<=0};var d=[],e=[];c.collinear=function(a,b,f,g){if(g){var h=d,i=e;h[0]=b[0]-a[0],h[1]=b[1]-a[1],i[0]=f[0]-b[0],i[1]=f[1]-b[1];var j=h[0]*i[0]+h[1]*i[1],k=Math.sqrt(h[0]*h[0]+h[1]*h[1]),l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=Math.acos(j/(k*l));return g>m}return 0==c.area(a,b,f)},c.sqdist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d}},{}],5:[function(a,b){function c(){this.vertices=[]}function d(a,b,c,d,e){e=e||0;var f=b[1]-a[1],h=a[0]-b[0],i=f*a[0]+h*a[1],j=d[1]-c[1],k=c[0]-d[0],l=j*c[0]+k*c[1],m=f*k-j*h;return g.eq(m,0,e)?[0,0]:[(k*i-h*l)/m,(f*l-j*i)/m]}var e=a("./Line"),f=a("./Point"),g=a("./Scalar");b.exports=c,c.prototype.at=function(a){var b=this.vertices,c=b.length;return b[0>a?a%c+c:a%c]},c.prototype.first=function(){return this.vertices[0]},c.prototype.last=function(){return this.vertices[this.vertices.length-1]},c.prototype.clear=function(){this.vertices.length=0},c.prototype.append=function(a,b,c){if("undefined"==typeof b)throw new Error("From is not given!");if("undefined"==typeof c)throw new Error("To is not given!");if(b>c-1)throw new Error("lol1");if(c>a.vertices.length)throw new Error("lol2");if(0>b)throw new Error("lol3");for(var d=b;c>d;d++)this.vertices.push(a.vertices[d])},c.prototype.makeCCW=function(){for(var a=0,b=this.vertices,c=1;cb[a][0])&&(a=c);f.left(this.at(a-1),this.at(a),this.at(a+1))||this.reverse()},c.prototype.reverse=function(){for(var a=[],b=0,c=this.vertices.length;b!==c;b++)a.push(this.vertices.pop());this.vertices=a},c.prototype.isReflex=function(a){return f.right(this.at(a-1),this.at(a),this.at(a+1))};var h=[],i=[];c.prototype.canSee=function(a,b){var c,d,g=h,j=i;if(f.leftOn(this.at(a+1),this.at(a),this.at(b))&&f.rightOn(this.at(a-1),this.at(a),this.at(b)))return!1;d=f.sqdist(this.at(a),this.at(b));for(var k=0;k!==this.vertices.length;++k)if((k+1)%this.vertices.length!==a&&k!==a&&f.leftOn(this.at(a),this.at(b),this.at(k+1))&&f.rightOn(this.at(a),this.at(b),this.at(k))&&(g[0]=this.at(a),g[1]=this.at(b),j[0]=this.at(k),j[1]=this.at(k+1),c=e.lineInt(g,j),f.sqdist(this.at(a),c)a)for(var f=a;b>=f;f++)e.vertices.push(this.vertices[f]);else{for(var f=0;b>=f;f++)e.vertices.push(this.vertices[f]);for(var f=a;f0?this.slice(a):[this]},c.prototype.slice=function(a){if(0==a.length)return[this];if(a instanceof Array&&a.length&&a[0]instanceof Array&&2==a[0].length&&a[0][0]instanceof Array){for(var b=[this],c=0;cc;c++)if(e.segmentsIntersect(a[b],a[b+1],a[c],a[c+1]))return!1;for(var b=1;bh)return console.warn("quickDecomp: max level ("+h+") reached."),a;for(var x=0;xo&&(n=o,k=l,r=y))),f.left(v.at(x+1),v.at(x),v.at(y+1))&&f.rightOn(v.at(x+1),v.at(x),v.at(y))&&(l=d(v.at(x+1),v.at(x),v.at(y),v.at(y+1)),f.left(v.at(x-1),v.at(x),l)&&(o=f.sqdist(v.vertices[x],l),m>o&&(m=o,j=l,q=y)));if(r==(q+1)%this.vertices.length)l[0]=(k[0]+j[0])/2,l[1]=(k[1]+j[1])/2,e.push(l),q>x?(t.append(v,x,q+1),t.vertices.push(l),u.vertices.push(l),0!=r&&u.append(v,r,v.vertices.length),u.append(v,0,x+1)):(0!=x&&t.append(v,x,v.vertices.length),t.append(v,0,q+1),t.vertices.push(l),u.vertices.push(l),u.append(v,r,x+1));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.length3&&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}],6:[function(a,b){function c(){}b.exports=c,c.eq=function(a,b,c){return c=c||0,Math.abs(a-b) (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:{jshint:"latest",nodeunit:"latest",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"~0.1.2","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"*","grunt-browserify":"*",browserify:"*"},dependencies:{underscore:"*","poly-decomp":"git://github.com/schteppe/poly-decomp.js","gl-matrix":"2.0.0",jsonschema:"*"}}},{}],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("../math/vec2");a("../utils/Utils")}b.exports=c;var e=d.create();c.prototype.setFromPoints=function(a,b,c){var f=this.lowerBound,g=this.upperBound;d.set(f,Number.MAX_VALUE,Number.MAX_VALUE),d.set(g,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var h=0;hj;j++)i[j]>g[j]&&(g[j]=i[j]),i[j]b;b++)a.lowerBound[b]this.upperBound[b]&&(this.upperBound[b]=a.upperBound[b])},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":33,"../utils/Utils":50}],10:[function(a,b){function c(a){this.type=a,this.result=[],this.world=null}var d=a("../math/vec2"),e=a("../objects/Body");b.exports=c,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.aabbNeedsUpdate&&a.updateAABB(),b.aabbNeedsUpdate&&b.updateAABB(),a.aabb.overlaps(b.aabb)},c.canCollide=function(a,b){return a.motionState==e.STATIC&&b.motionState==e.STATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.STATIC||a.motionState==e.STATIC&&b.motionState==e.KINEMATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.KINEMATIC?!1:a.sleepState==e.SLEEPING&&b.sleepState==e.SLEEPING?!1:!0},c.NAIVE=1,c.SAP=2},{"../math/vec2":33,"../objects/Body":34}],11:[function(a,b){function d(a,b,c,d,e,f){h.apply(this),e=e||10,f=f||10,this.binsizeX=(b-a)/e,this.binsizeY=(d-c)/f,this.nx=e,this.ny=f,this.xmin=a,this.ymin=c,this.xmax=b,this.ymax=d}{var e=a("../shapes/Circle"),f=a("../shapes/Plane"),g=a("../shapes/Particle"),h=a("../collision/Broadphase");a("../math/vec2")}b.exports=d,d.prototype=new h,d.prototype.getBinIndex=function(a,b){var c=this.nx,d=this.ny,e=this.xmin,f=this.ymin,g=this.xmax,h=this.ymax,i=Math.floor(c*(a-e)/(g-e)),j=Math.floor(d*(b-f)/(h-f));return i*d+j},d.prototype.getCollisionPairs=function(a){for(var b=[],d=a.bodies,i=i=d.length,j=this.binsizeX,k=this.binsizeY,l=[],m=nx*ny,n=0;m>n;n++)l.push([]);for(var o=nx/(xmax-xmin),p=ny/(ymax-ymin),n=0;n!==i;n++){var q=d[n],r=q.shape;if(void 0!==r)if(r instanceof e)for(var s=q.position[0],t=q.position[1],u=r.radius,v=Math.floor(o*(s-u-xmin)),w=Math.floor(p*(t-u-ymin)),x=Math.floor(o*(s+u-xmin)),y=Math.floor(p*(t+u-ymin)),z=v;x>=z;z++)for(var A=w;y>=A;A++){var B=z,C=A;B*(ny-1)+C>=0&&m>B*(ny-1)+C&&l[B*(ny-1)+C].push(q)}else{if(!(r instanceof f))throw new Error("Shape not supported in GridBroadphase!");if(0==q.angle)for(var t=q.position[1],z=0;z!==m&&t>ymin+k*(z-1);z++)for(var A=0;nx>A;A++){var B=A,C=Math.floor(p*(k*z-ymin));l[B*(ny-1)+C].push(q)}else if(q.angle==.5*Math.PI)for(var s=q.position[0],z=0;z!==m&&s>xmin+j*(z-1);z++)for(var A=0;ny>A;A++){var C=A,B=Math.floor(o*(j*z-xmin));l[B*(ny-1)+C].push(q)}else for(var z=0;z!==m;z++)l[z].push(q)}}for(var n=0;n!==m;n++)for(var D=l[n],z=0,E=D.length;z!==E;z++)for(var q=D[z],r=q.shape,A=0;A!==z;A++){var F=D[A],G=F.shape;r instanceof e?G instanceof e?c=h.circleCircle(q,F):G instanceof g?c=h.circleParticle(q,F):G instanceof f&&(c=h.circlePlane(q,F)):r instanceof g?G instanceof e&&(c=h.circleParticle(F,q)):r instanceof f&&G instanceof e&&(c=h.circlePlane(F,q))}return b}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43}],12:[function(a,b){function c(){d.call(this,d.NAIVE),this.useBoundingBoxes=!1}{var d=(a("../shapes/Circle"),a("../shapes/Plane"),a("../shapes/Shape"),a("../shapes/Particle"),a("../collision/Broadphase"));a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.getCollisionPairs=function(a){var b,c,e,f,g=a.bodies,h=this.result,i=this.useBoundingBoxes?d.aabbCheck:d.boundingRadiusCheck;for(h.length=0,b=0,Ncolliding=g.length;b!==Ncolliding;b++)for(e=g[b],c=0;b>c;c++)f=g[c],d.canCollide(e,f)&&i(e,f)&&h.push(e,f);return h}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Shape":45}],13:[function(a,b){function c(){this.contactEquations=[],this.frictionEquations=[],this.enableFriction=!0,this.slipForce=10,this.frictionCoefficient=.3,this.surfaceVelocity=0,this.reuseObjects=!0,this.reusableContactEquations=[],this.reusableFrictionEquations=[],this.restitution=0,this.stiffness=1e7,this.relaxation=3,this.frictionStiffness=1e7,this.frictionRelaxation=3,this.collidingBodiesLastStep={keys:[]}}function d(a){for(var b=0,c=a.keys.length;c>b;b++)delete a[a.keys[b]];a.keys.length=0}function e(a,b){g.set(a.vertices[0],.5*-b.length,-b.radius),g.set(a.vertices[1],.5*b.length,-b.radius),g.set(a.vertices[2],.5*b.length,b.radius),g.set(a.vertices[3],.5*-b.length,b.radius)}function f(a,b,c,d){for(var e=Q,f=R,j=S,k=T,l=a,m=b.vertices,n=null,o=0;o!==m.length+1;o++){var p=m[o%m.length],q=m[(o+1)%m.length];g.rotate(e,p,d),g.rotate(f,q,d),i(e,e,c),i(f,f,c),h(j,e,l),h(k,f,l);var r=g.crossLength(j,k);if(null===n&&(n=r),0>=r*n)return!1;n=r}return!0}var g=a("../math/vec2"),h=g.sub,i=g.add,j=g.dot,k=a("../utils/Utils"),l=a("../equations/ContactEquation"),m=a("../equations/FrictionEquation"),n=a("../shapes/Circle"),o=a("../shapes/Shape"),p=a("../objects/Body"),q=a("../shapes/Rectangle");b.exports=c;var r=g.fromValues(0,1),s=g.fromValues(0,0),t=g.fromValues(0,0),u=g.fromValues(0,0),v=g.fromValues(0,0),w=g.fromValues(0,0),x=g.fromValues(0,0),y=g.fromValues(0,0),z=g.fromValues(0,0),A=g.fromValues(0,0),B=g.fromValues(0,0),C=g.fromValues(0,0),D=g.fromValues(0,0),E=g.fromValues(0,0),F=g.fromValues(0,0),G=g.fromValues(0,0),H=g.fromValues(0,0),I=g.fromValues(0,0),J=g.fromValues(0,0),K=[];c.prototype.collidedLastStep=function(a,b){var c=a.id,d=b.id;if(c>d){var e=c;c=d,d=e}return!!this.collidingBodiesLastStep[c+" "+d]},c.prototype.reset=function(){d(this.collidingBodiesLastStep);for(var a=0;a!==this.contactEquations.length;a++){var b=this.contactEquations[a],c=b.bi.id,e=b.bj.id;if(c>e){var f=c;c=e,e=f}var g=c+" "+e;this.collidingBodiesLastStep[g]||(this.collidingBodiesLastStep[g]=!0,this.collidingBodiesLastStep.keys.push(g))}if(this.reuseObjects){var h=this.contactEquations,i=this.frictionEquations,j=this.reusableFrictionEquations,l=this.reusableContactEquations;k.appendArray(l,h),k.appendArray(j,i)}this.contactEquations.length=this.frictionEquations.length=0},c.prototype.createContactEquation=function(a,b,c,d){var e=this.reusableContactEquations.length?this.reusableContactEquations.pop():new l(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.restitution=this.restitution,e.firstImpact=!this.collidedLastStep(a,b),e.stiffness=this.stiffness,e.relaxation=this.relaxation,e.enabled=!0,a.allowSleep&&a.motionState==p.DYNAMIC&&b.motionState!=p.STATIC&&b.sleepState!==p.SLEEPY&&a.wakeUp(),b.allowSleep&&b.motionState==p.DYNAMIC&&a.motionState!=p.STATIC&&a.sleepState!==p.SLEEPY&&b.wakeUp(),e},c.prototype.createFrictionEquation=function(a,b,c,d){var e=this.reusableFrictionEquations.length?this.reusableFrictionEquations.pop():new m(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.setSlipForce(this.slipForce),e.frictionCoefficient=this.frictionCoefficient,e.relativeVelocity=this.surfaceVelocity,e.enabled=!0,e.frictionStiffness=this.frictionStiffness,e.frictionRelaxation=this.frictionRelaxation,e},c.prototype.createFrictionFromContact=function(a){var b=this.createFrictionEquation(a.bi,a.bj,a.shapeA,a.shapeB);return g.copy(b.ri,a.ri),g.copy(b.rj,a.rj),g.rotate(b.t,a.ni,-Math.PI/2),b.contactEquation=a,b},c.prototype[o.LINE|o.CONVEX]=c.prototype.convexLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.LINE|o.RECTANGLE]=c.prototype.lineRectangle=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var L=new q(1,1),M=g.create();c.prototype[o.CAPSULE|o.CONVEX]=c.prototype[o.CAPSULE|o.RECTANGLE]=c.prototype.convexCapsule=function(a,b,c,d,f,h,i,j,k){var l=M;g.set(l,h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var m=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);g.set(l,-h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var n=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);if(k&&(m||n))return!0;var o=L;e(o,h);var p=this.convexConvex(a,b,c,d,f,o,i,j,k);return p+m+n},c.prototype[o.CAPSULE|o.LINE]=c.prototype.lineCapsule=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var N=g.create(),O=g.create(),P=new q(1,1);c.prototype[o.CAPSULE|o.CAPSULE]=c.prototype.capsuleCapsule=function(a,b,c,d,f,h,i,j,k){for(var l=N,m=O,n=0,o=0;2>o;o++){g.set(l,(0==o?-1:1)*b.length/2,0),g.rotate(l,l,d),g.add(l,l,c);for(var p=0;2>p;p++){g.set(m,(0==p?-1:1)*h.length/2,0),g.rotate(m,m,j),g.add(m,m,i);var q=this.circleCircle(a,b,l,d,f,h,m,j,k,b.radius,h.radius);if(k&&q)return!0;n+=q}}var r=P;e(r,b);var s=this.convexCapsule(a,r,c,d,f,h,i,j,k);if(k&&s)return!0;n+=s,e(r,h);var t=this.convexCapsule(f,r,i,j,a,b,c,d,k);return k&&t?!0:n+=t},c.prototype[o.LINE|o.LINE]=c.prototype.lineLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.PLANE|o.LINE]=c.prototype.planeLine=function(a,b,c,d,e,f,k,l,m){var n=s,o=t,p=u,q=v,B=w,C=x,D=y,E=z,F=A,G=K;numContacts=0,g.set(n,-f.length/2,0),g.set(o,f.length/2,0),g.rotate(p,n,l),g.rotate(q,o,l),i(p,p,k),i(q,q,k),g.copy(n,p),g.copy(o,q),h(B,o,n),g.normalize(C,B),g.rotate(F,C,-Math.PI/2),g.rotate(E,r,d),G[0]=n,G[1]=o;for(var H=0;HJ){if(m)return!0;var L=this.createContactEquation(a,e,b,f);numContacts++,g.copy(L.ni,E),g.normalize(L.ni,L.ni),g.scale(D,E,J),h(L.ri,I,D),h(L.ri,L.ri,a.position),h(L.rj,I,k),i(L.rj,L.rj,k),h(L.rj,L.rj,e.position),this.contactEquations.push(L),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(L))}}return numContacts},c.prototype[o.PARTICLE|o.CAPSULE]=c.prototype.particleCapsule=function(a,b,c,d,e,f,g,h,i){return this.circleLine(a,b,c,d,e,f,g,h,i,f.radius,0)},c.prototype[o.CIRCLE|o.LINE]=c.prototype.circleLine=function(a,b,c,d,e,f,k,l,m,n,o){var p=f,q=l,r=e,G=k,H=c,I=a,J=b,n=n||0,o="undefined"!=typeof o?o:J.radius,L=s,M=t,N=u,O=v,P=w,Q=x,R=y,S=z,T=A,U=B,V=C,W=D,X=E,Y=F,Z=K;g.set(S,-p.length/2,0),g.set(T,p.length/2,0),g.rotate(U,S,q),g.rotate(V,T,q),i(U,U,G),i(V,V,G),g.copy(S,U),g.copy(T,V),h(Q,T,S),g.normalize(R,Q),g.rotate(P,R,-Math.PI/2),h(W,H,S);var $=j(W,P);if(h(O,S,G),h(X,H,G),Math.abs($)ab&&bb>_){if(m)return!0;var cb=this.createContactEquation(I,r,b,f);return g.scale(cb.ni,L,-1),g.normalize(cb.ni,cb.ni),g.scale(cb.ri,cb.ni,o),i(cb.ri,cb.ri,H),h(cb.ri,cb.ri,I.position),h(cb.rj,N,G),i(cb.rj,cb.rj,G),h(cb.rj,cb.rj,r.position),this.contactEquations.push(cb),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(cb)),1}}Z[0]=S,Z[1]=T;for(var db=0;dbW&&(g.copy(Q,O),S=W,g.scale(N,K,W),g.add(N,N,O),R=!0)}}if(R){if(m)return!0;var X=this.createContactEquation(y,q,b,j);return g.sub(X.ni,Q,x),g.normalize(X.ni,X.ni),g.scale(X.ri,X.ni,n),i(X.ri,X.ri,x),h(X.ri,X.ri,y.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}if(n>0)for(var T=0;TW&&(Q=W,g.scale(N,H,W),g.add(N,N,z),g.copy(P,H),R=!0)}if(R){var X=this.createContactEquation(A,q,b,k);return g.scale(X.ni,P,-1),g.normalize(X.ni,X.ni),g.set(X.ri,0,0),i(X.ri,X.ri,z),h(X.ri,X.ri,A.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}return 0},c.prototype[o.CIRCLE]=c.prototype.circleCircle=function(a,b,c,d,e,f,j,k,l,m,n){var o=a,p=b,q=c,r=e,t=f,u=j,v=s,m=m||p.radius,n=n||t.radius;h(v,c,j);var w=m+n;if(g.squaredLength(v)>w*w)return 0;if(l)return!0;var x=this.createContactEquation(o,r,b,f);return h(x.ni,u,q),g.normalize(x.ni,x.ni),g.scale(x.ri,x.ni,m),g.scale(x.rj,x.ni,-n),i(x.ri,x.ri,q),h(x.ri,x.ri,o.position),i(x.rj,x.rj,u),h(x.rj,x.rj,r.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.PLANE|o.CONVEX]=c.prototype[o.PLANE|o.RECTANGLE]=c.prototype.planeConvex=function(a,b,c,d,e,f,k,l,m){var n=e,o=k,p=f,q=l,v=a,w=b,x=c,y=d,z=s,A=t,B=u,C=0;g.rotate(A,r,y);for(var D=0;D=2)break}}return C},c.prototype.convexPlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.convexPlane is deprecated. Use planeConvex instead!"),this.planeConvex(e,f,g,h,a,b,c,d,i)},c.prototype[o.PARTICLE|o.PLANE]=c.prototype.particlePlane=function(a,b,c,d,e,f,i,k,l){var m=a,n=c,o=e,p=i,q=k,u=s,v=t;q=q||0,h(u,n,p),g.rotate(v,r,q);var w=j(u,v);if(w>0)return 0;if(l)return!0;var x=this.createContactEquation(o,m,f,b);return g.copy(x.ni,v),g.scale(u,x.ni,w),h(x.ri,n,u),h(x.ri,x.ri,o.position),h(x.rj,n,m.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.CIRCLE|o.PARTICLE]=c.prototype.circleParticle=function(a,b,c,d,e,f,j,k,l){var m=a,n=b,o=c,p=e,q=j,r=s;if(h(r,q,o),g.squaredLength(r)>n.radius*n.radius)return 0;if(l)return!0;var t=this.createContactEquation(m,p,b,f);return g.copy(t.ni,r),g.normalize(t.ni,t.ni),g.scale(t.ri,t.ni,n.radius),i(t.ri,t.ri,o),h(t.ri,t.ri,m.position),h(t.rj,q,p.position),this.contactEquations.push(t),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(t)),1};{var U=new n(1),V=g.create(),W=g.create();g.create()}c.prototype[o.PLANE|o.CAPSULE]=c.prototype.planeCapsule=function(a,b,c,d,e,f,h,j,k){var l=V,m=W,n=U;g.set(l,-f.length/2,0),g.rotate(l,l,j),i(l,l,h),g.set(m,f.length/2,0),g.rotate(m,m,j),i(m,m,h),n.radius=f.radius;var o=this.circlePlane(e,n,l,0,a,b,c,d,k),p=this.circlePlane(e,n,m,0,a,b,c,d,k);return k?o||p:o+p},c.prototype.capsulePlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.capsulePlane() is deprecated. Use .planeCapsule() instead!"),this.planeCapsule(e,f,g,h,a,b,c,d,i)},c.prototype[o.CIRCLE|o.PLANE]=c.prototype.circlePlane=function(a,b,c,d,e,f,k,l,m){var n=a,o=b,p=c,q=e,v=k,w=l;w=w||0;var x=s,y=t,z=u;h(x,p,v),g.rotate(y,r,w);var A=j(y,x);if(A>o.radius)return 0;if(m)return!0;var B=this.createContactEquation(q,n,f,b);return g.copy(B.ni,y),g.scale(B.rj,B.ni,-o.radius),i(B.rj,B.rj,p),h(B.rj,B.rj,n.position),g.scale(z,B.ni,A),h(B.ri,x,z),i(B.ri,B.ri,v),h(B.ri,B.ri,q.position),this.contactEquations.push(B),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(B)),1},c.convexPrecision=1e-10,c.prototype[o.CONVEX]=c.prototype[o.CONVEX|o.RECTANGLE]=c.prototype[o.RECTANGLE]=c.prototype.convexConvex=function(a,b,d,e,f,k,l,m,n,o){var p=s,q=t,r=u,x=v,B=w,C=y,D=z,E=A,F=0,o=o||c.convexPrecision,G=c.findSeparatingAxis(b,d,e,k,l,m,p);if(!G)return 0;h(D,l,d),j(p,D)>0&&g.scale(p,p,-1);var H=c.getClosestEdge(b,e,p,!0),I=c.getClosestEdge(k,m,p);if(-1==H||-1==I)return 0;for(var J=0;2>J;J++){var K=H,L=I,M=b,N=k,O=d,P=l,Q=e,R=m,S=a,T=f;if(0==J){var U;U=K,K=L,L=U,U=M,M=N,N=U,U=O,O=P,P=U,U=Q,Q=R,R=U,U=S,S=T,T=U}for(var V=L;L+2>V;V++){var W=N.vertices[(V+N.vertices.length)%N.vertices.length];g.rotate(q,W,R),i(q,q,P);for(var X=0,Y=K-1;K+2>Y;Y++){var Z=M.vertices[(Y+M.vertices.length)%M.vertices.length],$=M.vertices[(Y+1+M.vertices.length)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(E,B,-Math.PI/2),g.normalize(E,E),h(D,q,r);var _=j(E,D);o>=_&&X++}if(3==X){if(n)return!0;var ab=this.createContactEquation(S,T,M,N);F++;var Z=M.vertices[K%M.vertices.length],$=M.vertices[(K+1)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(ab.ni,B,-Math.PI/2),g.normalize(ab.ni,ab.ni),h(D,q,r);var _=j(ab.ni,D);g.scale(C,ab.ni,_),h(ab.ri,q,O),h(ab.ri,ab.ri,C),i(ab.ri,ab.ri,O),h(ab.ri,ab.ri,S.position),h(ab.rj,q,P),i(ab.rj,ab.rj,P),h(ab.rj,ab.rj,T.position),this.contactEquations.push(ab),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(ab))}}}return F};var X=g.fromValues(0,0);c.projectConvexOntoAxis=function(a,b,c,d,e){var f,h,i=null,k=null,l=X;g.rotate(l,d,-c);for(var m=0;mi)&&(i=h),(null===k||k>h)&&(k=h);if(k>i){var n=k;k=i,i=n}var o=j(b,d);g.set(e,k+o,i+o)};var Y=g.fromValues(0,0),Z=g.fromValues(0,0),$=g.fromValues(0,0),_=g.fromValues(0,0),ab=g.fromValues(0,0),bb=g.fromValues(0,0);c.findSeparatingAxis=function(a,b,d,e,f,i,j){for(var k=null,l=!1,m=!1,n=Y,o=Z,p=$,q=_,r=ab,s=bb,t=0;2!==t;t++){var u=a,v=d;1===t&&(u=e,v=i);for(var w=0;w!==u.vertices.length;w++){g.rotate(o,u.vertices[w],v),g.rotate(p,u.vertices[(w+1)%u.vertices.length],v),h(n,p,o),g.rotate(q,n,-Math.PI/2),g.normalize(q,q),c.projectConvexOntoAxis(a,b,d,q,r),c.projectConvexOntoAxis(e,f,i,q,s);var x=r,y=s,z=!1;r[0]>s[0]&&(y=r,x=s,z=!0);var A=y[0]-x[1];l=0>A,(null===k||A>k)&&(g.copy(j,q),k=A,m=l)}}return m};var cb=g.fromValues(0,0),db=g.fromValues(0,0),eb=g.fromValues(0,0);c.getClosestEdge=function(a,b,c,d){var e=cb,f=db,i=eb;g.rotate(e,c,-b),d&&g.scale(e,e,-1);for(var k=-1,l=a.vertices.length,m=Math.PI/2,n=0;n!==l;n++){h(f,a.vertices[(n+1)%l],a.vertices[n%l]),g.rotate(i,f,-m),g.normalize(i,i);var o=j(i,e);(-1==k||o>maxDot)&&(k=n%l,maxDot=o)}return k};var fb=g.create(),gb=g.create(),hb=g.create(),ib=g.create(),jb=g.create(),kb=g.create(),lb=g.create();c.prototype[o.CIRCLE|o.HEIGHTFIELD]=c.prototype.circleHeightfield=function(a,b,c,d,e,f,j,k,l,m){var n=f.data,m=m||b.radius,o=f.elementWidth,p=gb,q=fb,r=jb,s=lb,t=kb,u=hb,v=ib,w=Math.floor((c[0]-m-j[0])/o),x=Math.ceil((c[0]+m-j[0])/o); 0>w&&(w=0),x>=n.length&&(x=n.length-1);for(var y=n[w],z=n[x],A=w;x>A;A++)n[A]y&&(y=n[A]);if(c[1]-m>y)return l?!1:0;c[1]+mA;A++){g.set(u,A*o,n[A]),g.set(v,(A+1)*o,n[A+1]),g.add(u,u,j),g.add(v,v,j),g.sub(t,v,u),g.rotate(t,t,Math.PI/2),g.normalize(t,t),g.scale(q,t,-m),g.add(q,q,c),g.sub(p,q,u);var D=g.dot(p,t);if(q[0]>=u[0]&&q[0]=D&&(C===!1||Math.abs(D)0)for(var A=w;x>=A;A++)if(g.set(u,A*o,n[A]),g.add(u,u,j),g.sub(p,c,u),g.squaredLength(p)c;c++)this.root.insert(a[c]);else this.root.insert(a)},c.prototype.clear=function(){this.root.clear()},c.prototype.retrieve=function(a){var b=this.root.retrieve(a).slice(0);return b},c.prototype.getCollisionPairs=function(a){var b=[];this.insert(a.bodies);for(var c=0;c!==a.bodies.length;c++)for(var d=a.bodies[c],e=this.retrieve(d),f=0,h=e.length;f!==h;f++){var i=e[f];if(d!==i){for(var j=!1,k=0,l=b.length;l>k;k+=2){var m=b[k],n=b[k+1];if(m==i&&n==d||n==i&&m==d){j=!0;break}}!j&&g.boundingRadiusCheck(d,i)&&b.push(d,i)}}return this.clear(),b},d.prototype.classConstructor=d,d.prototype.children=null,d.prototype.depth=0,d.prototype.maxChildren=4,d.prototype.maxDepth=4,d.TOP_LEFT=0,d.TOP_RIGHT=1,d.BOTTOM_LEFT=2,d.BOTTOM_RIGHT=3,d.prototype.insert=function(a){if(this.nodes.length){var b=this.findIndex(a);return void this.nodes[b].insert(a)}this.children.push(a);var c=this.children.length;if(!(this.depth>=this.maxDepth)&&c>this.maxChildren){this.subdivide();for(var d=0;c>d;d++)this.insert(this.children[d]);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 void(!(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))}this.children.push(a);var d=this.children.length;if(this.depththis.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":43}],15:[function(a,b){function c(){e.call(this,e.SAP),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;this.axisIndex}for(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;if(e.canCollide(j,k)){var l=j.idb;b++){var k=g[b];if(!c.checkBounds(j,k,1))break;if(e.canCollide(j,k)){var l=j.idc)g.scale(e.ni,i,-1),g.sub(e.ri,j,h.position),g.sub(e.rj,k,o.position),g.scale(n,i,c),g.add(e.ri,e.ri,n),-1==a.indexOf(e)&&a.push(e);else{var u=a.indexOf(e);-1!=u&&a.splice(u,1)}if(this.lowerLimitEnabled&&d>s)g.scale(f.ni,i,1),g.sub(f.ri,j,h.position),g.sub(f.rj,k,o.position),g.scale(n,i,d),g.sub(f.rj,f.rj,n),-1==a.indexOf(f)&&a.push(f);else{var u=a.indexOf(f);-1!=u&&a.splice(u,1)}},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}}},{"../equations/ContactEquation":23,"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../math/vec2":33,"./Constraint":16}],21:[function(a,b){function c(a,b,c,n,o){d.call(this,a,c,d.REVOLUTE),o=this.maxForce="undefined"!=typeof o?o:Number.MAX_VALUE,this.pivotA=b,this.pivotB=n;var p=this.equations=[new e(a,c,-o,o),new e(a,c,-o,o)],q=p[0],r=p[1];q.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,k)},r.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,l)},r.minForce=q.minForce=-o,r.maxForce=q.maxForce=o,this.motorEquation=new f(a,c),this.motorEnabled=!1,this.angle=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=0,this.upperLimitEquation=new g(a,c),this.lowerLimitEquation=new g(a,c),this.upperLimitEquation.minForce=0,this.lowerLimitEquation.maxForce=0}var d=a("./Constraint"),e=a("../equations/Equation"),f=a("../equations/RotationalVelocityEquation"),g=a("../equations/RotationalLockEquation"),h=a("../math/vec2");b.exports=c;var i=h.create(),j=h.create(),k=h.fromValues(1,0),l=h.fromValues(0,1),m=h.create();c.prototype=new d,c.prototype.update=function(){var a=this.bodyA,b=this.bodyB,c=this.pivotA,d=this.pivotB,e=this.equations,f=(e[0],e[1],e[0]),g=e[1],m=this.upperLimit,n=this.lowerLimit,o=this.upperLimitEquation,p=this.lowerLimitEquation,q=this.angle=b.angle-a.angle;if(this.upperLimitEnabled&&q>m)o.angle=m,-1==e.indexOf(o)&&e.push(o);else{var r=e.indexOf(o);-1!=r&&e.splice(r,1)}if(this.lowerLimitEnabled&&n>q)p.angle=n,-1==e.indexOf(p)&&e.push(p);else{var r=e.indexOf(p);-1!=r&&e.splice(r,1)}h.rotate(i,c,a.angle),h.rotate(j,d,b.angle),f.G[0]=-1,f.G[1]=0,f.G[2]=-h.crossLength(i,k),f.G[3]=1,f.G[4]=0,f.G[5]=h.crossLength(j,k),g.G[0]=0,g.G[1]=-1,g.G[2]=-h.crossLength(i,l),g.G[3]=0,g.G[4]=1,g.G[5]=h.crossLength(j,l)},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}},c.prototype.motorIsEnabled=function(){return!!this.motorEnabled},c.prototype.setMotorSpeed=function(a){if(this.motorEnabled){var b=this.equations.indexOf(this.motorEquation);this.equations[b].relativeVelocity=a}},c.prototype.getMotorSpeed=function(){return this.motorEnabled?this.motorEquation.relativeVelocity:!1}},{"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../equations/RotationalVelocityEquation":27,"../math/vec2":33,"./Constraint":16}],22:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0,this.ratio="number"==typeof c.ratio?c.ratio:1,this.setRatio(this.ratio)}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeGq=function(){return this.ratio*this.bi.angle-this.bj.angle+this.angle},c.prototype.setRatio=function(a){var b=this.G;b[2]=a,b[5]=-1,this.ratio=a}},{"../math/vec2":33,"./Equation":24}],23:[function(a,b){function c(a,b){d.call(this,a,b,0,Number.MAX_VALUE),this.ri=e.create(),this.penetrationVec=e.create(),this.rj=e.create(),this.ni=e.create(),this.restitution=0,this.firstImpact=!1,this.shapeA=null,this.shapeB=null}{var d=a("./Equation"),e=a("../math/vec2");a("../math/mat2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.bi,f=this.bj,g=this.ri,h=this.rj,i=d.position,j=f.position,k=this.penetrationVec,l=this.ni,m=this.G,n=e.crossLength(g,l),o=e.crossLength(h,l);m[0]=-l[0],m[1]=-l[1],m[2]=-n,m[3]=l[0],m[4]=l[1],m[5]=o,e.add(k,j,h),e.sub(k,k,i),e.sub(k,k,g);var p,q;this.firstImpact&&0!==this.restitution?(q=0,p=1/b*(1+this.restitution)*this.computeGW()):(q=e.dot(l,k),p=this.computeGW());var r=this.computeGiMf(),s=-q*a-p*b-c*r;return s}},{"../math/mat2":31,"../math/vec2":33,"./Equation":24}],24:[function(a,b){function c(a,b,c,d){this.minForce="undefined"==typeof c?-1e6:c,this.maxForce="undefined"==typeof d?1e6:d,this.bi=a,this.bj=b,this.stiffness=1e6,this.relaxation=4,this.G=new g.ARRAY_TYPE(6);for(var e=0;6>e;e++)this.G[e]=0;this.offset=0,this.a=0,this.b=0,this.eps=0,this.h=0,this.updateSpookParams(1/60),this.multiplier=0,this.relativeVelocity=0,this.enabled=!0}function d(a,b,c,d,e){return a[0]*b[0]+a[1]*b[1]+a[2]*c+a[3]*d[0]+a[4]*d[1]+a[5]*e}b.exports=c;var e=a("../math/vec2"),f=a("../math/mat2"),g=a("../utils/Utils");c.prototype.constructor=c,c.prototype.updateSpookParams=function(a){var b=this.stiffness,c=this.relaxation,d=a;this.a=4/(d*(1+4*c)),this.b=4*c/(1+4*c),this.eps=4/(d*d*b*(1+4*c)),this.h=a},c.prototype.computeB=function(a,b,c){var d=this.computeGW(),e=this.computeGq(),f=this.computeGiMf();return-e*a-d*b-f*c};var h=e.create(),i=e.create();c.prototype.computeGq=function(){var a=this.G,b=this.bi,c=this.bj,e=(b.position,c.position,b.angle),f=c.angle;return d(a,h,e,i,f)+this.offset};e.create(),e.create();c.prototype.transformedGmult=function(a,b,c,e,f){return d(a,b,c,e,f)},c.prototype.computeGW=function(){var a=this.G,b=this.bi,c=this.bj,d=b.velocity,e=c.velocity,f=b.angularVelocity,g=c.angularVelocity;return this.transformedGmult(a,d,f,e,g)+this.relativeVelocity},c.prototype.computeGWlambda=function(){var a=this.G,b=this.bi,c=this.bj,e=b.vlambda,f=c.vlambda,g=b.wlambda,h=c.wlambda;return d(a,e,g,f,h)};var j=e.create(),k=e.create();c.prototype.computeGiMf=function(){var a=this.bi,b=this.bj,c=a.force,d=a.angularForce,f=b.force,g=b.angularForce,h=a.invMass,i=b.invMass,l=a.invInertia,m=b.invInertia,n=this.G;return e.scale(j,c,h),e.scale(k,f,i),this.transformedGmult(n,j,d*l,k,g*m)},c.prototype.computeGiMGt=function(){var a=this.bi,b=this.bj,c=a.invMass,d=b.invMass,e=a.invInertia,f=b.invInertia,g=this.G;return g[0]*g[0]*c+g[1]*g[1]*c+g[2]*g[2]*e+g[3]*g[3]*d+g[4]*g[4]*d+g[5]*g[5]*f};{var l=e.create(),m=e.create(),n=e.create();e.create(),e.create(),e.create(),f.create(),f.create()}c.prototype.addToWlambda=function(a){var b=this.bi,c=this.bj,d=l,f=m,g=n,h=this.G;f[0]=h[0],f[1]=h[1],g[0]=h[3],g[1]=h[4],e.scale(d,f,b.invMass*a),e.add(b.vlambda,b.vlambda,d),e.scale(d,g,c.invMass*a),e.add(c.vlambda,c.vlambda,d),b.wlambda+=b.invInertia*h[2]*a,c.wlambda+=c.invInertia*h[5]*a},c.prototype.computeInvC=function(a){return 1/(this.computeGiMGt()+a)}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50}],25:[function(a,b){function c(a,b,c){e.call(this,a,b,-c,c),this.ri=d.create(),this.rj=d.create(),this.t=d.create(),this.contactEquation=null,this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}{var d=(a("../math/mat2"),a("../math/vec2")),e=a("./Equation");a("../utils/Utils")}b.exports=c,c.prototype=new e,c.prototype.constructor=c,c.prototype.setSlipForce=function(a){this.maxForce=a,this.minForce=-a},c.prototype.computeB=function(a,b,c){var e=(this.bi,this.bj,this.ri),f=this.rj,g=this.t,h=this.G;h[0]=-g[0],h[1]=-g[1],h[2]=-d.crossLength(e,g),h[3]=g[0],h[4]=g[1],h[5]=d.crossLength(f,g);var i=this.computeGW(),j=this.computeGiMf(),k=-i*b-c*j;return k}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50,"./Equation":24}],26:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0;var e=this.G;e[2]=1,e[5]=-1}var d=a("./Equation"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.constructor=c;var f=e.create(),g=e.create(),h=e.fromValues(1,0),i=e.fromValues(0,1);c.prototype.computeGq=function(){return e.rotate(f,h,this.bi.angle+this.angle),e.rotate(g,i,this.bj.angle),e.dot(f,g)}},{"../math/vec2":33,"./Equation":24}],27:[function(a,b){function c(a,b){d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.G;d[2]=-1,d[5]=this.ratio;var e=this.computeGiMf(),f=this.computeGW(),g=-f*b-c*e;return g}},{"../math/vec2":33,"./Equation":24}],28:[function(a,b){var c=function(){};b.exports=c,c.prototype={constructor:c,on:function(a,b,c){b.context=c||this,void 0===this._listeners&&(this._listeners={});var d=this._listeners;return void 0===d[a]&&(d[a]=[]),-1===d[a].indexOf(b)&&d[a].push(b),this},has:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},off:function(a,b){if(void 0===this._listeners)return this;var c=this._listeners,d=c[a].indexOf(b);return-1!==d&&c[a].splice(d,1),this},emit:function(a){if(void 0===this._listeners)return this;var b=this._listeners,c=b[a.type];if(void 0!==c){a.target=this;for(var d=0,e=c.length;e>d;d++){var f=c[d];f.call(f.context,a)}}return this}}},{}],29:[function(a,b){function c(a,b,e){if(e=e||{},!(a instanceof d&&b instanceof d))throw new Error("First two arguments must be Material instances.");this.id=c.idCounter++,this.materialA=a,this.materialB=b,this.friction="undefined"!=typeof e.friction?Number(e.friction):.3,this.restitution="undefined"!=typeof e.restitution?Number(e.restitution):0,this.stiffness="undefined"!=typeof e.stiffness?Number(e.stiffness):1e7,this.relaxation="undefined"!=typeof e.relaxation?Number(e.relaxation):3,this.frictionStiffness="undefined"!=typeof e.frictionStiffness?Number(e.frictionStiffness):1e7,this.frictionRelaxation="undefined"!=typeof e.frictionRelaxation?Number(e.frictionRelaxation):3,this.surfaceVelocity="undefined"!=typeof e.surfaceVelocity?Number(e.surfaceVelocity):0}var d=a("./Material");b.exports=c,c.idCounter=0},{"./Material":30}],30:[function(a,b){function c(){this.id=c.idCounter++}b.exports=c,c.idCounter=0},{}],31:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/mat2").mat2;b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/mat2":1}],32:[function(a,b){var c={};c.GetArea=function(a){if(a.length<6)return 0;for(var b=a.length-2,c=0,d=0;b>d;d+=2)c+=(a[d+2]-a[d])*(a[d+1]+a[d+3]);return c+=(a[0]-a[b])*(a[b+1]+a[1]),.5*-c},c.Triangulate=function(a){var b=a.length>>1;if(3>b)return[];for(var d=[],e=[],f=0;b>f;f++)e.push(f);for(var f=0,g=b;g>3;){var h=e[(f+0)%g],i=e[(f+1)%g],j=e[(f+2)%g],k=a[2*h],l=a[2*h+1],m=a[2*i],n=a[2*i+1],o=a[2*j],p=a[2*j+1],q=!1;if(c._convex(k,l,m,n,o,p)){q=!0;for(var r=0;g>r;r++){var s=e[r];if(s!=h&&s!=i&&s!=j&&c._PointInTriangle(a[2*s],a[2*s+1],k,l,m,n,o,p)){q=!1;break}}}if(q)d.push(h,i,j),e.splice((f+1)%g,1),g--,f=0;else if(f++>3*g)break}return d.push(e[0],e[1],e[2]),d},c._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},c._convex=function(a,b,c,d,e,f){return(b-d)*(e-c)+(c-a)*(f-d)>=0},b.exports=c},{}],33:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/vec2").vec2;c.getX=function(a){return a[0]},c.getY=function(a){return a[1]},c.crossLength=function(a,b){return a[0]*b[1]-a[1]*b[0]},c.crossVZ=function(a,b,d){return c.rotate(a,b,-Math.PI/2),c.scale(a,a,d),a},c.crossZV=function(a,b,d){return c.rotate(a,d,Math.PI/2),c.scale(a,a,b),a},c.rotate=function(a,b,c){var d=Math.cos(c),e=Math.sin(c),f=b[0],g=b[1];a[0]=d*f-e*g,a[1]=e*f+d*g},c.toLocalFrame=function(a,b,d,e){c.copy(a,b),c.sub(a,a,d),c.rotate(a,a,-e)},c.toGlobalFrame=function(a,b,d,e){c.copy(a,b),c.rotate(a,a,e),c.add(a,a,d)},c.centroid=function(a,b,d,e){return c.add(a,b,d),c.add(a,a,e),c.scale(a,a,1/3),a},b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/vec2":2}],34:[function(a,b){function c(a){a=a||{},h.call(this),this.id=++c._idCounter,this.world=null,this.shapes=[],this.shapeOffsets=[],this.shapeAngles=[],this.mass=a.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.fixedRotation=!!a.fixedRotation||!1,this.position=d.fromValues(0,0),a.position&&d.copy(this.position,a.position),this.interpolatedPosition=d.fromValues(0,0),this.velocity=d.fromValues(0,0),a.velocity&&d.copy(this.velocity,a.velocity),this.vlambda=d.fromValues(0,0),this.wlambda=0,this.angle=a.angle||0,this.angularVelocity=a.angularVelocity||0,this.force=d.create(),a.force&&d.copy(this.force,a.force),this.angularForce=a.angularForce||0,this.damping="number"==typeof a.damping?a.damping:.1,this.angularDamping="number"==typeof a.angularDamping?a.angularDamping:.1,this.motionState=0==this.mass?c.STATIC:c.DYNAMIC,this.boundingRadius=0,this.aabb=new g,this.aabbNeedsUpdate=!0,this.allowSleep=!1,this.sleepState=c.AWAKE,this.sleepSpeedLimit=.1,this.sleepTimeLimit=1,this.gravityScale=1,this.timeLastSleepy=0,this.concavePath=null,this.lastDampingScale=1,this.lastAngularDampingScale=1,this.lastDampingTimeStep=-1,this.updateMassProperties()}var d=a("../math/vec2"),e=a("poly-decomp"),f=a("../shapes/Convex"),g=a("../collision/AABB"),h=a("../events/EventEmitter");b.exports=c,c.prototype=new h,c._idCounter=0,c.prototype.setDensity=function(a){var b=this.getArea();this.mass=b*a,this.updateMassProperties()},c.prototype.getArea=function(){for(var a=0,b=0;be&&(e=h+i)}this.boundingRadius=e},c.prototype.addShape=function(a,b,c){c=c||0,b=b?d.fromValues(b[0],b[1]):d.fromValues(0,0),this.shapes.push(a),this.shapeOffsets.push(b),this.shapeAngles.push(c),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},c.prototype.removeShape=function(a){var b=this.shapes.indexOf(a);return-1!=b?(this.shapes.splice(b,1),this.shapeOffsets.splice(b,1),this.shapeAngles.splice(b,1),this.aabbNeedsUpdate=!0,!0):!1},c.prototype.updateMassProperties=function(){if(this.motionState==c.STATIC||this.motionState==c.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var a=this.shapes,b=a.length,e=this.mass/b,f=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var g=0;b>g;g++){var h=a[g],i=d.squaredLength(this.shapeOffsets[g]),j=h.computeMomentOfInertia(e);f+=j+e*i}this.inertia=f,this.invInertia=f>0?1/f:0}this.invMass=1/this.mass}};var k=d.create();c.prototype.applyForce=function(a,b){var c=k;d.sub(c,b,this.position),d.add(this.force,this.force,a);var e=d.crossLength(c,a);this.angularForce+=e},c.prototype.toLocalFrame=function(a,b){d.toLocalFrame(a,b,this.position,this.angle)},c.prototype.toWorldFrame=function(a,b){d.toGlobalFrame(a,b,this.position,this.angle)},c.prototype.fromPolygon=function(a,b){b=b||{};for(var c=this.shapes.length;c>=0;--c)this.removeShape(this.shapes[c]);var g=new e.Polygon;if(g.vertices=a,g.makeCCW(),"number"==typeof b.removeCollinearPoints&&g.removeCollinearPoints(b.removeCollinearPoints),"undefined"==typeof b.skipSimpleCheck&&!g.isSimple())return!1;this.concavePath=g.vertices.slice(0);for(var c=0;ce?(this.sleepState=c.SLEEPY,this.timeLastSleepy=a,this.emit(c.sleepyEvent)):b===c.SLEEPY&&e>f?this.wakeUp():b===c.SLEEPY&&a-this.timeLastSleepy>this.sleepTimeLimit&&this.sleep()}},c.sleepyEvent={type:"sleepy"},c.sleepEvent={type:"sleep"},c.wakeUpEvent={type:"wakeup"},c.DYNAMIC=1,c.STATIC=2,c.KINEMATIC=4,c.AWAKE=0,c.SLEEPY=1,c.SLEEPING=2},{"../collision/AABB":9,"../events/EventEmitter":28,"../math/vec2":33,"../shapes/Convex":39,"poly-decomp":7}],35:[function(a,b){function c(a,b,c){c=c||{},this.restLength="number"==typeof c.restLength?c.restLength:1,this.stiffness=c.stiffness||100,this.damping=c.damping||1,this.bodyA=a,this.bodyB=b,this.localAnchorA=d.fromValues(0,0),this.localAnchorB=d.fromValues(0,0),c.localAnchorA&&d.copy(this.localAnchorA,c.localAnchorA),c.localAnchorB&&d.copy(this.localAnchorB,c.localAnchorB),c.worldAnchorA&&this.setWorldAnchorA(c.worldAnchorA),c.worldAnchorB&&this.setWorldAnchorB(c.worldAnchorB)}var d=a("../math/vec2");b.exports=c,c.prototype.setWorldAnchorA=function(a){this.bodyA.toLocalFrame(this.localAnchorA,a)},c.prototype.setWorldAnchorB=function(a){this.bodyB.toLocalFrame(this.localAnchorB,a)},c.prototype.getWorldAnchorA=function(a){this.bodyA.toWorldFrame(a,this.localAnchorA) },c.prototype.getWorldAnchorB=function(a){this.bodyB.toWorldFrame(a,this.localAnchorB)};var e=d.create(),f=d.create(),g=d.create(),h=d.create(),i=d.create(),j=d.create(),k=d.create(),l=d.create(),m=d.create();c.prototype.applyForce=function(){var a=this.stiffness,b=this.damping,c=this.restLength,n=this.bodyA,o=this.bodyB,p=e,q=f,r=g,s=h,t=m,u=i,v=j,w=k,x=l;this.getWorldAnchorA(u),this.getWorldAnchorB(v),d.sub(w,u,n.position),d.sub(x,v,o.position),d.sub(p,v,u);var y=d.len(p);d.normalize(q,p),d.sub(r,o.velocity,n.velocity),d.crossZV(t,o.angularVelocity,x),d.add(r,r,t),d.crossZV(t,n.angularVelocity,w),d.sub(r,r,t),d.scale(s,q,-a*(y-c)-b*d.dot(r,q)),d.sub(n.force,n.force,s),d.add(o.force,o.force,s);var z=d.crossLength(w,s),A=d.crossLength(x,s);n.angularForce-=z,o.angularForce+=A}},{"../math/vec2":33}],36:[function(a,b){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"),Island:a("./solver/IslandSolver"),IslandSolver:a("./solver/IslandSolver"),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"),Utils:a("./utils/Utils"),World:a("./world/World"),QuadTree:a("./collision/QuadTree").QuadTree,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/QuadTree":14,"./collision/SAPBroadphase":15,"./constraints/Constraint":16,"./constraints/DistanceConstraint":17,"./constraints/GearConstraint":18,"./constraints/LockConstraint":19,"./constraints/PrismaticConstraint":20,"./constraints/RevoluteConstraint":21,"./equations/AngleLockEquation":22,"./equations/ContactEquation":23,"./equations/Equation":24,"./equations/FrictionEquation":25,"./equations/RotationalVelocityEquation":27,"./events/EventEmitter":28,"./material/ContactMaterial":29,"./material/Material":30,"./math/vec2":33,"./objects/Body":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/IslandSolver":48,"./solver/Solver":49,"./utils/Utils":50,"./world/World":51}],37:[function(a,b){function c(a,b){this.length=a||1,this.radius=b||1,d.call(this,d.CAPSULE)}var d=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,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":45}],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":45}],39:[function(a,b){function c(a){this.vertices=[];for(var b=0;bg;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":45,"poly-decomp":7}],40:[function(a,b){function c(a,b,c){this.data=a,this.maxValue=b,this.elementWidth=c,d.call(this,d.HEIGHTFIELD)}{var d=a("./Shape");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return Number.MAX_VALUE},c.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},c.prototype.updateArea=function(){for(var a=this.data,b=0,c=0;cf)){var D=u?r:z.eps,E=c.iterateEquation(C,z,D,y,x,w,v,a,f,j,this.useNormalForceForFriction);B+=Math.abs(E)}if(k>=B*B)break}for(A=0;A!==o;A++)n[A].addConstraintVelocity()}},c.iterateEquation=function(a,b,c,d,e,f,g,i,j,k,l){var m=d[a],n=e[a],o=f[a],p=b.computeGWlambda();l&&b instanceof h&&j==k&&(b.maxForce=b.contactEquation.multiplier*b.frictionCoefficient*i,b.minForce=-b.contactEquation.multiplier*b.frictionCoefficient*i);var q=b.maxForce,r=b.minForce;g&&(m=0);var s=n*(m-p-c*o),t=o+s;return r*i>t?s=r*i-o:t>q*i&&(s=q*i-o),f[a]+=s,b.multiplier=f[a]/i,b.addToWlambda(s),s}},{"../equations/FrictionEquation":25,"../math/vec2":33,"../utils/Utils":50,"./Solver":49}],47:[function(a,b){function c(){this.equations=[],this.bodies=[]}b.exports=c,c.prototype.reset=function(){this.equations.length=this.bodies.length=0},c.prototype.getBodies=function(){for(var a=[],b=[],c=this.equations,d=0;d!==c.length;d++){var e=c[d];-1===b.indexOf(e.bi.id)&&(a.push(e.bi),b.push(e.bi.id)),-1===b.indexOf(e.bj.id)&&(a.push(e.bj),b.push(e.bj.id))}return a},c.prototype.solve=function(a,b){var c=[];b.removeAllEquations();for(var d=this.equations.length,e=0;e!==d;e++)b.addEquation(this.equations[e]);for(var f=this.getBodies(),g=f.length,e=0;e!==g;e++)c.push(f[e]);b.solve(a,{bodies:c})}},{}],48:[function(a,b){function c(a,b){g.call(this,b,g.ISLAND);this.subsolver=a,this.numIslands=0,this._nodePool=[],this._islandPool=[],this.beforeSolveIslandEvent={type:"beforeSolveIsland",island:null}}function d(a){for(var b=a.length,c=0;c!==b;c++){var d=a[c];if(!d.visited&&d.body.motionState!=j)return d}return!1}function e(a,b,c){b.push(a.body);for(var d=a.eqs.length,e=0;e!==d;e++){var f=a.eqs[e];-1===c.indexOf(f)&&c.push(f)}}function f(a,b,c,e){for(k.length=0,k.push(a),a.visited=!0,b(a,c,e);k.length;)for(var f,g=k.pop();f=d(g.children);)f.visited=!0,b(f,c,e),k.push(f)}var g=a("./Solver"),h=(a("../math/vec2"),a("../solver/Island")),i=a("../objects/Body"),j=i.STATIC;b.exports=c,c.prototype=new g;var k=[],l=[],m=[],n=[],o=[];c.prototype.solve=function(a,b){var c=l,g=b.bodies,i=this.equations,j=i.length,k=g.length,p=(this.subsolver,this._workers,this._workerData,this._workerIslandGroups,this._islandPool);l.length=0;for(var q=0;q!==k;q++)c.push(this._nodePool.length?this._nodePool.pop():{body:g[q],children:[],eqs:[],visited:!1});for(var q=0;q!==k;q++){var r=c[q];r.body=g[q],r.children.length=0,r.eqs.length=0,r.visited=!1}for(var s=0;s!==j;s++){var t=i[s],q=g.indexOf(t.bi),u=g.indexOf(t.bj),v=c[q],w=c[u];v.children.push(w),v.eqs.push(t),w.children.push(v),w.eqs.push(t)}var x,y=0,z=m,A=n;z.length=0,A.length=0;var B=o;for(B.length=0;x=d(c);){var C=p.length?p.pop():new h;z.length=0,A.length=0,f(x,e,A,z);for(var D=z.length,q=0;q!==D;q++){var t=z[q];C.equations.push(t)}y++,B.push(C)}this.numIslands=y;for(var E=this.beforeSolveIslandEvent,q=0;qd;d++)a[d]=a[d+c];a.length=e},c.ARRAY_TYPE=Float32Array||Array},{}],51:[function(a,b){function c(a){n.apply(this),a=a||{},this.springs=[],this.bodies=[],this.solver=a.solver||new d,this.narrowphase=new x(this),this.gravity=a.gravity||f.fromValues(0,-9.78),this.doProfiling=a.doProfiling||!1,this.lastStepTime=0,this.broadphase=a.broadphase||new e,this.broadphase.setWorld(this),this.constraints=[],this.defaultFriction=.3,this.defaultRestitution=0,this.defaultMaterial=new q,this.defaultContactMaterial=new r(this.defaultMaterial,this.defaultMaterial),this.lastTimeStep=1/60,this.applySpringForces=!0,this.applyDamping=!0,this.applyGravity=!0,this.solveConstraints=!0,this.contactMaterials=[],this.time=0,this.fixedStepTime=0,this.emitImpactEvent=!0,this._constraintIdCounter=0,this._bodyIdCounter=0,this.postStepEvent={type:"postStep"},this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.addSpringEvent={type:"addSpring",spring:null},this.impactEvent={type:"impact",bodyA:null,bodyB:null,shapeA:null,shapeB:null,contactEquation:null},this.postBroadphaseEvent={type:"postBroadphase",pairs:null},this.enableBodySleeping=!1,this.beginContactEvent={type:"beginContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null,contactEquations:[]},this.endContactEvent={type:"endContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null},this.preSolveEvent={type:"preSolve",contactEquations:null,frictionEquations:null},this.overlappingShapesLastState={keys:[]},this.overlappingShapesCurrentState={keys:[]},this.overlappingShapeLookup={keys:[]}}var d=a("../solver/GSSolver"),e=a("../collision/NaiveBroadphase"),f=a("../math/vec2"),g=a("../shapes/Circle"),h=a("../shapes/Rectangle"),i=a("../shapes/Convex"),j=a("../shapes/Line"),k=a("../shapes/Plane"),l=a("../shapes/Capsule"),m=a("../shapes/Particle"),n=a("../events/EventEmitter"),o=a("../objects/Body"),p=a("../objects/Spring"),q=a("../material/Material"),r=a("../material/ContactMaterial"),s=a("../constraints/DistanceConstraint"),t=a("../constraints/LockConstraint"),u=a("../constraints/RevoluteConstraint"),v=a("../constraints/PrismaticConstraint"),w=a("../../package.json"),x=(a("../collision/Broadphase"),a("../collision/Narrowphase")),y=a("../utils/Utils");b.exports=c;var z=w.version.split(".").slice(0,2).join(".");if("undefined"==typeof performance&&(performance={}),!performance.now){var A=Date.now();performance.timing&&performance.timing.navigationStart&&(A=performance.timing.navigationStart),performance.now=function(){return Date.now()-A}}c.prototype=new Object(n.prototype),c.prototype.addConstraint=function(a){this.constraints.push(a)},c.prototype.addContactMaterial=function(a){this.contactMaterials.push(a)},c.prototype.removeContactMaterial=function(a){var b=this.contactMaterials.indexOf(a);-1!==b&&y.splice(this.contactMaterials,b,1)},c.prototype.getContactMaterial=function(a,b){for(var c=this.contactMaterials,d=0,e=c.length;d!==e;d++){var f=c[d];if(f.materialA===a&&f.materialB===b||f.materialA===b&&f.materialB===a)return f}return!1},c.prototype.removeConstraint=function(a){var b=this.constraints.indexOf(a);-1!==b&&y.splice(this.constraints,b,1)};{var B=(f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create()),C=f.fromValues(0,0),D=f.fromValues(0,0);f.fromValues(0,0)}c.prototype.step=function(a,b,c){if(c=c||10,b=b||0,0==b)this.internalStep(a),this.time+=a;else{var d=Math.floor((this.time+b)/a)-Math.floor(this.time/a);d=Math.min(d,c);for(var e=0;d>e;e++)this.internalStep(a);this.time+=b,this.fixedStepTime+=d*a;for(var f=this.time-this.fixedStepTime-a,g=0;g!==this.bodies.length;g++){var h=this.bodies[g];h.interpolatedPosition[0]=h.position[0]+h.velocity[0]*f,h.interpolatedPosition[1]=h.position[1]+h.velocity[1]*f}}},c.prototype.internalStep=function(a){{var b,d,e=this,g=this.doProfiling,h=this.springs.length,i=this.springs,j=this.bodies,k=this.gravity,l=this.solver,m=this.bodies.length,n=this.broadphase,p=this.narrowphase,q=this.constraints,r=B,s=(f.scale,f.add);f.rotate}this.lastTimeStep=a,g&&(b=performance.now());var t=f.length(this.gravity);if(this.applyGravity)for(var u=0;u!==m;u++){var v=j[u],w=v.force;v.motionState==o.DYNAMIC&&(f.scale(r,k,v.mass*v.gravityScale),s(w,w,r))}if(this.applySpringForces)for(var u=0;u!==h;u++){var x=i[u];x.applyForce()}if(this.applyDamping)for(var u=0;u!==m;u++){var v=j[u];v.motionState==o.DYNAMIC&&v.applyDamping(a)}var y=n.getCollisionPairs(this);this.postBroadphaseEvent.pairs=y,this.emit(this.postBroadphaseEvent),p.reset(this);for(var u=0,z=y.length;u!==z;u+=2)for(var A=y[u],C=y[u+1],D=0,E=A.shapes.length;D!==E;D++)for(var F=A.shapes[D],G=A.shapeOffsets[D],H=A.shapeAngles[D],I=0,J=C.shapes.length;I!==J;I++){var K=C.shapes[I],L=C.shapeOffsets[I],M=C.shapeAngles[I],N=this.defaultContactMaterial;if(F.material&&K.material){var O=this.getContactMaterial(F.material,K.material);O&&(N=O)}this.runNarrowphase(p,A,F,G,H,C,K,L,M,N,t)}for(var P=this.overlappingShapesLastState,u=0;u!==P.keys.length;u++){var Q=P.keys[u];if(P[Q]===!0&&!this.overlappingShapesCurrentState[Q]){var R=this.endContactEvent;R.shapeA=P[Q+"_shapeA"],R.shapeB=P[Q+"_shapeB"],R.bodyA=P[Q+"_bodyA"],R.bodyB=P[Q+"_bodyB"],this.emit(R)}}for(var u=0;u!==P.keys.length;u++)delete P[P.keys[u]];P.keys.length=0;for(var S=this.overlappingShapesCurrentState,u=0;u!==S.keys.length;u++)P[S.keys[u]]=S[S.keys[u]],P.keys.push(S.keys[u]);for(var u=0;u!==S.keys.length;u++)delete S[S.keys[u]];S.keys.length=0;var T=this.preSolveEvent;T.contactEquations=p.contactEquations,T.frictionEquations=p.frictionEquations,this.emit(T),l.addEquations(p.contactEquations),l.addEquations(p.frictionEquations);var U=q.length;for(u=0;u!==U;u++){var V=q[u];V.update(),l.addEquations(V.equations)}this.solveConstraints&&l.solve(a,this),l.removeAllEquations();for(var u=0;u!==m;u++){var W=j[u];W.sleepState!==o.SLEEPING&&W.motionState!=o.STATIC&&c.integrateBody(W,a)}for(var u=0;u!==m;u++)j[u].setZeroForce();if(g&&(d=performance.now(),e.lastStepTime=d-b),this.emitImpactEvent)for(var X=this.impactEvent,u=0;u!==p.contactEquations.length;u++){var Y=p.contactEquations[u];Y.firstImpact&&(X.bodyA=Y.bi,X.bodyB=Y.bj,X.shapeA=Y.shapeA,X.shapeB=Y.shapeB,X.contactEquation=Y,this.emit(X))}if(this.enableBodySleeping)for(u=0;u!==m;u++)j[u].sleepTick(this.time);this.emit(this.postStepEvent)};var E=f.create(),F=f.create();c.integrateBody=function(a,b){var c=a.invMass,d=a.force,e=a.position,g=a.velocity;a.fixedRotation||(a.angularVelocity+=a.angularForce*a.invInertia*b,a.angle+=a.angularVelocity*b),f.scale(E,d,b*c),f.add(g,E,g),f.scale(F,g,b),f.add(e,e,F),a.aabbNeedsUpdate=!0},c.prototype.runNarrowphase=function(a,b,c,d,e,g,h,i,j,k,l){if(0!==(c.collisionGroup&h.collisionMask)&&0!==(h.collisionGroup&c.collisionMask)){f.rotate(C,d,b.angle),f.rotate(D,i,g.angle),f.add(C,C,b.position),f.add(D,D,g.position);var m=e+b.angle,n=j+g.angle;a.enableFriction=k.friction>0,a.frictionCoefficient=k.friction;var p;p=b.motionState==o.STATIC||b.motionState==o.KINEMATIC?g.mass:g.motionState==o.STATIC||g.motionState==o.KINEMATIC?b.mass:b.mass*g.mass/(b.mass+g.mass),a.slipForce=k.friction*l*p,a.restitution=k.restitution,a.surfaceVelocity=k.surfaceVelocity,a.frictionStiffness=k.frictionStiffness,a.frictionRelaxation=k.frictionRelaxation,a.stiffness=k.stiffness,a.relaxation=k.relaxation;var q=a[c.type|h.type],r=0;if(q){var s=c.sensor||h.sensor;if(r=c.type=0;b--)this.removeConstraint(a[b]);for(var c=this.bodies,b=c.length-1;b>=0;b--)this.removeBody(c[b]);for(var d=this.springs,b=d.length-1;b>=0;b--)this.removeSpring(d[b]);for(var e=this.contactMaterials,b=e.length-1;b>=0;b--)this.removeContactMaterial(e[b])},c.prototype.clone=function(){var a=new c;return a.fromJSON(this.toJSON()),a};var G=f.create(),H=f.fromValues(0,0),I=f.fromValues(0,0);c.prototype.hitTest=function(a,b,c){c=c||0;var d=new o({position:a}),e=new m,h=a,j=0,n=G,p=H,q=I;d.addShape(e);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;f.rotate(n,z,v.angle),f.add(n,n,v.position);var B=A+v.angle;(y instanceof g&&r.circleParticle(v,y,n,B,d,e,h,j,!0)||y instanceof i&&r.particleConvex(d,e,h,j,v,y,n,B,!0)||y instanceof k&&r.particlePlane(d,e,h,j,v,y,n,B,!0)||y instanceof l&&r.particleCapsule(d,e,h,j,v,y,n,B,!0)||y instanceof m&&f.squaredLength(f.sub(q,n,a))0&&this.enable(a[d],b,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c):(this.enableBody(a,b),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,!0))},enableBody:function(a,b){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.P2.Body(this.game,a,a.x,a.y,1),a.body.debug=b,a.anchor.set(.5))},setImpactEvents:function(a){a?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(a,b){this.postBroadphaseCallback=a,this.callbackContext=b,null!==a?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(a){if(this.postBroadphaseCallback)for(var b=a.pairs.length;b-=2;)1===a.pairs[b].id||1===a.pairs[b+1].id||this.postBroadphaseCallback.call(this.callbackContext,a.pairs[b].parent,a.pairs[b+1].parent)||a.pairs.splice(b,2)},impactHandler:function(a){if(a.bodyA.parent&&a.bodyB.parent){var b=a.bodyA.parent,c=a.bodyB.parent;b._bodyCallbacks[a.bodyB.id]&&b._bodyCallbacks[a.bodyB.id].call(b._bodyCallbackContext[a.bodyB.id],b,c,a.shapeA,a.shapeB),c._bodyCallbacks[a.bodyA.id]&&c._bodyCallbacks[a.bodyA.id].call(c._bodyCallbackContext[a.bodyA.id],c,b,a.shapeB,a.shapeA),b._groupCallbacks[a.shapeB.collisionGroup]&&b._groupCallbacks[a.shapeB.collisionGroup].call(b._groupCallbackContext[a.shapeB.collisionGroup],b,c,a.shapeA,a.shapeB),c._groupCallbacks[a.shapeA.collisionGroup]&&c._groupCallbacks[a.shapeA.collisionGroup].call(c._groupCallbackContext[a.shapeA.collisionGroup],c,b,a.shapeB,a.shapeA)}},beginContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onBeginContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB,a.contactEquations),a.bodyA.parent&&a.bodyA.parent.onBeginContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB,a.contactEquations),a.bodyB.parent&&a.bodyB.parent.onBeginContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA,a.contactEquations))},endContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onEndContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB),a.bodyA.parent&&a.bodyA.parent.onEndContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB),a.bodyB.parent&&a.bodyB.parent.onEndContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA))},setBoundsToWorld:function(a,b,c,d,e){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,a,b,c,d,e)},setWorldMaterial:function(a,b,c,d,e){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),b&&this._wallShapes[0]&&(this._wallShapes[0].material=a),c&&this._wallShapes[1]&&(this._wallShapes[1].material=a),d&&this._wallShapes[2]&&(this._wallShapes[2].material=a),e&&this._wallShapes[3]&&(this._wallShapes[3].material=a)},updateBoundsCollisionGroup:function(a){"undefined"==typeof a&&(a=!0);for(var b=0;4>b;b++)this._wallShapes[b]&&(this._wallShapes[b].collisionGroup=a?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask)},setBounds:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=c/2,k=d/2,l=j+a,m=k+b;if(null!==this.bounds){this.bounds.world&&this.world.removeBody(this.bounds);for(var n=this.bounds.shapes.length;n--;){var o=this.bounds.shapes[n];this.bounds.removeShape(o)}this.bounds.position[0]=this.pxmi(l),this.bounds.position[1]=this.pxmi(m)}else this.bounds=new p2.Body({mass:0,position:[this.pxmi(l),this.pxmi(m)]});e&&(this._wallShapes[0]=new p2.Plane,i&&(this._wallShapes[0].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[0],[this.pxmi(-j),0],1.5707963267948966)),f&&(this._wallShapes[1]=new p2.Plane,i&&(this._wallShapes[1].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[1],[this.pxmi(j),0],-1.5707963267948966)),g&&(this._wallShapes[2]=new p2.Plane,i&&(this._wallShapes[2].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[2],[0,this.pxmi(-k)],-3.141592653589793)),h&&(this._wallShapes[3]=new p2.Plane,i&&(this._wallShapes[3].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[3],[0,this.pxmi(k)])),this.world.addBody(this.bounds)},update:function(){this.world.step(this.useElapsedTime?this.game.time.physicsElapsed:this.frameRate)},clear:function(){this.world.clear(),this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this._collisionGroupID=2,this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){return a.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){return a.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){return this.world.addSpring(a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){return this.world.removeSpring(a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.GearConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e){return a=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(new Phaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):void console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){return this.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){return this.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){return this.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){return this.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){return this.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(var c=b.length;c--;)b.setMaterial(a)},createMaterial:function(a,b){a=a||"";var c=new Phaser.Physics.P2.Material(a);return this.materials.push(c),"undefined"!=typeof b&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeof a&&(a=this.createMaterial()),"undefined"==typeof b&&(b=this.createMaterial());var d=new Phaser.Physics.P2.ContactMaterial(a,b,c);return this.addContactMaterial(d)},getBodies:function(){for(var a=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);return a},getBody:function(a){return a instanceof p2.Body?a:a instanceof Phaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(var a=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);return a},getConstraints:function(){for(var a=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);return a},hitTest:function(a,b,c,d){"undefined"==typeof b&&(b=this.world.bodies),"undefined"==typeof c&&(c=5),"undefined"==typeof d&&(d=!1);for(var e=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceof Phaser.Physics.P2.Body&&(!d||b[g].data.motionState!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceof p2.Body&&b[g].parent&&(!d||b[g].motionState!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceof Phaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.motionState!==p2.Body.STATIC)&&f.push(b[g].body.data);return this.world.hitTest(e,f,c)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(a){var b=Math.pow(2,this._collisionGroupID);this._wallShapes[0]&&(this._wallShapes[0].collisionMask=this._wallShapes[0].collisionMask|b),this._wallShapes[1]&&(this._wallShapes[1].collisionMask=this._wallShapes[1].collisionMask|b),this._wallShapes[2]&&(this._wallShapes[2].collisionMask=this._wallShapes[2].collisionMask|b),this._wallShapes[3]&&(this._wallShapes[3].collisionMask=this._wallShapes[3].collisionMask|b),this._collisionGroupID++;var c=new Phaser.Physics.P2.CollisionGroup(b);return this.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(a instanceof Phaser.Group)for(var c=0;ce;e++){var g=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}return d},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c,d){b=a.getLayer(b),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),this.clearTilemapLayerBodies(a,b);for(var e=0,f=0,g=0,h=0,i=a.layers[b].height;i>h;h++){e=0;for(var j=0,k=a.layers[b].width;k>j;j++){var l=a.layers[b].data[h][j];if(l)if(d){var m=a.getTileRight(b,j,h);if(0===e&&(f=l.x*l.width,g=l.y*l.height,e=l.width),m&&m.collides)e+=l.width;else{var n=this.createBody(f,g,0,!1);n.addRectangle(e,l.height,e/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n),e=0}}else{var n=this.createBody(l.x*l.width,l.y*l.height,0,!1);n.addRectangle(l.width,l.height,l.width/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n)}}}return a.layers[b].bodies},mpx:function(a){return a*=20},pxm:function(a){return.05*a},mpxi:function(a){return a*=-20},pxmi:function(a){return a*-.05}},Object.defineProperty(Phaser.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultFriction},set:function(a){this.world.defaultFriction=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"restituion",{get:function(){return this.world.defaultRestitution},set:function(a){this.world.defaultRestitution=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(a){this.world.applySpringForces=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(a){this.world.applyDamping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(a){this.world.applyGravity=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(a){this.world.solveConstraints=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"time",{get:function(){return this.world.time}}),Object.defineProperty(Phaser.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(a){this.world.emitImpactEvent=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"enableBodySleeping",{get:function(){return this.world.enableBodySleeping},set:function(a){this.world.enableBodySleeping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),Phaser.Physics.P2.PointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.PointProxy.prototype.constructor=Phaser.Physics.P2.PointProxy,Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(a)}}),Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(a)}}),Phaser.Physics.P2.InversePointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.InversePointProxy.prototype.constructor=Phaser.Physics.P2.InversePointProxy,Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(-a)}}),Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(-a)}}),Phaser.Physics.P2.Body=function(a,b,c,d,e){b=b||null,c=c||0,d=d||0,"undefined"==typeof e&&(e=1),this.game=a,this.world=a.physics.p2,this.sprite=b,this.type=Phaser.Physics.P2JS,this.offset=new Phaser.Point,this.data=new p2.Body({position:[this.world.pxmi(c),this.world.pxmi(d)],mass:e}),this.data.parent=this,this.velocity=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new Phaser.Point,this.onImpact=new Phaser.Signal,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,this.collidesWith=[],this.removeNextStep=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody=null,b&&(this.setRectangleFromSprite(b),b.exists&&this.game.physics.p2.addBody(this))},Phaser.Physics.P2.Body.prototype={createBodyCallback:function(a,b,c){var d=-1;a.id?d=a.id:a.body&&(d=a.body.id),d>-1&&(null===b?(delete this._bodyCallbacks[d],delete this._bodyCallbackContext[d]):(this._bodyCallbacks[d]=b,this._bodyCallbackContext[d]=c))},createGroupCallback:function(a,b,c){null===b?(delete this._groupCallbacks[a.mask],delete this._groupCallbacksContext[a.mask]):(this._groupCallbacks[a.mask]=b,this._groupCallbackContext[a.mask]=c)},getCollisionMask:function(){var a=0;this._collideWorldBounds&&(a=this.game.physics.p2.boundsCollisionGroup.mask);for(var b=0;b=0;c--)this.data.shapes[c].collisionMask=b;else a.collisionMask=b},setCollisionGroup:function(a,b){var c=this.getCollisionMask();if("undefined"==typeof b)for(var d=this.data.shapes.length-1;d>=0;d--)this.data.shapes[d].collisionGroup=a.mask,this.data.shapes[d].collisionMask=c;else b.collisionGroup=a.mask,b.collisionMask=c},clearCollision:function(a,b,c){if("undefined"==typeof c)for(var d=this.data.shapes.length-1;d>=0;d--)a&&(this.data.shapes[d].collisionGroup=null),b&&(this.data.shapes[d].collisionMask=null);else a&&(c.collisionGroup=null),b&&(c.collisionMask=null);a&&(this.collidesWith.length=0)},collides:function(a,b,c,d){if(Array.isArray(a))for(var e=0;e=0;e--)this.data.shapes[e].collisionMask=f;else d.collisionMask=f},adjustCenterOfMass:function(){this.data.adjustCenterOfMass()},applyDamping:function(a){this.data.applyDamping(a)},applyForce:function(a,b,c){this.data.applyForce(a,[this.world.pxm(b),this.world.pxm(c)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(a,b){return this.data.toLocalFrame(a,b)},toWorldFrame:function(a,b){return this.data.toWorldFrame(a,b)},rotateLeft:function(a){this.data.angularVelocity=this.world.pxm(-a)},rotateRight:function(a){this.data.angularVelocity=this.world.pxm(a)},moveForward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=b*Math.cos(c),this.data.velocity[1]=b*Math.sin(c)},moveBackward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=-(b*Math.cos(c)),this.data.velocity[1]=-(b*Math.sin(c))},thrust:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]+=b*Math.cos(c),this.data.force[1]+=b*Math.sin(c)},reverse:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]-=b*Math.cos(c),this.data.force[1]-=b*Math.sin(c)},moveLeft:function(a){this.data.velocity[0]=this.world.pxmi(-a)},moveRight:function(a){this.data.velocity[0]=this.world.pxmi(a)},moveUp:function(a){this.data.velocity[1]=this.world.pxmi(-a)},moveDown:function(a){this.data.velocity[1]=this.world.pxmi(a)},preUpdate:function(){this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0]),this.sprite.y=this.world.mpxi(this.data.position[1]),this.fixedRotation||(this.sprite.rotation=this.data.angle)},reset:function(a,b,c,d){"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),c&&this.setZeroDamping(),d&&(this.mass=1),this.x=a,this.y=b},addToWorld:function(){this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(),this.debugBody=null,this.sprite=null},clearShapes:function(){for(var a=this.data.shapes.length;a--;)this.data.removeShape(this.data.shapes[a]);this.shapeChanged()},addShape:function(a,b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.data.addShape(a,[this.world.pxmi(b),this.world.pxmi(c)],d),this.shapeChanged(),a},addCircle:function(a,b,c,d){var e=new p2.Circle(this.world.pxm(a));return this.addShape(e,b,c,d)},addRectangle:function(a,b,c,d,e){var f=new p2.Rectangle(this.world.pxm(a),this.world.pxm(b));return this.addShape(f,c,d,e)},addPlane:function(a,b,c){var d=new p2.Plane;return this.addShape(d,a,b,c)},addParticle:function(a,b,c){var d=new p2.Particle;return this.addShape(d,a,b,c)},addLine:function(a,b,c,d){var e=new p2.Line(this.world.pxm(a));return this.addShape(e,b,c,d)},addCapsule:function(a,b,c,d,e){var f=new p2.Capsule(this.world.pxm(a),b);return this.addShape(f,c,d,e)},addPolygon:function(a,b){a=a||{},b=Array.prototype.slice.call(arguments,1);var c=[];if(1===b.length&&Array.isArray(b[0]))c=b[0].slice(0);else if(Array.isArray(b[0]))c=b[0].slice(0);else if("number"==typeof b[0])for(var d=0,e=b.length;e>d;d+=2)c.push([b[d],b[d+1]]);var f=c.length-1;c[f][0]===c[0][0]&&c[f][1]===c[0][1]&&c.pop();for(var g=0;g=0;c--)this.data.shapes[c].material=a;else b.material=a},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(a,b){for(var c=this.game.cache.getPhysicsData(a,b),d=[],e=0;eg;g+=2)e.push([f.shape[g],f.shape[g+1]]);return this.addPolygon(c,e)}for(var i=p2.vec2.create(),g=0;g=0?o>n:n>o;e=o>=0?++n:--n)k=b.vertices[e],p2.vec2.rotate(m,k,a),l.push([(m[0]+i[0])*this.ppu,-(m[1]+i[1])*this.ppu]);this.drawConvex(j,l,b.triangles,f,c,g,this.settings.debugPolygons,[i[0]*this.ppu,-i[1]*this.ppu]) -}else b instanceof p2.Plane?this.drawPlane(j,i[0]*this.ppu,-i[1]*this.ppu,c,f,5*g,10*g,10*g,100*this.ppu,a):b instanceof p2.Line?this.drawLine(j,b.length*this.ppu,f,g):b instanceof p2.Rectangle&&this.drawRectangle(j,i[0]*this.ppu,-i[1]*this.ppu,a,b.width*this.ppu,b.height*this.ppu,f,c,g);d++}}},drawRectangle:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof i&&(i=1),"undefined"==typeof g&&(g=0),a.lineStyle(i,g,1),a.beginFill(h),a.drawRect(b-e/2,c-f/2,e,f)},drawCircle:function(a,b,c,d,e,f,g){"undefined"==typeof g&&(g=1),"undefined"==typeof f&&(f=16777215),a.lineStyle(g,0,1),a.beginFill(f,1),a.drawCircle(b,c,-e),a.endFill(),a.moveTo(b,c),a.lineTo(b+e*Math.cos(-d),c+e*Math.sin(-d))},drawLine:function(a,b,c,d){"undefined"==typeof d&&(d=1),"undefined"==typeof c&&(c=0),a.lineStyle(5*d,c,1),a.moveTo(-b/2,0),a.lineTo(b/2,0)},drawConvex:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s;if("undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=0),g){for(i=[16711680,65280,255],j=0;j!==b.length+1;)l=b[j%b.length],m=b[(j+1)%b.length],o=l[0],r=l[1],p=m[0],s=m[1],a.lineStyle(f,i[j%i.length],1),a.moveTo(o,-r),a.lineTo(p,-s),a.drawCircle(o,-r,2*f),j++;return a.lineStyle(f,0,1),a.drawCircle(h[0],h[1],2*f)}for(a.lineStyle(f,d,1),a.beginFill(e),j=0;j!==b.length;)k=b[j],n=k[0],q=k[1],0===j?a.moveTo(n,-q):a.lineTo(n,-q),j++;return a.endFill(),b.length>2?(a.moveTo(b[b.length-1][0],-b[b.length-1][1]),a.lineTo(b[0][0],-b[0][1])):void 0},drawPath:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;for("undefined"==typeof e&&(e=1),"undefined"==typeof c&&(c=0),a.lineStyle(e,c,1),"number"==typeof d&&a.beginFill(d),h=null,i=null,g=0;g2&&"number"==typeof d&&(a.moveTo(b[b.length-1][0],b[b.length-1][1]),a.lineTo(b[0][0],b[0][1]))},drawPlane:function(a,b,c,d,e,f,g,h,i,j){var k,l,m;"undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=16777215),a.lineStyle(f,e,11),a.beginFill(d),k=i,a.moveTo(b,-c),l=b+Math.cos(j)*this.game.width,m=c+Math.sin(j)*this.game.height,a.lineTo(l,-m),a.moveTo(b,-c),l=b+Math.cos(j)*-this.game.width,m=c+Math.sin(j)*-this.game.height,a.lineTo(l,-m)},randomPastelHex:function(){var a,b,c,d;return c=[255,255,255],d=Math.floor(256*Math.random()),b=Math.floor(256*Math.random()),a=Math.floor(256*Math.random()),d=Math.floor((d+3*c[0])/4),b=Math.floor((b+3*c[1])/4),a=Math.floor((a+3*c[2])/4),this.rgbToHex(d,b,a)},rgbToHex:function(a,b,c){return this.componentToHex(a)+this.componentToHex(b)+this.componentToHex(c)},componentToHex:function(a){var b;return b=a.toString(16),2===b.len?b:b+"0"}}),Phaser.Physics.P2.Spring=function(a,b,c,d,e,f,g,h,i,j){this.game=a.game,this.world=a,"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=100),"undefined"==typeof f&&(f=1),d=a.pxm(d);var k={restLength:d,stiffness:e,damping:f};"undefined"!=typeof g&&null!==g&&(k.worldAnchorA=[a.pxm(g[0]),a.pxm(g[1])]),"undefined"!=typeof h&&null!==h&&(k.worldAnchorB=[a.pxm(h[0]),a.pxm(h[1])]),"undefined"!=typeof i&&null!==i&&(k.localAnchorA=[a.pxm(i[0]),a.pxm(i[1])]),"undefined"!=typeof j&&null!==j&&(k.localAnchorB=[a.pxm(j[0]),a.pxm(j[1])]),p2.Spring.call(this,b,c,k)},Phaser.Physics.P2.Spring.prototype=Object.create(p2.Spring.prototype),Phaser.Physics.P2.Spring.prototype.constructor=Phaser.Physics.P2.Spring,Phaser.Physics.P2.Material=function(a){this.name=a,p2.Material.call(this)},Phaser.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),Phaser.Physics.P2.Material.prototype.constructor=Phaser.Physics.P2.Material,Phaser.Physics.P2.ContactMaterial=function(a,b,c){p2.ContactMaterial.call(this,a,b,c)},Phaser.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),Phaser.Physics.P2.ContactMaterial.prototype.constructor=Phaser.Physics.P2.ContactMaterial,Phaser.Physics.P2.CollisionGroup=function(a){this.mask=a},Phaser.Physics.P2.DistanceConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=100),this.game=a.game,this.world=a,d=a.pxm(d),p2.DistanceConstraint.call(this,b,c,d,e)},Phaser.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),Phaser.Physics.P2.DistanceConstraint.prototype.constructor=Phaser.Physics.P2.DistanceConstraint,Phaser.Physics.P2.GearConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1),this.game=a.game,this.world=a;var f={angle:d,ratio:e};p2.GearConstraint.call(this,b,c,f)},Phaser.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),Phaser.Physics.P2.GearConstraint.prototype.constructor=Phaser.Physics.P2.GearConstraint,Phaser.Physics.P2.LockConstraint=function(a,b,c,d,e,f){"undefined"==typeof d&&(d=[0,0]),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,d=[a.pxm(d[0]),a.pxm(d[1])];var g={localOffsetB:d,localAngleB:e,maxForce:f};p2.LockConstraint.call(this,b,c,g)},Phaser.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),Phaser.Physics.P2.LockConstraint.prototype.constructor=Phaser.Physics.P2.LockConstraint,Phaser.Physics.P2.PrismaticConstraint=function(a,b,c,d,e,f,g,h){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=[0,0]),"undefined"==typeof f&&(f=[0,0]),"undefined"==typeof g&&(g=[0,0]),"undefined"==typeof h&&(h=Number.MAX_VALUE),this.game=a.game,this.world=a,e=[a.pxmi(e[0]),a.pxmi(e[1])],f=[a.pxmi(f[0]),a.pxmi(f[1])];var i={localAnchorA:e,localAnchorB:f,localAxisA:g,maxForce:h,disableRotationalLock:!d};p2.PrismaticConstraint.call(this,b,c,i)},Phaser.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),Phaser.Physics.P2.PrismaticConstraint.prototype.constructor=Phaser.Physics.P2.PrismaticConstraint,Phaser.Physics.P2.RevoluteConstraint=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,c=[a.pxmi(c[0]),a.pxmi(c[1])],e=[a.pxmi(e[0]),a.pxmi(e[1])],p2.RevoluteConstraint.call(this,b,c,d,e,f)},Phaser.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),Phaser.Physics.P2.RevoluteConstraint.prototype.constructor=Phaser.Physics.P2.RevoluteConstraint; \ No newline at end of file +}return s}},{"../../package.json":8,"../collision/Broadphase":10,"../collision/NaiveBroadphase":12,"../collision/Narrowphase":13,"../constraints/DistanceConstraint":17,"../constraints/LockConstraint":19,"../constraints/PrismaticConstraint":20,"../constraints/RevoluteConstraint":21,"../events/EventEmitter":28,"../material/ContactMaterial":29,"../material/Material":30,"../math/vec2":33,"../objects/Body":34,"../objects/Spring":35,"../shapes/Capsule":37,"../shapes/Circle":38,"../shapes/Convex":39,"../shapes/Line":41,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Rectangle":44,"../solver/GSSolver":46,"../utils/Utils":50}]},{},[36])(36)}),p2.Body.prototype.parent=null,p2.Spring.prototype.parent=null,Phaser.Physics.P2=function(a,b){this.game=a,"undefined"!=typeof b&&b.hasOwnProperty("gravity")&&b.hasOwnProperty("broadphase")||(b={gravity:[0,0],broadphase:new p2.SAPBroadphase}),this.world=new p2.World(b),this.frameRate=1/60,this.useElapsedTime=!1,this.materials=[],this.gravity=new Phaser.Physics.P2.InversePointProxy(this,this.world.gravity),this.bounds=null,this._wallShapes=[null,null,null,null],this.onBodyAdded=new Phaser.Signal,this.onBodyRemoved=new Phaser.Signal,this.onSpringAdded=new Phaser.Signal,this.onSpringRemoved=new Phaser.Signal,this.onConstraintAdded=new Phaser.Signal,this.onConstraintRemoved=new Phaser.Signal,this.onContactMaterialAdded=new Phaser.Signal,this.onContactMaterialRemoved=new Phaser.Signal,this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,b.hasOwnProperty("mpx")&&b.hasOwnProperty("pxm")&&b.hasOwnProperty("mpxi")&&b.hasOwnProperty("pxmi")&&(this.mpx=b.mpx,this.mpxi=b.mpxi,this.pxm=b.pxm,this.pxmi=b.pxmi),this.world.on("beginContact",this.beginContactHandler,this),this.world.on("endContact",this.endContactHandler,this),this._toRemove=[],this.collisionGroups=[],this._collisionGroupID=2,this.nothingCollisionGroup=new Phaser.Physics.P2.CollisionGroup(1),this.boundsCollisionGroup=new Phaser.Physics.P2.CollisionGroup(2),this.everythingCollisionGroup=new Phaser.Physics.P2.CollisionGroup(2147483648),this.boundsCollidesWith=[],this.setBoundsToWorld(!0,!0,!0,!0,!1)},Phaser.Physics.P2.LIME_CORONA_JSON=0,Phaser.Physics.P2.prototype={removeBodyNextStep:function(a){this._toRemove.push(a)},preUpdate:function(){for(var a=this._toRemove.length;a--;)this.removeBody(this._toRemove[a]);this._toRemove.length=0},enable:function(a,b,c){"undefined"==typeof b&&(b=!1),"undefined"==typeof c&&(c=!0);var d=1;if(Array.isArray(a))for(d=a.length;d--;)a[d]instanceof Phaser.Group?this.enable(a[d].children,b,c):(this.enableBody(a[d],b),c&&a[d].hasOwnProperty("children")&&a[d].children.length>0&&this.enable(a[d],b,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c):(this.enableBody(a,b),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,!0))},enableBody:function(a,b){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.P2.Body(this.game,a,a.x,a.y,1),a.body.debug=b,a.anchor.set(.5))},setImpactEvents:function(a){a?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(a,b){this.postBroadphaseCallback=a,this.callbackContext=b,null!==a?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(a){if(this.postBroadphaseCallback)for(var b=a.pairs.length;b-=2;)1===a.pairs[b].id||1===a.pairs[b+1].id||this.postBroadphaseCallback.call(this.callbackContext,a.pairs[b].parent,a.pairs[b+1].parent)||a.pairs.splice(b,2)},impactHandler:function(a){if(a.bodyA.parent&&a.bodyB.parent){var b=a.bodyA.parent,c=a.bodyB.parent;b._bodyCallbacks[a.bodyB.id]&&b._bodyCallbacks[a.bodyB.id].call(b._bodyCallbackContext[a.bodyB.id],b,c,a.shapeA,a.shapeB),c._bodyCallbacks[a.bodyA.id]&&c._bodyCallbacks[a.bodyA.id].call(c._bodyCallbackContext[a.bodyA.id],c,b,a.shapeB,a.shapeA),b._groupCallbacks[a.shapeB.collisionGroup]&&b._groupCallbacks[a.shapeB.collisionGroup].call(b._groupCallbackContext[a.shapeB.collisionGroup],b,c,a.shapeA,a.shapeB),c._groupCallbacks[a.shapeA.collisionGroup]&&c._groupCallbacks[a.shapeA.collisionGroup].call(c._groupCallbackContext[a.shapeA.collisionGroup],c,b,a.shapeB,a.shapeA)}},beginContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onBeginContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB,a.contactEquations),a.bodyA.parent&&a.bodyA.parent.onBeginContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB,a.contactEquations),a.bodyB.parent&&a.bodyB.parent.onBeginContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA,a.contactEquations))},endContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onEndContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB),a.bodyA.parent&&a.bodyA.parent.onEndContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB),a.bodyB.parent&&a.bodyB.parent.onEndContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA))},setBoundsToWorld:function(a,b,c,d,e){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,a,b,c,d,e)},setWorldMaterial:function(a,b,c,d,e){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),b&&this._wallShapes[0]&&(this._wallShapes[0].material=a),c&&this._wallShapes[1]&&(this._wallShapes[1].material=a),d&&this._wallShapes[2]&&(this._wallShapes[2].material=a),e&&this._wallShapes[3]&&(this._wallShapes[3].material=a)},updateBoundsCollisionGroup:function(a){"undefined"==typeof a&&(a=!0);for(var b=0;4>b;b++)this._wallShapes[b]&&(this._wallShapes[b].collisionGroup=a?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask)},setBounds:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=c/2,k=d/2,l=j+a,m=k+b;if(null!==this.bounds){this.bounds.world&&this.world.removeBody(this.bounds);for(var n=this.bounds.shapes.length;n--;){var o=this.bounds.shapes[n];this.bounds.removeShape(o)}this.bounds.position[0]=this.pxmi(l),this.bounds.position[1]=this.pxmi(m)}else this.bounds=new p2.Body({mass:0,position:[this.pxmi(l),this.pxmi(m)]});e&&(this._wallShapes[0]=new p2.Plane,i&&(this._wallShapes[0].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[0],[this.pxmi(-j),0],1.5707963267948966)),f&&(this._wallShapes[1]=new p2.Plane,i&&(this._wallShapes[1].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[1],[this.pxmi(j),0],-1.5707963267948966)),g&&(this._wallShapes[2]=new p2.Plane,i&&(this._wallShapes[2].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[2],[0,this.pxmi(-k)],-3.141592653589793)),h&&(this._wallShapes[3]=new p2.Plane,i&&(this._wallShapes[3].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[3],[0,this.pxmi(k)])),this.world.addBody(this.bounds)},update:function(){this.world.step(this.useElapsedTime?this.game.time.physicsElapsed:this.frameRate)},clear:function(){this.world.clear(),this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this._collisionGroupID=2,this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){return a.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){return a.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){return this.world.addSpring(a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){return this.world.removeSpring(a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.GearConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e){return a=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(new Phaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):void console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){return this.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){return this.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){return this.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){return this.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){return this.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(var c=b.length;c--;)b.setMaterial(a)},createMaterial:function(a,b){a=a||"";var c=new Phaser.Physics.P2.Material(a);return this.materials.push(c),"undefined"!=typeof b&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeof a&&(a=this.createMaterial()),"undefined"==typeof b&&(b=this.createMaterial());var d=new Phaser.Physics.P2.ContactMaterial(a,b,c);return this.addContactMaterial(d)},getBodies:function(){for(var a=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);return a},getBody:function(a){return a instanceof p2.Body?a:a instanceof Phaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(var a=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);return a},getConstraints:function(){for(var a=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);return a},hitTest:function(a,b,c,d){"undefined"==typeof b&&(b=this.world.bodies),"undefined"==typeof c&&(c=5),"undefined"==typeof d&&(d=!1);for(var e=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceof Phaser.Physics.P2.Body&&(!d||b[g].data.motionState!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceof p2.Body&&b[g].parent&&(!d||b[g].motionState!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceof Phaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.motionState!==p2.Body.STATIC)&&f.push(b[g].body.data);return this.world.hitTest(e,f,c)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(a){var b=Math.pow(2,this._collisionGroupID);this._wallShapes[0]&&(this._wallShapes[0].collisionMask=this._wallShapes[0].collisionMask|b),this._wallShapes[1]&&(this._wallShapes[1].collisionMask=this._wallShapes[1].collisionMask|b),this._wallShapes[2]&&(this._wallShapes[2].collisionMask=this._wallShapes[2].collisionMask|b),this._wallShapes[3]&&(this._wallShapes[3].collisionMask=this._wallShapes[3].collisionMask|b),this._collisionGroupID++;var c=new Phaser.Physics.P2.CollisionGroup(b);return this.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(a instanceof Phaser.Group)for(var c=0;ce;e++){var g=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}return d},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c,d){b=a.getLayer(b),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),this.clearTilemapLayerBodies(a,b);for(var e=0,f=0,g=0,h=0,i=a.layers[b].height;i>h;h++){e=0;for(var j=0,k=a.layers[b].width;k>j;j++){var l=a.layers[b].data[h][j];if(l)if(d){var m=a.getTileRight(b,j,h);if(0===e&&(f=l.x*l.width,g=l.y*l.height,e=l.width),m&&m.collides)e+=l.width;else{var n=this.createBody(f,g,0,!1);n.addRectangle(e,l.height,e/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n),e=0}}else{var n=this.createBody(l.x*l.width,l.y*l.height,0,!1);n.addRectangle(l.width,l.height,l.width/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n)}}}return a.layers[b].bodies},mpx:function(a){return a*=20},pxm:function(a){return.05*a},mpxi:function(a){return a*=-20},pxmi:function(a){return a*-.05}},Object.defineProperty(Phaser.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultFriction},set:function(a){this.world.defaultFriction=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"restituion",{get:function(){return this.world.defaultRestitution},set:function(a){this.world.defaultRestitution=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(a){this.world.applySpringForces=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(a){this.world.applyDamping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(a){this.world.applyGravity=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(a){this.world.solveConstraints=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"time",{get:function(){return this.world.time}}),Object.defineProperty(Phaser.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(a){this.world.emitImpactEvent=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"enableBodySleeping",{get:function(){return this.world.enableBodySleeping},set:function(a){this.world.enableBodySleeping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),Phaser.Physics.P2.PointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.PointProxy.prototype.constructor=Phaser.Physics.P2.PointProxy,Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(a)}}),Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(a)}}),Phaser.Physics.P2.InversePointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.InversePointProxy.prototype.constructor=Phaser.Physics.P2.InversePointProxy,Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(-a)}}),Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(-a)}}),Phaser.Physics.P2.Body=function(a,b,c,d,e){b=b||null,c=c||0,d=d||0,"undefined"==typeof e&&(e=1),this.game=a,this.world=a.physics.p2,this.sprite=b,this.type=Phaser.Physics.P2JS,this.offset=new Phaser.Point,this.data=new p2.Body({position:[this.world.pxmi(c),this.world.pxmi(d)],mass:e}),this.data.parent=this,this.velocity=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new Phaser.Point,this.onImpact=new Phaser.Signal,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,this.collidesWith=[],this.removeNextStep=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody=null,b&&(this.setRectangleFromSprite(b),b.exists&&this.game.physics.p2.addBody(this))},Phaser.Physics.P2.Body.prototype={createBodyCallback:function(a,b,c){var d=-1;a.id?d=a.id:a.body&&(d=a.body.id),d>-1&&(null===b?(delete this._bodyCallbacks[d],delete this._bodyCallbackContext[d]):(this._bodyCallbacks[d]=b,this._bodyCallbackContext[d]=c))},createGroupCallback:function(a,b,c){null===b?(delete this._groupCallbacks[a.mask],delete this._groupCallbacksContext[a.mask]):(this._groupCallbacks[a.mask]=b,this._groupCallbackContext[a.mask]=c)},getCollisionMask:function(){var a=0;this._collideWorldBounds&&(a=this.game.physics.p2.boundsCollisionGroup.mask);for(var b=0;b=0;c--)this.data.shapes[c].collisionMask=b;else a.collisionMask=b},setCollisionGroup:function(a,b){var c=this.getCollisionMask();if("undefined"==typeof b)for(var d=this.data.shapes.length-1;d>=0;d--)this.data.shapes[d].collisionGroup=a.mask,this.data.shapes[d].collisionMask=c;else b.collisionGroup=a.mask,b.collisionMask=c},clearCollision:function(a,b,c){if("undefined"==typeof c)for(var d=this.data.shapes.length-1;d>=0;d--)a&&(this.data.shapes[d].collisionGroup=null),b&&(this.data.shapes[d].collisionMask=null);else a&&(c.collisionGroup=null),b&&(c.collisionMask=null);a&&(this.collidesWith.length=0)},collides:function(a,b,c,d){if(Array.isArray(a))for(var e=0;e=0;e--)this.data.shapes[e].collisionMask=f;else d.collisionMask=f},adjustCenterOfMass:function(){this.data.adjustCenterOfMass()},applyDamping:function(a){this.data.applyDamping(a)},applyForce:function(a,b,c){this.data.applyForce(a,[this.world.pxm(b),this.world.pxm(c)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(a,b){return this.data.toLocalFrame(a,b)},toWorldFrame:function(a,b){return this.data.toWorldFrame(a,b)},rotateLeft:function(a){this.data.angularVelocity=this.world.pxm(-a)},rotateRight:function(a){this.data.angularVelocity=this.world.pxm(a)},moveForward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=b*Math.cos(c),this.data.velocity[1]=b*Math.sin(c)},moveBackward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=-(b*Math.cos(c)),this.data.velocity[1]=-(b*Math.sin(c))},thrust:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]+=b*Math.cos(c),this.data.force[1]+=b*Math.sin(c)},reverse:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]-=b*Math.cos(c),this.data.force[1]-=b*Math.sin(c)},moveLeft:function(a){this.data.velocity[0]=this.world.pxmi(-a)},moveRight:function(a){this.data.velocity[0]=this.world.pxmi(a)},moveUp:function(a){this.data.velocity[1]=this.world.pxmi(-a)},moveDown:function(a){this.data.velocity[1]=this.world.pxmi(a)},preUpdate:function(){this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0]),this.sprite.y=this.world.mpxi(this.data.position[1]),this.fixedRotation||(this.sprite.rotation=this.data.angle)},reset:function(a,b,c,d){"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),c&&this.setZeroDamping(),d&&(this.mass=1),this.x=a,this.y=b},addToWorld:function(){this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(),this.debugBody=null,this.sprite=null},clearShapes:function(){for(var a=this.data.shapes.length;a--;)this.data.removeShape(this.data.shapes[a]);this.shapeChanged()},addShape:function(a,b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.data.addShape(a,[this.world.pxmi(b),this.world.pxmi(c)],d),this.shapeChanged(),a},addCircle:function(a,b,c,d){var e=new p2.Circle(this.world.pxm(a));return this.addShape(e,b,c,d)},addRectangle:function(a,b,c,d,e){var f=new p2.Rectangle(this.world.pxm(a),this.world.pxm(b));return this.addShape(f,c,d,e)},addPlane:function(a,b,c){var d=new p2.Plane;return this.addShape(d,a,b,c)},addParticle:function(a,b,c){var d=new p2.Particle;return this.addShape(d,a,b,c)},addLine:function(a,b,c,d){var e=new p2.Line(this.world.pxm(a));return this.addShape(e,b,c,d)},addCapsule:function(a,b,c,d,e){var f=new p2.Capsule(this.world.pxm(a),b);return this.addShape(f,c,d,e)},addPolygon:function(a,b){a=a||{},b=Array.prototype.slice.call(arguments,1);var c=[];if(1===b.length&&Array.isArray(b[0]))c=b[0].slice(0);else if(Array.isArray(b[0]))c=b[0].slice(0);else if("number"==typeof b[0])for(var d=0,e=b.length;e>d;d+=2)c.push([b[d],b[d+1]]);var f=c.length-1;c[f][0]===c[0][0]&&c[f][1]===c[0][1]&&c.pop();for(var g=0;g=0;c--)this.data.shapes[c].material=a;else b.material=a},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(a,b){for(var c=this.game.cache.getPhysicsData(a,b),d=[],e=0;eg;g+=2)e.push([f.shape[g],f.shape[g+1]]);return this.addPolygon(c,e)}for(var i=p2.vec2.create(),g=0;g=0?o>n:n>o;e=o>=0?++n:--n)k=b.vertices[e],p2.vec2.rotate(m,k,a),l.push([(m[0]+i[0])*this.ppu,-(m[1]+i[1])*this.ppu]);this.drawConvex(j,l,b.triangles,f,c,g,this.settings.debugPolygons,[i[0]*this.ppu,-i[1]*this.ppu])}else b instanceof p2.Plane?this.drawPlane(j,i[0]*this.ppu,-i[1]*this.ppu,c,f,5*g,10*g,10*g,100*this.ppu,a):b instanceof p2.Line?this.drawLine(j,b.length*this.ppu,f,g):b instanceof p2.Rectangle&&this.drawRectangle(j,i[0]*this.ppu,-i[1]*this.ppu,a,b.width*this.ppu,b.height*this.ppu,f,c,g); +d++}}},drawRectangle:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof i&&(i=1),"undefined"==typeof g&&(g=0),a.lineStyle(i,g,1),a.beginFill(h),a.drawRect(b-e/2,c-f/2,e,f)},drawCircle:function(a,b,c,d,e,f,g){"undefined"==typeof g&&(g=1),"undefined"==typeof f&&(f=16777215),a.lineStyle(g,0,1),a.beginFill(f,1),a.drawCircle(b,c,-e),a.endFill(),a.moveTo(b,c),a.lineTo(b+e*Math.cos(-d),c+e*Math.sin(-d))},drawLine:function(a,b,c,d){"undefined"==typeof d&&(d=1),"undefined"==typeof c&&(c=0),a.lineStyle(5*d,c,1),a.moveTo(-b/2,0),a.lineTo(b/2,0)},drawConvex:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s;if("undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=0),g){for(i=[16711680,65280,255],j=0;j!==b.length+1;)l=b[j%b.length],m=b[(j+1)%b.length],o=l[0],r=l[1],p=m[0],s=m[1],a.lineStyle(f,i[j%i.length],1),a.moveTo(o,-r),a.lineTo(p,-s),a.drawCircle(o,-r,2*f),j++;return a.lineStyle(f,0,1),a.drawCircle(h[0],h[1],2*f)}for(a.lineStyle(f,d,1),a.beginFill(e),j=0;j!==b.length;)k=b[j],n=k[0],q=k[1],0===j?a.moveTo(n,-q):a.lineTo(n,-q),j++;return a.endFill(),b.length>2?(a.moveTo(b[b.length-1][0],-b[b.length-1][1]),a.lineTo(b[0][0],-b[0][1])):void 0},drawPath:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;for("undefined"==typeof e&&(e=1),"undefined"==typeof c&&(c=0),a.lineStyle(e,c,1),"number"==typeof d&&a.beginFill(d),h=null,i=null,g=0;g2&&"number"==typeof d&&(a.moveTo(b[b.length-1][0],b[b.length-1][1]),a.lineTo(b[0][0],b[0][1]))},drawPlane:function(a,b,c,d,e,f,g,h,i,j){var k,l,m;"undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=16777215),a.lineStyle(f,e,11),a.beginFill(d),k=i,a.moveTo(b,-c),l=b+Math.cos(j)*this.game.width,m=c+Math.sin(j)*this.game.height,a.lineTo(l,-m),a.moveTo(b,-c),l=b+Math.cos(j)*-this.game.width,m=c+Math.sin(j)*-this.game.height,a.lineTo(l,-m)},randomPastelHex:function(){var a,b,c,d;return c=[255,255,255],d=Math.floor(256*Math.random()),b=Math.floor(256*Math.random()),a=Math.floor(256*Math.random()),d=Math.floor((d+3*c[0])/4),b=Math.floor((b+3*c[1])/4),a=Math.floor((a+3*c[2])/4),this.rgbToHex(d,b,a)},rgbToHex:function(a,b,c){return this.componentToHex(a)+this.componentToHex(b)+this.componentToHex(c)},componentToHex:function(a){var b;return b=a.toString(16),2===b.len?b:b+"0"}}),Phaser.Physics.P2.Spring=function(a,b,c,d,e,f,g,h,i,j){this.game=a.game,this.world=a,"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=100),"undefined"==typeof f&&(f=1),d=a.pxm(d);var k={restLength:d,stiffness:e,damping:f};"undefined"!=typeof g&&null!==g&&(k.worldAnchorA=[a.pxm(g[0]),a.pxm(g[1])]),"undefined"!=typeof h&&null!==h&&(k.worldAnchorB=[a.pxm(h[0]),a.pxm(h[1])]),"undefined"!=typeof i&&null!==i&&(k.localAnchorA=[a.pxm(i[0]),a.pxm(i[1])]),"undefined"!=typeof j&&null!==j&&(k.localAnchorB=[a.pxm(j[0]),a.pxm(j[1])]),p2.Spring.call(this,b,c,k)},Phaser.Physics.P2.Spring.prototype=Object.create(p2.Spring.prototype),Phaser.Physics.P2.Spring.prototype.constructor=Phaser.Physics.P2.Spring,Phaser.Physics.P2.Material=function(a){this.name=a,p2.Material.call(this)},Phaser.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),Phaser.Physics.P2.Material.prototype.constructor=Phaser.Physics.P2.Material,Phaser.Physics.P2.ContactMaterial=function(a,b,c){p2.ContactMaterial.call(this,a,b,c)},Phaser.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),Phaser.Physics.P2.ContactMaterial.prototype.constructor=Phaser.Physics.P2.ContactMaterial,Phaser.Physics.P2.CollisionGroup=function(a){this.mask=a},Phaser.Physics.P2.DistanceConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=100),this.game=a.game,this.world=a,d=a.pxm(d),p2.DistanceConstraint.call(this,b,c,d,e)},Phaser.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),Phaser.Physics.P2.DistanceConstraint.prototype.constructor=Phaser.Physics.P2.DistanceConstraint,Phaser.Physics.P2.GearConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1),this.game=a.game,this.world=a;var f={angle:d,ratio:e};p2.GearConstraint.call(this,b,c,f)},Phaser.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),Phaser.Physics.P2.GearConstraint.prototype.constructor=Phaser.Physics.P2.GearConstraint,Phaser.Physics.P2.LockConstraint=function(a,b,c,d,e,f){"undefined"==typeof d&&(d=[0,0]),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,d=[a.pxm(d[0]),a.pxm(d[1])];var g={localOffsetB:d,localAngleB:e,maxForce:f};p2.LockConstraint.call(this,b,c,g)},Phaser.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),Phaser.Physics.P2.LockConstraint.prototype.constructor=Phaser.Physics.P2.LockConstraint,Phaser.Physics.P2.PrismaticConstraint=function(a,b,c,d,e,f,g,h){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=[0,0]),"undefined"==typeof f&&(f=[0,0]),"undefined"==typeof g&&(g=[0,0]),"undefined"==typeof h&&(h=Number.MAX_VALUE),this.game=a.game,this.world=a,e=[a.pxmi(e[0]),a.pxmi(e[1])],f=[a.pxmi(f[0]),a.pxmi(f[1])];var i={localAnchorA:e,localAnchorB:f,localAxisA:g,maxForce:h,disableRotationalLock:!d};p2.PrismaticConstraint.call(this,b,c,i)},Phaser.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),Phaser.Physics.P2.PrismaticConstraint.prototype.constructor=Phaser.Physics.P2.PrismaticConstraint,Phaser.Physics.P2.RevoluteConstraint=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,c=[a.pxmi(c[0]),a.pxmi(c[1])],e=[a.pxmi(e[0]),a.pxmi(e[1])],p2.RevoluteConstraint.call(this,b,c,d,e,f)},Phaser.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),Phaser.Physics.P2.RevoluteConstraint.prototype.constructor=Phaser.Physics.P2.RevoluteConstraint; \ No newline at end of file diff --git a/build/custom/phaser-no-libs.js b/build/custom/phaser-no-libs.js index 4aab931258..fa33471943 100644 --- a/build/custom/phaser-no-libs.js +++ b/build/custom/phaser-no-libs.js @@ -7,7 +7,7 @@ * * Phaser - http://www.phaser.io * -* v2.0.2 "Ghealdan" - Built: Tue Mar 25 2014 05:24:26 +* v2.0.2 "Ghealdan" - Built: Fri Mar 28 2014 01:30:50 * * By Richard Davey http://www.photonstorm.com @photonstorm * @@ -37,6 +37,7 @@ var root = this; +/* global Phaser:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -52,70 +53,70 @@ var Phaser = Phaser || { DEV_VERSION: '2.0.2', GAMES: [], - AUTO: 0, - CANVAS: 1, - WEBGL: 2, - HEADLESS: 3, - - NONE: 0, - LEFT: 1, - RIGHT: 2, - UP: 3, - DOWN: 4, - - SPRITE: 0, - BUTTON: 1, - IMAGE: 2, - GRAPHICS: 3, - TEXT: 4, - TILESPRITE: 5, - BITMAPTEXT: 6, - GROUP: 7, - RENDERTEXTURE: 8, - TILEMAP: 9, - TILEMAPLAYER: 10, - EMITTER: 11, - POLYGON: 12, - BITMAPDATA: 13, - CANVAS_FILTER: 14, - WEBGL_FILTER: 15, - ELLIPSE: 16, - SPRITEBATCH: 17, - RETROFONT: 18, - - // The various blend modes supported by pixi / phaser - 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 - }, - - // The scale modes - scaleModes: { - DEFAULT:0, - LINEAR:0, - NEAREST:1 - } - -}; - -PIXI.InteractionManager = function (dummy) { - // We don't need this in Pixi, so we've removed it to save space - // however the Stage object expects a reference to it, so here is a dummy entry. + AUTO: 0, + CANVAS: 1, + WEBGL: 2, + HEADLESS: 3, + + NONE: 0, + LEFT: 1, + RIGHT: 2, + UP: 3, + DOWN: 4, + + SPRITE: 0, + BUTTON: 1, + IMAGE: 2, + GRAPHICS: 3, + TEXT: 4, + TILESPRITE: 5, + BITMAPTEXT: 6, + GROUP: 7, + RENDERTEXTURE: 8, + TILEMAP: 9, + TILEMAPLAYER: 10, + EMITTER: 11, + POLYGON: 12, + BITMAPDATA: 13, + CANVAS_FILTER: 14, + WEBGL_FILTER: 15, + ELLIPSE: 16, + SPRITEBATCH: 17, + RETROFONT: 18, + + // The various blend modes supported by pixi / phaser + 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 + }, + + // The scale modes + scaleModes: { + DEFAULT:0, + LINEAR:0, + NEAREST:1 + } + +}; + +PIXI.InteractionManager = function () { + // We don't need this in Pixi, so we've removed it to save space + // however the Stage object expects a reference to it, so here is a dummy entry. }; /* jshint supernew: true */ @@ -131,7 +132,7 @@ PIXI.InteractionManager = function (dummy) { * @static */ Phaser.Utils = { - + /** * Get a unit dimension from a string. * @@ -192,7 +193,7 @@ Phaser.Utils = { } return array; - + }, /** @@ -200,7 +201,7 @@ Phaser.Utils = { * pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) * @method Phaser.Utils.pad - * @param {string} str - The target string. + * @param {string} str - The target string. * @param {number} len - The number of characters to be added. * @param {number} pad - The string to pad it out with (defaults to a space). * @param {number} [dir=3] The direction dir = 1 (left), 2 (right), 3 (both). @@ -219,17 +220,17 @@ Phaser.Utils = { switch (dir) { case 1: - str = Array(len + 1 - str.length).join(pad) + str; + str = new Array(len + 1 - str.length).join(pad) + str; break; case 3: var right = Math.ceil((padlen = len - str.length) / 2); var left = padlen - right; - str = Array(left+1).join(pad) + str + Array(right+1).join(pad); + str = new Array(left+1).join(pad) + str + new Array(right+1).join(pad); break; default: - str = str + Array(len + 1 - str.length).join(pad); + str = str + new Array(len + 1 - str.length).join(pad); break; } } @@ -260,7 +261,7 @@ Phaser.Utils = { // the "constructor" property of certain host objects, ie. |window.location| // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 try { - if (obj.constructor && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } @@ -311,7 +312,7 @@ Phaser.Utils = { --i; } - for ( ; i < length; i++ ) + for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) @@ -365,6 +366,7 @@ Phaser.Utils = { */ if (typeof Function.prototype.bind != 'function') { + /* jshint freeze: false */ Function.prototype.bind = (function () { var slice = Array.prototype.slice; @@ -372,26 +374,29 @@ if (typeof Function.prototype.bind != 'function') { return function (thisArg) { var target = this, boundArgs = slice.call(arguments, 1); - + if (typeof target != 'function') { throw new TypeError(); } - + function bound() { var args = boundArgs.concat(slice.call(arguments)); target.apply(this instanceof bound ? this : thisArg, args); } - + bound.prototype = (function F(proto) { - proto && (F.prototype = proto); + if (proto) + { + F.prototype = proto; + } if (!(this instanceof F)) { return new F; } })(target.prototype); - + return bound; }; })(); @@ -405,7 +410,7 @@ if (!Array.isArray) Array.isArray = function (arg) { return Object.prototype.toString.call(arg) == '[object Array]'; - } + }; } /** @@ -529,7 +534,7 @@ Phaser.Circle.prototype = { */ distance: function (dest, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -657,7 +662,7 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", { * @property {number} radius - Gets or sets the radius of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "radius", { - + get: function () { return this._radius; }, @@ -680,7 +685,7 @@ Object.defineProperty(Phaser.Circle.prototype, "radius", { * @propety {number} left - Gets or sets the value of the leftmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "left", { - + get: function () { return this.x - this._radius; }, @@ -738,7 +743,7 @@ Object.defineProperty(Phaser.Circle.prototype, "top", { get: function () { return this.y - this._radius; }, - + set: function (value) { if (value > this.y) @@ -968,7 +973,7 @@ Phaser.Point = function (x, y) { * @property {number} x - The x coordinate of the point. */ this.x = x; - + /** * @property {number} y - The y coordinate of the point. */ @@ -1010,7 +1015,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -1026,7 +1031,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -1100,7 +1105,7 @@ Phaser.Point.prototype = { this.x = Phaser.Math.clamp(this.x, min, max); return this; - + }, /** @@ -1114,7 +1119,7 @@ Phaser.Point.prototype = { this.y = Phaser.Math.clamp(this.y, min, max); return this; - + }, /** @@ -1358,7 +1363,7 @@ Phaser.Point.equals = function (a, b) { */ Phaser.Point.distance = function (a, b, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -1433,17 +1438,17 @@ Phaser.Rectangle = function (x, y, width, height) { * @property {number} x - The x coordinate of the top-left corner of the Rectangle. */ this.x = x; - + /** * @property {number} y - The y coordinate of the top-left corner of the Rectangle. */ this.y = y; - + /** * @property {number} width - The width of the Rectangle. */ this.width = width; - + /** * @property {number} height - The height of the Rectangle. */ @@ -1468,7 +1473,7 @@ Phaser.Rectangle.prototype = { return this; }, - + /** * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. * @method Phaser.Rectangle#offsetPoint @@ -1480,7 +1485,7 @@ Phaser.Rectangle.prototype = { return this.offset(point.x, point.y); }, - + /** * Sets the members of Rectangle to the specified values. * @method Phaser.Rectangle#setTo @@ -1511,7 +1516,7 @@ Phaser.Rectangle.prototype = { this.y = Math.floor(this.y); }, - + /** * Runs Math.floor() on the x, y, width and height values of this Rectangle. * @method Phaser.Rectangle#floorAll @@ -1583,7 +1588,7 @@ Phaser.Rectangle.prototype = { * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. * @method Phaser.Rectangle#clone * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. - * @return {Phaser.Rectangle} + * @return {Phaser.Rectangle} */ clone: function (output) { @@ -1731,11 +1736,11 @@ Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", { * @property {number} bottom - The sum of the y and height properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { - + get: function () { return this.y + this.height; }, - + set: function (value) { if (value <= this.y) { this.height = 0; @@ -1752,7 +1757,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { * @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { - + get: function () { return new Phaser.Point(this.right, this.bottom); }, @@ -1770,7 +1775,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { * @property {number} left - The x coordinate of the left of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "left", { - + get: function () { return this.x; }, @@ -1792,7 +1797,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "left", { * @property {number} right - The sum of the x and width properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "right", { - + get: function () { return this.x + this.width; }, @@ -1814,7 +1819,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { - + get: function () { return this.width * this.height; } @@ -1828,7 +1833,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { - + get: function () { return (this.width * 2) + (this.height * 2); } @@ -1841,7 +1846,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { * @property {number} centerX - The x coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { - + get: function () { return this.x + this.halfWidth; }, @@ -1858,7 +1863,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { * @property {number} centerY - The y coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { - + get: function () { return this.y + this.halfHeight; }, @@ -1876,7 +1881,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { * @property {number} top - The y coordinate of the top of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "top", { - + get: function () { return this.y; }, @@ -1902,7 +1907,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { get: function () { return new Phaser.Point(this.x, this.y); }, - + set: function (value) { this.x = value.x; this.y = value.y; @@ -1912,12 +1917,12 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { /** * Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. -* If set to true then all of the Rectangle properties are set to 0. +* If set to true then all of the Rectangle properties are set to 0. * @name Phaser.Rectangle#empty * @property {boolean} empty - Gets or sets the Rectangles empty state. */ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { - + get: function () { return (!this.width || !this.height); }, @@ -1928,7 +1933,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { { this.setTo(0, 0, 0, 0); } - + } }); @@ -2174,7 +2179,7 @@ Phaser.Rectangle.union = function (a, b, output) { } return output.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right) - Math.min(a.left, b.left), Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)); - + }; // Because PIXI uses its own Rectangle, we'll replace it with ours to avoid duplicating code or confusion. @@ -2243,12 +2248,12 @@ Phaser.Line.prototype = { * @method Phaser.Line#fromSprite * @param {Phaser.Sprite} startSprite - The coordinates of this Sprite will be set to the Line.start point. * @param {Phaser.Sprite} endSprite - The coordinates of this Sprite will be set to the Line.start point. - * @param {boolean} [useCenter=true] - If true it will use startSprite.center.x, if false startSprite.x. + * @param {boolean} [useCenter=false] - If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class. * @return {Phaser.Line} This line object */ fromSprite: function (startSprite, endSprite, useCenter) { - if (typeof useCenter === 'undefined') { useCenter = true; } + if (typeof useCenter === 'undefined') { useCenter = false; } if (useCenter) { @@ -2341,7 +2346,7 @@ Phaser.Line.prototype = { while (!((x1 == x2) && (y1 == y2))) { var e2 = err << 1; - + if (e2 > -dy) { err -= dy; @@ -2560,7 +2565,7 @@ Phaser.Line.intersectsPoints = function (a, b, e, f, asSegment, result) { result.x = ((b1 * c2) - (b2 * c1)) / denom; result.y = ((a2 * c1) - (a1 * c2)) / denom; - + if (asSegment) { if (Math.pow((result.x - b.x) + (result.y - b.y), 2) > Math.pow((a.x - b.x) + (a.y - b.y), 2)) @@ -2761,7 +2766,7 @@ Phaser.Ellipse.prototype.constructor = Phaser.Ellipse; * @propety {number} left - Gets or sets the value of the leftmost point of the ellipse. */ Object.defineProperty(Phaser.Ellipse.prototype, "left", { - + get: function () { return this.x; }, @@ -2809,7 +2814,7 @@ Object.defineProperty(Phaser.Ellipse.prototype, "top", { get: function () { return this.y; }, - + set: function (value) { this.y = value; } @@ -2914,7 +2919,7 @@ PIXI.Ellipse = Phaser.Ellipse; /** * Creates a new Polygon. You have to provide a list of points. -* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], +* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be all the points of the polygon e.g. `new Phaser.Polygon(new Phaser.Point(), new Phaser.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Phaser.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @@ -3036,7 +3041,7 @@ PIXI.Polygon = Phaser.Polygon; * @param {number} height - The height of the view rectangle */ Phaser.Camera = function (game, id, x, y, width, height) { - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -3054,7 +3059,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { this.id = 0; /** - * Camera view. + * Camera view. * The view into the world we wish to render (by default the game dimensions). * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render. * Objects outside of this view are not rendered if set to camera cull. @@ -3113,7 +3118,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { * @property {Phaser.Point} scale - The scale of the display object to which all game objects are added. Set by World.boot */ this.scale = null; - + }; /** @@ -3324,7 +3329,7 @@ Phaser.Camera.prototype = { /** * A helper function to set both the X and Y properties of the camera at once * without having to use game.camera.x and game.camera.y. - * + * * @method Phaser.Camera#setPosition * @param {number} x - X position. * @param {number} y - Y position. @@ -3343,7 +3348,7 @@ Phaser.Camera.prototype = { /** * Sets the size of the view rectangle given the width and height in parameters. - * + * * @method Phaser.Camera#setSize * @param {number} width - The desired width. * @param {number} height - The desired height. @@ -3357,7 +3362,7 @@ Phaser.Camera.prototype = { /** * Resets the camera back to 0,0 and un-follows any object it may have been tracking. - * + * * @method Phaser.Camera#reset */ reset: function () { @@ -3382,7 +3387,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { get: function () { return this.view.x; }, - + set: function (value) { this.view.x = value; @@ -3401,7 +3406,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { * @property {number} y - Gets or sets the cameras y position. */ Object.defineProperty(Phaser.Camera.prototype, "y", { - + get: function () { return this.view.y; }, @@ -3472,12 +3477,12 @@ Phaser.State = function () { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = null; - + /** * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory. */ this.add = null; - + /** * @property {Phaser.GameObjectCreator} make - Reference to the GameObjectCreator. */ @@ -3487,32 +3492,32 @@ Phaser.State = function () { * @property {Phaser.Camera} camera - A handy reference to world.camera. */ this.camera = null; - + /** * @property {Phaser.Cache} cache - Reference to the assets cache. */ this.cache = null; - + /** * @property {Phaser.Input} input - Reference to the input manager */ this.input = null; - + /** * @property {Phaser.Loader} load - Reference to the assets loader. */ this.load = null; - + /** * @property {Phaser.Math} math - Reference to the math helper. */ this.math = null; - + /** * @property {Phaser.SoundManager} sound - Reference to the sound manager. */ this.sound = null; - + /** * @property {Phaser.ScaleManager} scale - Reference to the game scale manager. */ @@ -3522,27 +3527,27 @@ Phaser.State = function () { * @property {Phaser.Stage} stage - Reference to the stage. */ this.stage = null; - + /** * @property {Phaser.TimeManager} time - Reference to game clock. */ this.time = null; - + /** * @property {Phaser.TweenManager} tweens - Reference to the tween manager. */ this.tweens = null; - + /** * @property {Phaser.World} world - Reference to the world. */ this.world = null; - + /** * @property {Phaser.Particles} particles - The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it. */ this.particles = null; - + /** * @property {Phaser.Physics.World} physics - Reference to the physics manager. */ @@ -3560,7 +3565,7 @@ Phaser.State.prototype = { /** * Override this method to add some load operations. * If you need to use the loader, you may need to use them here. - * + * * @method Phaser.State#preload */ preload: function () { @@ -3568,7 +3573,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#loadUpdate */ loadUpdate: function () { @@ -3576,7 +3581,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#loadRender */ loadRender: function () { @@ -3585,7 +3590,7 @@ Phaser.State.prototype = { /** * This method is called after the game engine successfully switches states. * Feel free to add any setup code here (do not load anything here, override preload() instead). - * + * * @method Phaser.State#create */ create: function () { @@ -3593,7 +3598,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#update */ update: function () { @@ -3601,7 +3606,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#render */ render: function () { @@ -3609,7 +3614,7 @@ Phaser.State.prototype = { /** * This method will be called when game paused. - * + * * @method Phaser.State#paused */ paused: function () { @@ -3636,7 +3641,7 @@ Phaser.State.prototype.constructor = Phaser.State; /** * The State Manager is responsible for loading, setting up and switching game states. -* +* * @class Phaser.StateManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. @@ -3703,7 +3708,7 @@ Phaser.StateManager = function (game, pendingState) { * @property {function} onPreloadCallback - This will be called when init states (loading assets...). */ this.onPreloadCallback = null; - + /** * @property {function} onCreateCallback - This will be called when create states (setup states...). */ @@ -3884,7 +3889,7 @@ Phaser.StateManager.prototype = { } }, - + /** * Used by onInit and onShutdown when those functions don't exist on the state * @method Phaser.StateManager#dummy @@ -4247,7 +4252,7 @@ Phaser.LinkedList = function () { * @default */ this.last = null; - + /** * @property {object} game - Number of elements in the list. * @default @@ -4260,7 +4265,7 @@ Phaser.LinkedList.prototype = { /** * Adds a new element to this linked list. - * + * * @method Phaser.LinkedList#add * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through. * @return {object} The child that was added. @@ -4293,7 +4298,7 @@ Phaser.LinkedList.prototype = { /** * Removes the given element from this linked list if it exists. - * + * * @method Phaser.LinkedList#remove * @param {object} child - The child to be removed from the list. */ @@ -4336,7 +4341,7 @@ Phaser.LinkedList.prototype = { /** * Calls a function on all members of this list, using the member as the context for the callback. * The function must exist on the member. - * + * * @method Phaser.LinkedList#callAll * @param {function} callback - The function to call. */ @@ -4348,7 +4353,7 @@ Phaser.LinkedList.prototype = { } var entity = this.first; - + do { if (entity && entity[callback]) @@ -4359,7 +4364,7 @@ Phaser.LinkedList.prototype = { entity = entity.next; } - while(entity != this.last.next) + while(entity != this.last.next); } @@ -4386,7 +4391,7 @@ Phaser.Signal = function () { * @private */ this._bindings = []; - + /** * @property {any} _prevParams - Internal variable. * @private @@ -4416,7 +4421,7 @@ Phaser.Signal.prototype = { memorize: false, /** - * @property {boolean} _shouldPropagate + * @property {boolean} _shouldPropagate * @private */ _shouldPropagate: true, @@ -4437,7 +4442,7 @@ Phaser.Signal.prototype = { */ validateListener: function (listener, fnName) { if (typeof listener !== 'function') { - throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) ); + throw new Error('listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName)); } }, @@ -4458,14 +4463,14 @@ Phaser.Signal.prototype = { if (prevIndex !== -1) { binding = this._bindings[prevIndex]; if (binding.isOnce() !== isOnce) { - throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.'); + throw new Error('You cannot add' + (isOnce ? '' : 'Once') + '() then add' + (!isOnce ? '' : 'Once') + '() the same listener without removing the relationship first.'); } } else { binding = new Phaser.SignalBinding(this, listener, isOnce, listenerContext, priority); this._addBinding(binding); } - if (this.memorize && this._prevParams){ + if (this.memorize && this._prevParams) { binding.execute(this._prevParams); } @@ -4473,7 +4478,7 @@ Phaser.Signal.prototype = { }, /** - * @method Phaser.Signal#_addBinding + * @method Phaser.Signal#_addBinding * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener. * @private */ @@ -4504,7 +4509,7 @@ Phaser.Signal.prototype = { /** * Check if listener was attached to Signal. - * + * * @method Phaser.Signal#has * @param {Function} listener - Signal handler function. * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -4516,7 +4521,7 @@ Phaser.Signal.prototype = { /** * Add a listener to the signal. - * + * * @method Phaser.Signal#add * @param {function} listener - Signal handler function. * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -4634,7 +4639,7 @@ Phaser.Signal.prototype = { //execute all callbacks until end of the list or until a callback returns `false` or stops propagation //reverse loop since listeners with higher priority will be added at the end of the list do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false); - + }, /** @@ -4741,8 +4746,8 @@ Phaser.SignalBinding.prototype = { /** * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters). - * @property {array|null} params - * @default + * @property {array|null} params + * @default */ params: null, @@ -4753,13 +4758,13 @@ Phaser.SignalBinding.prototype = { * @param {array} [paramsArr] - Array of parameters that should be passed to the listener. * @return {any} Value returned by the listener. */ - execute: function (paramsArr) { + execute: function(paramsArr) { var handlerReturn, params; if (this.active && !!this._listener) { - params = this.params? this.params.concat(paramsArr) : paramsArr; + params = this.params ? this.params.concat(paramsArr) : paramsArr; handlerReturn = this._listener.apply(this.context, params); if (this._isOnce) @@ -4843,9 +4848,9 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Filter template to use for any Phaser filter development. -* +* * @class Phaser.Filter * @classdesc Phaser - Filter * @constructor @@ -4864,8 +4869,8 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @property {number} type - The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER. * @default */ - this.type = Phaser.WEBGL_FILTER; - + this.type = Phaser.WEBGL_FILTER; + /** * An array of passes - some filters contain a few steps this array simply stores the steps in a linear fashion. * For example the blur filter has two passes blurX and blurY. @@ -4873,7 +4878,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @private */ this.passes = [this]; - + /** * @property {array} shaders - Array an array of shaders. * @private @@ -4902,7 +4907,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { mouse: { type: '2f', value: { x: 0.0, y: 0.0 }} }; - + /** * @property {array} fragmentSrc - The fragment shader code. */ @@ -4964,7 +4969,7 @@ Phaser.Filter.prototype = { destroy: function () { this.game = null; - + } }; @@ -5009,9 +5014,9 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Plugin template to use for any Phaser plugin development. -* +* * @class Phaser.Plugin * @classdesc Phaser - Plugin * @constructor @@ -5026,30 +5031,30 @@ Phaser.Plugin = function (game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null. */ this.parent = parent; - + /** * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped. * @default */ this.active = false; - + /** * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped. * @default */ this.visible = false; - + /** * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method. * @default */ this.hasPreUpdate = false; - + /** * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method. * @default @@ -5061,13 +5066,13 @@ Phaser.Plugin = function (game, parent) { * @default */ this.hasPostUpdate = false; - + /** * @property {boolean} hasRender - A flag to indicate if this plugin has a render method. * @default */ this.hasRender = false; - + /** * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method. * @default @@ -5120,7 +5125,7 @@ Phaser.Plugin.prototype = { this.parent = null; this.active = false; this.visible = false; - + } }; @@ -5135,9 +5140,9 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins. -* +* * @class Phaser.PluginManager * @classdesc Phaser - PluginManager * @constructor @@ -5150,18 +5155,18 @@ Phaser.PluginManager = function(game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Description} _parent - Description. * @private */ this._parent = parent; - + /** * @property {array} plugins - Description. */ this.plugins = []; - + /** * @property {array} _pluginsLength - Description. * @private @@ -5261,7 +5266,7 @@ Phaser.PluginManager.prototype = { * @param {Phaser.Plugin} plugin - The plugin to be removed. */ remove: function (plugin) { - + if (this._pluginsLength === 0) { return; @@ -5284,7 +5289,7 @@ Phaser.PluginManager.prototype = { * @method Phaser.PluginManager#removeAll */ removeAll: function() { - + for (this._p = 0; this._p < this._pluginsLength; this._p++) { this.plugins[this._p].destroy(); @@ -5296,7 +5301,7 @@ Phaser.PluginManager.prototype = { /** * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#preUpdate */ preUpdate: function () { @@ -5319,11 +5324,11 @@ Phaser.PluginManager.prototype = { /** * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#update */ update: function () { - + if (this._pluginsLength === 0) { return; @@ -5343,11 +5348,11 @@ Phaser.PluginManager.prototype = { * PostUpdate is the last thing to be called before the world render. * In particular, it is called after the world postUpdate, which means the camera has been adjusted. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#postUpdate */ postUpdate: function () { - + if (this._pluginsLength === 0) { return; @@ -5366,7 +5371,7 @@ Phaser.PluginManager.prototype = { /** * Render is called right after the Game Renderer completes, but before the State.render. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#render */ render: function () { @@ -5389,7 +5394,7 @@ Phaser.PluginManager.prototype = { /** * Post-render is called after the Game Renderer and State.render have run. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#postRender */ postRender: function () { @@ -5411,7 +5416,7 @@ Phaser.PluginManager.prototype = { /** * Clear down this PluginManager and null out references - * + * * @method Phaser.PluginManager#destroy */ destroy: function () { @@ -5455,7 +5460,7 @@ Phaser.Stage = function (game, width, height) { * @property {Phaser.Point} offset - Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes) */ this.offset = new Phaser.Point(); - + PIXI.Stage.call(this, 0x000000, false); /** @@ -5525,11 +5530,11 @@ Phaser.Stage.prototype.constructor = Phaser.Stage; /** * This is called automatically after the plugins preUpdate and before the State.update. * Most objects have preUpdate methods and it's where initial movement and positioning is done. -* +* * @method Phaser.Stage#preUpdate */ Phaser.Stage.prototype.preUpdate = function () { - + this.currentRenderOrderID = 0; // This can't loop in reverse, we need the orderID to be in sequence @@ -5540,11 +5545,11 @@ Phaser.Stage.prototype.preUpdate = function () { this.children[i].preUpdate(); } -} +}; /** * This is called automatically after the State.update, but before particles or plugins update. -* +* * @method Phaser.Stage#update */ Phaser.Stage.prototype.update = function () { @@ -5556,14 +5561,14 @@ Phaser.Stage.prototype.update = function () { this.children[i].update(); } -} +}; /** * This is called automatically before the renderer runs and after the plugins have updated. * In postUpdate this is where all the final physics calculatations and object positioning happens. * The objects are processed in the order of the display list. * The only exception to this is if the camera is following an object, in which case that is updated first. -* +* * @method Phaser.Stage#postUpdate */ Phaser.Stage.prototype.postUpdate = function () { @@ -5605,7 +5610,7 @@ Phaser.Stage.prototype.postUpdate = function () { } } -} +}; /** * Parses a Game configuration object. @@ -5658,7 +5663,7 @@ Phaser.Stage.prototype.parseConfig = function (config) { this.backgroundColor = config['backgroundColor']; } -} +}; /** * Initialises the stage and adds the event listeners. @@ -5675,14 +5680,14 @@ Phaser.Stage.prototype.boot = function () { this._onChange = function (event) { return _this.visibilityChange(event); - } + }; Phaser.Canvas.setUserSelect(this.game.canvas, 'none'); Phaser.Canvas.setTouchAction(this.game.canvas, 'none'); this.checkVisibility(); -} +}; /** * Starts a page visibility event listener running, or window.blur/focus if not supported by the browser. @@ -5723,7 +5728,7 @@ Phaser.Stage.prototype.checkVisibility = function () { window.onblur = this._onChange; window.onfocus = this._onChange; -} +}; /** * This method is called when the document visibility is changed. @@ -5760,7 +5765,7 @@ Phaser.Stage.prototype.visibilityChange = function (event) { this.game.gameResumed(event); } -} +}; /** * Sets the background color for the stage. @@ -5775,7 +5780,7 @@ Phaser.Stage.prototype.setBackgroundColor = function(backgroundColor) var hex = this._backgroundColor.toString(16); hex = '000000'.substr(0, 6 - hex.length) + hex; this.backgroundColorString = '#' + hex; -} +}; /** * @name Phaser.Stage#backgroundColor @@ -5812,7 +5817,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { * @property {boolean} smoothed - Set to true to smooth all sprites rendered on this Stage, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Stage.prototype, "smoothed", { - + get: function () { return !PIXI.scaleModes.LINEAR; @@ -6045,7 +6050,7 @@ Phaser.Group.prototype.add = function (child) { return child; -} +}; /** * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object. @@ -6082,7 +6087,7 @@ Phaser.Group.prototype.addAt = function (child, index) { return child; -} +}; /** * Returns the child found at the given index within this Group. @@ -6102,7 +6107,7 @@ Phaser.Group.prototype.getAt = function (index) { return this.getChildAt(index); } -} +}; /** * Automatically creates a new Phaser.Sprite object and adds it to the top of this Group. @@ -6132,9 +6137,9 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { child.alive = exists; this.addChild(child); - + child.z = this.children.length; - + if (child.events) { child.events.onAddedToGroup.dispatch(child, this); @@ -6147,7 +6152,7 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { return child; -} +}; /** * Automatically creates multiple Phaser.Sprite objects and adds them to the top of this Group. @@ -6169,7 +6174,7 @@ Phaser.Group.prototype.createMultiple = function (quantity, key, frame, exists) this.create(0, 0, key, frame, exists); } -} +}; /** * Internal method that re-applies all of the childrens Z values. @@ -6186,7 +6191,7 @@ Phaser.Group.prototype.updateZ = function () { this.children[i].z = i; } -} +}; /** * Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object. @@ -6210,7 +6215,7 @@ Phaser.Group.prototype.next = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object. @@ -6234,7 +6239,7 @@ Phaser.Group.prototype.previous = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Swaps the position of two children in this Group. Both children must be in this Group. @@ -6254,8 +6259,8 @@ Phaser.Group.prototype.swap = function (child1, child2) { } return result; - -} + +}; /** * Brings the given child to the top of this Group so it renders above all other children. @@ -6274,7 +6279,7 @@ Phaser.Group.prototype.bringToTop = function (child) { return child; -} +}; /** * Sends the given child to the bottom of this Group so it renders below all other children. @@ -6293,7 +6298,7 @@ Phaser.Group.prototype.sendToBack = function (child) { return child; -} +}; /** * Moves the given child up one place in this Group unless it's already at the top. @@ -6317,7 +6322,7 @@ Phaser.Group.prototype.moveUp = function (child) { return child; -} +}; /** * Moves the given child down one place in this Group unless it's already at the top. @@ -6341,7 +6346,7 @@ Phaser.Group.prototype.moveDown = function (child) { return child; -} +}; /** * Positions the child found at the given index within this Group to the given x and y coordinates. @@ -6363,7 +6368,7 @@ Phaser.Group.prototype.xy = function (index, x, y) { this.getChildAt(index).y = y; } -} +}; /** * Reverses all children in this Group. Note that this does not propagate, only direct children are re-ordered. @@ -6375,7 +6380,7 @@ Phaser.Group.prototype.reverse = function () { this.children.reverse(); this.updateZ(); -} +}; /** * Get the index position of the given child in this Group. This should always match the childs z property. @@ -6388,7 +6393,7 @@ Phaser.Group.prototype.getIndex = function (child) { return this.children.indexOf(child); -} +}; /** * Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group. @@ -6401,7 +6406,7 @@ Phaser.Group.prototype.getIndex = function (child) { Phaser.Group.prototype.replace = function (oldChild, newChild) { var index = this.getIndex(oldChild); - + if (index !== -1) { if (newChild.parent !== undefined) @@ -6424,7 +6429,7 @@ Phaser.Group.prototype.replace = function (oldChild, newChild) { return temp; } -} +}; /** * Sets the given property to the given value on the child. The operation controls the assignment of the value. @@ -6484,7 +6489,7 @@ Phaser.Group.prototype.setProperty = function (child, key, value, operation) { else if (operation == 4) { child[key[0]][key[1]][key[2]][key[3]] /= value; } } -} +}; /** * This function allows you to quickly set a property on a single child of this Group to a new value. @@ -6510,7 +6515,7 @@ Phaser.Group.prototype.set = function (child, key, value, checkAlive, checkVisib this.setProperty(child, key, value, operation); } -} +}; /** * This function allows you to quickly set the same property across all children of this Group to a new value. @@ -6543,7 +6548,7 @@ Phaser.Group.prototype.setAll = function (key, value, checkAlive, checkVisible, } } -} +}; /** * This function allows you to quickly set the same property across all children of this Group, and any child Groups, to a new value. @@ -6582,7 +6587,7 @@ Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkV } } -} +}; /** * Adds the amount to the given property on all children in this Group. @@ -6598,7 +6603,7 @@ Phaser.Group.prototype.addAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 1); -} +}; /** * Subtracts the amount from the given property on all children in this Group. @@ -6614,7 +6619,7 @@ Phaser.Group.prototype.subAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 2); -} +}; /** * Multiplies the given property by the amount on all children in this Group. @@ -6630,7 +6635,7 @@ Phaser.Group.prototype.multiplyAll = function (property, amount, checkAlive, che this.setAll(property, amount, checkAlive, checkVisible, 3); -} +}; /** * Divides the given property by the amount on all children in this Group. @@ -6646,12 +6651,12 @@ Phaser.Group.prototype.divideAll = function (property, amount, checkAlive, check this.setAll(property, amount, checkAlive, checkVisible, 4); -} +}; /** * Calls a function on all of the children that have exists=true in this Group. * After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback. -* +* * @method Phaser.Group#callAllExists * @param {function} callback - The function that exists on the children that will be called. * @param {boolean} existsValue - Only children with exists=existsValue will be called. @@ -6669,11 +6674,11 @@ Phaser.Group.prototype.callAllExists = function (callback, existsValue) { } } -} +}; /** * Returns a reference to a function that exists on a child of the Group based on the given callback array. -* +* * @method Phaser.Group#callbackFromArray * @param {object} child - The object to inspect. * @param {array} callback - The array of function names. @@ -6722,12 +6727,12 @@ Phaser.Group.prototype.callbackFromArray = function (child, callback, length) { return false; -} +}; /** * Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that) * After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child. -* +* * @method Phaser.Group#callAll * @param {string} method - A string containing the name of the function that will be called. The function must exist on the child. * @param {string} [context=null] - A string containing the context under which the method will be executed. Set to null to default to the child. @@ -6782,7 +6787,7 @@ Phaser.Group.prototype.callAll = function (method, context) { } } -} +}; /** * The core preUpdate - as called by World. @@ -6806,7 +6811,7 @@ Phaser.Group.prototype.preUpdate = function () { return true; -} +}; /** * The core update - as called by World. @@ -6822,7 +6827,7 @@ Phaser.Group.prototype.update = function () { this.children[i].update(); } -} +}; /** * The core postUpdate - as called by World. @@ -6845,25 +6850,22 @@ Phaser.Group.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run. * After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEach(awardBonusGold, this, true, 100, 500) * Note: Currently this will skip any children which are Groups themselves. -* +* * @method Phaser.Group#forEach * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). -* @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. +* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. */ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists) { - if (typeof checkExists === 'undefined') - { - checkExists = false; - } + if (typeof checkExists === 'undefined') { checkExists = false; } var args = Array.prototype.splice.call(arguments, 3); args.unshift(null); @@ -6877,13 +6879,13 @@ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExist } } -} +}; /** * Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachExists(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachExists * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -6895,13 +6897,13 @@ Phaser.Group.prototype.forEachExists = function (callback, callbackContext) { this.iterate('exists', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachAlive(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachAlive * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -6913,13 +6915,13 @@ Phaser.Group.prototype.forEachAlive = function (callback, callbackContext) { this.iterate('alive', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachDead(bringToLife, this) -* +* * @method Phaser.Group#forEachDead * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -6931,7 +6933,7 @@ Phaser.Group.prototype.forEachDead = function (callback, callbackContext) { this.iterate('alive', false, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Call this function to sort the group according to a particular value and order. @@ -6965,7 +6967,7 @@ Phaser.Group.prototype.sort = function (index, order) { this.updateZ(); -} +}; /** * An internal helper function for the sort process. @@ -6996,7 +6998,7 @@ Phaser.Group.prototype.ascendingSortHandler = function (a, b) { } } -} +}; /** * An internal helper function for the sort process. @@ -7020,13 +7022,13 @@ Phaser.Group.prototype.descendingSortHandler = function (a, b) { return 0; } -} +}; /** * Iterates over the children of the Group. When a child has a property matching key that equals the given value, it is considered as a match. * Matched children can be sent to the optional callback, or simply returned or counted. * You can add as many callback parameters as you like, which will all be passed to the callback along with the child, after the callbackContext parameter. -* +* * @method Phaser.Group#iterate * @param {string} key - The child property to check, i.e. 'exists', 'alive', 'health' * @param {any} value - If child.key === this value it will be considered a match. Note that a strict comparison is used. @@ -7077,7 +7079,7 @@ Phaser.Group.prototype.iterate = function (key, value, returnType, callback, cal return null; } -} +}; /** * Call this function to retrieve the first object with exists == (the given state) in the Group. @@ -7095,7 +7097,7 @@ Phaser.Group.prototype.getFirstExists = function (state) { return this.iterate('exists', state, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === true in the group. @@ -7108,7 +7110,7 @@ Phaser.Group.prototype.getFirstAlive = function () { return this.iterate('alive', true, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === false in the group. @@ -7121,7 +7123,7 @@ Phaser.Group.prototype.getFirstDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_CHILD); -} +}; /** * Returns the child at the top of this Group. The top is the one being displayed (rendered) above every other child. @@ -7136,7 +7138,7 @@ Phaser.Group.prototype.getTop = function () { return this.children[this.children.length - 1]; } -} +}; /** * Returns the child at the bottom of this Group. The bottom is the one being displayed (rendered) below every other child. @@ -7151,7 +7153,7 @@ Phaser.Group.prototype.getBottom = function () { return this.children[0]; } -} +}; /** * Call this function to find out how many members of the group are alive. @@ -7163,7 +7165,7 @@ Phaser.Group.prototype.countLiving = function () { return this.iterate('alive', true, Phaser.Group.RETURN_TOTAL); -} +}; /** * Call this function to find out how many members of the group are dead. @@ -7175,7 +7177,7 @@ Phaser.Group.prototype.countDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_TOTAL); -} +}; /** * Returns a member at random from the group. @@ -7197,7 +7199,7 @@ Phaser.Group.prototype.getRandom = function (startIndex, length) { return this.game.math.getRandom(this.children, startIndex, length); -} +}; /** * Removes the given child from this Group and sets its group property to null. @@ -7229,7 +7231,7 @@ Phaser.Group.prototype.remove = function (child) { return true; -} +}; /** * Removes all children from this Group, setting all group properties to null. @@ -7257,7 +7259,7 @@ Phaser.Group.prototype.removeAll = function () { this.cursor = null; -} +}; /** * Removes all children from this Group whos index falls beteen the given startIndex and endIndex values. @@ -7295,7 +7297,7 @@ Phaser.Group.prototype.removeBetween = function (startIndex, endIndex) { this.updateZ(); -} +}; /** * Destroys this Group. Removes all children, then removes the container from the display list and nulls references. @@ -7341,7 +7343,7 @@ Phaser.Group.prototype.destroy = function (destroyChildren, soft) { this.exists = false; } -} +}; /** * @name Phaser.Group#total @@ -7400,7 +7402,7 @@ Object.defineProperty(Phaser.Group.prototype, "angle", { * @property {boolean} fixedToCamera - Set to true to fix this Group to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Group.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -7490,8 +7492,8 @@ Phaser.World = function (game) { * @property {Phaser.Camera} camera - Camera instance. */ this.camera = null; - -} + +}; Phaser.World.prototype = Object.create(Phaser.Group.prototype); Phaser.World.prototype.constructor = Phaser.World; @@ -7514,7 +7516,7 @@ Phaser.World.prototype.boot = function () { this.game.stage.addChild(this); -} +}; /** * Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height. @@ -7547,7 +7549,7 @@ Phaser.World.prototype.setBounds = function (x, y, width, height) { this.game.physics.setBoundsToWorld(); -} +}; /** * Destroyer of worlds. @@ -7559,7 +7561,7 @@ Phaser.World.prototype.shutdown = function () { // World is a Group, so run a soft destruction on this and all children. this.destroy(true, true); -} +}; /** * @name Phaser.World#width @@ -7672,7 +7674,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", { /** * The ScaleManager object is responsible for helping you manage the scaling, resizing and alignment of your game within the browser. * -* @class Phaser.ScaleManager +* @class Phaser.ScaleManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} width - The native width of the game. @@ -7904,7 +7906,7 @@ Phaser.ScaleManager = function (game, width, height) { document.addEventListener('fullscreenchange', function (event) { return _this.fullScreenChange(event); }, false); - + }; /** @@ -8223,7 +8225,7 @@ Phaser.ScaleManager.prototype = { { force = false; } - + if (this.game.device.iPad === false && this.game.device.webApp === false && this.game.device.desktop === false) { if (this.game.device.android && this.game.device.chrome === false) @@ -8242,7 +8244,7 @@ Phaser.ScaleManager.prototype = { { // Set minimum height of content to new window height document.documentElement['style'].minHeight = window.innerHeight + 'px'; - + if (this.incorrectOrientation === true) { this.setMaximum(); @@ -8308,7 +8310,7 @@ Phaser.ScaleManager.prototype = { this.game.canvas.style.width = this.width + 'px'; this.game.canvas.style.height = this.height + 'px'; - + this.game.input.scale.setTo(this.game.width / this.width, this.game.height / this.height); if (this.pageAlignHorizontally) @@ -8340,9 +8342,9 @@ Phaser.ScaleManager.prototype = { } Phaser.Canvas.getOffset(this.game.canvas, this.game.stage.offset); - + this.aspectRatio = this.width / this.height; - + this.scaleFactor.x = this.game.width / this.width; this.scaleFactor.y = this.game.height / this.height; @@ -8421,7 +8423,7 @@ Object.defineProperty(Phaser.ScaleManager.prototype, "isFullScreen", { get: function () { - return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']) + return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']); } @@ -8768,7 +8770,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this._onBoot = function () { return _this.boot(); - } + }; if (document.readyState === 'complete' || document.readyState === 'interactive') { @@ -9298,7 +9300,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Phaser.Input = function (game) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -9307,7 +9309,7 @@ Phaser.Input = function (game) { * @default */ this.hitCanvas = null; - + /** * @property {CanvasRenderingContext2D} hitContext - The context of the pixel perfect hit canvas. * @default @@ -9340,13 +9342,13 @@ Phaser.Input = function (game) { /** * @property {number} multiInputOverride - Controls the expected behaviour when using a mouse and touch together on a multi-input device. - * @default + * @default */ this.multiInputOverride = Phaser.Input.MOUSE_TOUCH_COMBINE; /** * @property {Phaser.Point} position - A point object representing the current position of the Pointer. - * @default + * @default */ this.position = null; @@ -9493,22 +9495,22 @@ Phaser.Input = function (game) { * @property {Pointer} mousePointer - The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game. */ this.mousePointer = null; - + /** * @property {Phaser.Mouse} mouse - The Mouse Input manager. */ this.mouse = null; - + /** * @property {Phaser.Keyboard} keyboard - The Keyboard Input manager. */ this.keyboard = null; - + /** * @property {Phaser.Touch} touch - the Touch Input manager. */ this.touch = null; - + /** * @property {Phaser.MSPointer} mspointer - The MSPointer Input manager. */ @@ -9528,17 +9530,17 @@ Phaser.Input = function (game) { * @property {Phaser.Signal} onDown - A Signal that is dispatched each time a pointer is pressed down. */ this.onDown = null; - + /** * @property {Phaser.Signal} onUp - A Signal that is dispatched each time a pointer is released. */ this.onUp = null; - + /** * @property {Phaser.Signal} onTap - A Signal that is dispatched each time a pointer is tapped. */ this.onTap = null; - + /** * @property {Phaser.Signal} onHold - A Signal that is dispatched each time a pointer is held down. */ @@ -9555,7 +9557,7 @@ Phaser.Input = function (game) { * @private */ this._localPoint = new Phaser.Point(); - + /** * @property {number} _pollCounter - Internal var holding the current poll counter. * @private @@ -9996,7 +9998,7 @@ Phaser.Input.prototype = { wt.d * id * pointer.x + -wt.b * id * pointer.y + (wt.ty * wt.b - wt.tx * wt.d) * id, wt.a * id * pointer.y + -wt.c * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.c) * id ); - + }, /** @@ -10098,7 +10100,7 @@ Object.defineProperty(Phaser.Input.prototype, "x", { * @property {number} y - The Y coordinate of the most recently active pointer. */ Object.defineProperty(Phaser.Input.prototype, "y", { - + get: function () { return this._y; }, @@ -10143,7 +10145,7 @@ Object.defineProperty(Phaser.Input.prototype, "totalInactivePointers", { * @readonly */ Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", { - + get: function () { this.currentPointers = 0; @@ -10204,7 +10206,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { Phaser.Key = function (game, keycode) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -10293,7 +10295,7 @@ Phaser.Key = function (game, keycode) { * @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again). */ this.onUp = new Phaser.Signal(); - + }; Phaser.Key.prototype = { @@ -10464,7 +10466,7 @@ Phaser.Keyboard = function (game) { * @private */ this._keys = []; - + /** * @property {array} _capture - The array the key capture values are stored in. * @private @@ -10477,14 +10479,20 @@ Phaser.Keyboard = function (game) { * @default */ this._onKeyDown = null; - + /** * @property {function} _onKeyUp * @private * @default */ this._onKeyUp = null; - + + /** + * @property {number} _i - Internal cache var + * @private + */ + this._i = 0; + }; Phaser.Keyboard.prototype = { @@ -10541,7 +10549,7 @@ Phaser.Keyboard.prototype = { if (this._keys[keycode]) { this._keys[keycode] = null; - + this.removeKeyCapture(keycode); } @@ -10560,12 +10568,12 @@ Phaser.Keyboard.prototype = { down: this.addKey(Phaser.Keyboard.DOWN), left: this.addKey(Phaser.Keyboard.LEFT), right: this.addKey(Phaser.Keyboard.RIGHT) - } + }; }, /** - * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. + * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. * This is called automatically by Phaser.Input and should not normally be invoked directly. * * @method Phaser.Keyboard#start @@ -10594,17 +10602,37 @@ Phaser.Keyboard.prototype = { }, /** - * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body. + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { + this._onKeyDown = null; + this._onKeyUp = null; + window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); }, + /** + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. + * Also clears all key captures and currently created Key objects. + * + * @method Phaser.Keyboard#destroy + */ + destroy: function () { + + this.stop(); + + this.clearCaptures(); + + this._keys.length = 0; + this._i = 0; + + }, + /** * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. @@ -10659,13 +10687,13 @@ Phaser.Keyboard.prototype = { */ update: function () { - var i = this._keys.length; + this._i = this._keys.length; - while (i--) + while (this._i--) { - if (this._keys[i]) + if (this._keys[this._i]) { - this._keys[i].update(); + this._keys[this._i].update(); } } @@ -10702,7 +10730,7 @@ Phaser.Keyboard.prototype = { { this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode); } - + this._keys[event.keyCode].processKeyDown(event); }, @@ -10945,7 +10973,7 @@ Phaser.Mouse = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called. */ @@ -10955,12 +10983,12 @@ Phaser.Mouse = function (game) { * @property {function} mouseDownCallback - A callback that can be fired when the mouse is pressed down. */ this.mouseDownCallback = null; - + /** * @property {function} mouseMoveCallback - A callback that can be fired when the mouse is moved while pressed down. */ this.mouseMoveCallback = null; - + /** * @property {function} mouseUpCallback - A callback that can be fired when the mouse is released from a pressed down state. */ @@ -11286,7 +11314,7 @@ Phaser.MSPointer = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called (defaults to game). */ @@ -11303,13 +11331,13 @@ Phaser.MSPointer = function (game) { * @private */ this._onMSPointerDown = null; - + /** * @property {function} _onMSPointerMove - Internal function to handle MSPointer events. * @private */ this._onMSPointerMove = null; - + /** * @property {function} _onMSPointerUp - Internal function to handle MSPointer events. * @private @@ -11612,7 +11640,7 @@ Phaser.Pointer = function (game, id) { * @property {Phaser.Point} position - A Phaser.Point object containing the current x/y values of the pointer on the display. */ this.position = new Phaser.Point(); - + /** * @property {Phaser.Point} positionDown - A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display. */ @@ -11719,7 +11747,7 @@ Phaser.Pointer.prototype = { x: this.position.x, y: this.position.y }); - + if (this._history.length > this.game.input.recordLimit) { this._history.shift(); @@ -11821,7 +11849,7 @@ Phaser.Pointer.prototype = { } currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this._highestRenderObject === null) @@ -11941,17 +11969,17 @@ Phaser.Pointer.prototype = { if (this.game.input.interactiveItems.total > 0) { var currentNode = this.game.input.interactiveItems.next; - + do { if (currentNode) { currentNode._releasedHandler(this); } - + currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this.targetObject) @@ -12101,7 +12129,7 @@ Phaser.Touch = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored. * @return {boolean} @@ -12117,32 +12145,32 @@ Phaser.Touch = function (game) { * @property {function} touchStartCallback - A callback that can be fired on a touchStart event. */ this.touchStartCallback = null; - + /** * @property {function} touchMoveCallback - A callback that can be fired on a touchMove event. */ this.touchMoveCallback = null; - + /** * @property {function} touchEndCallback - A callback that can be fired on a touchEnd event. */ this.touchEndCallback = null; - + /** * @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event. */ this.touchEnterCallback = null; - + /** * @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event. */ this.touchLeaveCallback = null; - + /** * @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event. */ this.touchCancelCallback = null; - + /** * @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it. * @default @@ -12760,7 +12788,7 @@ Phaser.Gamepad.prototype = { } var rawPad = this._rawPads[m]; - + if (rawPad) { if (validConnections.rawIndices[rawPad.index]) @@ -13323,7 +13351,7 @@ Phaser.SinglePad.prototype = { } this._axes[axisState.axis] = axisState.value; - + if (this._padParent.onAxisCallback) { this._padParent.onAxisCallback.call(this._padParent.callbackContext, axisState, this._index); @@ -13811,7 +13839,7 @@ Phaser.InputHandler = function (sprite) { this.sprite = sprite; /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = sprite.game; @@ -13826,13 +13854,13 @@ Phaser.InputHandler = function (sprite) { * @default */ this.priorityID = 0; - + /** * @property {boolean} useHandCursor - On a desktop browser you can set the 'hand' cursor to appear when moving over the Sprite. * @default */ this.useHandCursor = false; - + /** * @property {boolean} _setHandCursor - Did this Sprite trigger the hand cursor? * @private @@ -13844,19 +13872,19 @@ Phaser.InputHandler = function (sprite) { * @default */ this.isDragged = false; - + /** * @property {boolean} allowHorizontalDrag - Controls if the Sprite is allowed to be dragged horizontally. * @default */ this.allowHorizontalDrag = true; - + /** * @property {boolean} allowVerticalDrag - Controls if the Sprite is allowed to be dragged vertically. * @default */ this.allowVerticalDrag = true; - + /** * @property {boolean} bringToTop - If true when this Sprite is clicked or dragged it will automatically be bought to the top of the Group it is within. * @default @@ -13868,25 +13896,25 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffset = null; - + /** * @property {boolean} snapOnDrag - When the Sprite is dragged this controls if the center of the Sprite will snap to the pointer on drag or not. * @default */ this.snapOnDrag = false; - + /** * @property {boolean} snapOnRelease - When the Sprite is dragged this controls if the Sprite will be snapped on release. * @default */ this.snapOnRelease = false; - + /** * @property {number} snapX - When a Sprite has snapping enabled this holds the width of the snap grid. * @default */ this.snapX = 0; - + /** * @property {number} snapY - When a Sprite has snapping enabled this holds the height of the snap grid. * @default @@ -13898,7 +13926,7 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffsetX = 0; - + /** * @property {number} snapOffsetY - This defines the top-left Y coordinate of the snap grid.. * @default @@ -13931,13 +13959,13 @@ Phaser.InputHandler = function (sprite) { /** * @property {boolean} draggable - Is this sprite allowed to be dragged by the mouse? true = yes, false = no - * @default + * @default */ this.draggable = false; /** * @property {Phaser.Rectangle} boundsRect - A region of the game world within which the sprite is restricted during drag. - * @default + * @default */ this.boundsRect = null; @@ -14437,7 +14465,7 @@ Phaser.InputHandler.prototype = { y += this.sprite.texture.frame.y; this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1); if (rgb.data[3] >= this.pixelPerfectAlpha) @@ -14923,7 +14951,7 @@ Phaser.InputHandler.prototype = { } this.updateDrag(pointer); - + if (this.bringToTop) { this.sprite.bringToTop(); @@ -14943,7 +14971,7 @@ Phaser.InputHandler.prototype = { this.isDragged = false; this._draggedPointerID = -1; this._pointerData[pointer.id].isDragged = false; - + if (this.snapOnRelease) { if (this.sprite.fixedToCamera) @@ -15147,7 +15175,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler; * @param {Phaser.Sprite} sprite - A reference to Description. */ Phaser.Events = function (sprite) { - + this.parent = sprite; this.onAddedToGroup = new Phaser.Signal(); @@ -15223,7 +15251,7 @@ Phaser.GameObjectFactory = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -15363,7 +15391,7 @@ Phaser.GameObjectFactory.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -15379,7 +15407,7 @@ Phaser.GameObjectFactory.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -15485,7 +15513,7 @@ Phaser.GameObjectFactory.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectFactory#retroFont @@ -15643,7 +15671,7 @@ Phaser.GameObjectCreator = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -15746,7 +15774,7 @@ Phaser.GameObjectCreator.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -15762,7 +15790,7 @@ Phaser.GameObjectCreator.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -15856,7 +15884,7 @@ Phaser.GameObjectCreator.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectCreator#retroFont @@ -16016,7 +16044,7 @@ Phaser.BitmapData = function (game, key, width, height) { if (typeof height === 'undefined') { height = 100; } /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -16029,7 +16057,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @property {number} width - The width of the BitmapData in pixels. */ this.width = width; - + /** * @property {number} height - The height of the BitmapData in pixels. */ @@ -16040,7 +16068,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.canvas = Phaser.Canvas.create(width, height, '', true); - + /** * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. * @default @@ -16074,13 +16102,13 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - The PIXI.Texture. * @default */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - The Frame this BitmapData uses for rendering. * @default @@ -16098,13 +16126,13 @@ Phaser.BitmapData = function (game, key, width, height) { */ this.dirty = false; -} +}; Phaser.BitmapData.prototype = { /** * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. - * + * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. */ @@ -16134,7 +16162,7 @@ Phaser.BitmapData.prototype = { clear: function () { this.context.clearRect(0, 0, this.width, this.height); - + this.dirty = true; }, @@ -16155,7 +16183,7 @@ Phaser.BitmapData.prototype = { this.textureFrame.height = height; this.imageData = this.context.getImageData(0, 0, width, height); } - + this.dirty = true; }, @@ -16400,7 +16428,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -16478,7 +16506,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -16781,6 +16809,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) { /** * Crop allows you to crop the texture used to display this Sprite. * Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite. * * @method Phaser.Sprite#crop * @memberof Phaser.Sprite @@ -16829,7 +16858,7 @@ Phaser.Sprite.prototype.crop = function(rect) { * Brings a 'dead' Sprite back to life, optionally giving it the health value specified. * A resurrected Sprite has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal. -* +* * @method Phaser.Sprite#revive * @memberof Phaser.Sprite * @param {number} [health=1] - The health to give the Sprite. @@ -16858,7 +16887,7 @@ Phaser.Sprite.prototype.revive = function(health) { * It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal. * Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory. * If you don't need this Sprite any more you should call Sprite.destroy instead. -* +* * @method Phaser.Sprite#kill * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -16881,7 +16910,7 @@ Phaser.Sprite.prototype.kill = function() { /** * Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Sprite#destroy * @memberof Phaser.Sprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -16954,7 +16983,7 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) { /** * Damages the Sprite, this removes the given amount from the Sprites health property. * If health is then taken below or is equal to zero `Sprite.kill` is called. -* +* * @method Phaser.Sprite#damage * @memberof Phaser.Sprite * @param {number} amount - The amount to subtract from the Sprite.health value. @@ -16980,7 +17009,7 @@ Phaser.Sprite.prototype.damage = function(amount) { * Resets the Sprite. This places the Sprite at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. * If the Sprite has a physics body that too is reset. -* +* * @method Phaser.Sprite#reset * @memberof Phaser.Sprite * @param {number} x - The x coordinate (in world space) to position the Sprite at. @@ -17011,13 +17040,13 @@ Phaser.Sprite.prototype.reset = function(x, y, health) { this._cache[4] = 1; return this; - + }; /** * Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Sprite#bringToTop * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -17036,7 +17065,7 @@ Phaser.Sprite.prototype.bringToTop = function() { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.Sprite#play * @memberof Phaser.Sprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -17054,11 +17083,27 @@ Phaser.Sprite.prototype.play = function (name, frameRate, loop, killOnComplete) }; +/** +* Checks to see if the bounds of this Sprite overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as a Button. +* This check ignores the Sprites hitArea property and runs a Sprite.getBounds comparison on both objects to determine the result. +* Therefore it's relatively expensive to use in large quantities (i.e. with lots of Sprites at a high frequency), but should be fine for low-volume testing where physics isn't required. +* +* @method Phaser.Sprite#overlap +* @memberof Phaser.Sprite +* @param {Phaser.Sprite|Phaser.Image|Phaser.TileSprite|Phaser.Button|PIXI.DisplayObject} displayObject - The display object to check against. +* @return {boolean} True if the bounds of this Sprite intersects at any point with the bounds of the given display object. +*/ +Phaser.Sprite.prototype.overlap = function (displayObject) { + + return Phaser.Rectangle.intersects(this.getBounds(), displayObject.getBounds()); + +}; + /** * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Sprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -17105,7 +17150,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaX", { Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -17122,7 +17167,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { Object.defineProperty(Phaser.Sprite.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -17156,7 +17201,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inWorld", { Object.defineProperty(Phaser.Sprite.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -17218,7 +17263,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -17255,7 +17300,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { * @property {boolean} exists - If the Sprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.Sprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -17302,7 +17347,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "exists", { * @property {boolean} fixedToCamera - Set to true to fix this Sprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -17331,7 +17376,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Sprite, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -17358,6 +17403,60 @@ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { }); +/** +* The position of the Sprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#x +* @property {number} x - The position of the Sprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the Sprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#y +* @property {number} y - The position of the Sprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -17383,12 +17482,12 @@ Phaser.Image = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Image isn't updated by the core game loop. * @default @@ -17524,7 +17623,7 @@ Phaser.Image.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -17534,7 +17633,7 @@ Phaser.Image.prototype.preUpdate = function() { */ Phaser.Image.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -17562,7 +17661,7 @@ Phaser.Image.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Changes the Texture the Image is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -17639,7 +17738,7 @@ Phaser.Image.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Crop allows you to crop the texture used to display this Image. @@ -17686,13 +17785,13 @@ Phaser.Image.prototype.crop = function(rect) { } } -} +}; /** * Brings a 'dead' Image back to life, optionally giving it the health value specified. * A resurrected Image has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Image.events.onRevived for the signal. -* +* * @method Phaser.Image#revive * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -17710,14 +17809,14 @@ Phaser.Image.prototype.revive = function() { return this; -} +}; /** * Kills a Image. A killed Image has its alive, exists and visible properties all set to false. * It will dispatch the onKilled event, you can listen to Image.events.onKilled for the signal. * Note that killing a Image is a way for you to quickly recycle it in a Image pool, it doesn't free it up from memory. * If you don't need this Image any more you should call Image.destroy instead. -* +* * @method Phaser.Image#kill * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -17735,12 +17834,12 @@ Phaser.Image.prototype.kill = function() { return this; -} +}; /** * Destroys the Image. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Image#destroy * @memberof Phaser.Image * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -17798,11 +17897,11 @@ Phaser.Image.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Resets the Image. This places the Image at the given x/y world coordinates and then sets alive, exists, visible and renderable all to true. -* +* * @method Phaser.Image#reset * @memberof Phaser.Image * @param {number} x - The x coordinate (in world space) to position the Image at. @@ -17820,13 +17919,13 @@ Phaser.Image.prototype.reset = function(x, y) { this.renderable = true; return this; - -} + +}; /** * Brings the Image to the top of the display list it is a child of. Images that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Image#bringToTop * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -17840,13 +17939,13 @@ Phaser.Image.prototype.bringToTop = function() { return this; -} +}; /** * Indicates the rotation of the Image, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Image.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Image#angle * @property {number} angle - The angle of this Image in degrees. */ @@ -17893,7 +17992,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaX", { Object.defineProperty(Phaser.Image.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -17910,7 +18009,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaY", { Object.defineProperty(Phaser.Image.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -17944,7 +18043,7 @@ Object.defineProperty(Phaser.Image.prototype, "inWorld", { Object.defineProperty(Phaser.Image.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -17958,7 +18057,7 @@ Object.defineProperty(Phaser.Image.prototype, "inCamera", { Object.defineProperty(Phaser.Image.prototype, "frame", { get: function() { - + return this._frame; }, @@ -17987,7 +18086,7 @@ Object.defineProperty(Phaser.Image.prototype, "frame", { Object.defineProperty(Phaser.Image.prototype, "frameName", { get: function() { - + return this._frameName; }, @@ -18032,7 +18131,7 @@ Object.defineProperty(Phaser.Image.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -18069,7 +18168,7 @@ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Image to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -18098,7 +18197,7 @@ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Image, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Image.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -18251,7 +18350,7 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -18380,7 +18479,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -18390,7 +18489,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { */ Phaser.TileSprite.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -18418,7 +18517,7 @@ Phaser.TileSprite.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Sets this TileSprite to automatically scroll in the given direction until stopped via TileSprite.stopScroll(). @@ -18433,7 +18532,7 @@ Phaser.TileSprite.prototype.autoScroll = function(x, y) { this._scroll.set(x, y); -} +}; /** * Stops an automatically scrolling TileSprite. @@ -18445,7 +18544,7 @@ Phaser.TileSprite.prototype.stopScroll = function() { this._scroll.set(0, 0); -} +}; /** * Changes the Texture the TileSprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -18517,12 +18616,12 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Destroys the TileSprite. This removes it from its parent group, destroys the event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.TileSprite#destroy * @memberof Phaser.TileSprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -18578,12 +18677,12 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.TileSprite#play * @memberof Phaser.TileSprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -18596,7 +18695,7 @@ Phaser.TileSprite.prototype.play = function (name, frameRate, loop, killOnComple return this.animations.play(name, frameRate, loop, killOnComplete); -} +}; /** * Resets the TileSprite. This places the TileSprite at the given x/y world coordinates, resets the tilePosition and then @@ -18638,7 +18737,7 @@ Phaser.TileSprite.prototype.reset = function(x, y) { * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.TileSprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -18709,7 +18808,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "frameName", { * @property {boolean} fixedToCamera - Set to true to fix this TileSprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -18740,7 +18839,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { * @property {boolean} exists - If the TileSprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -18786,7 +18885,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -18814,6 +18913,60 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { }); +/** +* The position of the TileSprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#x +* @property {number} x - The position of the TileSprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the TileSprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#y +* @property {number} y - The position of the TileSprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -18854,7 +19007,7 @@ Phaser.Text = function (game, x, y, text, style) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -18991,7 +19144,7 @@ Phaser.Text.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -19001,7 +19154,7 @@ Phaser.Text.prototype.preUpdate = function () { */ Phaser.Text.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -19021,7 +19174,7 @@ Phaser.Text.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * @method Phaser.Text.prototype.destroy @@ -19081,7 +19234,7 @@ Phaser.Text.prototype.destroy = function (destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @method Phaser.Text.prototype.setShadow @@ -19098,7 +19251,7 @@ Phaser.Text.prototype.setShadow = function (x, y, color, blur) { this.style.shadowBlur = blur || 0; this.dirty = true; -} +}; /** * Set the style of the text by passing a single style object to it. @@ -19131,7 +19284,7 @@ Phaser.Text.prototype.setStyle = function (style) { this.style = style; this.dirty = true; -} +}; /** * Renders text. This replaces the Pixi.Text.updateText function as we need a few extra bits in here. @@ -19169,15 +19322,15 @@ Phaser.Text.prototype.updateText = function () { this.canvas.width = maxLineWidth + this.style.strokeThickness; //calculate text height - var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; + var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; this.canvas.height = lineHeight * lines.length; if (navigator.isCocoonJS) { - this.context.clearRect(0,0,this.canvas.width,this.canvas.height); + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); } - + //set canvas text styles this.context.fillStyle = this.style.fill; this.context.font = this.style.font; @@ -19197,30 +19350,30 @@ Phaser.Text.prototype.updateText = function () { { var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight); - if(this.style.align === 'right') + if (this.style.align === 'right') { linePosition.x += maxLineWidth - lineWidths[i]; } - else if(this.style.align === 'center') + else if (this.style.align === 'center') { linePosition.x += (maxLineWidth - lineWidths[i]) / 2; } linePosition.y += this._lineSpacing; - if(this.style.stroke && this.style.strokeThickness) + if (this.style.stroke && this.style.strokeThickness) { this.context.strokeText(lines[i], linePosition.x, linePosition.y); } - if(this.style.fill) + if (this.style.fill) { this.context.fillText(lines[i], linePosition.x, linePosition.y); } } this.updateTexture(); -} +}; /** * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal bounds. @@ -19268,7 +19421,7 @@ Phaser.Text.prototype.runWordWrap = function (text) { return result; -} +}; /** * Indicates the rotation of the Text, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -19638,7 +19791,7 @@ Object.defineProperty(Phaser.Text.prototype, 'shadowBlur', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -19675,7 +19828,7 @@ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Text to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Text.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -19735,7 +19888,7 @@ Phaser.BitmapText = function (game, x, y, font, text, size) { */ this.game = game; - /** + /** * @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all. * @default */ @@ -19876,7 +20029,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -19885,7 +20038,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { */ Phaser.BitmapText.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -19900,7 +20053,7 @@ Phaser.BitmapText.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this BitmapText instance. This will remove any filters and un-parent any children. @@ -19956,7 +20109,7 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @name Phaser.BitmapText#align @@ -20100,7 +20253,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'text', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -20137,7 +20290,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this BitmapText to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -20201,136 +20354,136 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, Phaser.Image.call(this, game, x, y, key, outFrame); - /** + /** * @property {number} type - The Phaser Object Type. */ this.type = Phaser.BUTTON; - /** + /** * @property {string} _onOverFrameName - Internal variable. * @private * @default */ this._onOverFrameName = null; - - /** + + /** * @property {string} _onOutFrameName - Internal variable. * @private * @default */ this._onOutFrameName = null; - - /** + + /** * @property {string} _onDownFrameName - Internal variable. * @private * @default */ this._onDownFrameName = null; - /** + /** * @property {string} _onUpFrameName - Internal variable. * @private * @default */ this._onUpFrameName = null; - - /** + + /** * @property {number} _onOverFrameID - Internal variable. * @private * @default */ this._onOverFrameID = null; - - /** + + /** * @property {number} _onOutFrameID - Internal variable. * @private * @default */ this._onOutFrameID = null; - - /** + + /** * @property {number} _onDownFrameID - Internal variable. * @private * @default */ this._onDownFrameID = null; - /** + /** * @property {number} _onUpFrameID - Internal variable. * @private * @default */ this._onUpFrameID = null; - /** + /** * @property {Phaser.Sound} onOverSound - The Sound to be played when this Buttons Over state is activated. * @default */ this.onOverSound = null; - /** + /** * @property {Phaser.Sound} onOutSound - The Sound to be played when this Buttons Out state is activated. * @default */ this.onOutSound = null; - /** + /** * @property {Phaser.Sound} onDownSound - The Sound to be played when this Buttons Down state is activated. * @default */ this.onDownSound = null; - /** + /** * @property {Phaser.Sound} onUpSound - The Sound to be played when this Buttons Up state is activated. * @default */ this.onUpSound = null; - /** + /** * @property {string} onOverSoundMarker - The Sound Marker used in conjunction with the onOverSound. * @default */ this.onOverSoundMarker = ''; - /** + /** * @property {string} onOutSoundMarker - The Sound Marker used in conjunction with the onOutSound. * @default */ this.onOutSoundMarker = ''; - /** + /** * @property {string} onDownSoundMarker - The Sound Marker used in conjunction with the onDownSound. * @default */ this.onDownSoundMarker = ''; - /** + /** * @property {string} onUpSoundMarker - The Sound Marker used in conjunction with the onUpSound. * @default */ this.onUpSoundMarker = ''; - /** + /** * @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state. */ this.onInputOver = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state. */ this.onInputOut = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state. */ this.onInputDown = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state. */ this.onInputUp = new Phaser.Signal(); - /** + /** * @property {boolean} freezeFrames - When true the Button will cease to change texture frame on all events (over, out, up, down). */ this.freezeFrames = false; @@ -20383,7 +20536,7 @@ Phaser.Button.prototype.clearFrames = function () { this._onUpFrameName = null; this._onUpFrameID = null; -} +}; /** * Used to manually set the frames that will be used for the different states of the Button. @@ -20403,7 +20556,7 @@ Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame, up if (typeof overFrame === 'string') { this._onOverFrameName = overFrame; - + if (this.input.pointerOver()) { this.frameName = overFrame; @@ -20510,7 +20663,7 @@ Phaser.Button.prototype.setSounds = function (overSound, overMarker, downSound, this.setDownSound(downSound, downMarker); this.setUpSound(upSound, upMarker); -} +}; /** * The Sound to be played when a Pointer moves over this Button. @@ -20534,7 +20687,7 @@ Phaser.Button.prototype.setOverSound = function (sound, marker) { this.onOverSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer moves out of this Button. @@ -20558,7 +20711,7 @@ Phaser.Button.prototype.setOutSound = function (sound, marker) { this.onOutSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer presses down on this Button. @@ -20582,7 +20735,7 @@ Phaser.Button.prototype.setDownSound = function (sound, marker) { this.onDownSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer has pressed down and is released from this Button. @@ -20606,7 +20759,7 @@ Phaser.Button.prototype.setUpSound = function (sound, marker) { this.onUpSoundMarker = marker; } -} +}; /** * Internal function that handles input events. @@ -20805,7 +20958,7 @@ Phaser.Button.prototype.setState = function (newState) { /** * Creates a new `Graphics` object. -* +* * @class Phaser.Graphics * @constructor * @@ -20822,7 +20975,7 @@ Phaser.Graphics = function (game, x, y) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -20911,7 +21064,7 @@ Phaser.Graphics.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -20921,7 +21074,7 @@ Phaser.Graphics.prototype.preUpdate = function () { */ Phaser.Graphics.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -20936,11 +21089,11 @@ Phaser.Graphics.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this Graphics instance. -* +* * @method Phaser.Graphics.prototype.destroy * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? */ @@ -20984,11 +21137,11 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) { this.game = null; -} +}; /* * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled -* +* * @method Phaser.Graphics.prototype.drawPolygon */ Phaser.Graphics.prototype.drawPolygon = function (poly) { @@ -21001,8 +21154,8 @@ Phaser.Graphics.prototype.drawPolygon = function (poly) { } this.lineTo(poly.points[0].x, poly.points[0].y); - -} + +}; /** * Indicates the rotation of the Graphics, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -21032,7 +21185,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'angle', { * @property {boolean} fixedToCamera - Set to true to fix this Graphics to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -21072,7 +21225,7 @@ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { Phaser.RenderTexture = function (game, width, height, key) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -21082,7 +21235,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this.key = key; /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RENDERTEXTURE; @@ -21093,7 +21246,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this._temp = new Phaser.Point(); PIXI.RenderTexture.call(this, width, height); - + }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); @@ -21114,7 +21267,7 @@ Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) this.render(displayObject, this._temp, clear); -} +}; // Documentation stubs @@ -21281,13 +21434,13 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, * @private */ this.grabData = []; - + // Now generate our rects for faster copying later on var currentX = this.offsetX; var currentY = this.offsetY; var r = 0; var data = new Phaser.FrameData(); - + for (var c = 0; c < chars.length; c++) { var uuid = game.rnd.uuid(); @@ -21302,9 +21455,9 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, width: this.characterWidth, height: this.characterHeight }); - + r++; - + if (r == this.characterPerRow) { r = 0; @@ -21324,10 +21477,10 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, Phaser.RenderTexture.call(this, game); /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RETROFONT; - + }; Phaser.RetroFont.prototype = Object.create(Phaser.RenderTexture.prototype); @@ -21339,91 +21492,91 @@ Phaser.RetroFont.prototype.constructor = Phaser.RetroFont; * @type {string} */ Phaser.RetroFont.ALIGN_LEFT = "left"; - + /** * Align each line of multi-line text to the right. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_RIGHT = "right"; - + /** * Align each line of multi-line text in the center. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_CENTER = "center"; - + /** * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - + /** * Text Set 2 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** -* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 +* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; - + /** * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"; - + /** * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789"; - + /** -* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' +* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' "; - + /** * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39"; - + /** * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?! * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!"; - + /** * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789 * @constant @@ -21447,11 +21600,11 @@ Phaser.RetroFont.prototype.setFixedWidth = function (width, lineAlignment) { this.fixedWidth = width; this.align = lineAlignment; -} +}; /** * A helper function that quickly sets lots of variables at once, and then updates the text. -* +* * @method Phaser.RetroFont#setText * @memberof Phaser.RetroFont * @param {string} content - The text of this sprite. @@ -21467,7 +21620,7 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac this.customSpacingX = characterSpacing || 0; this.customSpacingY = lineSpacing || 0; this.align = lineAlignment || 'left'; - + if (allowLowerCase) { this.autoUpperCase = false; @@ -21476,17 +21629,17 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac { this.autoUpperCase = true; } - + if (content.length > 0) { this.text = content; } -} +}; /** * Over rides the default PIXI.RenderTexture resize event as we need our baseTexture resized as well. -* +* * @method Phaser.RetroFont#resize * @memberof Phaser.RetroFont */ @@ -21508,7 +21661,7 @@ Phaser.RetroFont.prototype.resize = function (width, height) { var gl = this.renderer.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTextures[gl.id]); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { @@ -21517,11 +21670,11 @@ Phaser.RetroFont.prototype.resize = function (width, height) { PIXI.Texture.frameUpdates.push(this); -} +}; /** * Updates the BitmapData of the Sprite with the text -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont */ @@ -21533,7 +21686,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { if (this.multiLine) { var lines = this._text.split("\n"); - + if (this.fixedWidth > 0) { this.resize(this.fixedWidth, (lines.length * (this.characterHeight + this.customSpacingY)) - this.customSpacingY); @@ -21544,7 +21697,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + // Loop through each line of text for (var i = 0; i < lines.length; i++) { @@ -21554,25 +21707,25 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (lines[i].length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((lines[i].length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + // Sanity checks if (cx < 0) { cx = 0; } - + this.pasteLine(lines[i], cx, cy, this.customSpacingX); - + cy += this.characterHeight + this.customSpacingY; } } @@ -21588,32 +21741,32 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + switch (this.align) { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (this._text.length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((this._text.length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + this.pasteLine(this._text, cx, 0, this.customSpacingX); } -} +}; /** * Internal function that takes a single line of text (2nd parameter) and pastes it into the BitmapData at the given coordinates. * Used by getLine and getMultiLine -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont * @param {string} line - The single line of text to paste. @@ -21640,9 +21793,9 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { this.stamp.frame = this.grabData[line.charCodeAt(c)]; p.set(x, y); this.render(this.stamp, p, false); - + x += this.characterWidth + customSpacingX; - + if (x > this.width) { break; @@ -21650,11 +21803,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { } } } -} - +}; + /** * Works out the longest line of text in _text and returns its length -* +* * @method Phaser.RetroFont#getLongestLine * @memberof Phaser.RetroFont * @return {number} The length of the longest line of text. @@ -21662,11 +21815,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { Phaser.RetroFont.prototype.getLongestLine = function () { var longestLine = 0; - + if (this._text.length > 0) { var lines = this._text.split("\n"); - + for (var i = 0; i < lines.length; i++) { if (lines[i].length > longestLine) @@ -21675,13 +21828,13 @@ Phaser.RetroFont.prototype.getLongestLine = function () { } } } - + return longestLine; -} - +}; + /** * Internal helper function that removes all unsupported characters from the _text String, leaving only characters contained in the font set. -* +* * @method Phaser.RetroFont#removeUnsupportedCharacters * @memberof Phaser.RetroFont * @protected @@ -21691,7 +21844,7 @@ Phaser.RetroFont.prototype.getLongestLine = function () { Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { var newString = ""; - + for (var c = 0; c < this._text.length; c++) { var aChar = this._text[c]; @@ -21702,16 +21855,16 @@ Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { newString = newString.concat(aChar); } } - + return newString; -} +}; /** * @name Phaser.BitmapText#text * @property {string} text - Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true. */ Object.defineProperty(Phaser.RetroFont.prototype, "text", { - + get: function () { return this._text; @@ -21721,7 +21874,7 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { set: function (value) { var newText; - + if (this.autoUpperCase) { newText = value.toUpperCase(); @@ -21730,13 +21883,13 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { { newText = value; } - + if (newText !== this._text) { this._text = newText; - + this.removeUnsupportedCharacters(this.multiLine); - + this.buildRetroFontText(); } @@ -21860,7 +22013,7 @@ Phaser.Canvas = { color = color || 'rgb(0,0,0)'; canvas.style.backgroundColor = color; - + return canvas; }, @@ -22179,7 +22332,7 @@ Phaser.Device = function (game) { */ this.css3D = false; - /** + /** * @property {boolean} pointerLock - Is Pointer Lock available? * @default */ @@ -22360,7 +22513,7 @@ Phaser.Device = function (game) { */ this.iPhone4 = false; - /** + /** * @property {boolean} iPad - Is running on iPad? * @default */ @@ -22409,7 +22562,7 @@ Phaser.Device = function (game) { this._checkDevice(); this._checkFeatures(); this._checkOS(); - + }; Phaser.Device.prototype = { @@ -22495,7 +22648,7 @@ Phaser.Device.prototype = { } this.worker = !!window['Worker']; - + if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) { this.touch = true; @@ -22505,7 +22658,7 @@ Phaser.Device.prototype = { { this.mspointer = true; } - + this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true; @@ -22661,7 +22814,7 @@ Phaser.Device.prototype = { try { if (result = !!audioElement.canPlayType) { - + if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) { this.ogg = true; } @@ -22718,7 +22871,7 @@ Phaser.Device.prototype = { } navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - + if (navigator.vibrate) { this.vibration = true; @@ -22754,7 +22907,7 @@ Phaser.Device.prototype = { has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } - + document.body.removeChild(el); this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none"); @@ -22841,13 +22994,13 @@ Phaser.Device.prototype.constructor = Phaser.Device; /** * Abstracts away the use of RAF or setTimeOut for the core game update loop. * -* @class Phaser.RequestAnimationFrame +* @class Phaser.RequestAnimationFrame * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {boolean} [forceSetTimeOut=false] - Tell Phaser to use setTimeOut even if raf is available. */ Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) { - + if (typeof forceSetTimeOut === 'undefined') { forceSetTimeOut = false; } /** @@ -22936,7 +23089,7 @@ Phaser.RequestAnimationFrame.prototype = { /** * The update method for the requestAnimationFrame - * @method Phaser.RequestAnimationFrame#updateRAF + * @method Phaser.RequestAnimationFrame#updateRAF */ updateRAF: function () { @@ -23019,11 +23172,11 @@ Phaser.Math = { PI2: Math.PI * 2, /** - * Two number are fuzzyEqual if their difference is less than ε. + * Two number are fuzzyEqual if their difference is less than ε. * @method Phaser.Math#fuzzyEqual * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if |a-b|<ε */ fuzzyEqual: function (a, b, epsilon) { @@ -23032,11 +23185,11 @@ Phaser.Math = { }, /** - * a is fuzzyLessThan b if it is less than b + ε. + * a is fuzzyLessThan b if it is less than b + ε. * @method Phaser.Math#fuzzyLessThan * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if ab+ε */ fuzzyGreaterThan: function (a, b, epsilon) { @@ -23057,10 +23210,10 @@ Phaser.Math = { return a > b - epsilon; }, - /** + /** * @method Phaser.Math#fuzzyCeil * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} ceiling(val-ε) */ fuzzyCeil: function (val, epsilon) { @@ -23068,10 +23221,10 @@ Phaser.Math = { return Math.ceil(val - epsilon); }, - /** + /** * @method Phaser.Math#fuzzyFloor * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} floor(val-ε) */ fuzzyFloor: function (val, epsilon) { @@ -23079,7 +23232,7 @@ Phaser.Math = { return Math.floor(val + epsilon); }, - /** + /** * Averages all values passed to the function and returns the result. You can pass as many parameters as you like. * @method Phaser.Math#average * @return {number} The average of all given values. @@ -23102,7 +23255,7 @@ Phaser.Math = { }, - /** + /** * @method Phaser.Math#truncate * @param {number} n * @return {number} @@ -23111,7 +23264,7 @@ Phaser.Math = { return (n > 0) ? Math.floor(n) : Math.ceil(n); }, - /** + /** * @method Phaser.Math#shear * @param {number} n * @return {number} n mod 1 @@ -23203,7 +23356,7 @@ Phaser.Math = { * Snaps a value to the nearest value in an array. * @method Phaser.Math#snapToInArray * @param {number} input - * @param {array} arr + * @param {array} arr * @param {boolean} sort - True if the array needs to be sorted. * @return {number} */ @@ -23220,14 +23373,14 @@ Phaser.Math = { } var i = 1; - + while (arr[i] < input) { i++; } var low = arr[i - 1]; var high = (i < arr.length) ? arr[i] : Number.POSITIVE_INFINITY; - + return ((high - input) <= (input - low)) ? high : low; }, @@ -23261,7 +23414,7 @@ Phaser.Math = { * * Note what occurs when we round to the 3rd space (8ths place), 100100000, this is to be assumed * because we are rounding 100011.1011011011011011 which rounds up. - * + * * @method Phaser.Math#roundTo * @param {number} value - The value to round. * @param {number} place - The place to round to. @@ -23272,9 +23425,9 @@ Phaser.Math = { if (typeof place === "undefined") { place = 0; } if (typeof base === "undefined") { base = 10; } - + var p = Math.pow(base, -place); - + return Math.round(value * p) / p; }, @@ -23320,7 +23473,7 @@ Phaser.Math = { * @method Phaser.Math#interpolateFloat * @param {number} a * @param {number} b - * @param {number} weight + * @param {number} weight * @return {number} */ interpolateFloat: function (a, b, weight) { @@ -23371,7 +23524,7 @@ Phaser.Math = { angleRad = angleRad % (2 * Math.PI); return angleRad >= 0 ? angleRad : angleRad + 2 * Math.PI; - + }, /** @@ -23417,7 +23570,7 @@ Phaser.Math = { var rd = (radians) ? Math.PI : 180; a1 = this.normalizeAngle(a1, radians); a2 = this.normalizeAngle(a2, radians); - + if (a1 < -rd / 2 && a2 > rd / 2) { a1 += rd * 2; @@ -23467,7 +23620,7 @@ Phaser.Math = { chanceRoll: function (chance) { if (typeof chance === "undefined") { chance = 50; } - + if (chance <= 0) { return false; @@ -23545,7 +23698,7 @@ Phaser.Math = { minSub: function (value, amount, min) { value -= amount; - + if (value < min) { value = min; @@ -23580,7 +23733,7 @@ Phaser.Math = { { result += range; } - + return result + min; }, @@ -23815,7 +23968,7 @@ Phaser.Math = { * @method Phaser.Math#linearInterpolation * @param {number} v * @param {number} k - * @return {number} + * @return {number} */ linearInterpolation: function (v, k) { @@ -23928,7 +24081,7 @@ Phaser.Math = { * @param {number} p2 * @param {number} p3 * @param {number} t - * @return {number} + * @return {number} */ catmullRom: function (p0, p1, p2, p3, t) { @@ -23962,7 +24115,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -23996,7 +24149,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -24063,14 +24216,14 @@ Phaser.Math = { if (typeof sinAmplitude === "undefined") { sinAmplitude = 1.0; } if (typeof cosAmplitude === "undefined") { cosAmplitude = 1.0; } if (typeof frequency === "undefined") { frequency = 1.0; } - + var sin = sinAmplitude; var cos = cosAmplitude; var frq = frequency * Math.PI / length; - + var cosTable = []; var sinTable = []; - + for (var c = 0; c < length; c++) { cos -= sin * frq; @@ -24088,7 +24241,7 @@ Phaser.Math = { /** * Removes the top element from the stack and re-inserts it onto the bottom, then returns it. * The original stack is modified in the process. This effectively moves the position of the data from the start to the end of the table. - * + * * @method Phaser.Math#shift * @param {array} stack - The array to shift. * @return {any} The shifted value. @@ -24124,7 +24277,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates. - * + * * @method Phaser.Math#distance * @param {number} x1 * @param {number} y1 @@ -24143,7 +24296,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates at the power given. - * + * * @method Phaser.Math#distancePow * @param {number} x1 * @param {number} y1 @@ -24162,7 +24315,7 @@ Phaser.Math = { /** * Returns the rounded distance between the two given set of coordinates. - * + * * @method Phaser.Math#distanceRounded * @param {number} x1 * @param {number} y1 @@ -24179,7 +24332,7 @@ Phaser.Math = { /** * Force a value within the boundaries of two values. * Clamp value to range - * + * * @method Phaser.Math#clamp * @param {number} x * @param {number} a @@ -24191,10 +24344,10 @@ Phaser.Math = { return ( x < a ) ? a : ( ( x > b ) ? b : x ); }, - + /** * Clamp value to range to range - * + * * @method Phaser.Math#mapLinear * @param {number} x the value to map * @param {number} a1 first endpoint of the range @@ -24240,7 +24393,7 @@ Phaser.Math = { /** * Smoothstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smoothstep * @param {number} x * @param {number} min @@ -24267,7 +24420,7 @@ Phaser.Math = { /** * Smootherstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smootherstep * @param {number} x * @param {number} min @@ -24295,7 +24448,7 @@ Phaser.Math = { /** * A value representing the sign of the value. * -1 for negative, +1 for positive, 0 if value is 0 - * + * * @method Phaser.Math#sign * @param {number} x * @return {number} @@ -24308,11 +24461,11 @@ Phaser.Math = { /** * Convert degrees to radians. - * + * * @method Phaser.Math#degToRad * @return {function} */ - degToRad: function() { + degToRad: (function() { var degreeToRadiansFactor = Math.PI / 180; @@ -24322,15 +24475,15 @@ Phaser.Math = { }; - }(), + }()), /** * Convert degrees to radians. - * + * * @method Phaser.Math#radToDeg * @return {function} */ - radToDeg: function() { + radToDeg: (function() { var radianToDegreesFactor = 180 / Math.PI; @@ -24340,7 +24493,7 @@ Phaser.Math = { }; - }() + }()) }; @@ -24354,17 +24507,17 @@ Phaser.Math = { /** * Phaser.RandomDataGenerator constructor. -* +* * @class Phaser.RandomDataGenerator * @classdesc An extremely useful repeatable random data generator. Access it via Phaser.Game.rnd * Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense. * Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript -* +* * @constructor * @param {array} seeds */ Phaser.RandomDataGenerator = function (seeds) { - + if (typeof seeds === "undefined") { seeds = []; } /** @@ -24417,7 +24570,7 @@ Phaser.RandomDataGenerator.prototype = { /** * Reset the seed of the random data generator. - * + * * @method Phaser.RandomDataGenerator#sow * @param {array} seeds */ @@ -24441,7 +24594,7 @@ Phaser.RandomDataGenerator.prototype = { this.s2 -= this.hash(seed); this.s2 += ~~(this.s2 < 0); } - + }, /** @@ -24946,7 +25099,7 @@ Phaser.QuadTree.prototype.constructor = Phaser.QuadTree; * @param {Phaser.Game} game - A reference to the currently running game. */ Phaser.Net = function (game) { - + this.game = game; }; @@ -24955,7 +25108,7 @@ Phaser.Net.prototype = { /** * Returns the hostname given by the browser. - * + * * @method Phaser.Net#getHostName * @return {string} */ @@ -24974,7 +25127,7 @@ Phaser.Net.prototype = { * If the domain name is found it returns true. * You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc. * Do not include 'http://' at the start. - * + * * @method Phaser.Net#checkDomainName * @param {string} domain * @return {boolean} true if the given domain fragment can be found in the window.location.hostname @@ -24988,7 +25141,7 @@ Phaser.Net.prototype = { * If the value doesn't already exist it is set. * If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string. * Optionally you can redirect to the new url, or just return it as a string. - * + * * @method Phaser.Net#updateQueryString * @param {string} key - The querystring key to update. * @param {string} value - The new value to be set. If it already exists it will be replaced. @@ -25003,7 +25156,7 @@ Phaser.Net.prototype = { var output = ''; var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"); - + if (re.test(url)) { if (typeof value !== 'undefined' && value !== null) @@ -25050,7 +25203,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#getQueryString * @param {string} [parameter=''] - If specified this will return just the value for that key. * @return {string|object} An object containing the key value pairs found in the query string or just the value if a parameter was given. @@ -25086,7 +25239,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#decodeURI * @param {string} value - The URI component to be decoded. * @return {string} The decoded value. @@ -25107,9 +25260,9 @@ Phaser.Net.prototype.constructor = Phaser.Net; /** * Phaser - TweenManager -* +* * @class Phaser.TweenManager -* @classdesc +* @classdesc * Phaser.Game has a single instance of the TweenManager through which all Tween objects are created and updated. * Tweens are hooked into the game clock and pause system, adjusting based on the game state. * @@ -25127,13 +25280,13 @@ Phaser.TweenManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {array} _tweens - All of the currently running tweens. * @private */ this._tweens = []; - + /** * @property {array} _add - All of the tweens queued to be added in the next update. * @private @@ -25188,7 +25341,7 @@ Phaser.TweenManager.prototype = { }, /** - * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. + * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * * @method Phaser.TweenManager#create * @param {Object} object - Object the tween will be run on. @@ -25462,7 +25615,7 @@ Phaser.Tween = function (object, game, manager) { * @default null */ this._onUpdateCallback = null; - + /** * @property {object} _onUpdateCallbackContext - The context in which to call the onUpdate callback. * @private @@ -25501,7 +25654,7 @@ Phaser.Tween = function (object, game, manager) { // { // this._valuesStart[field] = parseFloat(object[field], 10); // } - + /** * @property {Phaser.Signal} onStart - The onStart event is fired when the Tween begins. */ @@ -25813,7 +25966,7 @@ Phaser.Tween.prototype = { }, /** - * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. + * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. * * @method Phaser.Tween#easing * @param {function} easing - The easing function this tween will use, i.e. Phaser.Easing.Linear.None. @@ -25857,7 +26010,7 @@ Phaser.Tween.prototype = { /** * Loop a chain of tweens - * + * * Usage: * game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true) * .to({ y: 300 }, 1000, Phaser.Easing.Linear.None) @@ -25891,7 +26044,7 @@ Phaser.Tween.prototype = { }, /** - * Pauses the tween. + * Pauses the tween. * * @method Phaser.Tween#pause */ @@ -25909,7 +26062,7 @@ Phaser.Tween.prototype = { * @private */ _pause: function () { - + if (!this._codePaused) { this._paused = true; @@ -26074,7 +26227,7 @@ Phaser.Tween.prototype = { return true; } - + }; Phaser.Tween.prototype.constructor = Phaser.Tween; @@ -26104,7 +26257,7 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Linear#In + * @method Phaser.Easing.Linear#In * @param {number} k - The value to be tweened. * @returns {number} k^2. */ @@ -26126,8 +26279,8 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Quadratic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#In + * @param {number} k - The value to be tweened. * @returns {number} k^2. */ In: function ( k ) { @@ -26139,8 +26292,8 @@ Phaser.Easing = { /** * Ease-out. * - * @method Phaser.Easing.Quadratic#Out - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#Out + * @param {number} k - The value to be tweened. * @returns {number} k* (2-k). */ Out: function ( k ) { @@ -26153,7 +26306,7 @@ Phaser.Easing = { * Ease-in/out. * * @method Phaser.Easing.Quadratic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26175,8 +26328,8 @@ Phaser.Easing = { /** * Cubic ease-in. * - * @method Phaser.Easing.Cubic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Cubic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26189,7 +26342,7 @@ Phaser.Easing = { * Cubic ease-out. * * @method Phaser.Easing.Cubic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26202,7 +26355,7 @@ Phaser.Easing = { * Cubic ease-in/out. * * @method Phaser.Easing.Cubic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26224,8 +26377,8 @@ Phaser.Easing = { /** * Quartic ease-in. * - * @method Phaser.Easing.Quartic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quartic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26238,7 +26391,7 @@ Phaser.Easing = { * Quartic ease-out. * * @method Phaser.Easing.Quartic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26251,7 +26404,7 @@ Phaser.Easing = { * Quartic ease-in/out. * * @method Phaser.Easing.Quartic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26273,8 +26426,8 @@ Phaser.Easing = { /** * Quintic ease-in. * - * @method Phaser.Easing.Quintic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quintic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26287,7 +26440,7 @@ Phaser.Easing = { * Quintic ease-out. * * @method Phaser.Easing.Quintic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26300,7 +26453,7 @@ Phaser.Easing = { * Quintic ease-in/out. * * @method Phaser.Easing.Quintic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26322,8 +26475,8 @@ Phaser.Easing = { /** * Sinusoidal ease-in. * - * @method Phaser.Easing.Sinusoidal#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Sinusoidal#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26336,7 +26489,7 @@ Phaser.Easing = { * Sinusoidal ease-out. * * @method Phaser.Easing.Sinusoidal#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26349,7 +26502,7 @@ Phaser.Easing = { * Sinusoidal ease-in/out. * * @method Phaser.Easing.Sinusoidal#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26370,8 +26523,8 @@ Phaser.Easing = { /** * Exponential ease-in. * - * @method Phaser.Easing.Exponential#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Exponential#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26384,7 +26537,7 @@ Phaser.Easing = { * Exponential ease-out. * * @method Phaser.Easing.Exponential#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26397,7 +26550,7 @@ Phaser.Easing = { * Exponential ease-in/out. * * @method Phaser.Easing.Exponential#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26421,8 +26574,8 @@ Phaser.Easing = { /** * Circular ease-in. * - * @method Phaser.Easing.Circular#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Circular#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26435,7 +26588,7 @@ Phaser.Easing = { * Circular ease-out. * * @method Phaser.Easing.Circular#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26448,7 +26601,7 @@ Phaser.Easing = { * Circular ease-in/out. * * @method Phaser.Easing.Circular#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26470,8 +26623,8 @@ Phaser.Easing = { /** * Elastic ease-in. * - * @method Phaser.Easing.Elastic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Elastic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26489,7 +26642,7 @@ Phaser.Easing = { * Elastic ease-out. * * @method Phaser.Easing.Elastic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26507,7 +26660,7 @@ Phaser.Easing = { * Elastic ease-in/out. * * @method Phaser.Easing.Elastic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26534,8 +26687,8 @@ Phaser.Easing = { /** * Back ease-in. * - * @method Phaser.Easing.Back#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Back#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26549,7 +26702,7 @@ Phaser.Easing = { * Back ease-out. * * @method Phaser.Easing.Back#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26563,7 +26716,7 @@ Phaser.Easing = { * Back ease-in/out. * * @method Phaser.Easing.Back#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26586,8 +26739,8 @@ Phaser.Easing = { /** * Bounce ease-in. * - * @method Phaser.Easing.Bounce#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Bounce#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -26600,7 +26753,7 @@ Phaser.Easing = { * Bounce ease-out. * * @method Phaser.Easing.Bounce#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -26629,7 +26782,7 @@ Phaser.Easing = { * Bounce ease-in/out. * * @method Phaser.Easing.Bounce#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -26867,7 +27020,7 @@ Phaser.Time.prototype = { { this.time = this.now; this._justResumed = false; - + this.events.resume(); for (var i = 0; i < this._timers.length; i++) @@ -26940,7 +27093,7 @@ Phaser.Time.prototype = { * @private */ gamePaused: function () { - + this._pauseStarted = this.now; this.events.pause(); @@ -27448,7 +27601,7 @@ Phaser.Timer.prototype = { * @method Phaser.Timer#pause */ pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -27465,7 +27618,7 @@ Phaser.Timer.prototype = { * @private */ _pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -27572,7 +27725,7 @@ Object.defineProperty(Phaser.Timer.prototype, "next", { Object.defineProperty(Phaser.Timer.prototype, "duration", { get: function () { - + if (this.running && this.nextTick > this._now) { return this.nextTick - this._now; @@ -27732,7 +27885,7 @@ Phaser.AnimationManager = function (sprite) { * @default */ this.currentFrame = null; - + /** * @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false. * @default @@ -27886,7 +28039,7 @@ Phaser.AnimationManager.prototype = { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. - * + * * @method Phaser.AnimationManager#play * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". * @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used. @@ -27948,7 +28101,7 @@ Phaser.AnimationManager.prototype = { /** * The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events. - * + * * @method Phaser.AnimationManager#update * @protected * @return {boolean} True if a new animation frame has been set, otherwise false. @@ -28046,7 +28199,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameData', { * @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', { - + get: function () { if (this._frameData) @@ -28093,7 +28246,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { { return this._frameIndex; } - + }, set: function (value) { @@ -28101,12 +28254,12 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) { this.currentFrame = this._frameData.getFrame(value); - + if (this.currentFrame) { this._frameIndex = value; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -28144,7 +28297,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', { { this._frameIndex = this.currentFrame.index; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -28301,7 +28454,7 @@ Phaser.Animation = function (game, parent, name, frameData, frames, delay, loop) // Set-up some event listeners this.game.onPause.add(this.onPause, this); this.game.onResume.add(this.onResume, this); - + }; Phaser.Animation.prototype = { @@ -28500,7 +28653,7 @@ Phaser.Animation.prototype = { this._parent.tilingTexture = false; } } - + this.loopCount++; this._parent.events.onAnimationLoop.dispatch(this._parent, this); this.onLoop.dispatch(this._parent, this); @@ -28748,7 +28901,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer return output; -} +}; /** * @author Richard Davey @@ -28775,7 +28928,7 @@ Phaser.Frame = function (index, x, y, width, height, name, uuid) { * @property {number} index - The index of this Frame within the FrameData set it is being added to. */ this.index = index; - + /** * @property {number} x - X position within the image to cut from. */ @@ -29039,7 +29192,7 @@ Phaser.FrameData.prototype = { } return true; - + }, /** @@ -29052,7 +29205,7 @@ Phaser.FrameData.prototype = { * @return {Array} An array of Frames between the start and end index values, or an empty array if none were found. */ getFrameRange: function (start, end, output) { - + if (typeof output === "undefined") { output = []; } for (var i = start; i <= end; i++) @@ -29227,7 +29380,7 @@ Phaser.AnimationParser = { var row = Math.floor((width - margin) / (frameWidth + spacing)); var column = Math.floor((height - margin) / (frameHeight + spacing)); var total = row * column; - + if (frameMax !== -1) { total = frameMax; @@ -29292,11 +29445,11 @@ Phaser.AnimationParser = { // Let's create some frames then var data = new Phaser.FrameData(); - + // By this stage frames is a fully parsed array var frames = json['frames']; var newFrame; - + for (var i = 0; i < frames.length; i++) { var uuid = game.rnd.uuid(); @@ -29357,7 +29510,7 @@ Phaser.AnimationParser = { console.log(json); return; } - + // Let's create some frames then var data = new Phaser.FrameData(); @@ -29365,7 +29518,7 @@ Phaser.AnimationParser = { var frames = json['frames']; var newFrame; var i = 0; - + for (var key in frames) { var uuid = game.rnd.uuid(); @@ -29443,7 +29596,7 @@ Phaser.AnimationParser = { var frameY; var frameWidth; var frameHeight; - + for (var i = 0; i < frames.length; i++) { uuid = game.rnd.uuid(); @@ -29864,7 +30017,7 @@ Phaser.Cache.prototype = { * Add a new text data. * * @method Phaser.Cache#addText - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -29878,7 +30031,7 @@ Phaser.Cache.prototype = { * Add a new json object into the cache. * * @method Phaser.Cache#addJSON - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -29978,7 +30131,7 @@ Phaser.Cache.prototype = { * @param {string} key - Asset key for the sound. */ updateSound: function (key, property, value) { - + if (this._sounds[key]) { this._sounds[key][property] = value; @@ -30094,7 +30247,7 @@ Phaser.Cache.prototype = { console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "' + key + ' / ' + object + '"'); } } - + return null; }, @@ -30383,7 +30536,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getText: Invalid key: "' + key + '"'); } - + }, /** @@ -30403,7 +30556,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"'); } - + }, /** @@ -30423,7 +30576,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getBinary: Invalid key: "' + key + '"'); } - + }, /** @@ -30674,6 +30827,7 @@ Phaser.Cache.prototype = { Phaser.Cache.prototype.constructor = Phaser.Cache; +/* jshint wsh:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -30773,17 +30927,17 @@ Phaser.Loader = function (game) { * @property {Phaser.Signal} onFileComplete - Event signal. */ this.onFileComplete = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onFileError - Event signal. */ this.onFileError = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadStart - Event signal. */ this.onLoadStart = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadComplete - Event signal. */ @@ -30871,7 +31025,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -30896,7 +31050,7 @@ Phaser.Loader.prototype = { } return -1; - + }, /** @@ -30921,7 +31075,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -31839,11 +31993,11 @@ Phaser.Loader.prototype = { if (file.autoDecode) { - this.game.cache.updateSound(key, 'isDecoding', true); - var that = this; var key = file.key; + this.game.cache.updateSound(key, 'isDecoding', true); + this.game.sound.context.decodeAudioData(file.data, function (buffer) { if (buffer) { @@ -32078,7 +32232,7 @@ Phaser.Loader.prototype = { { this.hasLoaded = true; this.isLoading = false; - + this.removeAll(); this.onLoadComplete.dispatch(); @@ -32236,7 +32390,7 @@ Phaser.LoaderParser = { * @param {boolean} [loop=false] - Whether or not the sound will loop. */ Phaser.Sound = function (game, key, volume, loop, connect) { - + if (typeof volume == 'undefined') { volume = 1; } if (typeof loop == 'undefined') { loop = false; } if (typeof connect === 'undefined') { connect = game.sound.connectToMaster; } @@ -32272,7 +32426,7 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {object} markers - The sound markers. */ this.markers = {}; - + /** * @property {AudioContext} context - Reference to the AudioContext instance. */ @@ -32300,34 +32454,34 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {number} totalDuration - The total duration of the sound, in milliseconds */ this.totalDuration = 0; - + /** * @property {number} startTime - The time the Sound starts at (typically 0 unless starting from a marker) * @default */ this.startTime = 0; - + /** * @property {number} currentTime - The current time the sound is at. */ this.currentTime = 0; - + /** * @property {number} duration - The duration of the sound. */ this.duration = 0; - + /** * @property {number} stopTime - The time the sound stopped. */ this.stopTime = 0; - + /** * @property {boolean} paused - true if the sound is paused, otherwise false. * @default */ this.paused = false; - + /** * @property {number} pausedPosition - The position the sound had reached when it was paused. */ @@ -32343,31 +32497,31 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @default */ this.isPlaying = false; - + /** * @property {string} currentMarker - The string ID of the currently playing marker, if any. * @default */ this.currentMarker = ''; - + /** * @property {boolean} pendingPlayback - true if the sound file is pending playback * @readonly */ this.pendingPlayback = false; - + /** * @property {boolean} override - if true when you play this sound it will always start from the beginning. * @default */ this.override = false; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = this.game.sound.usingWebAudio; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. */ @@ -32421,37 +32575,37 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {Phaser.Signal} onDecoded - The onDecoded event is dispatched when the sound has finished decoding (typically for mp3 files) */ this.onDecoded = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPlay - The onPlay event is dispatched each time this sound is played. */ this.onPlay = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPause - The onPause event is dispatched when this sound is paused. */ this.onPause = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onResume - The onResume event is dispatched when this sound is resumed from a paused state. */ this.onResume = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoop - The onLoop event is dispatched when this sound loops during playback. */ this.onLoop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onStop - The onStop event is dispatched when this sound stops playback. */ this.onStop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMute - The onMouse event is dispatched when this sound is muted. */ this.onMute = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMarkerComplete - The onMarkerComplete event is dispatched when a marker within this sound completes playback. */ @@ -32712,7 +32866,7 @@ Phaser.Sound.prototype = { this._sound = this.context.createBufferSource(); this._sound.buffer = this._buffer; - + if (this.externalNode) { this._sound.connect(this.externalNode.input); @@ -32792,7 +32946,7 @@ Phaser.Sound.prototype = { // console.log('playing', this._sound); this._sound.currentTime = this.position; this._sound.muted = this._muted; - + if (this._muted) { this._sound.volume = 0; @@ -32933,7 +33087,7 @@ Phaser.Sound.prototype = { this.isPlaying = false; var prevMarker = this.currentMarker; - + if (this.currentMarker !== '') { this.onMarkerComplete.dispatch(this.currentMarker, this); @@ -32979,11 +33133,11 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoded", { * @property {boolean} mute - Gets or sets the muted state of this sound. */ Object.defineProperty(Phaser.Sound.prototype, "mute", { - + get: function () { return this._muted; }, - + set: function (value) { value = value || null; @@ -33076,12 +33230,12 @@ Phaser.SoundManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {Phaser.Signal} onSoundDecode - The event dispatched when a sound decodes (typically only for mp3 files) */ this.onSoundDecode = new Phaser.Signal(); - + /** * @property {boolean} _codeMuted - Internal mute tracking var. * @private @@ -33095,7 +33249,7 @@ Phaser.SoundManager = function (game) { * @default */ this._muted = false; - + /** * @property {Description} _unlockSource - Internal unlock tracking var. * @private @@ -33106,12 +33260,12 @@ Phaser.SoundManager = function (game) { /** * @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume). * @private - * @default + * @default */ this._volume = 1; /** - * @property {array} _sounds - An array containing all the sounds + * @property {array} _sounds - An array containing all the sounds * @private * @default The empty array. */ @@ -33122,19 +33276,19 @@ Phaser.SoundManager = function (game) { * @default */ this.context = null; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = true; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. * @readonly */ this.usingAudioTag = false; - + /** * @property {boolean} noAudio - Has audio been disabled via the PhaserGlobal object? Useful if you need to use a 3rd party audio library instead. * @default @@ -33158,7 +33312,7 @@ Phaser.SoundManager = function (game) { * @default */ this.channels = 32; - + }; Phaser.SoundManager.prototype = { @@ -33324,7 +33478,7 @@ Phaser.SoundManager.prototype = { this._sounds[i].resume(); } } - + }, /** @@ -33539,7 +33693,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { * @property {number} volume - Gets or sets the global volume of the SoundManager, a value between 0 and 1. */ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { - + get: function () { if (this.usingWebAudio) @@ -33572,7 +33726,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { } } } - + } }); @@ -33599,7 +33753,7 @@ Phaser.Utils.Debug = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {PIXI.Sprite} sprite - If debugging in WebGL mode we need this. */ @@ -33614,7 +33768,7 @@ Phaser.Utils.Debug = function (game) { * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = null; - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ @@ -33635,7 +33789,7 @@ Phaser.Utils.Debug = function (game) { * @default '14px Courier' */ this.font = '14px Courier'; - + /** * @property {number} columnWidth - The spacing between columns. */ @@ -33645,24 +33799,24 @@ Phaser.Utils.Debug = function (game) { * @property {number} lineHeight - The line height between the debug text. */ this.lineHeight = 16; - + /** * @property {boolean} renderShadow - Should the text be rendered with a slight shadow? Makes it easier to read on different types of background. */ this.renderShadow = true; - + /** * @property {Context} currentX - The current X position the debug information will be rendered at. * @default */ this.currentX = 0; - + /** * @property {number} currentY - The current Y position the debug information will be rendered at. * @default */ this.currentY = 0; - + /** * @property {number} currentAlpha - The current alpha the debug information will be rendered at. * @default @@ -33849,7 +34003,7 @@ Phaser.Utils.Debug.prototype = { this.line('Bounds x: ' + camera.bounds.x + ' Y: ' + camera.bounds.y + ' w: ' + camera.bounds.width + ' h: ' + camera.bounds.height); this.line('View x: ' + camera.view.x + ' Y: ' + camera.view.y + ' w: ' + camera.view.width + ' h: ' + camera.view.height); this.stop(); - + }, /** @@ -34142,7 +34296,7 @@ Phaser.Utils.Debug.prototype = { } this.stop(); - + }, /** @@ -34351,7 +34505,7 @@ Phaser.Color = { var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h; - if (hex16.length==3) + if (hex16.length == 3) { hex16 = hex16.charAt(0) + hex16.charAt(0) + hex16.charAt(1) + hex16.charAt(1) + hex16.charAt(2) + hex16.charAt(2); } @@ -34361,7 +34515,7 @@ Phaser.Color = { var blue = parseInt(hex16.substring(4, 6), 16); return red << 16 | green << 8 | blue; - + }, /** @@ -34377,13 +34531,13 @@ Phaser.Color = { var argb = Phaser.Color.getRGB(color); var hsl = Phaser.Color.RGBtoHSV(color); - + // Hex format var result = Phaser.Color.RGBtoHexstring(color) + "\n"; - + // RGB format result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n"; - + // HSL info result = result.concat("Hue: " + hsl.hue + " Saturation: " + hsl.saturation + " Lightnes: " + hsl.lightness); @@ -34584,7 +34738,7 @@ Phaser.Color = { var blue = color & 0xFF; return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',' + alpha.toString() + ')'; - + }, /** @@ -34646,7 +34800,7 @@ Phaser.Color = { getBlue: function (color) { return color & 0xFF; } - + }; /** @@ -34797,11 +34951,11 @@ Phaser.Physics.prototype = { } else if (system === Phaser.Physics.BOX2D && this.box2d === null) { - // Coming soon + throw new Error('The Box2D physics system has not been implemented yet.'); } else if (system === Phaser.Physics.CHIPMUNK && this.chipmunk === null) { - // Coming soon + throw new Error('The Chipmunk physics system has not been implemented yet.'); } }, @@ -34955,7 +35109,7 @@ Phaser.Physics.prototype.constructor = Phaser.Physics; * @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Arcade = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -35282,7 +35436,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if an overlap occured otherwise false. + * @return {boolean} True if an overlap occured otherwise false. */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -35323,7 +35477,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if a collision occured otherwise false. + * @return {boolean} True if a collision occured otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -35593,10 +35747,10 @@ Phaser.Physics.Arcade.prototype = { collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) { this._mapData = tilemapLayer.getTiles( - sprite.body.position.x - sprite.body.tilePadding.x, - sprite.body.position.y - sprite.body.tilePadding.y, - sprite.body.width + sprite.body.tilePadding.x, - sprite.body.height + sprite.body.tilePadding.y, + sprite.body.position.x - sprite.body.tilePadding.x, + sprite.body.position.y - sprite.body.tilePadding.y, + sprite.body.width + sprite.body.tilePadding.x, + sprite.body.height + sprite.body.tilePadding.y, false, false); if (this._mapData.length === 0) @@ -35638,8 +35792,8 @@ Phaser.Physics.Arcade.prototype = { /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * - * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @private + * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @param {Phaser.Group} group - The Group to check. * @param {Phaser.TilemapLayer} tilemapLayer - The layer to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. @@ -35667,13 +35821,14 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies. * + * @private * @method Phaser.Physics.Arcade#separate * @param {Phaser.Physics.Arcade.Body} body1 - The first Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body object to separate. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. * @param {object} [callbackContext] - The context in which to run the process callback. * @param {boolean} overlapOnly - Just run an overlap or a full collision. - * @returns {boolean} Returns true if the bodies collided, otherwise false. + * @return {boolean} Returns true if the bodies collided, otherwise false. */ separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { @@ -35745,11 +35900,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the x axis. + * + * @private * @method Phaser.Physics.Arcade#separateX * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateX: function (body1, body2, overlapOnly) { @@ -35858,11 +36015,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the y axis. + * + * @private * @method Phaser.Physics.Arcade#separateY * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateY: function (body1, body2, overlapOnly) { @@ -35984,10 +36143,12 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate a physics body and a tile. + * + * @private * @method Phaser.Physics.Arcade#separateTile * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to collide against. - * @returns {boolean} Returns true if the body was separated, otherwise false. + * @return {boolean} Returns true if the body was separated, otherwise false. */ separateTile: function (i, body, tile) { @@ -36056,7 +36217,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceTop || tile.faceBottom) { oy = this.tileCheckY(body, tile); @@ -36074,7 +36235,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceLeft || tile.faceRight) { ox = this.tileCheckX(body, tile); @@ -36088,11 +36249,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the X axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckX: function (body, tile) { @@ -36137,11 +36298,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the Y axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckY: function (body, tile) { @@ -36185,11 +36346,12 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} x - The x separation amount. - * @returns {boolean} Returns true as a pass-thru to the separateTile method. + * @return {boolean} Returns true as a pass-thru to the separateTile method. */ processTileSeparationX: function (body, x) { @@ -36217,12 +36379,13 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} y - The y separation amount. */ - processTileSeparationY: function (body, y, tile) { + processTileSeparationY: function (body, y) { if (y < 0) { @@ -36253,7 +36416,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -36267,13 +36430,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -36287,7 +36450,7 @@ Phaser.Physics.Arcade.prototype = { * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#moveToPointer * @param {any} displayObject - The display object to move. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) @@ -36308,7 +36471,7 @@ Phaser.Physics.Arcade.prototype = { // We know how many pixels we need to move, but how fast? speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -36323,7 +36486,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to move towards. @@ -36338,13 +36501,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(y - displayObject.y, x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -36355,7 +36518,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromAngle * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -36374,7 +36537,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -36393,7 +36556,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. * One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#accelerationFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -36414,7 +36577,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -36443,7 +36606,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToPointer * @param {any} displayObject - The display object to move. * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. @@ -36460,7 +36623,7 @@ Phaser.Physics.Arcade.prototype = { if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; } this._angle = this.angleToPointer(displayObject, pointer); - + displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); @@ -36473,7 +36636,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to accelerate towards. @@ -36500,7 +36663,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the distance between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#distanceBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -36510,7 +36673,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = source.x - target.x; this._dy = source.y - target.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -36519,7 +36682,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and the given x/y coordinates. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to move towards. @@ -36530,7 +36693,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - x; this._dy = displayObject.y - y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -36539,7 +36702,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -36551,14 +36714,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - pointer.x; this._dy = displayObject.y - pointer.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, /** * Find the angle in radians between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#angleBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -36575,7 +36738,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate. - * + * * @method Phaser.Physics.Arcade#angleToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to get the angle to. @@ -36586,14 +36749,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = x - displayObject.x; this._dy = y - displayObject.y; - + return Math.atan2(this._dy, this._dx); }, - + /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account. - * + * * @method Phaser.Physics.Arcade#angleToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -36605,7 +36768,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = pointer.worldX - displayObject.x; this._dy = pointer.worldY - displayObject.y; - + return Math.atan2(this._dy, this._dx); } @@ -36805,12 +36968,6 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.speed = 0; - /** - * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to any QuadTrees. - * @default - this.skipQuadTree = false; - */ - /** * @property {number} facing - A const reference to the direction the Body is traveling or facing. * @default @@ -36906,6 +37063,17 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.tilePadding = new Phaser.Point(); + /** + * @property {number} phaser - Is this Body in a preUpdate or postUpdate state? + */ + this.phase = 0; + + /** + * @property {boolean} _reset - Internal cache var. + * @private + */ + this._reset = true; + /** * @property {number} _sx - Internal cache var. * @private @@ -36955,11 +37123,9 @@ Phaser.Physics.Arcade.Body.prototype = { this._sy = asy; this.center.setTo(this.position.x + this.halfWidth, this.position.y + this.halfHeight); - return true; + this._reset = true; } - return false; - }, /** @@ -36970,6 +37136,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ preUpdate: function () { + this.phase = 1; + // Store and reset collision flags this.wasTouching.none = this.touching.none; this.wasTouching.up = this.touching.up; @@ -36990,13 +37158,15 @@ Phaser.Physics.Arcade.Body.prototype = { this.embedded = false; + this.updateBounds(); + this.position.x = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x; this.position.y = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y; this.rotation = this.sprite.angle; this.preRotation = this.rotation; - if (this.updateBounds() || this.sprite._cache[4] === 1) + if (this._reset || this.sprite._cache[4] === 1) { this.prev.x = this.position.x; this.prev.y = this.position.y; @@ -37026,6 +37196,11 @@ Phaser.Physics.Arcade.Body.prototype = { } } + this._dx = this.deltaX(); + this._dy = this.deltaY(); + + this._reset = false; + }, /** @@ -37036,6 +37211,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ postUpdate: function () { + this.phase = 2; + if (this.deltaX() < 0) { this.facing = Phaser.LEFT; @@ -37073,7 +37250,7 @@ Phaser.Physics.Arcade.Body.prototype = { if (this.deltaMax.y !== 0 && this._dy !== 0) { - if (this._dy < 0 && this._dx < -this.deltaMax.y) + if (this._dy < 0 && this._dy < -this.deltaMax.y) { this._dy = -this.deltaMax.y; } @@ -37283,7 +37460,7 @@ Phaser.Physics.Arcade.Body.prototype = { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { - + get: function () { return this.position.y + this.height; } @@ -37296,7 +37473,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { - + get: function () { return this.position.x + this.width; } @@ -37308,12 +37485,13 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { - + get: function () { return this.position.x; }, set: function (value) { + this.position.x = value; } @@ -37324,13 +37502,15 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", { - + get: function () { return this.position.y; }, set: function (value) { + this.position.y = value; + } }); @@ -37361,7 +37541,7 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { context.strokeRect(body.position.x - body.game.camera.x, body.position.y - body.game.camera.y, body.width, body.height); } -} +}; /** * Render Sprite Body Physics Data as text. @@ -37375,14 +37555,13 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { Phaser.Physics.Arcade.Body.renderBodyInfo = function (debug, body) { debug.line('x: ' + body.x.toFixed(2), 'y: ' + body.y.toFixed(2), 'width: ' + body.width, 'height: ' + body.height); - // debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body.deltaX().toFixed(2), 'deltaY: ' + body.deltaY().toFixed(2)); - debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'new velocity x: ' + body.newVelocity.x.toFixed(2), 'y: ' + body.newVelocity.y.toFixed(2)); + debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body._dx.toFixed(2), 'deltaY: ' + body._dy.toFixed(2)); debug.line('acceleration x: ' + body.acceleration.x.toFixed(2), 'y: ' + body.acceleration.y.toFixed(2), 'speed: ' + body.speed.toFixed(2), 'angle: ' + body.angle.toFixed(2)); debug.line('gravity x: ' + body.gravity.x, 'y: ' + body.gravity.y, 'bounce x: ' + body.bounce.x.toFixed(2), 'y: ' + body.bounce.y.toFixed(2)); debug.line('touching left: ' + body.touching.left, 'right: ' + body.touching.right, 'up: ' + body.touching.up, 'down: ' + body.touching.down); debug.line('blocked left: ' + body.blocked.left, 'right: ' + body.blocked.right, 'up: ' + body.blocked.up, 'down: ' + body.blocked.down); -} +}; Phaser.Physics.Arcade.Body.prototype.constructor = Phaser.Physics.Arcade.Body; @@ -37413,7 +37592,7 @@ Phaser.Particles = function (game) { this.emitters = {}; /** - * @property {number} ID - + * @property {number} ID - * @default */ this.ID = 0; @@ -37468,7 +37647,8 @@ Phaser.Particles.prototype = { Phaser.Particles.prototype.constructor = Phaser.Particles; -Phaser.Particles.Arcade = {} +Phaser.Particles.Arcade = {}; + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -37660,7 +37840,7 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) { * @property {boolean} emitX */ this.emitX = x; - + /** * The point the particles are emitted from. * Emitter.x and Emitter.y control the containers location, which updates all current particles @@ -37700,7 +37880,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { if (this.game.time.now >= this._timer) { this.emitParticle(); - + this._counter++; if (this._quantity > 0) @@ -37716,7 +37896,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { } } -} +}; /** * This function generates a new array of particle sprites to attach to the emitter. @@ -37783,7 +37963,7 @@ Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames return this; -} +}; /** * Call this function to turn off all the particles and the emitter. @@ -37795,7 +37975,7 @@ Phaser.Particles.Arcade.Emitter.prototype.kill = function () { this.alive = false; this.exists = false; -} +}; /** * Handy for bringing game objects "back to life". Just sets alive and exists back to true. @@ -37806,7 +37986,7 @@ Phaser.Particles.Arcade.Emitter.prototype.revive = function () { this.alive = true; this.exists = true; -} +}; /** * Call this function to start emitting particles. @@ -37844,7 +38024,7 @@ Phaser.Particles.Arcade.Emitter.prototype.start = function (explode, lifespan, f this._counter = 0; this._timer = this.game.time.now + frequency; -} +}; /** * This function can be used both internally and externally to emit the next particle. @@ -37921,7 +38101,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () { particle.body.drag.y = this.particleDrag.y; particle.body.angularDrag = this.angularDrag; -} +}; /** * A more compact way of setting the width and height of the emitter. @@ -37934,7 +38114,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setSize = function (width, height) { this.width = width; this.height = height; -} +}; /** * A more compact way of setting the X velocity range of the emitter. @@ -37950,7 +38130,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setXSpeed = function (min, max) { this.minParticleSpeed.x = min; this.maxParticleSpeed.x = max; -} +}; /** * A more compact way of setting the Y velocity range of the emitter. @@ -37966,7 +38146,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setYSpeed = function (min, max) { this.minParticleSpeed.y = min; this.maxParticleSpeed.y = max; -} +}; /** * A more compact way of setting the angular velocity constraints of the emitter. @@ -37982,7 +38162,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setRotation = function (min, max) { this.minRotation = min; this.maxRotation = max; -} +}; /** * Change the emitters center to match the center of any object with a `center` property, such as a Sprite. @@ -37997,7 +38177,7 @@ Phaser.Particles.Arcade.Emitter.prototype.at = function (object) { this.emitY = object.center.y; } -} +}; /** * @name Phaser.Particles.Arcade.Emitter#x @@ -38037,7 +38217,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { - + get: function () { return Math.floor(this.x - (this.width / 2)); } @@ -38050,7 +38230,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { - + get: function () { return Math.floor(this.x + (this.width / 2)); } @@ -38063,7 +38243,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { - + get: function () { return Math.floor(this.y - (this.height / 2)); } @@ -38076,7 +38256,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { - + get: function () { return Math.floor(this.y + (this.height / 2)); } @@ -38113,12 +38293,12 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} index - The index of this tile within the map data corresponding to the tileset. */ this.index = index; - + /** * @property {number} x - The x map coordinate of this tile. */ this.x = x; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -38128,7 +38308,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} x - The x map coordinate of this tile. */ this.worldX = x * width; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -38138,7 +38318,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.width = width; - + /** * @property {number} height - The height of the tile in pixels. */ @@ -38148,7 +38328,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.centerX = Math.abs(width / 2); - + /** * @property {number} height - The height of the tile in pixels. */ @@ -38281,7 +38461,7 @@ Phaser.Tile.prototype = { /** * Set a callback to be called when this tile is hit by an object. * The callback must true true for collision processing to take place. - * + * * @method Phaser.Tile#setCollisionCallback * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. @@ -38303,7 +38483,7 @@ Phaser.Tile.prototype = { this.collisionCallback = null; this.collisionCallbackContext = null; this.properties = null; - + }, /** @@ -38405,7 +38585,7 @@ Phaser.Tile.prototype.constructor = Phaser.Tile; * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "collides", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } @@ -38418,7 +38598,7 @@ Object.defineProperty(Phaser.Tile.prototype, "collides", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); } @@ -38431,7 +38611,7 @@ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "left", { - + get: function () { return this.worldX; } @@ -38444,7 +38624,7 @@ Object.defineProperty(Phaser.Tile.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "right", { - + get: function () { return this.worldX + this.width; } @@ -38457,7 +38637,7 @@ Object.defineProperty(Phaser.Tile.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "top", { - + get: function () { return this.worldY; } @@ -38470,7 +38650,7 @@ Object.defineProperty(Phaser.Tile.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "bottom", { - + get: function () { return this.worldY + this.height; } @@ -38656,7 +38836,7 @@ Phaser.Tilemap.prototype = { * @param {Phaser.Group} [group] - Optional Group to add the layer to. If not specified it will be added to the World group. * @return {Phaser.TilemapLayer} The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly. */ - create: function (name, width, height, tileWidth, tileHeight) { + create: function (name, width, height, tileWidth, tileHeight, group) { if (typeof group === 'undefined') { group = this.game.world; } @@ -39237,7 +39417,7 @@ Phaser.Tilemap.prototype = { } } - for (var y = 0; y < this.layers[layer].height ; y++) + for (var y = 0; y < this.layers[layer].height; y++) { for (var x = 0; x < this.layers[layer].width; x++) { @@ -39536,7 +39716,7 @@ Phaser.Tilemap.prototype = { this.layers[layer].dirty = true; this.calculateFaces(layer); - + return this.layers[layer].data[y][x]; } @@ -39659,7 +39839,7 @@ Phaser.Tilemap.prototype = { this._results.length = 0; - this._results.push( { x: x, y: y, width: width, height: height, layer: layer }); + this._results.push({ x: x, y: y, width: width, height: height, layer: layer }); for (var ty = y; ty < y + height; ty++) { @@ -39686,7 +39866,7 @@ Phaser.Tilemap.prototype = { if (typeof x === "undefined") { x = 0; } if (typeof y === "undefined") { y = 0; } - + layer = this.getLayer(layer); if (!tileblock || tileblock.length < 2) @@ -40061,17 +40241,17 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. */ this.context = this.canvas.getContext('2d'); - + /** * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - Dimensions of the renderable area. */ @@ -40173,7 +40353,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {object} _mc - Local map data and calculation cache. - * @private + * @private */ this._mc = { @@ -40202,7 +40382,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {array} _results - Local render loop var to help avoid gc spikes. - * @private + * @private */ this._results = []; @@ -40223,8 +40403,8 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // console.log('layer pu'); - Phaser.Image.prototype.postUpdate.call(this); - + Phaser.Image.prototype.postUpdate.call(this); + // Stops you being able to auto-scroll the camera if it's not following a sprite this.scrollX = this.game.camera.x * this.scrollFactorX; this.scrollY = this.game.camera.y * this.scrollFactorY; @@ -40244,7 +40424,7 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // this.children[i].postUpdate(); // } -} +}; /** * Sets the world size to match the size of this layer. @@ -40256,10 +40436,10 @@ Phaser.TilemapLayer.prototype.resizeWorld = function () { this.game.world.setBounds(0, 0, this.layer.widthInPixels, this.layer.heightInPixels); -} +}; /** -* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it +* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixX * @memberof Phaser.TilemapLayer @@ -40281,10 +40461,10 @@ Phaser.TilemapLayer.prototype._fixX = function(x) { return this._mc.x + (x - (this._mc.x / this.scrollFactorX)); -} +}; /** -* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it +* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixX * @memberof Phaser.TilemapLayer @@ -40301,10 +40481,10 @@ Phaser.TilemapLayer.prototype._unfixX = function(x) { return (this._mc.x / this.scrollFactorX) + (x - this._mc.x); -} +}; /** -* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it +* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixY * @memberof Phaser.TilemapLayer @@ -40326,10 +40506,10 @@ Phaser.TilemapLayer.prototype._fixY = function(y) { return this._mc.y + (y - (this._mc.y / this.scrollFactorY)); -} +}; /** -* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it +* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixY * @memberof Phaser.TilemapLayer @@ -40346,7 +40526,7 @@ Phaser.TilemapLayer.prototype._unfixY = function(y) { return (this._mc.y / this.scrollFactorY) + (y - this._mc.y); -} +}; /** * Convert a pixel value to a tile coordinate. @@ -40361,7 +40541,7 @@ Phaser.TilemapLayer.prototype.getTileX = function (x) { return this.game.math.snapToFloor(this._fixX(x), this.map.tileWidth) / this.map.tileWidth; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -40376,7 +40556,7 @@ Phaser.TilemapLayer.prototype.getTileY = function (y) { return this.game.math.snapToFloor(this._fixY(y), this.map.tileHeight) / this.map.tileHeight; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -40394,7 +40574,7 @@ Phaser.TilemapLayer.prototype.getTileXY = function (x, y, point) { return point; -} +}; /** * Gets all tiles that intersect with the given line. @@ -40440,7 +40620,7 @@ Phaser.TilemapLayer.prototype.getRayCastTiles = function (line, stepRate, collid return results; -} +}; /** * Get all tiles that exist within the given area, defined by the top-left corner, width and height. Values given are in pixels, not tiles. @@ -40499,7 +40679,7 @@ Phaser.TilemapLayer.prototype.getTiles = function (x, y, width, height, collides return this._results; -} +}; /** * Internal function to update maximum values. @@ -40526,7 +40706,7 @@ Phaser.TilemapLayer.prototype.updateMax = function () { this.dirty = true; -} +}; /** * Renders the tiles to the layer canvas and pushes to the display. @@ -40609,7 +40789,7 @@ Phaser.TilemapLayer.prototype.render = function () { if (this.game.renderType === Phaser.WEBGL) { - // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); + // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl); } @@ -40618,7 +40798,7 @@ Phaser.TilemapLayer.prototype.render = function () { return true; -} +}; /** * Renders a collision debug overlay on-top of the canvas. Called automatically by render when debug = true. @@ -40688,14 +40868,14 @@ Phaser.TilemapLayer.prototype.renderDebug = function () { } -} +}; /** * @name Phaser.TilemapLayer#scrollX * @property {number} scrollX - Scrolls the map horizontally or returns the current x position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { - + get: function () { return this._mc.x; }, @@ -40705,7 +40885,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { if (value !== this._mc.x && value >= 0 && this.layer.widthInPixels > this.width) { this._mc.x = value; - + if (this._mc.x > (this.layer.widthInPixels - this.width)) { this._mc.x = this.layer.widthInPixels - this.width; @@ -40735,7 +40915,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { * @property {number} scrollY - Scrolls the map vertically or returns the current y position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { - + get: function () { return this._mc.y; }, @@ -40775,7 +40955,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { * @property {number} collisionWidth - The width of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { - + get: function () { return this._mc.cw; }, @@ -40795,7 +40975,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { * @property {number} collisionHeight - The height of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", { - + get: function () { return this._mc.ch; }, @@ -41180,7 +41360,7 @@ Phaser.TilemapParser = { properties: json.layers[i].objects[v].properties }; - + objects[json.layers[i].name].push(object); } else if (json.layers[i].objects[v].polyline) @@ -41221,7 +41401,7 @@ Phaser.TilemapParser = { for (var i = 0; i < map.tilesets.length; i++) { var set = map.tilesets[i]; - + var x = set.tileMargin; var y = set.tileMargin; @@ -41266,7 +41446,7 @@ Phaser.TilemapParser = { } -} +}; /** * @author Richard Davey @@ -41462,4 +41642,4 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset; } else { root.Phaser = Phaser; } -}).call(this); \ No newline at end of file +}).call(this); diff --git a/build/custom/phaser-no-libs.min.js b/build/custom/phaser-no-libs.min.js index 0d225cb602..40427b5879 100644 --- a/build/custom/phaser-no-libs.min.js +++ b/build/custom/phaser-no-libs.min.js @@ -1,12 +1,12 @@ /* Phaser (no libs) v2.0.2 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */ -(function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f;a=Array(g+1).join(c)+a+Array(f+1).join(c);break;default:a+=Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!hasOwn.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context -},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a}}),b.Plugin=function(a,b){"undefined"==typeof b&&(b=null),this.game=a,this.parent=b,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},b.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},b.Plugin.prototype.constructor=b.Plugin,b.PluginManager=function(a,b){this.game=a,this._parent=b,this.plugins=[],this._pluginsLength=0},b.PluginManager.prototype={add:function(a){var b=!1;return"function"==typeof a?a=new a(this.game,this._parent):(a.game=this.game,a.parent=this._parent),"function"==typeof a.preUpdate&&(a.hasPreUpdate=!0,b=!0),"function"==typeof a.update&&(a.hasUpdate=!0,b=!0),"function"==typeof a.postUpdate&&(a.hasPostUpdate=!0,b=!0),"function"==typeof a.render&&(a.hasRender=!0,b=!0),"function"==typeof a.postRender&&(a.hasPostRender=!0,b=!0),b?((a.hasPreUpdate||a.hasUpdate||a.hasPostUpdate)&&(a.active=!0),(a.hasRender||a.hasPostRender)&&(a.visible=!0),this._pluginsLength=this.plugins.push(a),"function"==typeof a.init&&a.init(),a):null},remove:function(a){if(0!==this._pluginsLength)for(this._p=0;this._pb;b++)this.children[b].preUpdate()},b.Stage.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Stage.prototype.postUpdate=function(){if(this.game.world.camera.target){this.game.world.camera.target.postUpdate(),this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a]!==this.game.world.camera.target&&this.children[a].postUpdate()}else{this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a].postUpdate()}this.checkOffsetInterval!==!1&&this.game.time.now>this._nextOffsetCheck&&(b.Canvas.getOffset(this.game.canvas,this.offset),this._nextOffsetCheck=this.game.time.now+this.checkOffsetInterval)},b.Stage.prototype.parseConfig=function(a){this.game.canvas=a.canvasID?b.Canvas.create(this.game.width,this.game.height,a.canvasID):b.Canvas.create(this.game.width,this.game.height),a.canvasStyle?this.game.canvas.stlye=a.canvasStyle:this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",a.checkOffsetInterval&&(this.checkOffsetInterval=a.checkOffsetInterval),a.disableVisibilityChange&&(this.disableVisibilityChange=a.disableVisibilityChange),a.fullScreenScaleMode&&(this.fullScreenScaleMode=a.fullScreenScaleMode),a.scaleMode&&(this.scaleMode=a.scaleMode),a.backgroundColor&&(this.backgroundColor=a.backgroundColor)},b.Stage.prototype.boot=function(){b.Canvas.getOffset(this.game.canvas,this.offset),this.bounds=new b.Rectangle(this.offset.x,this.offset.y,this.game.width,this.game.height);var a=this;this._onChange=function(b){return a.visibilityChange(b)},b.Canvas.setUserSelect(this.game.canvas,"none"),b.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},b.Stage.prototype.checkVisibility=function(){this._hiddenVar=void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.hidden?"visibilitychange":null,this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.onblur=this._onChange,window.onfocus=this._onChange},b.Stage.prototype.visibilityChange=function(a){return this.disableVisibilityChange?void 0:"pagehide"===a.type||"blur"===a.type||"pageshow"===a.type||"focus"===a.type?void("pagehide"===a.type||"blur"===a.type?this.game.focusLoss(a):("pageshow"===a.type||"focus"===a.type)&&this.game.focusGain(a)):void(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden?this.game.gamePaused(a):this.game.gameResumed(a))},b.Stage.prototype.setBackgroundColor=function(a){this._backgroundColor=a||0,this.backgroundColorSplit=PIXI.hex2rgb(this.backgroundColor);var b=this._backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},Object.defineProperty(b.Stage.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this.game.transparent===!1&&("string"==typeof a&&(a=b.Color.hexToRGB(a)),this.setBackgroundColor(a))}}),Object.defineProperty(b.Stage.prototype,"smoothed",{get:function(){return!PIXI.scaleModes.LINEAR},set:function(a){PIXI.scaleModes.LINEAR=a?0:1}}),b.Group=function(a,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=b.Physics.ARCADE),this.game=a,"undefined"==typeof c&&(c=a.world),this.name=d||"group",PIXI.DisplayObjectContainer.call(this),e?this.game.stage.addChild(this):c&&c.addChild(this),this.z=0,this.type=b.GROUP,this.alive=!0,this.exists=!0,this.scale=new b.Point(1,1),this.cursor=null,this.cameraOffset=new b.Point,this.enableBody=f,this.enableBodyDebug=!1,this.physicsBodyType=g,this._sortProperty="z",this._cache=[0,0,0,0,1,0,1,0,0,0]},b.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),b.Group.prototype.constructor=b.Group,b.Group.RETURN_NONE=0,b.Group.RETURN_TOTAL=1,b.Group.RETURN_CHILD=2,b.Group.SORT_ASCENDING=-1,b.Group.SORT_DESCENDING=1,b.Group.prototype.add=function(a){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChild(a),a.z=this.children.length,a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.addAt=function(a,b){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChildAt(a,b),this.updateZ(),a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.getAt=function(a){return 0>a||a>=this.children.length?-1:this.getChildAt(a)},b.Group.prototype.create=function(a,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new b.Sprite(this.game,a,c,d,e);return this.enableBody&&this.game.physics.enable(g,this.physicsBodyType),g.exists=f,g.visible=f,g.alive=f,this.addChild(g),g.z=this.children.length,g.events&&g.events.onAddedToGroup.dispatch(g,this),null===this.cursor&&(this.cursor=g),g},b.Group.prototype.createMultiple=function(a,b,c,d){"undefined"==typeof d&&(d=!1);for(var e=0;a>e;e++)this.create(0,0,b,c,d)},b.Group.prototype.updateZ=function(){for(var a=this.children.length;a--;)this.children[a].z=a},b.Group.prototype.next=function(){this.cursor&&(this._cache[8]===this.children.length?this._cache[8]=0:this._cache[8]++,this.cursor=this.children[this._cache[8]])},b.Group.prototype.previous=function(){this.cursor&&(0===this._cache[8]?this._cache[8]=this.children.length-1:this._cache[8]--,this.cursor=this.children[this._cache[8]])},b.Group.prototype.swap=function(a,b){var c=this.swapChildren(a,b);return c&&this.updateZ(),c},b.Group.prototype.bringToTop=function(a){return a.parent===this&&this.getIndex(a)0&&(this.remove(a),this.addAt(a,0)),a},b.Group.prototype.moveUp=function(a){if(a.parent===this&&this.getIndex(a)0){var b=this.getIndex(a),c=this.getAt(b-1);c&&this.swap(b,c)}return a},b.Group.prototype.xy=function(a,b,c){return 0>a||a>this.children.length?-1:(this.getChildAt(a).x=b,void(this.getChildAt(a).y=c))},b.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},b.Group.prototype.getIndex=function(a){return this.children.indexOf(a)},b.Group.prototype.replace=function(a,c){var d=this.getIndex(a);if(-1!==d){void 0!==c.parent&&(c.events.onRemovedFromGroup.dispatch(c,this),c.parent.removeChild(c),c.parent instanceof b.Group&&c.parent.updateZ());var e=a;return this.remove(e),this.addAt(c,d),e}},b.Group.prototype.setProperty=function(a,b,c,d){d=d||0;var e=b.length;1==e?0===d?a[b[0]]=c:1==d?a[b[0]]+=c:2==d?a[b[0]]-=c:3==d?a[b[0]]*=c:4==d&&(a[b[0]]/=c):2==e?0===d?a[b[0]][b[1]]=c:1==d?a[b[0]][b[1]]+=c:2==d?a[b[0]][b[1]]-=c:3==d?a[b[0]][b[1]]*=c:4==d&&(a[b[0]][b[1]]/=c):3==e?0===d?a[b[0]][b[1]][b[2]]=c:1==d?a[b[0]][b[1]][b[2]]+=c:2==d?a[b[0]][b[1]][b[2]]-=c:3==d?a[b[0]][b[1]][b[2]]*=c:4==d&&(a[b[0]][b[1]][b[2]]/=c):4==e&&(0===d?a[b[0]][b[1]][b[2]][b[3]]=c:1==d?a[b[0]][b[1]][b[2]][b[3]]+=c:2==d?a[b[0]][b[1]][b[2]][b[3]]-=c:3==d?a[b[0]][b[1]][b[2]][b[3]]*=c:4==d&&(a[b[0]][b[1]][b[2]][b[3]]/=c))},b.Group.prototype.set=function(a,b,c,d,e,f){b=b.split("."),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),(d===!1||d&&a.alive)&&(e===!1||e&&a.visible)&&this.setProperty(a,b,c,f)},b.Group.prototype.setAll=function(a,b,c,d,e){a=a.split("."),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),e=e||0;for(var f=0,g=this.children.length;g>f;f++)(!c||c&&this.children[f].alive)&&(!d||d&&this.children[f].visible)&&this.setProperty(this.children[f],a,b,e)},b.Group.prototype.setAllChildren=function(a,c,d,e,f){"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),f=f||0;for(var g=0,h=this.children.length;h>g;g++)(!d||d&&this.children[g].alive)&&(!e||e&&this.children[g].visible)&&(this.children[g]instanceof b.Group?this.children[g].setAllChildren(a,c,d,e,f):this.setProperty(this.children[g],a.split("."),c,f))},b.Group.prototype.addAll=function(a,b,c,d){this.setAll(a,b,c,d,1)},b.Group.prototype.subAll=function(a,b,c,d){this.setAll(a,b,c,d,2)},b.Group.prototype.multiplyAll=function(a,b,c,d){this.setAll(a,b,c,d,3)},b.Group.prototype.divideAll=function(a,b,c,d){this.setAll(a,b,c,d,4)},b.Group.prototype.callAllExists=function(a,b){for(var c=Array.prototype.splice.call(arguments,2),d=0,e=this.children.length;e>d;d++)this.children[d].exists===b&&this.children[d][a]&&this.children[d][a].apply(this.children[d],c)},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||null===b||""===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){this.children.length<2||("undefined"==typeof a&&(a="z"),"undefined"==typeof c&&(c=b.Group.SORT_ASCENDING),this._sortProperty=a,this.children.sort(c===b.Group.SORT_ASCENDING?this.ascendingSortHandler.bind(this):this.descendingSortHandler.bind(this)),this.updateZ())},b.Group.prototype.ascendingSortHandler=function(a,b){return a[this._sortProperty]b[this._sortProperty]?1:a.zb[this._sortProperty]?-1:0},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.getTop=function(){return this.children.length>0?this.children[this.children.length-1]:void 0},b.Group.prototype.getBottom=function(){return this.children.length>0?this.children[0]:void 0},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.updateZ(),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===this.children[c]&&(this.cursor=null);this.updateZ()}},b.Group.prototype.destroy=function(a,b){if(null!==this.game){if("undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!1),a){if(this.children.length>0)do this.children[0].parent&&this.children[0].destroy(a);while(this.children.length>0)}else this.removeAll();this.cursor=null,b||(this.parent.removeChild(this),this.game=null,this.exists=!1)}},Object.defineProperty(b.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,b.Group.RETURN_TOTAL)}}),Object.defineProperty(b.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(b.Group.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Group.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.World=function(a){b.Group.call(this,a,null,"__world",!1),this.bounds=new b.Rectangle(0,0,a.width,a.height),this.camera=null},b.World.prototype=Object.create(b.Group.prototype),b.World.prototype.constructor=b.World,b.World.prototype.boot=function(){this.camera=new b.Camera(this.game,0,0,0,this.game.width,this.game.height),this.camera.displayObject=this,this.camera.scale=this.scale,this.game.camera=this.camera,this.game.stage.addChild(this)},b.World.prototype.setBounds=function(a,b,c,d){cwindow.outerHeight&&(this.orientation=90),this.scaleFactor=new b.Point(1,1),this.scaleFactorInversed=new b.Point(1,1),this.margin=new b.Point(0,0),this.aspectRatio=0,this.sourceAspectRatio=c/d,this.event=null,this.scaleMode=b.ScaleManager.NO_SCALE,this.fullScreenScaleMode=b.ScaleManager.NO_SCALE,this._startHeight=0,this._width=0,this._height=0;var e=this;window.addEventListener("orientationchange",function(a){return e.checkOrientation(a)},!1),window.addEventListener("resize",function(a){return e.checkResize(a)},!1),document.addEventListener("webkitfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("mozfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("fullscreenchange",function(a){return e.fullScreenChange(a)},!1)},b.ScaleManager.EXACT_FIT=0,b.ScaleManager.NO_SCALE=1,b.ScaleManager.SHOW_ALL=2,b.ScaleManager.prototype={startFullScreen:function(a){!this.isFullScreen&&this.game.device.fullscreen&&("undefined"!=typeof a&&this.game.renderType===b.CANVAS&&(this.game.stage.smoothed=a),this._width=this.width,this._height=this.height,this.game.device.fullscreenKeyboard?this.fullScreenTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):this.fullScreenTarget[this.game.device.requestFullscreen]())},stopFullScreen:function(){this.fullScreenTarget[this.game.device.cancelFullscreen]()},fullScreenChange:function(a){this.event=a,this.isFullScreen?(this.fullScreenScaleMode===b.ScaleManager.EXACT_FIT?(this.fullScreenTarget.style.width="100%",this.fullScreenTarget.style.height="100%",this.width=window.outerWidth,this.height=window.outerHeight,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.checkResize()):this.fullScreenScaleMode===b.ScaleManager.SHOW_ALL&&(this.setShowAll(),this.refresh()),this.enterFullScreen.dispatch(this.width,this.height)):(this.fullScreenTarget.style.width=this.game.width+"px",this.fullScreenTarget.style.height=this.game.height+"px",this.width=this._width,this.height=this._height,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.leaveFullScreen.dispatch(this.width,this.height))},forceOrientation:function(a,c,d){"undefined"==typeof c&&(c=!1),this.forceLandscape=a,this.forcePortrait=c,"undefined"!=typeof d&&((null==d||this.game.cache.checkImageKey(d)===!1)&&(d="__default"),this.orientationSprite=new b.Image(this.game,this.game.width/2,this.game.height/2,PIXI.TextureCache[d]),this.orientationSprite.anchor.set(.5),this.checkOrientationState(),this.incorrectOrientation?(this.orientationSprite.visible=!0,this.game.world.visible=!1):(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.game.stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()):(this.forceLandscape&&window.innerWidthwindow.outerHeight?90:0,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh(),this.checkOrientationState()},refresh:function(){if(this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),null==this._check&&this.maxIterations>0){this._iterations=this.maxIterations;var a=this;this._check=window.setInterval(function(){return a.setScreenSize()},10),this.setScreenSize()}},setScreenSize:function(a){"undefined"==typeof a&&(a=!1),this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),this._iterations--,(a||window.innerHeight>this._startHeight||this._iterations<0)&&(document.documentElement.style.minHeight=window.innerHeight+"px",this.incorrectOrientation===!0?this.setMaximum():this.isFullScreen?this.fullScreenScaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.fullScreenScaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll():this.scaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.scaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll(),this.setSize(),clearInterval(this._check),this._check=null)},setSize:function(){this.incorrectOrientation===!1&&(this.maxWidth&&this.width>this.maxWidth&&(this.width=this.maxWidth),this.maxHeight&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.minWidth&&this.widththis.maxWidth?this.maxWidth:a,this.height=this.maxHeight&&b>this.maxHeight?this.maxHeight:b}},b.ScaleManager.prototype.constructor=b.ScaleManager,Object.defineProperty(b.ScaleManager.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(b.ScaleManager.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(b.ScaleManager.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),b.Game=function(a,c,d,e,f,g,h,i){this.id=b.GAMES.push(this)-1,this.config=null,this.physicsConfig=i,this.parent="",this.width=800,this.height=600,this.transparent=!1,this.antialias=!0,this.renderer=b.AUTO,this.renderType=b.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.rnd=null,this.device=null,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof c&&(this.height=c),"undefined"!=typeof d&&(this.renderer=d,this.renderType=d),"undefined"!=typeof e&&(this.parent=e),"undefined"!=typeof g&&(this.transparent=g),"undefined"!=typeof h&&(this.antialias=h),this.rnd=new b.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new b.StateManager(this,f));var j=this;return this._onBoot=function(){return j.boot()},"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(this._onBoot,0):(document.addEventListener("DOMContentLoaded",this._onBoot,!1),window.addEventListener("load",this._onBoot,!1)),this},b.Game.prototype={parseConfig:function(a){this.config=a,a.width&&(this.width=b.Utils.parseDimension(a.width,0)),a.height&&(this.height=b.Utils.parseDimension(a.height,1)),a.renderer&&(this.renderer=a.renderer,this.renderType=a.renderer),a.parent&&(this.parent=a.parent),a.transparent&&(this.transparent=a.transparent),a.antialias&&(this.antialias=a.antialias),a.physicsConfig&&(this.physicsConfig=a.physicsConfig);var c=[(Date.now()*Math.random()).toString()];a.seed&&(c=a.seed),this.rnd=new b.RandomDataGenerator(c);var d=null;a.state&&(d=a.state),this.state=new b.StateManager(this,d)},boot:function(){this.isBooted||(document.body?(document.removeEventListener("DOMContentLoaded",this._onBoot),window.removeEventListener("load",this._onBoot),this.onPause=new b.Signal,this.onResume=new b.Signal,this.onBlur=new b.Signal,this.onFocus=new b.Signal,this.isBooted=!0,this.device=new b.Device(this),this.math=b.Math,this.stage=new b.Stage(this,this.width,this.height),this.scale=new b.ScaleManager(this,this.width,this.height),this.setUpRenderer(),this.device.checkFullScreenSupport(),this.world=new b.World(this),this.add=new b.GameObjectFactory(this),this.make=new b.GameObjectCreator(this),this.cache=new b.Cache(this),this.load=new b.Loader(this),this.time=new b.Time(this),this.tweens=new b.TweenManager(this),this.input=new b.Input(this),this.sound=new b.SoundManager(this),this.physics=new b.Physics(this,this.physicsConfig),this.particles=new b.Particles(this),this.plugins=new b.PluginManager(this,this),this.net=new b.Net(this),this.debug=new b.Utils.Debug(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.debug.boot(),this.showDebugHeader(),this.isRunning=!0,this.raf=this.config&&this.config.forceSetTimeOut?new b.RequestAnimationFrame(this,this.config.forceSetTimeOut):new b.RequestAnimationFrame(this,!1),this.raf.start()):window.setTimeout(this._onBoot,20)) -},showDebugHeader:function(){var a=b.DEV_VERSION,c="Canvas",d="HTML Audio",e=1;if(this.renderType===b.WEBGL?(c="WebGL",e++):this.renderType==b.HEADLESS&&(c="Headless"),this.device.webAudio&&(d="WebAudio",e++),this.device.chrome){for(var f=["%c %c %c Phaser v"+a+" - "+c+" - "+d+" %c %c http://phaser.io %c %c ♥%c♥%c♥ ","background: #0cf300","background: #00bc17","color: #ffffff; background: #00711f;","background: #00bc17","background: #0cf300","background: #00bc17"],g=0;3>g;g++)f.push(e>g?"color: #ff2424; background: #fff":"color: #959595; background: #fff");console.log.apply(console,f)}else console.log("Phaser v"+a+" - Renderer: "+c+" - Audio: "+d+" - http://phaser.io")},setUpRenderer:function(){if(this.device.trident&&(this.renderType=b.CANVAS),this.renderType===b.HEADLESS||this.renderType===b.CANVAS||this.renderType===b.AUTO&&this.device.webGL===!1){if(!this.device.canvas)throw new Error("Phaser.Game - cannot create Canvas or WebGL context, aborting.");this.renderType===b.AUTO&&(this.renderType=b.CANVAS),this.renderer=new PIXI.CanvasRenderer(this.width,this.height,this.canvas,this.transparent),this.context=this.renderer.context}else this.renderType=b.WEBGL,this.renderer=new PIXI.WebGLRenderer(this.width,this.height,this.canvas,this.transparent,this.antialias),this.context=null;this.renderType!==b.HEADLESS&&(this.stage.smoothed=this.antialias,b.Canvas.addToDOM(this.canvas,this.parent,!0),b.Canvas.setTouchAction(this.canvas))},update:function(a){this.time.update(a),this._paused||this.pendingStep?this.debug.preUpdate():(this.stepping&&(this.pendingStep=!0),this.debug.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(),this.plugins.preUpdate(),this.stage.preUpdate(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.state.update(),this.physics.update(),this.particles.update(),this.plugins.update(),this.stage.postUpdate(),this.plugins.postUpdate()),this.renderType!=b.HEADLESS&&(this.renderer.render(this.stage),this.plugins.render(),this.state.render(),this.plugins.postRender())},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.input.destroy(),this.state.destroy(),this.physics.destroy(),this.state=null,this.cache=null,this.input=null,this.load=null,this.sound=null,this.stage=null,this.time=null,this.world=null,this.isBooted=!1},gamePaused:function(a){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.setMute(),this.onPause.dispatch(a))},gameResumed:function(a){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.unsetMute(),this.onResume.dispatch(a))},focusLoss:function(a){this.onBlur.dispatch(a),this.gamePaused(a)},focusGain:function(a){this.onFocus.dispatch(a),this.gameResumed(a)}},b.Game.prototype.constructor=b.Game,Object.defineProperty(b.Game.prototype,"paused",{get:function(){return this._paused},set:function(a){a===!0?this._paused===!1&&(this._paused=!0,this._codePaused=!0,this.sound.mute=!0,this.time.gamePaused(),this.onPause.dispatch(this)):this._paused&&(this._paused=!1,this._codePaused=!1,this.input.reset(),this.sound.mute=!1,this.time.gameResumed(),this.onResume.dispatch(this))}}),b.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.disabled=!1,this.multiInputOverride=b.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=10,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.interactiveItems=new b.LinkedList,this._localPoint=new b.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},b.Input.MOUSE_OVERRIDES_TOUCH=0,b.Input.TOUCH_OVERRIDES_MOUSE=1,b.Input.MOUSE_TOUCH_COMBINE=2,b.Input.prototype={boot:function(){this.mousePointer=new b.Pointer(this.game,0),this.pointer1=new b.Pointer(this.game,1),this.pointer2=new b.Pointer(this.game,2),this.mouse=new b.Mouse(this.game),this.keyboard=new b.Keyboard(this.game),this.touch=new b.Touch(this.game),this.mspointer=new b.MSPointer(this.game),this.gamepad=new b.Gamepad(this.game),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.scale=new b.Point(1,1),this.speed=new b.Point,this.position=new b.Point,this._oldPosition=new b.Point,this.circle=new b.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallback=null},setMoveCallback:function(a,b){this.moveCallback=a,this.moveCallbackContext=b},addPointer:function(){for(var a=0,c=10;c>0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=new Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f;a=new Array(g+1).join(c)+a+new Array(f+1).join(c);break;default:a+=new Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!{}.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal +},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a}}),b.Plugin=function(a,b){"undefined"==typeof b&&(b=null),this.game=a,this.parent=b,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},b.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},b.Plugin.prototype.constructor=b.Plugin,b.PluginManager=function(a,b){this.game=a,this._parent=b,this.plugins=[],this._pluginsLength=0},b.PluginManager.prototype={add:function(a){var b=!1;return"function"==typeof a?a=new a(this.game,this._parent):(a.game=this.game,a.parent=this._parent),"function"==typeof a.preUpdate&&(a.hasPreUpdate=!0,b=!0),"function"==typeof a.update&&(a.hasUpdate=!0,b=!0),"function"==typeof a.postUpdate&&(a.hasPostUpdate=!0,b=!0),"function"==typeof a.render&&(a.hasRender=!0,b=!0),"function"==typeof a.postRender&&(a.hasPostRender=!0,b=!0),b?((a.hasPreUpdate||a.hasUpdate||a.hasPostUpdate)&&(a.active=!0),(a.hasRender||a.hasPostRender)&&(a.visible=!0),this._pluginsLength=this.plugins.push(a),"function"==typeof a.init&&a.init(),a):null},remove:function(a){if(0!==this._pluginsLength)for(this._p=0;this._pb;b++)this.children[b].preUpdate()},b.Stage.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Stage.prototype.postUpdate=function(){if(this.game.world.camera.target){this.game.world.camera.target.postUpdate(),this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a]!==this.game.world.camera.target&&this.children[a].postUpdate()}else{this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a].postUpdate()}this.checkOffsetInterval!==!1&&this.game.time.now>this._nextOffsetCheck&&(b.Canvas.getOffset(this.game.canvas,this.offset),this._nextOffsetCheck=this.game.time.now+this.checkOffsetInterval)},b.Stage.prototype.parseConfig=function(a){this.game.canvas=a.canvasID?b.Canvas.create(this.game.width,this.game.height,a.canvasID):b.Canvas.create(this.game.width,this.game.height),a.canvasStyle?this.game.canvas.stlye=a.canvasStyle:this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",a.checkOffsetInterval&&(this.checkOffsetInterval=a.checkOffsetInterval),a.disableVisibilityChange&&(this.disableVisibilityChange=a.disableVisibilityChange),a.fullScreenScaleMode&&(this.fullScreenScaleMode=a.fullScreenScaleMode),a.scaleMode&&(this.scaleMode=a.scaleMode),a.backgroundColor&&(this.backgroundColor=a.backgroundColor)},b.Stage.prototype.boot=function(){b.Canvas.getOffset(this.game.canvas,this.offset),this.bounds=new b.Rectangle(this.offset.x,this.offset.y,this.game.width,this.game.height);var a=this;this._onChange=function(b){return a.visibilityChange(b)},b.Canvas.setUserSelect(this.game.canvas,"none"),b.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},b.Stage.prototype.checkVisibility=function(){this._hiddenVar=void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.hidden?"visibilitychange":null,this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.onblur=this._onChange,window.onfocus=this._onChange},b.Stage.prototype.visibilityChange=function(a){return this.disableVisibilityChange?void 0:"pagehide"===a.type||"blur"===a.type||"pageshow"===a.type||"focus"===a.type?void("pagehide"===a.type||"blur"===a.type?this.game.focusLoss(a):("pageshow"===a.type||"focus"===a.type)&&this.game.focusGain(a)):void(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden?this.game.gamePaused(a):this.game.gameResumed(a))},b.Stage.prototype.setBackgroundColor=function(a){this._backgroundColor=a||0,this.backgroundColorSplit=PIXI.hex2rgb(this.backgroundColor);var b=this._backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},Object.defineProperty(b.Stage.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this.game.transparent===!1&&("string"==typeof a&&(a=b.Color.hexToRGB(a)),this.setBackgroundColor(a))}}),Object.defineProperty(b.Stage.prototype,"smoothed",{get:function(){return!PIXI.scaleModes.LINEAR},set:function(a){PIXI.scaleModes.LINEAR=a?0:1}}),b.Group=function(a,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=b.Physics.ARCADE),this.game=a,"undefined"==typeof c&&(c=a.world),this.name=d||"group",PIXI.DisplayObjectContainer.call(this),e?this.game.stage.addChild(this):c&&c.addChild(this),this.z=0,this.type=b.GROUP,this.alive=!0,this.exists=!0,this.scale=new b.Point(1,1),this.cursor=null,this.cameraOffset=new b.Point,this.enableBody=f,this.enableBodyDebug=!1,this.physicsBodyType=g,this._sortProperty="z",this._cache=[0,0,0,0,1,0,1,0,0,0]},b.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),b.Group.prototype.constructor=b.Group,b.Group.RETURN_NONE=0,b.Group.RETURN_TOTAL=1,b.Group.RETURN_CHILD=2,b.Group.SORT_ASCENDING=-1,b.Group.SORT_DESCENDING=1,b.Group.prototype.add=function(a){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChild(a),a.z=this.children.length,a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.addAt=function(a,b){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChildAt(a,b),this.updateZ(),a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.getAt=function(a){return 0>a||a>=this.children.length?-1:this.getChildAt(a)},b.Group.prototype.create=function(a,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new b.Sprite(this.game,a,c,d,e);return this.enableBody&&this.game.physics.enable(g,this.physicsBodyType),g.exists=f,g.visible=f,g.alive=f,this.addChild(g),g.z=this.children.length,g.events&&g.events.onAddedToGroup.dispatch(g,this),null===this.cursor&&(this.cursor=g),g},b.Group.prototype.createMultiple=function(a,b,c,d){"undefined"==typeof d&&(d=!1);for(var e=0;a>e;e++)this.create(0,0,b,c,d)},b.Group.prototype.updateZ=function(){for(var a=this.children.length;a--;)this.children[a].z=a},b.Group.prototype.next=function(){this.cursor&&(this._cache[8]===this.children.length?this._cache[8]=0:this._cache[8]++,this.cursor=this.children[this._cache[8]])},b.Group.prototype.previous=function(){this.cursor&&(0===this._cache[8]?this._cache[8]=this.children.length-1:this._cache[8]--,this.cursor=this.children[this._cache[8]])},b.Group.prototype.swap=function(a,b){var c=this.swapChildren(a,b);return c&&this.updateZ(),c},b.Group.prototype.bringToTop=function(a){return a.parent===this&&this.getIndex(a)0&&(this.remove(a),this.addAt(a,0)),a},b.Group.prototype.moveUp=function(a){if(a.parent===this&&this.getIndex(a)0){var b=this.getIndex(a),c=this.getAt(b-1);c&&this.swap(b,c)}return a},b.Group.prototype.xy=function(a,b,c){return 0>a||a>this.children.length?-1:(this.getChildAt(a).x=b,void(this.getChildAt(a).y=c))},b.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},b.Group.prototype.getIndex=function(a){return this.children.indexOf(a)},b.Group.prototype.replace=function(a,c){var d=this.getIndex(a);if(-1!==d){void 0!==c.parent&&(c.events.onRemovedFromGroup.dispatch(c,this),c.parent.removeChild(c),c.parent instanceof b.Group&&c.parent.updateZ());var e=a;return this.remove(e),this.addAt(c,d),e}},b.Group.prototype.setProperty=function(a,b,c,d){d=d||0;var e=b.length;1==e?0===d?a[b[0]]=c:1==d?a[b[0]]+=c:2==d?a[b[0]]-=c:3==d?a[b[0]]*=c:4==d&&(a[b[0]]/=c):2==e?0===d?a[b[0]][b[1]]=c:1==d?a[b[0]][b[1]]+=c:2==d?a[b[0]][b[1]]-=c:3==d?a[b[0]][b[1]]*=c:4==d&&(a[b[0]][b[1]]/=c):3==e?0===d?a[b[0]][b[1]][b[2]]=c:1==d?a[b[0]][b[1]][b[2]]+=c:2==d?a[b[0]][b[1]][b[2]]-=c:3==d?a[b[0]][b[1]][b[2]]*=c:4==d&&(a[b[0]][b[1]][b[2]]/=c):4==e&&(0===d?a[b[0]][b[1]][b[2]][b[3]]=c:1==d?a[b[0]][b[1]][b[2]][b[3]]+=c:2==d?a[b[0]][b[1]][b[2]][b[3]]-=c:3==d?a[b[0]][b[1]][b[2]][b[3]]*=c:4==d&&(a[b[0]][b[1]][b[2]][b[3]]/=c))},b.Group.prototype.set=function(a,b,c,d,e,f){b=b.split("."),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),(d===!1||d&&a.alive)&&(e===!1||e&&a.visible)&&this.setProperty(a,b,c,f)},b.Group.prototype.setAll=function(a,b,c,d,e){a=a.split("."),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),e=e||0;for(var f=0,g=this.children.length;g>f;f++)(!c||c&&this.children[f].alive)&&(!d||d&&this.children[f].visible)&&this.setProperty(this.children[f],a,b,e)},b.Group.prototype.setAllChildren=function(a,c,d,e,f){"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),f=f||0;for(var g=0,h=this.children.length;h>g;g++)(!d||d&&this.children[g].alive)&&(!e||e&&this.children[g].visible)&&(this.children[g]instanceof b.Group?this.children[g].setAllChildren(a,c,d,e,f):this.setProperty(this.children[g],a.split("."),c,f))},b.Group.prototype.addAll=function(a,b,c,d){this.setAll(a,b,c,d,1)},b.Group.prototype.subAll=function(a,b,c,d){this.setAll(a,b,c,d,2)},b.Group.prototype.multiplyAll=function(a,b,c,d){this.setAll(a,b,c,d,3)},b.Group.prototype.divideAll=function(a,b,c,d){this.setAll(a,b,c,d,4)},b.Group.prototype.callAllExists=function(a,b){for(var c=Array.prototype.splice.call(arguments,2),d=0,e=this.children.length;e>d;d++)this.children[d].exists===b&&this.children[d][a]&&this.children[d][a].apply(this.children[d],c)},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||null===b||""===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){this.children.length<2||("undefined"==typeof a&&(a="z"),"undefined"==typeof c&&(c=b.Group.SORT_ASCENDING),this._sortProperty=a,this.children.sort(c===b.Group.SORT_ASCENDING?this.ascendingSortHandler.bind(this):this.descendingSortHandler.bind(this)),this.updateZ())},b.Group.prototype.ascendingSortHandler=function(a,b){return a[this._sortProperty]b[this._sortProperty]?1:a.zb[this._sortProperty]?-1:0},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.getTop=function(){return this.children.length>0?this.children[this.children.length-1]:void 0},b.Group.prototype.getBottom=function(){return this.children.length>0?this.children[0]:void 0},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.updateZ(),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===this.children[c]&&(this.cursor=null);this.updateZ()}},b.Group.prototype.destroy=function(a,b){if(null!==this.game){if("undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!1),a){if(this.children.length>0)do this.children[0].parent&&this.children[0].destroy(a);while(this.children.length>0)}else this.removeAll();this.cursor=null,b||(this.parent.removeChild(this),this.game=null,this.exists=!1)}},Object.defineProperty(b.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,b.Group.RETURN_TOTAL)}}),Object.defineProperty(b.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(b.Group.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Group.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.World=function(a){b.Group.call(this,a,null,"__world",!1),this.bounds=new b.Rectangle(0,0,a.width,a.height),this.camera=null},b.World.prototype=Object.create(b.Group.prototype),b.World.prototype.constructor=b.World,b.World.prototype.boot=function(){this.camera=new b.Camera(this.game,0,0,0,this.game.width,this.game.height),this.camera.displayObject=this,this.camera.scale=this.scale,this.game.camera=this.camera,this.game.stage.addChild(this)},b.World.prototype.setBounds=function(a,b,c,d){cwindow.outerHeight&&(this.orientation=90),this.scaleFactor=new b.Point(1,1),this.scaleFactorInversed=new b.Point(1,1),this.margin=new b.Point(0,0),this.aspectRatio=0,this.sourceAspectRatio=c/d,this.event=null,this.scaleMode=b.ScaleManager.NO_SCALE,this.fullScreenScaleMode=b.ScaleManager.NO_SCALE,this._startHeight=0,this._width=0,this._height=0;var e=this;window.addEventListener("orientationchange",function(a){return e.checkOrientation(a)},!1),window.addEventListener("resize",function(a){return e.checkResize(a)},!1),document.addEventListener("webkitfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("mozfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("fullscreenchange",function(a){return e.fullScreenChange(a)},!1)},b.ScaleManager.EXACT_FIT=0,b.ScaleManager.NO_SCALE=1,b.ScaleManager.SHOW_ALL=2,b.ScaleManager.prototype={startFullScreen:function(a){!this.isFullScreen&&this.game.device.fullscreen&&("undefined"!=typeof a&&this.game.renderType===b.CANVAS&&(this.game.stage.smoothed=a),this._width=this.width,this._height=this.height,this.game.device.fullscreenKeyboard?this.fullScreenTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):this.fullScreenTarget[this.game.device.requestFullscreen]())},stopFullScreen:function(){this.fullScreenTarget[this.game.device.cancelFullscreen]()},fullScreenChange:function(a){this.event=a,this.isFullScreen?(this.fullScreenScaleMode===b.ScaleManager.EXACT_FIT?(this.fullScreenTarget.style.width="100%",this.fullScreenTarget.style.height="100%",this.width=window.outerWidth,this.height=window.outerHeight,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.checkResize()):this.fullScreenScaleMode===b.ScaleManager.SHOW_ALL&&(this.setShowAll(),this.refresh()),this.enterFullScreen.dispatch(this.width,this.height)):(this.fullScreenTarget.style.width=this.game.width+"px",this.fullScreenTarget.style.height=this.game.height+"px",this.width=this._width,this.height=this._height,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.leaveFullScreen.dispatch(this.width,this.height))},forceOrientation:function(a,c,d){"undefined"==typeof c&&(c=!1),this.forceLandscape=a,this.forcePortrait=c,"undefined"!=typeof d&&((null==d||this.game.cache.checkImageKey(d)===!1)&&(d="__default"),this.orientationSprite=new b.Image(this.game,this.game.width/2,this.game.height/2,PIXI.TextureCache[d]),this.orientationSprite.anchor.set(.5),this.checkOrientationState(),this.incorrectOrientation?(this.orientationSprite.visible=!0,this.game.world.visible=!1):(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.game.stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()):(this.forceLandscape&&window.innerWidthwindow.outerHeight?90:0,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh(),this.checkOrientationState()},refresh:function(){if(this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),null==this._check&&this.maxIterations>0){this._iterations=this.maxIterations;var a=this;this._check=window.setInterval(function(){return a.setScreenSize()},10),this.setScreenSize()}},setScreenSize:function(a){"undefined"==typeof a&&(a=!1),this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),this._iterations--,(a||window.innerHeight>this._startHeight||this._iterations<0)&&(document.documentElement.style.minHeight=window.innerHeight+"px",this.incorrectOrientation===!0?this.setMaximum():this.isFullScreen?this.fullScreenScaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.fullScreenScaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll():this.scaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.scaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll(),this.setSize(),clearInterval(this._check),this._check=null)},setSize:function(){this.incorrectOrientation===!1&&(this.maxWidth&&this.width>this.maxWidth&&(this.width=this.maxWidth),this.maxHeight&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.minWidth&&this.widththis.maxWidth?this.maxWidth:a,this.height=this.maxHeight&&b>this.maxHeight?this.maxHeight:b}},b.ScaleManager.prototype.constructor=b.ScaleManager,Object.defineProperty(b.ScaleManager.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(b.ScaleManager.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(b.ScaleManager.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),b.Game=function(a,c,d,e,f,g,h,i){this.id=b.GAMES.push(this)-1,this.config=null,this.physicsConfig=i,this.parent="",this.width=800,this.height=600,this.transparent=!1,this.antialias=!0,this.renderer=b.AUTO,this.renderType=b.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.rnd=null,this.device=null,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof c&&(this.height=c),"undefined"!=typeof d&&(this.renderer=d,this.renderType=d),"undefined"!=typeof e&&(this.parent=e),"undefined"!=typeof g&&(this.transparent=g),"undefined"!=typeof h&&(this.antialias=h),this.rnd=new b.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new b.StateManager(this,f));var j=this;return this._onBoot=function(){return j.boot()},"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(this._onBoot,0):(document.addEventListener("DOMContentLoaded",this._onBoot,!1),window.addEventListener("load",this._onBoot,!1)),this},b.Game.prototype={parseConfig:function(a){this.config=a,a.width&&(this.width=b.Utils.parseDimension(a.width,0)),a.height&&(this.height=b.Utils.parseDimension(a.height,1)),a.renderer&&(this.renderer=a.renderer,this.renderType=a.renderer),a.parent&&(this.parent=a.parent),a.transparent&&(this.transparent=a.transparent),a.antialias&&(this.antialias=a.antialias),a.physicsConfig&&(this.physicsConfig=a.physicsConfig);var c=[(Date.now()*Math.random()).toString()];a.seed&&(c=a.seed),this.rnd=new b.RandomDataGenerator(c);var d=null;a.state&&(d=a.state),this.state=new b.StateManager(this,d)},boot:function(){this.isBooted||(document.body?(document.removeEventListener("DOMContentLoaded",this._onBoot),window.removeEventListener("load",this._onBoot),this.onPause=new b.Signal,this.onResume=new b.Signal,this.onBlur=new b.Signal,this.onFocus=new b.Signal,this.isBooted=!0,this.device=new b.Device(this),this.math=b.Math,this.stage=new b.Stage(this,this.width,this.height),this.scale=new b.ScaleManager(this,this.width,this.height),this.setUpRenderer(),this.device.checkFullScreenSupport(),this.world=new b.World(this),this.add=new b.GameObjectFactory(this),this.make=new b.GameObjectCreator(this),this.cache=new b.Cache(this),this.load=new b.Loader(this),this.time=new b.Time(this),this.tweens=new b.TweenManager(this),this.input=new b.Input(this),this.sound=new b.SoundManager(this),this.physics=new b.Physics(this,this.physicsConfig),this.particles=new b.Particles(this),this.plugins=new b.PluginManager(this,this),this.net=new b.Net(this),this.debug=new b.Utils.Debug(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.debug.boot(),this.showDebugHeader(),this.isRunning=!0,this.raf=this.config&&this.config.forceSetTimeOut?new b.RequestAnimationFrame(this,this.config.forceSetTimeOut):new b.RequestAnimationFrame(this,!1),this.raf.start()):window.setTimeout(this._onBoot,20)) +},showDebugHeader:function(){var a=b.DEV_VERSION,c="Canvas",d="HTML Audio",e=1;if(this.renderType===b.WEBGL?(c="WebGL",e++):this.renderType==b.HEADLESS&&(c="Headless"),this.device.webAudio&&(d="WebAudio",e++),this.device.chrome){for(var f=["%c %c %c Phaser v"+a+" - "+c+" - "+d+" %c %c http://phaser.io %c %c ♥%c♥%c♥ ","background: #0cf300","background: #00bc17","color: #ffffff; background: #00711f;","background: #00bc17","background: #0cf300","background: #00bc17"],g=0;3>g;g++)f.push(e>g?"color: #ff2424; background: #fff":"color: #959595; background: #fff");console.log.apply(console,f)}else console.log("Phaser v"+a+" - Renderer: "+c+" - Audio: "+d+" - http://phaser.io")},setUpRenderer:function(){if(this.device.trident&&(this.renderType=b.CANVAS),this.renderType===b.HEADLESS||this.renderType===b.CANVAS||this.renderType===b.AUTO&&this.device.webGL===!1){if(!this.device.canvas)throw new Error("Phaser.Game - cannot create Canvas or WebGL context, aborting.");this.renderType===b.AUTO&&(this.renderType=b.CANVAS),this.renderer=new PIXI.CanvasRenderer(this.width,this.height,this.canvas,this.transparent),this.context=this.renderer.context}else this.renderType=b.WEBGL,this.renderer=new PIXI.WebGLRenderer(this.width,this.height,this.canvas,this.transparent,this.antialias),this.context=null;this.renderType!==b.HEADLESS&&(this.stage.smoothed=this.antialias,b.Canvas.addToDOM(this.canvas,this.parent,!0),b.Canvas.setTouchAction(this.canvas))},update:function(a){this.time.update(a),this._paused||this.pendingStep?this.debug.preUpdate():(this.stepping&&(this.pendingStep=!0),this.debug.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(),this.plugins.preUpdate(),this.stage.preUpdate(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.state.update(),this.physics.update(),this.particles.update(),this.plugins.update(),this.stage.postUpdate(),this.plugins.postUpdate()),this.renderType!=b.HEADLESS&&(this.renderer.render(this.stage),this.plugins.render(),this.state.render(),this.plugins.postRender())},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.input.destroy(),this.state.destroy(),this.physics.destroy(),this.state=null,this.cache=null,this.input=null,this.load=null,this.sound=null,this.stage=null,this.time=null,this.world=null,this.isBooted=!1},gamePaused:function(a){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.setMute(),this.onPause.dispatch(a))},gameResumed:function(a){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.unsetMute(),this.onResume.dispatch(a))},focusLoss:function(a){this.onBlur.dispatch(a),this.gamePaused(a)},focusGain:function(a){this.onFocus.dispatch(a),this.gameResumed(a)}},b.Game.prototype.constructor=b.Game,Object.defineProperty(b.Game.prototype,"paused",{get:function(){return this._paused},set:function(a){a===!0?this._paused===!1&&(this._paused=!0,this._codePaused=!0,this.sound.mute=!0,this.time.gamePaused(),this.onPause.dispatch(this)):this._paused&&(this._paused=!1,this._codePaused=!1,this.input.reset(),this.sound.mute=!1,this.time.gameResumed(),this.onResume.dispatch(this))}}),b.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.disabled=!1,this.multiInputOverride=b.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=10,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.interactiveItems=new b.LinkedList,this._localPoint=new b.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},b.Input.MOUSE_OVERRIDES_TOUCH=0,b.Input.TOUCH_OVERRIDES_MOUSE=1,b.Input.MOUSE_TOUCH_COMBINE=2,b.Input.prototype={boot:function(){this.mousePointer=new b.Pointer(this.game,0),this.pointer1=new b.Pointer(this.game,1),this.pointer2=new b.Pointer(this.game,2),this.mouse=new b.Mouse(this.game),this.keyboard=new b.Keyboard(this.game),this.touch=new b.Touch(this.game),this.mspointer=new b.MSPointer(this.game),this.gamepad=new b.Gamepad(this.game),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.scale=new b.Point(1,1),this.speed=new b.Point,this.position=new b.Point,this._oldPosition=new b.Point,this.circle=new b.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallback=null},setMoveCallback:function(a,b){this.moveCallback=a,this.moveCallbackContext=b},addPointer:function(){for(var a=0,c=10;c>0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b0&&e>this.deadZone||0>e&&e<-this.deadZone?{axis:d,value:e}:{axis:d,value:0})}this._prevTimestamp=this._rawPad.timestamp}},connect:function(a){var b=!this._connected;this._index=a.index,this._connected=!0,this._rawPad=a,this._rawButtons=a.buttons,this._axes=a.axes,b&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this._index),b&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var a=this._connected;this._connected=!1,this._rawPad=void 0,this._rawButtons=[],this._buttons=[];var b=this._index;this._index=null,a&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,b),a&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},processAxisChange:function(a){this.game.input.disabled||this.game.input.gamepad.disabled||this._axes[a.axis]!==a.value&&(this._axes[a.axis]=a.value,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,a,this._index),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,a))},processButtonDown:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,a,b,this._index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,a,b),this._buttons[a]&&this._buttons[a].isDown?this._buttons[a].duration=this.game.time.now-this._buttons[a].timeDown:this._buttons[a]?(this._buttons[a].isDown=!0,this._buttons[a].timeDown=this.game.time.now,this._buttons[a].duration=0,this._buttons[a].value=b):this._buttons[a]={isDown:!0,timeDown:this.game.time.now,timeUp:0,duration:0,value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonDown(b))},processButtonUp:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,a,b,this._index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,a,b),this._hotkeys[a]&&this._hotkeys[a].processButtonUp(b),this._buttons[a]?(this._buttons[a].isDown=!1,this._buttons[a].timeUp=this.game.time.now,this._buttons[a].value=b):this._buttons[a]={isDown:!1,timeDown:this.game.time.now,timeUp:this.game.time.now,duration:0,value:b})},processButtonFloat:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,a,b,this._index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,a,b),this._buttons[a]?this._buttons[a].value=b:this._buttons[a]={value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonFloat(b))},axis:function(a){return this._axes[a]?this._axes[a]:!1},isDown:function(a){return this._buttons[a]?this._buttons[a].isDown:!1},justReleased:function(a,b){return"undefined"==typeof b&&(b=250),this._buttons[a]&&this._buttons[a].isDown===!1&&this.game.time.now-this._buttons[a].timeUpd;d++)this._pointerData[d]={id:d,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new b.Point,this.enabled=!0,this.sprite.events&&null===this.sprite.events.onInputOver&&(this.sprite.events.onInputOver=new b.Signal,this.sprite.events.onInputOut=new b.Signal,this.sprite.events.onInputDown=new b.Signal,this.sprite.events.onInputUp=new b.Signal,this.sprite.events.onDragStart=new b.Signal,this.sprite.events.onDragStop=new b.Signal)}return this.sprite},reset:function(){this.enabled=!1;for(var a=0;10>a;a++)this._pointerData[a]={id:a,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){this.enabled!==!1&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.enabled&&(this._setHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(a,b){return 0===this.sprite.scale.x||0===this.sprite.scale.y?!1:this.pixelPerfectClick||this.pixelPerfectOver?!0:this.priorityID>a||this.priorityID===a&&this.sprite._cache[3]b;b++)if(this._pointerData[b].isOver)return!0}return!1},pointerOut:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOut;for(var b=0;10>b;b++)if(this._pointerData[b].isOut)return!0}return!1},pointerTimeOver:function(a){return a=a||0,this._pointerData[a].timeOver},pointerTimeOut:function(a){return a=a||0,this._pointerData[a].timeOut},pointerDragged:function(a){return a=a||0,this._pointerData[a].isDragged},checkPointerDown:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectClick?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPointerOver:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectOver?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPixel:function(a,b,c){if(this.sprite.texture.baseTexture.source){if(this.game.input.hitContext.clearRect(0,0,1,1),null===a&&null===b){this.game.input.getLocalPosition(this.sprite,c,this._tempPoint);var a=this._tempPoint.x,b=this._tempPoint.y}0!==this.sprite.anchor.x&&(a-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(b-=-this.sprite.texture.frame.height*this.sprite.anchor.y),a+=this.sprite.texture.frame.x,b+=this.sprite.texture.frame.y,this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,a,b,1,1,0,0,1,1);var d=this.game.input.hitContext.getImageData(0,0,1,1);if(d.data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(a){return null!==this.sprite?this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this.draggable&&this._draggedPointerID==a.id?this.updateDrag(a):this._pointerData[a.id].isOver===!0?this.checkPointerOver(a)?(this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,!0):(this._pointerOutHandler(a),!1):void 0:(this._pointerOutHandler(a),!1):void 0},_pointerOverHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isOver===!1&&(this._pointerData[a.id].isOver=!0,this._pointerData[a.id].isOut=!1,this._pointerData[a.id].timeOver=this.game.time.now,this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!1),this.sprite.events.onInputOver.dispatch(this.sprite,a))},_pointerOutHandler:function(a){null!==this.sprite&&(this._pointerData[a.id].isOver=!1,this._pointerData[a.id].isOut=!0,this._pointerData[a.id].timeOut=this.game.time.now,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.sprite&&this.sprite.events&&this.sprite.events.onInputOut.dispatch(this.sprite,a))},_touchedHandler:function(a){if(null!==this.sprite){if(this._pointerData[a.id].isDown===!1&&this._pointerData[a.id].isOver===!0){if(this.pixelPerfectClick&&!this.checkPixel(null,null,a))return;this._pointerData[a.id].isDown=!0,this._pointerData[a.id].isUp=!1,this._pointerData[a.id].timeDown=this.game.time.now,this.sprite.events.onInputDown.dispatch(this.sprite,a),this.draggable&&this.isDragged===!1&&this.startDrag(a),this.bringToTop&&this.sprite.bringToTop()}return this.consumePointerEvent}},_releasedHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isDown&&a.isUp&&(this._pointerData[a.id].isDown=!1,this._pointerData[a.id].isUp=!0,this._pointerData[a.id].timeUp=this.game.time.now,this._pointerData[a.id].downDuration=this._pointerData[a.id].timeUp-this._pointerData[a.id].timeDown,this.checkPointerOver(a)?this.sprite.events.onInputUp.dispatch(this.sprite,a,!0):(this.sprite.events.onInputUp.dispatch(this.sprite,a,!1),this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1)),this.draggable&&this.isDragged&&this._draggedPointerID==a.id&&this.stopDrag(a))},updateDrag:function(a){return a.isUp?(this.stopDrag(a),!1):(this.sprite.fixedToCamera?(this.allowHorizontalDrag&&(this.sprite.cameraOffset.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.cameraOffset.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)):(this.allowHorizontalDrag&&(this.sprite.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),!0)},justOver:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isOver&&this.overDuration(a)a;a++)this._pointerData[a].isDragged=!1;this.draggable=!1,this.isDragged=!1,this._draggedPointerID=-1},startDrag:function(a){if(this.isDragged=!0,this._draggedPointerID=a.id,this._pointerData[a.id].isDragged=!0,this.sprite.fixedToCamera)this.dragFromCenter?(this.sprite.centerOn(a.x,a.y),this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y)):this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y);else if(this.dragFromCenter){var b=this.sprite.getBounds();this.sprite.x=a.x+(this.sprite.x-b.centerX),this.sprite.y=a.y+(this.sprite.y-b.centerY),this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y)}else this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y);this.updateDrag(a),this.bringToTop&&this.sprite.bringToTop(),this.sprite.events.onDragStart.dispatch(this.sprite,a)},stopDrag:function(a){this.isDragged=!1,this._draggedPointerID=-1,this._pointerData[a.id].isDragged=!1,this.snapOnRelease&&(this.sprite.fixedToCamera?(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY):(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),this.sprite.events.onDragStop.dispatch(this.sprite,a),this.checkPointerOver(a)===!1&&this._pointerOutHandler(a)},setDragLock:function(a,b){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!0),this.allowHorizontalDrag=a,this.allowVerticalDrag=b},enableSnap:function(a,b,c,d,e,f){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.snapX=a,this.snapY=b,this.snapOffsetX=e,this.snapOffsetY=f,this.snapOnDrag=c,this.snapOnRelease=d},disableSnap:function(){this.snapOnDrag=!1,this.snapOnRelease=!1},checkBoundsRect:function(){this.sprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.ythis.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.xthis.boundsRect.right&&(this.sprite.x=this.boundsRect.right-this.sprite.width),this.sprite.ythis.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-this.sprite.height))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsSprite.camerOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.camerOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.ythis.boundsSprite.camerOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.camerOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.xthis.boundsSprite.x+this.boundsSprite.width&&(this.sprite.x=this.boundsSprite.x+this.boundsSprite.width-this.sprite.width),this.sprite.ythis.boundsSprite.y+this.boundsSprite.height&&(this.sprite.y=this.boundsSprite.y+this.boundsSprite.height-this.sprite.height))}},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.onEnterBounds=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,e,f){return new b.Group(this.game,a,c,d,e,f)},physicsGroup:function(a,c,d,e){return new b.Group(this.game,c,d,e,!0,a)},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))},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(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,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator=function(a){this.game=a,this.world=this.game.world},b.GameObjectCreator.prototype={image:function(a,c,d,e){return new b.Image(this.game,a,c,d,e)},sprite:function(a,c,d,e){return new b.Sprite(this.game,a,c,d,e)},tween:function(a){return new b.Tween(a,this.game)},group:function(a,c,d,e,f){return new b.Group(this.game,null,c,d,e,f)},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){return new b.TileSprite(this.game,a,c,d,e,f,g)},text:function(a,c,d,e){return new b.Text(this.game,a,c,d,e)},button:function(a,c,d,e,f,g,h,i,j){return new b.Button(this.game,a,c,d,e,f,g,h,i,j)},graphics:function(a,c){return new b.Graphics(this.game,a,c)},emitter:function(a,c,d){return new b.Particles.Arcade.Emitter(this.game,a,c,d)},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(this.game,a,c,d,e,f,g,h,i,j)},bitmapText:function(a,c,d,e,f){return new b.BitmapText(this.game,a,c,d,e,f)},tilemap:function(a,c,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator.prototype.constructor=b.GameObjectCreator,b.BitmapData=function(a,c,d,e){"undefined"==typeof d&&(d=100),"undefined"==typeof e&&(e=100),this.game=a,this.key=c,this.width=d,this.height=e,this.canvas=b.Canvas.create(d,e,"",!0),this.context=this.canvas.getContext("2d"),this.ctx=this.context,this.imageData=this.context.getImageData(0,0,d,e),this.pixels=this.imageData.data.buffer?this.imageData.data.buffer:this.imageData.data,this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,d,e,"bitmapData",a.rnd.uuid()),this.type=b.BITMAPDATA,this.dirty=!1},b.BitmapData.prototype={add:function(a){if(Array.isArray(a))for(var b=0;b=0&&a<=this.width&&b>=0&&b<=this.height&&(this.pixels[b*this.width+a]=f<<24|e<<16|d<<8|c,this.context.putImageData(this.imageData,0,0),this.dirty=!0)},setPixel:function(a,b,c,d,e){this.setPixel32(a,b,c,d,e,255)},getPixel:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixel32:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixels:function(a){return this.context.getImageData(a.x,a.y,a.width,a.height)},copyPixels:function(a,b,c,d){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,b.x,b.y,b.width,b.height,c,d,b.width,b.height)},draw:function(a,b,c){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0,a.width,a.height,b,c,a.width,a.height)},alphaMask:function(a,b){var c=this.context.globalCompositeOperation;"string"==typeof b&&(b=this.game.cache.getImage(b)),b&&this.context.drawImage(b,0,0),this.context.globalCompositeOperation="source-atop","string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0),this.context.globalCompositeOperation=c},render:function(){this.game.renderType===b.WEBGL&&this.dirty&&(PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1)}},b.BitmapData.prototype.constructor=b.BitmapData,b.Sprite=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.name="",this.type=b.SPRITE,this.z=0,this.events=new b.Events(this),this.animations=new b.AnimationManager(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.body=null,this.health=1,this.lifespan=0,this.checkWorldBounds=!1,this.outOfBoundsKill=!1,this.debug=!1,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0],this._bounds=new b.Rectangle -},b.Sprite.prototype=Object.create(PIXI.Sprite.prototype),b.Sprite.prototype.constructor=b.Sprite,b.Sprite.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;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA?this.ninja=new b.Physics.Ninja(this.game):a===b.Physics.BOX2D&&null===this.box2d||a===b.Physics.CHIPMUNK&&null===this.chipmunk},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);return a!==this._sx||b!==this._sy?(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),!0):!1},preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this.updateBounds()||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds())},postUpdate:function(){this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dx<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0)},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight) -},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"new velocity x: "+b.newVelocity.x.toFixed(2),"y: "+b.newVelocity.y.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.prototype={create:function(a,b,c,d,e){return"undefined"==typeof group&&(group=this.game.world),this.width=b,this.height=c,this.setTileSize(d,e),this.layers.length=0,this.createBlankLayer(a,b,c,d,e,group)},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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},b.Sprite.prototype.overlap=function(a){return b.Rectangle.intersects(this.getBounds(),a.getBounds())},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),Object.defineProperty(b.Sprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.TileSprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.TileSprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a=""); +var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){if(a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA)this.ninja=new b.Physics.Ninja(this.game);else{if(a===b.Physics.BOX2D&&null===this.box2d)throw new Error("The Box2D physics system has not been implemented yet.");if(a===b.Physics.CHIPMUNK&&null===this.chipmunk)throw new Error("The Chipmunk physics system has not been implemented yet.")}},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this.phase=0,this._reset=!0,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);(a!==this._sx||b!==this._sy)&&(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this._reset=!0)},preUpdate:function(){this.phase=1,this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.updateBounds(),this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this._reset||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds()),this._dx=this.deltaX(),this._dy=this.deltaY(),this._reset=!1},postUpdate:function(){this.phase=2,this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0) +},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"deltaX: "+b._dx.toFixed(2),"deltaY: "+b._dy.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e */ @@ -490,8 +492,8 @@ PIXI.Matrix2 = PIXI.determineMatrixArrayType(); /* * @class Matrix -* The Matrix class is now an object, which makes it a lot faster, -* here is a representation of it : +* The Matrix class is now an object, which makes it a lot faster, +* here is a representation of it : * | a | b | tx| * | c | c | ty| * | 0 | 0 | 1 | @@ -564,6 +566,7 @@ PIXI.Matrix.prototype.toArray = function(transpose) }; PIXI.identityMatrix = new PIXI.Matrix(); + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -688,7 +691,7 @@ PIXI.DisplayObject = function() /** * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * + * * @property defaultCursor * @type String * @@ -728,7 +731,7 @@ PIXI.DisplayObject = function() this._cr = 1; /** - * The area the filter is applied to + * The area the filter is applied to * * @property filterArea * @type Rectangle @@ -1082,11 +1085,11 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) { this._cacheAsBitmap = false; var bounds = this.getLocalBounds(); - + if(!this._cachedSprite) { var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - + this._cachedSprite = new PIXI.Sprite(renderTexture); this._cachedSprite.worldTransform = this.worldTransform; } @@ -1111,7 +1114,7 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._destroyCachedSprite = function() @@ -1137,7 +1140,7 @@ PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) @@ -1308,7 +1311,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) this.children[index1] = child2; this.children[index2] = child; - + }; /** @@ -1354,7 +1357,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) /** -* Removes all the children +* Removes all the children * * @method removeAll * NOT tested yet @@ -1367,7 +1370,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { this.removeChild(this.children[i]); } - + }; */ /* @@ -1426,13 +1429,13 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function(matrix) for(var i=0,j=this.children.length; i https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5512,7 +5516,7 @@ PIXI.WebGLSpriteBatch = function(gl) { /** - * + * * * @property vertSize * @type Number @@ -5549,7 +5553,7 @@ PIXI.WebGLSpriteBatch = function(gl) * @type Uint16Array */ this.indices = new Uint16Array(numIndices); - + this.lastIndexCount = 0; for (var i=0, j=0; i < numIndices; i += 6, j += 4) @@ -5566,12 +5570,12 @@ PIXI.WebGLSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.setContext(gl); }; /** -* +* * @method setContext * * @param gl {WebGLContext} the current WebGL drawing context @@ -5598,7 +5602,7 @@ PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) }; /** -* +* * @method begin * * @param renderSession {RenderSession} the RenderSession @@ -5612,7 +5616,7 @@ PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) }; /** -* +* * @method end * */ @@ -5622,9 +5626,9 @@ PIXI.WebGLSpriteBatch.prototype.end = function() }; /** -* +* * @method render -* +* * @param sprite {Sprite} the sprite to render when using this spritebatch */ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) @@ -5662,7 +5666,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) var aY = sprite.anchor.y; var w0, w1, h0, h1; - + if (sprite.texture.trim) { // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. @@ -5734,7 +5738,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // increment the batchsize this.currentBatchSize++; @@ -5744,7 +5748,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) /** * Renders a tilingSprite using the spriteBatch * @method renderTilingSprite -* +* * @param sprite {TilingSprite} the tilingSprite to render */ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) @@ -5839,7 +5843,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // xy verticies[index++] = a * w0 + c * h0 + tx; verticies[index++] = d * h0 + b * w0 + ty; @@ -5869,7 +5873,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) * Renders the content and empties the current batch * * @method flush -* +* */ PIXI.WebGLSpriteBatch.prototype.flush = function() { @@ -5877,12 +5881,12 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() if (this.currentBatchSize===0)return; var gl = this.gl; - + // bind the current texture gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id] || PIXI.createWebGLTexture(this.currentBaseTexture, gl)); // upload the verts to the buffer - + if(this.currentBatchSize > ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -5896,10 +5900,10 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() // var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); //gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -5908,7 +5912,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() }; /** -* +* * @method stop * */ @@ -5918,7 +5922,7 @@ PIXI.WebGLSpriteBatch.prototype.stop = function() }; /** -* +* * @method start * */ @@ -5952,7 +5956,7 @@ PIXI.WebGLSpriteBatch.prototype.start = function() /** * Sets-up the given blendMode from WebGL's point of view -* @method setBlendMode +* @method setBlendMode * * @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD */ @@ -5961,7 +5965,7 @@ PIXI.WebGLSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -5975,19 +5979,19 @@ PIXI.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; }; /** * @author Mat Groves - * + * * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5997,7 +6001,7 @@ PIXI.WebGLSpriteBatch.prototype.destroy = function() PIXI.WebGLFastSpriteBatch = function(gl) { - + this.vertSize = 10; this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; @@ -6012,7 +6016,7 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.vertices = new Float32Array(numVerts); //index data this.indices = new Uint16Array(numIndices); - + this.vertexBuffer = null; this.indexBuffer = null; @@ -6031,10 +6035,10 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.currentBlendMode = 0; this.renderSession = null; - + this.shader = null; @@ -6087,17 +6091,17 @@ PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) var sprite = children[0]; // if the uvs have not updated then no point rendering just yet! - + // check texture. if(!sprite.texture._uvs)return; - + this.currentBaseTexture = sprite.texture.baseTexture; // check blend mode if(sprite.blendMode !== this.currentBlendMode) { this.setBlendMode(sprite.blendMode); } - + for(var i=0,j= children.length; i ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -6271,11 +6275,11 @@ PIXI.WebGLFastSpriteBatch.prototype.flush = function() gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); } - - + + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -6329,7 +6333,7 @@ PIXI.WebGLFastSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -6352,7 +6356,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) this.transparent = transparent; this.filterStack = []; - + this.offsetX = 0; this.offsetY = 0; @@ -6362,7 +6366,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) // API /** * Initialises the context and the properties -* @method setContext +* @method setContext * @param gl {WebGLContext} the current WebGL drawing context */ PIXI.WebGLFilterManager.prototype.setContext = function(gl) @@ -6374,10 +6378,10 @@ PIXI.WebGLFilterManager.prototype.setContext = function(gl) }; /** -* +* * @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} +* @param renderSession {RenderSession} +* @param buffer {ArrayBuffer} */ PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) { @@ -6628,7 +6632,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function() // bind the buffer gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - // set the blend mode! + // set the blend mode! //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) // set texture @@ -6777,7 +6781,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() var gl = this.gl; this.filterStack = null; - + this.offsetX = 0; this.offsetY = 0; @@ -6785,7 +6789,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() for (var i = 0; i < this.texturePool.length; i++) { this.texturePool.destroy(); } - + this.texturePool = null; //destroy buffers.. @@ -6840,7 +6844,7 @@ PIXI.FilterTexture = function(gl, width, height) PIXI.FilterTexture.prototype.clear = function() { var gl = this.gl; - + gl.clearColor(0,0,0, 0); gl.clear(gl.COLOR_BUFFER_BIT); }; @@ -6882,8 +6886,8 @@ PIXI.FilterTexture.prototype.destroy = function() /** * @author Mat Groves - * - * + * + * */ /** * A set of functions used to handle masking @@ -6892,7 +6896,7 @@ PIXI.FilterTexture.prototype.destroy = function() */ PIXI.CanvasMaskManager = function() { - + }; /** @@ -6905,7 +6909,7 @@ PIXI.CanvasMaskManager = function() PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, context) { context.save(); - + var cacheAlpha = maskData.alpha; var transform = maskData.worldTransform; @@ -6929,10 +6933,11 @@ PIXI.CanvasMaskManager.prototype.popMask = function(context) context.restore(); }; + /** * @author Mat Groves - * - * + * + * */ /** @@ -6946,13 +6951,13 @@ PIXI.CanvasTinter = function() }; //PIXI.CanvasTinter.cachTint = true; - + /** - * Basically this method just needs a sprite and a color and tints the sprite + * Basically this method just needs a sprite and a color and tints the sprite * with the given color - * - * @method getTintedTexture + * + * @method getTintedTexture * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with */ @@ -6964,17 +6969,17 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) color = PIXI.CanvasTinter.roundColor(color); var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + texture.tintCache = texture.tintCache || {}; if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; // clone texture.. var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - + //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - + PIXI.CanvasTinter.tintMethod(texture, color, canvas); if(PIXI.CanvasTinter.convertTintToImage) @@ -6987,7 +6992,7 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) } else { - + texture.tintCache[stringColor] = canvas; // if we are not converting the texture to an image then we need to lose the reference to the canvas PIXI.CanvasTinter.canvas = null; @@ -7014,9 +7019,9 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) canvas.height = frame.height; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + context.fillRect(0, 0, frame.width, frame.height); - + context.globalCompositeOperation = "multiply"; context.drawImage(texture.baseTexture.source, @@ -7030,7 +7035,7 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) frame.height); context.globalCompositeOperation = "destination-atop"; - + context.drawImage(texture.baseTexture.source, frame.x, frame.y, @@ -7058,8 +7063,8 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - - + + context.globalCompositeOperation = "copy"; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); context.fillRect(0, 0, frame.width, frame.height); @@ -7075,7 +7080,7 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) frame.width, frame.height); - + //context.globalCompositeOperation = "copy"; }; @@ -7095,7 +7100,7 @@ PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - + context.globalCompositeOperation = "copy"; context.drawImage(texture.baseTexture.source, frame.x, @@ -7143,7 +7148,7 @@ PIXI.CanvasTinter.roundColor = function(color) }; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property cacheStepsPerColorChannel @@ -7151,7 +7156,7 @@ PIXI.CanvasTinter.roundColor = function(color) */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property convertTintToImage @@ -7224,7 +7229,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent) if(!PIXI.blendModesCanvas) { PIXI.blendModesCanvas = []; - + if(PIXI.canUseNewCanvasBlendModes()) { PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; @@ -7860,7 +7865,7 @@ PIXI.Graphics = function() * @default 0xFFFFFF */ this.tint = 0xFFFFFF;// * Math.random(); - + /** * The blend mode to be applied to the graphic shape * @@ -7869,7 +7874,7 @@ PIXI.Graphics = function() * @default PIXI.blendModes.NORMAL; */ this.blendMode = PIXI.blendModes.NORMAL; - + /** * Current path * @@ -8145,7 +8150,7 @@ PIXI.Graphics.prototype.generateTexture = function() var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); canvasBuffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); return texture; @@ -8155,23 +8160,23 @@ PIXI.Graphics.prototype.generateTexture = function() * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + if(this._cacheAsBitmap) { - + if(this.dirty) { this._generateCachedSprite(); // we will also need to update the texture on the gpu too! PIXI.updateWebGLTexture(this._cachedSprite.texture.baseTexture, renderSession.gl); - + this.dirty = false; } @@ -8185,7 +8190,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._mask)renderSession.maskManager.pushMask(this.mask, renderSession); if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - + // check blend mode if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) { @@ -8193,9 +8198,9 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); } - + PIXI.WebGLGraphics.renderGraphics(this, renderSession); - + // only render if it has children! if(this.children.length) { @@ -8212,7 +8217,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._filters)renderSession.filterManager.popFilter(); if(this._mask)renderSession.maskManager.popMask(renderSession); - + renderSession.drawCount++; renderSession.spriteBatch.start(); @@ -8223,17 +8228,17 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderCanvas = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + var context = renderSession.context; var transform = this.worldTransform; - + if(this.blendMode !== renderSession.currentBlendMode) { renderSession.currentBlendMode = this.blendMode; @@ -8331,7 +8336,7 @@ PIXI.Graphics.prototype.getBounds = function( matrix ) */ PIXI.Graphics.prototype.updateBounds = function() { - + var minX = Infinity; var maxX = -Infinity; @@ -8409,7 +8414,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() { var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - + this._cachedSprite = new PIXI.Sprite(texture); this._cachedSprite.buffer = canvasBuffer; @@ -8426,7 +8431,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() // this._cachedSprite.buffer.context.save(); this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); // this._cachedSprite.buffer.context.restore(); }; @@ -8496,7 +8501,7 @@ PIXI.TilingSprite = function(texture, width, height) * @type Point */ this.tileScaleOffset = new PIXI.Point(1,1); - + /** * The offset position of the image that is being tiled * @@ -8523,7 +8528,7 @@ PIXI.TilingSprite = function(texture, width, height) * @default 0xFFFFFF */ this.tint = 0xFFFFFF; - + /** * The blend mode to be applied to the sprite * @@ -8550,7 +8555,7 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { return this._width; }, set: function(value) { - + this._width = value; } }); @@ -8616,14 +8621,14 @@ PIXI.TilingSprite.prototype.setTexture = function(texture) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) { if(this.visible === false || this.alpha === 0)return; - + var i,j; if(this.mask) @@ -8652,7 +8657,7 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) } } else renderSession.spriteBatch.renderTilingSprite(this); - + // simple render children! for(i=0,j=this.children.length; i * @copyright 2014 Photon Storm Ltd. @@ -9604,7 +9611,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix(); * * Phaser - http://www.phaser.io * -* v2.0.2 "Ghealdan" - Built: Tue Mar 25 2014 05:24:26 +* v2.0.2 "Ghealdan" - Built: Fri Mar 28 2014 01:30:50 * * By Richard Davey http://www.photonstorm.com @photonstorm * @@ -9634,6 +9641,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix(); var root = this; +/* global Phaser:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -9649,70 +9657,70 @@ var Phaser = Phaser || { DEV_VERSION: '2.0.2', GAMES: [], - AUTO: 0, - CANVAS: 1, - WEBGL: 2, - HEADLESS: 3, - - NONE: 0, - LEFT: 1, - RIGHT: 2, - UP: 3, - DOWN: 4, - - SPRITE: 0, - BUTTON: 1, - IMAGE: 2, - GRAPHICS: 3, - TEXT: 4, - TILESPRITE: 5, - BITMAPTEXT: 6, - GROUP: 7, - RENDERTEXTURE: 8, - TILEMAP: 9, - TILEMAPLAYER: 10, - EMITTER: 11, - POLYGON: 12, - BITMAPDATA: 13, - CANVAS_FILTER: 14, - WEBGL_FILTER: 15, - ELLIPSE: 16, - SPRITEBATCH: 17, - RETROFONT: 18, - - // The various blend modes supported by pixi / phaser - 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 - }, - - // The scale modes - scaleModes: { - DEFAULT:0, - LINEAR:0, - NEAREST:1 - } - -}; - -PIXI.InteractionManager = function (dummy) { - // We don't need this in Pixi, so we've removed it to save space - // however the Stage object expects a reference to it, so here is a dummy entry. + AUTO: 0, + CANVAS: 1, + WEBGL: 2, + HEADLESS: 3, + + NONE: 0, + LEFT: 1, + RIGHT: 2, + UP: 3, + DOWN: 4, + + SPRITE: 0, + BUTTON: 1, + IMAGE: 2, + GRAPHICS: 3, + TEXT: 4, + TILESPRITE: 5, + BITMAPTEXT: 6, + GROUP: 7, + RENDERTEXTURE: 8, + TILEMAP: 9, + TILEMAPLAYER: 10, + EMITTER: 11, + POLYGON: 12, + BITMAPDATA: 13, + CANVAS_FILTER: 14, + WEBGL_FILTER: 15, + ELLIPSE: 16, + SPRITEBATCH: 17, + RETROFONT: 18, + + // The various blend modes supported by pixi / phaser + 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 + }, + + // The scale modes + scaleModes: { + DEFAULT:0, + LINEAR:0, + NEAREST:1 + } + +}; + +PIXI.InteractionManager = function () { + // We don't need this in Pixi, so we've removed it to save space + // however the Stage object expects a reference to it, so here is a dummy entry. }; /* jshint supernew: true */ @@ -9728,7 +9736,7 @@ PIXI.InteractionManager = function (dummy) { * @static */ Phaser.Utils = { - + /** * Get a unit dimension from a string. * @@ -9789,7 +9797,7 @@ Phaser.Utils = { } return array; - + }, /** @@ -9797,7 +9805,7 @@ Phaser.Utils = { * pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) * @method Phaser.Utils.pad - * @param {string} str - The target string. + * @param {string} str - The target string. * @param {number} len - The number of characters to be added. * @param {number} pad - The string to pad it out with (defaults to a space). * @param {number} [dir=3] The direction dir = 1 (left), 2 (right), 3 (both). @@ -9816,17 +9824,17 @@ Phaser.Utils = { switch (dir) { case 1: - str = Array(len + 1 - str.length).join(pad) + str; + str = new Array(len + 1 - str.length).join(pad) + str; break; case 3: var right = Math.ceil((padlen = len - str.length) / 2); var left = padlen - right; - str = Array(left+1).join(pad) + str + Array(right+1).join(pad); + str = new Array(left+1).join(pad) + str + new Array(right+1).join(pad); break; default: - str = str + Array(len + 1 - str.length).join(pad); + str = str + new Array(len + 1 - str.length).join(pad); break; } } @@ -9857,7 +9865,7 @@ Phaser.Utils = { // the "constructor" property of certain host objects, ie. |window.location| // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 try { - if (obj.constructor && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } @@ -9908,7 +9916,7 @@ Phaser.Utils = { --i; } - for ( ; i < length; i++ ) + for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) @@ -9962,6 +9970,7 @@ Phaser.Utils = { */ if (typeof Function.prototype.bind != 'function') { + /* jshint freeze: false */ Function.prototype.bind = (function () { var slice = Array.prototype.slice; @@ -9969,26 +9978,29 @@ if (typeof Function.prototype.bind != 'function') { return function (thisArg) { var target = this, boundArgs = slice.call(arguments, 1); - + if (typeof target != 'function') { throw new TypeError(); } - + function bound() { var args = boundArgs.concat(slice.call(arguments)); target.apply(this instanceof bound ? this : thisArg, args); } - + bound.prototype = (function F(proto) { - proto && (F.prototype = proto); + if (proto) + { + F.prototype = proto; + } if (!(this instanceof F)) { return new F; } })(target.prototype); - + return bound; }; })(); @@ -10002,7 +10014,7 @@ if (!Array.isArray) Array.isArray = function (arg) { return Object.prototype.toString.call(arg) == '[object Array]'; - } + }; } /** @@ -10126,7 +10138,7 @@ Phaser.Circle.prototype = { */ distance: function (dest, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -10254,7 +10266,7 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", { * @property {number} radius - Gets or sets the radius of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "radius", { - + get: function () { return this._radius; }, @@ -10277,7 +10289,7 @@ Object.defineProperty(Phaser.Circle.prototype, "radius", { * @propety {number} left - Gets or sets the value of the leftmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "left", { - + get: function () { return this.x - this._radius; }, @@ -10335,7 +10347,7 @@ Object.defineProperty(Phaser.Circle.prototype, "top", { get: function () { return this.y - this._radius; }, - + set: function (value) { if (value > this.y) @@ -10565,7 +10577,7 @@ Phaser.Point = function (x, y) { * @property {number} x - The x coordinate of the point. */ this.x = x; - + /** * @property {number} y - The y coordinate of the point. */ @@ -10607,7 +10619,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -10623,7 +10635,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -10697,7 +10709,7 @@ Phaser.Point.prototype = { this.x = Phaser.Math.clamp(this.x, min, max); return this; - + }, /** @@ -10711,7 +10723,7 @@ Phaser.Point.prototype = { this.y = Phaser.Math.clamp(this.y, min, max); return this; - + }, /** @@ -10955,7 +10967,7 @@ Phaser.Point.equals = function (a, b) { */ Phaser.Point.distance = function (a, b, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -11030,17 +11042,17 @@ Phaser.Rectangle = function (x, y, width, height) { * @property {number} x - The x coordinate of the top-left corner of the Rectangle. */ this.x = x; - + /** * @property {number} y - The y coordinate of the top-left corner of the Rectangle. */ this.y = y; - + /** * @property {number} width - The width of the Rectangle. */ this.width = width; - + /** * @property {number} height - The height of the Rectangle. */ @@ -11065,7 +11077,7 @@ Phaser.Rectangle.prototype = { return this; }, - + /** * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. * @method Phaser.Rectangle#offsetPoint @@ -11077,7 +11089,7 @@ Phaser.Rectangle.prototype = { return this.offset(point.x, point.y); }, - + /** * Sets the members of Rectangle to the specified values. * @method Phaser.Rectangle#setTo @@ -11108,7 +11120,7 @@ Phaser.Rectangle.prototype = { this.y = Math.floor(this.y); }, - + /** * Runs Math.floor() on the x, y, width and height values of this Rectangle. * @method Phaser.Rectangle#floorAll @@ -11180,7 +11192,7 @@ Phaser.Rectangle.prototype = { * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. * @method Phaser.Rectangle#clone * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. - * @return {Phaser.Rectangle} + * @return {Phaser.Rectangle} */ clone: function (output) { @@ -11328,11 +11340,11 @@ Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", { * @property {number} bottom - The sum of the y and height properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { - + get: function () { return this.y + this.height; }, - + set: function (value) { if (value <= this.y) { this.height = 0; @@ -11349,7 +11361,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { * @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { - + get: function () { return new Phaser.Point(this.right, this.bottom); }, @@ -11367,7 +11379,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { * @property {number} left - The x coordinate of the left of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "left", { - + get: function () { return this.x; }, @@ -11389,7 +11401,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "left", { * @property {number} right - The sum of the x and width properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "right", { - + get: function () { return this.x + this.width; }, @@ -11411,7 +11423,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { - + get: function () { return this.width * this.height; } @@ -11425,7 +11437,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { - + get: function () { return (this.width * 2) + (this.height * 2); } @@ -11438,7 +11450,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { * @property {number} centerX - The x coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { - + get: function () { return this.x + this.halfWidth; }, @@ -11455,7 +11467,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { * @property {number} centerY - The y coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { - + get: function () { return this.y + this.halfHeight; }, @@ -11473,7 +11485,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { * @property {number} top - The y coordinate of the top of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "top", { - + get: function () { return this.y; }, @@ -11499,7 +11511,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { get: function () { return new Phaser.Point(this.x, this.y); }, - + set: function (value) { this.x = value.x; this.y = value.y; @@ -11509,12 +11521,12 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { /** * Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. -* If set to true then all of the Rectangle properties are set to 0. +* If set to true then all of the Rectangle properties are set to 0. * @name Phaser.Rectangle#empty * @property {boolean} empty - Gets or sets the Rectangles empty state. */ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { - + get: function () { return (!this.width || !this.height); }, @@ -11525,7 +11537,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { { this.setTo(0, 0, 0, 0); } - + } }); @@ -11771,7 +11783,7 @@ Phaser.Rectangle.union = function (a, b, output) { } return output.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right) - Math.min(a.left, b.left), Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)); - + }; // Because PIXI uses its own Rectangle, we'll replace it with ours to avoid duplicating code or confusion. @@ -11840,12 +11852,12 @@ Phaser.Line.prototype = { * @method Phaser.Line#fromSprite * @param {Phaser.Sprite} startSprite - The coordinates of this Sprite will be set to the Line.start point. * @param {Phaser.Sprite} endSprite - The coordinates of this Sprite will be set to the Line.start point. - * @param {boolean} [useCenter=true] - If true it will use startSprite.center.x, if false startSprite.x. + * @param {boolean} [useCenter=false] - If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class. * @return {Phaser.Line} This line object */ fromSprite: function (startSprite, endSprite, useCenter) { - if (typeof useCenter === 'undefined') { useCenter = true; } + if (typeof useCenter === 'undefined') { useCenter = false; } if (useCenter) { @@ -11938,7 +11950,7 @@ Phaser.Line.prototype = { while (!((x1 == x2) && (y1 == y2))) { var e2 = err << 1; - + if (e2 > -dy) { err -= dy; @@ -12157,7 +12169,7 @@ Phaser.Line.intersectsPoints = function (a, b, e, f, asSegment, result) { result.x = ((b1 * c2) - (b2 * c1)) / denom; result.y = ((a2 * c1) - (a1 * c2)) / denom; - + if (asSegment) { if (Math.pow((result.x - b.x) + (result.y - b.y), 2) > Math.pow((a.x - b.x) + (a.y - b.y), 2)) @@ -12358,7 +12370,7 @@ Phaser.Ellipse.prototype.constructor = Phaser.Ellipse; * @propety {number} left - Gets or sets the value of the leftmost point of the ellipse. */ Object.defineProperty(Phaser.Ellipse.prototype, "left", { - + get: function () { return this.x; }, @@ -12406,7 +12418,7 @@ Object.defineProperty(Phaser.Ellipse.prototype, "top", { get: function () { return this.y; }, - + set: function (value) { this.y = value; } @@ -12511,7 +12523,7 @@ PIXI.Ellipse = Phaser.Ellipse; /** * Creates a new Polygon. You have to provide a list of points. -* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], +* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be all the points of the polygon e.g. `new Phaser.Polygon(new Phaser.Point(), new Phaser.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Phaser.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @@ -12633,7 +12645,7 @@ PIXI.Polygon = Phaser.Polygon; * @param {number} height - The height of the view rectangle */ Phaser.Camera = function (game, id, x, y, width, height) { - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -12651,7 +12663,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { this.id = 0; /** - * Camera view. + * Camera view. * The view into the world we wish to render (by default the game dimensions). * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render. * Objects outside of this view are not rendered if set to camera cull. @@ -12710,7 +12722,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { * @property {Phaser.Point} scale - The scale of the display object to which all game objects are added. Set by World.boot */ this.scale = null; - + }; /** @@ -12921,7 +12933,7 @@ Phaser.Camera.prototype = { /** * A helper function to set both the X and Y properties of the camera at once * without having to use game.camera.x and game.camera.y. - * + * * @method Phaser.Camera#setPosition * @param {number} x - X position. * @param {number} y - Y position. @@ -12940,7 +12952,7 @@ Phaser.Camera.prototype = { /** * Sets the size of the view rectangle given the width and height in parameters. - * + * * @method Phaser.Camera#setSize * @param {number} width - The desired width. * @param {number} height - The desired height. @@ -12954,7 +12966,7 @@ Phaser.Camera.prototype = { /** * Resets the camera back to 0,0 and un-follows any object it may have been tracking. - * + * * @method Phaser.Camera#reset */ reset: function () { @@ -12979,7 +12991,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { get: function () { return this.view.x; }, - + set: function (value) { this.view.x = value; @@ -12998,7 +13010,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { * @property {number} y - Gets or sets the cameras y position. */ Object.defineProperty(Phaser.Camera.prototype, "y", { - + get: function () { return this.view.y; }, @@ -13069,12 +13081,12 @@ Phaser.State = function () { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = null; - + /** * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory. */ this.add = null; - + /** * @property {Phaser.GameObjectCreator} make - Reference to the GameObjectCreator. */ @@ -13084,32 +13096,32 @@ Phaser.State = function () { * @property {Phaser.Camera} camera - A handy reference to world.camera. */ this.camera = null; - + /** * @property {Phaser.Cache} cache - Reference to the assets cache. */ this.cache = null; - + /** * @property {Phaser.Input} input - Reference to the input manager */ this.input = null; - + /** * @property {Phaser.Loader} load - Reference to the assets loader. */ this.load = null; - + /** * @property {Phaser.Math} math - Reference to the math helper. */ this.math = null; - + /** * @property {Phaser.SoundManager} sound - Reference to the sound manager. */ this.sound = null; - + /** * @property {Phaser.ScaleManager} scale - Reference to the game scale manager. */ @@ -13119,27 +13131,27 @@ Phaser.State = function () { * @property {Phaser.Stage} stage - Reference to the stage. */ this.stage = null; - + /** * @property {Phaser.TimeManager} time - Reference to game clock. */ this.time = null; - + /** * @property {Phaser.TweenManager} tweens - Reference to the tween manager. */ this.tweens = null; - + /** * @property {Phaser.World} world - Reference to the world. */ this.world = null; - + /** * @property {Phaser.Particles} particles - The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it. */ this.particles = null; - + /** * @property {Phaser.Physics.World} physics - Reference to the physics manager. */ @@ -13157,7 +13169,7 @@ Phaser.State.prototype = { /** * Override this method to add some load operations. * If you need to use the loader, you may need to use them here. - * + * * @method Phaser.State#preload */ preload: function () { @@ -13165,7 +13177,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#loadUpdate */ loadUpdate: function () { @@ -13173,7 +13185,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#loadRender */ loadRender: function () { @@ -13182,7 +13194,7 @@ Phaser.State.prototype = { /** * This method is called after the game engine successfully switches states. * Feel free to add any setup code here (do not load anything here, override preload() instead). - * + * * @method Phaser.State#create */ create: function () { @@ -13190,7 +13202,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#update */ update: function () { @@ -13198,7 +13210,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#render */ render: function () { @@ -13206,7 +13218,7 @@ Phaser.State.prototype = { /** * This method will be called when game paused. - * + * * @method Phaser.State#paused */ paused: function () { @@ -13233,7 +13245,7 @@ Phaser.State.prototype.constructor = Phaser.State; /** * The State Manager is responsible for loading, setting up and switching game states. -* +* * @class Phaser.StateManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. @@ -13300,7 +13312,7 @@ Phaser.StateManager = function (game, pendingState) { * @property {function} onPreloadCallback - This will be called when init states (loading assets...). */ this.onPreloadCallback = null; - + /** * @property {function} onCreateCallback - This will be called when create states (setup states...). */ @@ -13481,7 +13493,7 @@ Phaser.StateManager.prototype = { } }, - + /** * Used by onInit and onShutdown when those functions don't exist on the state * @method Phaser.StateManager#dummy @@ -13844,7 +13856,7 @@ Phaser.LinkedList = function () { * @default */ this.last = null; - + /** * @property {object} game - Number of elements in the list. * @default @@ -13857,7 +13869,7 @@ Phaser.LinkedList.prototype = { /** * Adds a new element to this linked list. - * + * * @method Phaser.LinkedList#add * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through. * @return {object} The child that was added. @@ -13890,7 +13902,7 @@ Phaser.LinkedList.prototype = { /** * Removes the given element from this linked list if it exists. - * + * * @method Phaser.LinkedList#remove * @param {object} child - The child to be removed from the list. */ @@ -13933,7 +13945,7 @@ Phaser.LinkedList.prototype = { /** * Calls a function on all members of this list, using the member as the context for the callback. * The function must exist on the member. - * + * * @method Phaser.LinkedList#callAll * @param {function} callback - The function to call. */ @@ -13945,7 +13957,7 @@ Phaser.LinkedList.prototype = { } var entity = this.first; - + do { if (entity && entity[callback]) @@ -13956,7 +13968,7 @@ Phaser.LinkedList.prototype = { entity = entity.next; } - while(entity != this.last.next) + while(entity != this.last.next); } @@ -13983,7 +13995,7 @@ Phaser.Signal = function () { * @private */ this._bindings = []; - + /** * @property {any} _prevParams - Internal variable. * @private @@ -14013,7 +14025,7 @@ Phaser.Signal.prototype = { memorize: false, /** - * @property {boolean} _shouldPropagate + * @property {boolean} _shouldPropagate * @private */ _shouldPropagate: true, @@ -14034,7 +14046,7 @@ Phaser.Signal.prototype = { */ validateListener: function (listener, fnName) { if (typeof listener !== 'function') { - throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) ); + throw new Error('listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName)); } }, @@ -14055,14 +14067,14 @@ Phaser.Signal.prototype = { if (prevIndex !== -1) { binding = this._bindings[prevIndex]; if (binding.isOnce() !== isOnce) { - throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.'); + throw new Error('You cannot add' + (isOnce ? '' : 'Once') + '() then add' + (!isOnce ? '' : 'Once') + '() the same listener without removing the relationship first.'); } } else { binding = new Phaser.SignalBinding(this, listener, isOnce, listenerContext, priority); this._addBinding(binding); } - if (this.memorize && this._prevParams){ + if (this.memorize && this._prevParams) { binding.execute(this._prevParams); } @@ -14070,7 +14082,7 @@ Phaser.Signal.prototype = { }, /** - * @method Phaser.Signal#_addBinding + * @method Phaser.Signal#_addBinding * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener. * @private */ @@ -14101,7 +14113,7 @@ Phaser.Signal.prototype = { /** * Check if listener was attached to Signal. - * + * * @method Phaser.Signal#has * @param {Function} listener - Signal handler function. * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -14113,7 +14125,7 @@ Phaser.Signal.prototype = { /** * Add a listener to the signal. - * + * * @method Phaser.Signal#add * @param {function} listener - Signal handler function. * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -14231,7 +14243,7 @@ Phaser.Signal.prototype = { //execute all callbacks until end of the list or until a callback returns `false` or stops propagation //reverse loop since listeners with higher priority will be added at the end of the list do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false); - + }, /** @@ -14338,8 +14350,8 @@ Phaser.SignalBinding.prototype = { /** * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters). - * @property {array|null} params - * @default + * @property {array|null} params + * @default */ params: null, @@ -14350,13 +14362,13 @@ Phaser.SignalBinding.prototype = { * @param {array} [paramsArr] - Array of parameters that should be passed to the listener. * @return {any} Value returned by the listener. */ - execute: function (paramsArr) { + execute: function(paramsArr) { var handlerReturn, params; if (this.active && !!this._listener) { - params = this.params? this.params.concat(paramsArr) : paramsArr; + params = this.params ? this.params.concat(paramsArr) : paramsArr; handlerReturn = this._listener.apply(this.context, params); if (this._isOnce) @@ -14440,9 +14452,9 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Filter template to use for any Phaser filter development. -* +* * @class Phaser.Filter * @classdesc Phaser - Filter * @constructor @@ -14461,8 +14473,8 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @property {number} type - The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER. * @default */ - this.type = Phaser.WEBGL_FILTER; - + this.type = Phaser.WEBGL_FILTER; + /** * An array of passes - some filters contain a few steps this array simply stores the steps in a linear fashion. * For example the blur filter has two passes blurX and blurY. @@ -14470,7 +14482,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @private */ this.passes = [this]; - + /** * @property {array} shaders - Array an array of shaders. * @private @@ -14499,7 +14511,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { mouse: { type: '2f', value: { x: 0.0, y: 0.0 }} }; - + /** * @property {array} fragmentSrc - The fragment shader code. */ @@ -14561,7 +14573,7 @@ Phaser.Filter.prototype = { destroy: function () { this.game = null; - + } }; @@ -14606,9 +14618,9 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Plugin template to use for any Phaser plugin development. -* +* * @class Phaser.Plugin * @classdesc Phaser - Plugin * @constructor @@ -14623,30 +14635,30 @@ Phaser.Plugin = function (game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null. */ this.parent = parent; - + /** * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped. * @default */ this.active = false; - + /** * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped. * @default */ this.visible = false; - + /** * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method. * @default */ this.hasPreUpdate = false; - + /** * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method. * @default @@ -14658,13 +14670,13 @@ Phaser.Plugin = function (game, parent) { * @default */ this.hasPostUpdate = false; - + /** * @property {boolean} hasRender - A flag to indicate if this plugin has a render method. * @default */ this.hasRender = false; - + /** * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method. * @default @@ -14717,7 +14729,7 @@ Phaser.Plugin.prototype = { this.parent = null; this.active = false; this.visible = false; - + } }; @@ -14732,9 +14744,9 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins. -* +* * @class Phaser.PluginManager * @classdesc Phaser - PluginManager * @constructor @@ -14747,18 +14759,18 @@ Phaser.PluginManager = function(game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Description} _parent - Description. * @private */ this._parent = parent; - + /** * @property {array} plugins - Description. */ this.plugins = []; - + /** * @property {array} _pluginsLength - Description. * @private @@ -14858,7 +14870,7 @@ Phaser.PluginManager.prototype = { * @param {Phaser.Plugin} plugin - The plugin to be removed. */ remove: function (plugin) { - + if (this._pluginsLength === 0) { return; @@ -14881,7 +14893,7 @@ Phaser.PluginManager.prototype = { * @method Phaser.PluginManager#removeAll */ removeAll: function() { - + for (this._p = 0; this._p < this._pluginsLength; this._p++) { this.plugins[this._p].destroy(); @@ -14893,7 +14905,7 @@ Phaser.PluginManager.prototype = { /** * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#preUpdate */ preUpdate: function () { @@ -14916,11 +14928,11 @@ Phaser.PluginManager.prototype = { /** * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#update */ update: function () { - + if (this._pluginsLength === 0) { return; @@ -14940,11 +14952,11 @@ Phaser.PluginManager.prototype = { * PostUpdate is the last thing to be called before the world render. * In particular, it is called after the world postUpdate, which means the camera has been adjusted. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#postUpdate */ postUpdate: function () { - + if (this._pluginsLength === 0) { return; @@ -14963,7 +14975,7 @@ Phaser.PluginManager.prototype = { /** * Render is called right after the Game Renderer completes, but before the State.render. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#render */ render: function () { @@ -14986,7 +14998,7 @@ Phaser.PluginManager.prototype = { /** * Post-render is called after the Game Renderer and State.render have run. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#postRender */ postRender: function () { @@ -15008,7 +15020,7 @@ Phaser.PluginManager.prototype = { /** * Clear down this PluginManager and null out references - * + * * @method Phaser.PluginManager#destroy */ destroy: function () { @@ -15052,7 +15064,7 @@ Phaser.Stage = function (game, width, height) { * @property {Phaser.Point} offset - Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes) */ this.offset = new Phaser.Point(); - + PIXI.Stage.call(this, 0x000000, false); /** @@ -15122,11 +15134,11 @@ Phaser.Stage.prototype.constructor = Phaser.Stage; /** * This is called automatically after the plugins preUpdate and before the State.update. * Most objects have preUpdate methods and it's where initial movement and positioning is done. -* +* * @method Phaser.Stage#preUpdate */ Phaser.Stage.prototype.preUpdate = function () { - + this.currentRenderOrderID = 0; // This can't loop in reverse, we need the orderID to be in sequence @@ -15137,11 +15149,11 @@ Phaser.Stage.prototype.preUpdate = function () { this.children[i].preUpdate(); } -} +}; /** * This is called automatically after the State.update, but before particles or plugins update. -* +* * @method Phaser.Stage#update */ Phaser.Stage.prototype.update = function () { @@ -15153,14 +15165,14 @@ Phaser.Stage.prototype.update = function () { this.children[i].update(); } -} +}; /** * This is called automatically before the renderer runs and after the plugins have updated. * In postUpdate this is where all the final physics calculatations and object positioning happens. * The objects are processed in the order of the display list. * The only exception to this is if the camera is following an object, in which case that is updated first. -* +* * @method Phaser.Stage#postUpdate */ Phaser.Stage.prototype.postUpdate = function () { @@ -15202,7 +15214,7 @@ Phaser.Stage.prototype.postUpdate = function () { } } -} +}; /** * Parses a Game configuration object. @@ -15255,7 +15267,7 @@ Phaser.Stage.prototype.parseConfig = function (config) { this.backgroundColor = config['backgroundColor']; } -} +}; /** * Initialises the stage and adds the event listeners. @@ -15272,14 +15284,14 @@ Phaser.Stage.prototype.boot = function () { this._onChange = function (event) { return _this.visibilityChange(event); - } + }; Phaser.Canvas.setUserSelect(this.game.canvas, 'none'); Phaser.Canvas.setTouchAction(this.game.canvas, 'none'); this.checkVisibility(); -} +}; /** * Starts a page visibility event listener running, or window.blur/focus if not supported by the browser. @@ -15320,7 +15332,7 @@ Phaser.Stage.prototype.checkVisibility = function () { window.onblur = this._onChange; window.onfocus = this._onChange; -} +}; /** * This method is called when the document visibility is changed. @@ -15357,7 +15369,7 @@ Phaser.Stage.prototype.visibilityChange = function (event) { this.game.gameResumed(event); } -} +}; /** * Sets the background color for the stage. @@ -15372,7 +15384,7 @@ Phaser.Stage.prototype.setBackgroundColor = function(backgroundColor) var hex = this._backgroundColor.toString(16); hex = '000000'.substr(0, 6 - hex.length) + hex; this.backgroundColorString = '#' + hex; -} +}; /** * @name Phaser.Stage#backgroundColor @@ -15409,7 +15421,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { * @property {boolean} smoothed - Set to true to smooth all sprites rendered on this Stage, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Stage.prototype, "smoothed", { - + get: function () { return !PIXI.scaleModes.LINEAR; @@ -15642,7 +15654,7 @@ Phaser.Group.prototype.add = function (child) { return child; -} +}; /** * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object. @@ -15679,7 +15691,7 @@ Phaser.Group.prototype.addAt = function (child, index) { return child; -} +}; /** * Returns the child found at the given index within this Group. @@ -15699,7 +15711,7 @@ Phaser.Group.prototype.getAt = function (index) { return this.getChildAt(index); } -} +}; /** * Automatically creates a new Phaser.Sprite object and adds it to the top of this Group. @@ -15729,9 +15741,9 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { child.alive = exists; this.addChild(child); - + child.z = this.children.length; - + if (child.events) { child.events.onAddedToGroup.dispatch(child, this); @@ -15744,7 +15756,7 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { return child; -} +}; /** * Automatically creates multiple Phaser.Sprite objects and adds them to the top of this Group. @@ -15766,7 +15778,7 @@ Phaser.Group.prototype.createMultiple = function (quantity, key, frame, exists) this.create(0, 0, key, frame, exists); } -} +}; /** * Internal method that re-applies all of the childrens Z values. @@ -15783,7 +15795,7 @@ Phaser.Group.prototype.updateZ = function () { this.children[i].z = i; } -} +}; /** * Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object. @@ -15807,7 +15819,7 @@ Phaser.Group.prototype.next = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object. @@ -15831,7 +15843,7 @@ Phaser.Group.prototype.previous = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Swaps the position of two children in this Group. Both children must be in this Group. @@ -15851,8 +15863,8 @@ Phaser.Group.prototype.swap = function (child1, child2) { } return result; - -} + +}; /** * Brings the given child to the top of this Group so it renders above all other children. @@ -15871,7 +15883,7 @@ Phaser.Group.prototype.bringToTop = function (child) { return child; -} +}; /** * Sends the given child to the bottom of this Group so it renders below all other children. @@ -15890,7 +15902,7 @@ Phaser.Group.prototype.sendToBack = function (child) { return child; -} +}; /** * Moves the given child up one place in this Group unless it's already at the top. @@ -15914,7 +15926,7 @@ Phaser.Group.prototype.moveUp = function (child) { return child; -} +}; /** * Moves the given child down one place in this Group unless it's already at the top. @@ -15938,7 +15950,7 @@ Phaser.Group.prototype.moveDown = function (child) { return child; -} +}; /** * Positions the child found at the given index within this Group to the given x and y coordinates. @@ -15960,7 +15972,7 @@ Phaser.Group.prototype.xy = function (index, x, y) { this.getChildAt(index).y = y; } -} +}; /** * Reverses all children in this Group. Note that this does not propagate, only direct children are re-ordered. @@ -15972,7 +15984,7 @@ Phaser.Group.prototype.reverse = function () { this.children.reverse(); this.updateZ(); -} +}; /** * Get the index position of the given child in this Group. This should always match the childs z property. @@ -15985,7 +15997,7 @@ Phaser.Group.prototype.getIndex = function (child) { return this.children.indexOf(child); -} +}; /** * Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group. @@ -15998,7 +16010,7 @@ Phaser.Group.prototype.getIndex = function (child) { Phaser.Group.prototype.replace = function (oldChild, newChild) { var index = this.getIndex(oldChild); - + if (index !== -1) { if (newChild.parent !== undefined) @@ -16021,7 +16033,7 @@ Phaser.Group.prototype.replace = function (oldChild, newChild) { return temp; } -} +}; /** * Sets the given property to the given value on the child. The operation controls the assignment of the value. @@ -16081,7 +16093,7 @@ Phaser.Group.prototype.setProperty = function (child, key, value, operation) { else if (operation == 4) { child[key[0]][key[1]][key[2]][key[3]] /= value; } } -} +}; /** * This function allows you to quickly set a property on a single child of this Group to a new value. @@ -16107,7 +16119,7 @@ Phaser.Group.prototype.set = function (child, key, value, checkAlive, checkVisib this.setProperty(child, key, value, operation); } -} +}; /** * This function allows you to quickly set the same property across all children of this Group to a new value. @@ -16140,7 +16152,7 @@ Phaser.Group.prototype.setAll = function (key, value, checkAlive, checkVisible, } } -} +}; /** * This function allows you to quickly set the same property across all children of this Group, and any child Groups, to a new value. @@ -16179,7 +16191,7 @@ Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkV } } -} +}; /** * Adds the amount to the given property on all children in this Group. @@ -16195,7 +16207,7 @@ Phaser.Group.prototype.addAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 1); -} +}; /** * Subtracts the amount from the given property on all children in this Group. @@ -16211,7 +16223,7 @@ Phaser.Group.prototype.subAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 2); -} +}; /** * Multiplies the given property by the amount on all children in this Group. @@ -16227,7 +16239,7 @@ Phaser.Group.prototype.multiplyAll = function (property, amount, checkAlive, che this.setAll(property, amount, checkAlive, checkVisible, 3); -} +}; /** * Divides the given property by the amount on all children in this Group. @@ -16243,12 +16255,12 @@ Phaser.Group.prototype.divideAll = function (property, amount, checkAlive, check this.setAll(property, amount, checkAlive, checkVisible, 4); -} +}; /** * Calls a function on all of the children that have exists=true in this Group. * After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback. -* +* * @method Phaser.Group#callAllExists * @param {function} callback - The function that exists on the children that will be called. * @param {boolean} existsValue - Only children with exists=existsValue will be called. @@ -16266,11 +16278,11 @@ Phaser.Group.prototype.callAllExists = function (callback, existsValue) { } } -} +}; /** * Returns a reference to a function that exists on a child of the Group based on the given callback array. -* +* * @method Phaser.Group#callbackFromArray * @param {object} child - The object to inspect. * @param {array} callback - The array of function names. @@ -16319,12 +16331,12 @@ Phaser.Group.prototype.callbackFromArray = function (child, callback, length) { return false; -} +}; /** * Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that) * After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child. -* +* * @method Phaser.Group#callAll * @param {string} method - A string containing the name of the function that will be called. The function must exist on the child. * @param {string} [context=null] - A string containing the context under which the method will be executed. Set to null to default to the child. @@ -16379,7 +16391,7 @@ Phaser.Group.prototype.callAll = function (method, context) { } } -} +}; /** * The core preUpdate - as called by World. @@ -16403,7 +16415,7 @@ Phaser.Group.prototype.preUpdate = function () { return true; -} +}; /** * The core update - as called by World. @@ -16419,7 +16431,7 @@ Phaser.Group.prototype.update = function () { this.children[i].update(); } -} +}; /** * The core postUpdate - as called by World. @@ -16442,25 +16454,22 @@ Phaser.Group.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run. * After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEach(awardBonusGold, this, true, 100, 500) * Note: Currently this will skip any children which are Groups themselves. -* +* * @method Phaser.Group#forEach * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). -* @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. +* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. */ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists) { - if (typeof checkExists === 'undefined') - { - checkExists = false; - } + if (typeof checkExists === 'undefined') { checkExists = false; } var args = Array.prototype.splice.call(arguments, 3); args.unshift(null); @@ -16474,13 +16483,13 @@ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExist } } -} +}; /** * Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachExists(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachExists * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16492,13 +16501,13 @@ Phaser.Group.prototype.forEachExists = function (callback, callbackContext) { this.iterate('exists', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachAlive(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachAlive * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16510,13 +16519,13 @@ Phaser.Group.prototype.forEachAlive = function (callback, callbackContext) { this.iterate('alive', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachDead(bringToLife, this) -* +* * @method Phaser.Group#forEachDead * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16528,7 +16537,7 @@ Phaser.Group.prototype.forEachDead = function (callback, callbackContext) { this.iterate('alive', false, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Call this function to sort the group according to a particular value and order. @@ -16562,7 +16571,7 @@ Phaser.Group.prototype.sort = function (index, order) { this.updateZ(); -} +}; /** * An internal helper function for the sort process. @@ -16593,7 +16602,7 @@ Phaser.Group.prototype.ascendingSortHandler = function (a, b) { } } -} +}; /** * An internal helper function for the sort process. @@ -16617,13 +16626,13 @@ Phaser.Group.prototype.descendingSortHandler = function (a, b) { return 0; } -} +}; /** * Iterates over the children of the Group. When a child has a property matching key that equals the given value, it is considered as a match. * Matched children can be sent to the optional callback, or simply returned or counted. * You can add as many callback parameters as you like, which will all be passed to the callback along with the child, after the callbackContext parameter. -* +* * @method Phaser.Group#iterate * @param {string} key - The child property to check, i.e. 'exists', 'alive', 'health' * @param {any} value - If child.key === this value it will be considered a match. Note that a strict comparison is used. @@ -16674,7 +16683,7 @@ Phaser.Group.prototype.iterate = function (key, value, returnType, callback, cal return null; } -} +}; /** * Call this function to retrieve the first object with exists == (the given state) in the Group. @@ -16692,7 +16701,7 @@ Phaser.Group.prototype.getFirstExists = function (state) { return this.iterate('exists', state, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === true in the group. @@ -16705,7 +16714,7 @@ Phaser.Group.prototype.getFirstAlive = function () { return this.iterate('alive', true, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === false in the group. @@ -16718,7 +16727,7 @@ Phaser.Group.prototype.getFirstDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_CHILD); -} +}; /** * Returns the child at the top of this Group. The top is the one being displayed (rendered) above every other child. @@ -16733,7 +16742,7 @@ Phaser.Group.prototype.getTop = function () { return this.children[this.children.length - 1]; } -} +}; /** * Returns the child at the bottom of this Group. The bottom is the one being displayed (rendered) below every other child. @@ -16748,7 +16757,7 @@ Phaser.Group.prototype.getBottom = function () { return this.children[0]; } -} +}; /** * Call this function to find out how many members of the group are alive. @@ -16760,7 +16769,7 @@ Phaser.Group.prototype.countLiving = function () { return this.iterate('alive', true, Phaser.Group.RETURN_TOTAL); -} +}; /** * Call this function to find out how many members of the group are dead. @@ -16772,7 +16781,7 @@ Phaser.Group.prototype.countDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_TOTAL); -} +}; /** * Returns a member at random from the group. @@ -16794,7 +16803,7 @@ Phaser.Group.prototype.getRandom = function (startIndex, length) { return this.game.math.getRandom(this.children, startIndex, length); -} +}; /** * Removes the given child from this Group and sets its group property to null. @@ -16826,7 +16835,7 @@ Phaser.Group.prototype.remove = function (child) { return true; -} +}; /** * Removes all children from this Group, setting all group properties to null. @@ -16854,7 +16863,7 @@ Phaser.Group.prototype.removeAll = function () { this.cursor = null; -} +}; /** * Removes all children from this Group whos index falls beteen the given startIndex and endIndex values. @@ -16892,7 +16901,7 @@ Phaser.Group.prototype.removeBetween = function (startIndex, endIndex) { this.updateZ(); -} +}; /** * Destroys this Group. Removes all children, then removes the container from the display list and nulls references. @@ -16938,7 +16947,7 @@ Phaser.Group.prototype.destroy = function (destroyChildren, soft) { this.exists = false; } -} +}; /** * @name Phaser.Group#total @@ -16997,7 +17006,7 @@ Object.defineProperty(Phaser.Group.prototype, "angle", { * @property {boolean} fixedToCamera - Set to true to fix this Group to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Group.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -17087,8 +17096,8 @@ Phaser.World = function (game) { * @property {Phaser.Camera} camera - Camera instance. */ this.camera = null; - -} + +}; Phaser.World.prototype = Object.create(Phaser.Group.prototype); Phaser.World.prototype.constructor = Phaser.World; @@ -17111,7 +17120,7 @@ Phaser.World.prototype.boot = function () { this.game.stage.addChild(this); -} +}; /** * Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height. @@ -17144,7 +17153,7 @@ Phaser.World.prototype.setBounds = function (x, y, width, height) { this.game.physics.setBoundsToWorld(); -} +}; /** * Destroyer of worlds. @@ -17156,7 +17165,7 @@ Phaser.World.prototype.shutdown = function () { // World is a Group, so run a soft destruction on this and all children. this.destroy(true, true); -} +}; /** * @name Phaser.World#width @@ -17269,7 +17278,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", { /** * The ScaleManager object is responsible for helping you manage the scaling, resizing and alignment of your game within the browser. * -* @class Phaser.ScaleManager +* @class Phaser.ScaleManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} width - The native width of the game. @@ -17501,7 +17510,7 @@ Phaser.ScaleManager = function (game, width, height) { document.addEventListener('fullscreenchange', function (event) { return _this.fullScreenChange(event); }, false); - + }; /** @@ -17820,7 +17829,7 @@ Phaser.ScaleManager.prototype = { { force = false; } - + if (this.game.device.iPad === false && this.game.device.webApp === false && this.game.device.desktop === false) { if (this.game.device.android && this.game.device.chrome === false) @@ -17839,7 +17848,7 @@ Phaser.ScaleManager.prototype = { { // Set minimum height of content to new window height document.documentElement['style'].minHeight = window.innerHeight + 'px'; - + if (this.incorrectOrientation === true) { this.setMaximum(); @@ -17905,7 +17914,7 @@ Phaser.ScaleManager.prototype = { this.game.canvas.style.width = this.width + 'px'; this.game.canvas.style.height = this.height + 'px'; - + this.game.input.scale.setTo(this.game.width / this.width, this.game.height / this.height); if (this.pageAlignHorizontally) @@ -17937,9 +17946,9 @@ Phaser.ScaleManager.prototype = { } Phaser.Canvas.getOffset(this.game.canvas, this.game.stage.offset); - + this.aspectRatio = this.width / this.height; - + this.scaleFactor.x = this.game.width / this.width; this.scaleFactor.y = this.game.height / this.height; @@ -18018,7 +18027,7 @@ Object.defineProperty(Phaser.ScaleManager.prototype, "isFullScreen", { get: function () { - return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']) + return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']); } @@ -18365,7 +18374,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this._onBoot = function () { return _this.boot(); - } + }; if (document.readyState === 'complete' || document.readyState === 'interactive') { @@ -18895,7 +18904,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Phaser.Input = function (game) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -18904,7 +18913,7 @@ Phaser.Input = function (game) { * @default */ this.hitCanvas = null; - + /** * @property {CanvasRenderingContext2D} hitContext - The context of the pixel perfect hit canvas. * @default @@ -18937,13 +18946,13 @@ Phaser.Input = function (game) { /** * @property {number} multiInputOverride - Controls the expected behaviour when using a mouse and touch together on a multi-input device. - * @default + * @default */ this.multiInputOverride = Phaser.Input.MOUSE_TOUCH_COMBINE; /** * @property {Phaser.Point} position - A point object representing the current position of the Pointer. - * @default + * @default */ this.position = null; @@ -19090,22 +19099,22 @@ Phaser.Input = function (game) { * @property {Pointer} mousePointer - The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game. */ this.mousePointer = null; - + /** * @property {Phaser.Mouse} mouse - The Mouse Input manager. */ this.mouse = null; - + /** * @property {Phaser.Keyboard} keyboard - The Keyboard Input manager. */ this.keyboard = null; - + /** * @property {Phaser.Touch} touch - the Touch Input manager. */ this.touch = null; - + /** * @property {Phaser.MSPointer} mspointer - The MSPointer Input manager. */ @@ -19125,17 +19134,17 @@ Phaser.Input = function (game) { * @property {Phaser.Signal} onDown - A Signal that is dispatched each time a pointer is pressed down. */ this.onDown = null; - + /** * @property {Phaser.Signal} onUp - A Signal that is dispatched each time a pointer is released. */ this.onUp = null; - + /** * @property {Phaser.Signal} onTap - A Signal that is dispatched each time a pointer is tapped. */ this.onTap = null; - + /** * @property {Phaser.Signal} onHold - A Signal that is dispatched each time a pointer is held down. */ @@ -19152,7 +19161,7 @@ Phaser.Input = function (game) { * @private */ this._localPoint = new Phaser.Point(); - + /** * @property {number} _pollCounter - Internal var holding the current poll counter. * @private @@ -19593,7 +19602,7 @@ Phaser.Input.prototype = { wt.d * id * pointer.x + -wt.b * id * pointer.y + (wt.ty * wt.b - wt.tx * wt.d) * id, wt.a * id * pointer.y + -wt.c * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.c) * id ); - + }, /** @@ -19695,7 +19704,7 @@ Object.defineProperty(Phaser.Input.prototype, "x", { * @property {number} y - The Y coordinate of the most recently active pointer. */ Object.defineProperty(Phaser.Input.prototype, "y", { - + get: function () { return this._y; }, @@ -19740,7 +19749,7 @@ Object.defineProperty(Phaser.Input.prototype, "totalInactivePointers", { * @readonly */ Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", { - + get: function () { this.currentPointers = 0; @@ -19801,7 +19810,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { Phaser.Key = function (game, keycode) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -19890,7 +19899,7 @@ Phaser.Key = function (game, keycode) { * @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again). */ this.onUp = new Phaser.Signal(); - + }; Phaser.Key.prototype = { @@ -20061,7 +20070,7 @@ Phaser.Keyboard = function (game) { * @private */ this._keys = []; - + /** * @property {array} _capture - The array the key capture values are stored in. * @private @@ -20074,14 +20083,20 @@ Phaser.Keyboard = function (game) { * @default */ this._onKeyDown = null; - + /** * @property {function} _onKeyUp * @private * @default */ this._onKeyUp = null; - + + /** + * @property {number} _i - Internal cache var + * @private + */ + this._i = 0; + }; Phaser.Keyboard.prototype = { @@ -20138,7 +20153,7 @@ Phaser.Keyboard.prototype = { if (this._keys[keycode]) { this._keys[keycode] = null; - + this.removeKeyCapture(keycode); } @@ -20157,12 +20172,12 @@ Phaser.Keyboard.prototype = { down: this.addKey(Phaser.Keyboard.DOWN), left: this.addKey(Phaser.Keyboard.LEFT), right: this.addKey(Phaser.Keyboard.RIGHT) - } + }; }, /** - * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. + * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. * This is called automatically by Phaser.Input and should not normally be invoked directly. * * @method Phaser.Keyboard#start @@ -20191,17 +20206,37 @@ Phaser.Keyboard.prototype = { }, /** - * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body. + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { + this._onKeyDown = null; + this._onKeyUp = null; + window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); }, + /** + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. + * Also clears all key captures and currently created Key objects. + * + * @method Phaser.Keyboard#destroy + */ + destroy: function () { + + this.stop(); + + this.clearCaptures(); + + this._keys.length = 0; + this._i = 0; + + }, + /** * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. @@ -20256,13 +20291,13 @@ Phaser.Keyboard.prototype = { */ update: function () { - var i = this._keys.length; + this._i = this._keys.length; - while (i--) + while (this._i--) { - if (this._keys[i]) + if (this._keys[this._i]) { - this._keys[i].update(); + this._keys[this._i].update(); } } @@ -20299,7 +20334,7 @@ Phaser.Keyboard.prototype = { { this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode); } - + this._keys[event.keyCode].processKeyDown(event); }, @@ -20542,7 +20577,7 @@ Phaser.Mouse = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called. */ @@ -20552,12 +20587,12 @@ Phaser.Mouse = function (game) { * @property {function} mouseDownCallback - A callback that can be fired when the mouse is pressed down. */ this.mouseDownCallback = null; - + /** * @property {function} mouseMoveCallback - A callback that can be fired when the mouse is moved while pressed down. */ this.mouseMoveCallback = null; - + /** * @property {function} mouseUpCallback - A callback that can be fired when the mouse is released from a pressed down state. */ @@ -20883,7 +20918,7 @@ Phaser.MSPointer = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called (defaults to game). */ @@ -20900,13 +20935,13 @@ Phaser.MSPointer = function (game) { * @private */ this._onMSPointerDown = null; - + /** * @property {function} _onMSPointerMove - Internal function to handle MSPointer events. * @private */ this._onMSPointerMove = null; - + /** * @property {function} _onMSPointerUp - Internal function to handle MSPointer events. * @private @@ -21209,7 +21244,7 @@ Phaser.Pointer = function (game, id) { * @property {Phaser.Point} position - A Phaser.Point object containing the current x/y values of the pointer on the display. */ this.position = new Phaser.Point(); - + /** * @property {Phaser.Point} positionDown - A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display. */ @@ -21316,7 +21351,7 @@ Phaser.Pointer.prototype = { x: this.position.x, y: this.position.y }); - + if (this._history.length > this.game.input.recordLimit) { this._history.shift(); @@ -21418,7 +21453,7 @@ Phaser.Pointer.prototype = { } currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this._highestRenderObject === null) @@ -21538,17 +21573,17 @@ Phaser.Pointer.prototype = { if (this.game.input.interactiveItems.total > 0) { var currentNode = this.game.input.interactiveItems.next; - + do { if (currentNode) { currentNode._releasedHandler(this); } - + currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this.targetObject) @@ -21698,7 +21733,7 @@ Phaser.Touch = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored. * @return {boolean} @@ -21714,32 +21749,32 @@ Phaser.Touch = function (game) { * @property {function} touchStartCallback - A callback that can be fired on a touchStart event. */ this.touchStartCallback = null; - + /** * @property {function} touchMoveCallback - A callback that can be fired on a touchMove event. */ this.touchMoveCallback = null; - + /** * @property {function} touchEndCallback - A callback that can be fired on a touchEnd event. */ this.touchEndCallback = null; - + /** * @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event. */ this.touchEnterCallback = null; - + /** * @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event. */ this.touchLeaveCallback = null; - + /** * @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event. */ this.touchCancelCallback = null; - + /** * @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it. * @default @@ -22357,7 +22392,7 @@ Phaser.Gamepad.prototype = { } var rawPad = this._rawPads[m]; - + if (rawPad) { if (validConnections.rawIndices[rawPad.index]) @@ -22920,7 +22955,7 @@ Phaser.SinglePad.prototype = { } this._axes[axisState.axis] = axisState.value; - + if (this._padParent.onAxisCallback) { this._padParent.onAxisCallback.call(this._padParent.callbackContext, axisState, this._index); @@ -23408,7 +23443,7 @@ Phaser.InputHandler = function (sprite) { this.sprite = sprite; /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = sprite.game; @@ -23423,13 +23458,13 @@ Phaser.InputHandler = function (sprite) { * @default */ this.priorityID = 0; - + /** * @property {boolean} useHandCursor - On a desktop browser you can set the 'hand' cursor to appear when moving over the Sprite. * @default */ this.useHandCursor = false; - + /** * @property {boolean} _setHandCursor - Did this Sprite trigger the hand cursor? * @private @@ -23441,19 +23476,19 @@ Phaser.InputHandler = function (sprite) { * @default */ this.isDragged = false; - + /** * @property {boolean} allowHorizontalDrag - Controls if the Sprite is allowed to be dragged horizontally. * @default */ this.allowHorizontalDrag = true; - + /** * @property {boolean} allowVerticalDrag - Controls if the Sprite is allowed to be dragged vertically. * @default */ this.allowVerticalDrag = true; - + /** * @property {boolean} bringToTop - If true when this Sprite is clicked or dragged it will automatically be bought to the top of the Group it is within. * @default @@ -23465,25 +23500,25 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffset = null; - + /** * @property {boolean} snapOnDrag - When the Sprite is dragged this controls if the center of the Sprite will snap to the pointer on drag or not. * @default */ this.snapOnDrag = false; - + /** * @property {boolean} snapOnRelease - When the Sprite is dragged this controls if the Sprite will be snapped on release. * @default */ this.snapOnRelease = false; - + /** * @property {number} snapX - When a Sprite has snapping enabled this holds the width of the snap grid. * @default */ this.snapX = 0; - + /** * @property {number} snapY - When a Sprite has snapping enabled this holds the height of the snap grid. * @default @@ -23495,7 +23530,7 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffsetX = 0; - + /** * @property {number} snapOffsetY - This defines the top-left Y coordinate of the snap grid.. * @default @@ -23528,13 +23563,13 @@ Phaser.InputHandler = function (sprite) { /** * @property {boolean} draggable - Is this sprite allowed to be dragged by the mouse? true = yes, false = no - * @default + * @default */ this.draggable = false; /** * @property {Phaser.Rectangle} boundsRect - A region of the game world within which the sprite is restricted during drag. - * @default + * @default */ this.boundsRect = null; @@ -24034,7 +24069,7 @@ Phaser.InputHandler.prototype = { y += this.sprite.texture.frame.y; this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1); if (rgb.data[3] >= this.pixelPerfectAlpha) @@ -24520,7 +24555,7 @@ Phaser.InputHandler.prototype = { } this.updateDrag(pointer); - + if (this.bringToTop) { this.sprite.bringToTop(); @@ -24540,7 +24575,7 @@ Phaser.InputHandler.prototype = { this.isDragged = false; this._draggedPointerID = -1; this._pointerData[pointer.id].isDragged = false; - + if (this.snapOnRelease) { if (this.sprite.fixedToCamera) @@ -24744,7 +24779,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler; * @param {Phaser.Sprite} sprite - A reference to Description. */ Phaser.Events = function (sprite) { - + this.parent = sprite; this.onAddedToGroup = new Phaser.Signal(); @@ -24820,7 +24855,7 @@ Phaser.GameObjectFactory = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -24960,7 +24995,7 @@ Phaser.GameObjectFactory.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -24976,7 +25011,7 @@ Phaser.GameObjectFactory.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25082,7 +25117,7 @@ Phaser.GameObjectFactory.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectFactory#retroFont @@ -25240,7 +25275,7 @@ Phaser.GameObjectCreator = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -25343,7 +25378,7 @@ Phaser.GameObjectCreator.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25359,7 +25394,7 @@ Phaser.GameObjectCreator.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25453,7 +25488,7 @@ Phaser.GameObjectCreator.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectCreator#retroFont @@ -25613,7 +25648,7 @@ Phaser.BitmapData = function (game, key, width, height) { if (typeof height === 'undefined') { height = 100; } /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -25626,7 +25661,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @property {number} width - The width of the BitmapData in pixels. */ this.width = width; - + /** * @property {number} height - The height of the BitmapData in pixels. */ @@ -25637,7 +25672,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.canvas = Phaser.Canvas.create(width, height, '', true); - + /** * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. * @default @@ -25671,13 +25706,13 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - The PIXI.Texture. * @default */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - The Frame this BitmapData uses for rendering. * @default @@ -25695,13 +25730,13 @@ Phaser.BitmapData = function (game, key, width, height) { */ this.dirty = false; -} +}; Phaser.BitmapData.prototype = { /** * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. - * + * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. */ @@ -25731,7 +25766,7 @@ Phaser.BitmapData.prototype = { clear: function () { this.context.clearRect(0, 0, this.width, this.height); - + this.dirty = true; }, @@ -25752,7 +25787,7 @@ Phaser.BitmapData.prototype = { this.textureFrame.height = height; this.imageData = this.context.getImageData(0, 0, width, height); } - + this.dirty = true; }, @@ -25997,7 +26032,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -26075,7 +26110,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -26378,6 +26413,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) { /** * Crop allows you to crop the texture used to display this Sprite. * Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite. * * @method Phaser.Sprite#crop * @memberof Phaser.Sprite @@ -26426,7 +26462,7 @@ Phaser.Sprite.prototype.crop = function(rect) { * Brings a 'dead' Sprite back to life, optionally giving it the health value specified. * A resurrected Sprite has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal. -* +* * @method Phaser.Sprite#revive * @memberof Phaser.Sprite * @param {number} [health=1] - The health to give the Sprite. @@ -26455,7 +26491,7 @@ Phaser.Sprite.prototype.revive = function(health) { * It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal. * Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory. * If you don't need this Sprite any more you should call Sprite.destroy instead. -* +* * @method Phaser.Sprite#kill * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -26478,7 +26514,7 @@ Phaser.Sprite.prototype.kill = function() { /** * Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Sprite#destroy * @memberof Phaser.Sprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -26551,7 +26587,7 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) { /** * Damages the Sprite, this removes the given amount from the Sprites health property. * If health is then taken below or is equal to zero `Sprite.kill` is called. -* +* * @method Phaser.Sprite#damage * @memberof Phaser.Sprite * @param {number} amount - The amount to subtract from the Sprite.health value. @@ -26577,7 +26613,7 @@ Phaser.Sprite.prototype.damage = function(amount) { * Resets the Sprite. This places the Sprite at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. * If the Sprite has a physics body that too is reset. -* +* * @method Phaser.Sprite#reset * @memberof Phaser.Sprite * @param {number} x - The x coordinate (in world space) to position the Sprite at. @@ -26608,13 +26644,13 @@ Phaser.Sprite.prototype.reset = function(x, y, health) { this._cache[4] = 1; return this; - + }; /** * Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Sprite#bringToTop * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -26633,7 +26669,7 @@ Phaser.Sprite.prototype.bringToTop = function() { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.Sprite#play * @memberof Phaser.Sprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -26651,11 +26687,27 @@ Phaser.Sprite.prototype.play = function (name, frameRate, loop, killOnComplete) }; +/** +* Checks to see if the bounds of this Sprite overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as a Button. +* This check ignores the Sprites hitArea property and runs a Sprite.getBounds comparison on both objects to determine the result. +* Therefore it's relatively expensive to use in large quantities (i.e. with lots of Sprites at a high frequency), but should be fine for low-volume testing where physics isn't required. +* +* @method Phaser.Sprite#overlap +* @memberof Phaser.Sprite +* @param {Phaser.Sprite|Phaser.Image|Phaser.TileSprite|Phaser.Button|PIXI.DisplayObject} displayObject - The display object to check against. +* @return {boolean} True if the bounds of this Sprite intersects at any point with the bounds of the given display object. +*/ +Phaser.Sprite.prototype.overlap = function (displayObject) { + + return Phaser.Rectangle.intersects(this.getBounds(), displayObject.getBounds()); + +}; + /** * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Sprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -26702,7 +26754,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaX", { Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -26719,7 +26771,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { Object.defineProperty(Phaser.Sprite.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -26753,7 +26805,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inWorld", { Object.defineProperty(Phaser.Sprite.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -26815,7 +26867,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -26852,7 +26904,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { * @property {boolean} exists - If the Sprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.Sprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -26899,7 +26951,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "exists", { * @property {boolean} fixedToCamera - Set to true to fix this Sprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -26928,7 +26980,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Sprite, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -26955,6 +27007,60 @@ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { }); +/** +* The position of the Sprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#x +* @property {number} x - The position of the Sprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the Sprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#y +* @property {number} y - The position of the Sprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -26980,12 +27086,12 @@ Phaser.Image = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Image isn't updated by the core game loop. * @default @@ -27121,7 +27227,7 @@ Phaser.Image.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -27131,7 +27237,7 @@ Phaser.Image.prototype.preUpdate = function() { */ Phaser.Image.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -27159,7 +27265,7 @@ Phaser.Image.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Changes the Texture the Image is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -27236,7 +27342,7 @@ Phaser.Image.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Crop allows you to crop the texture used to display this Image. @@ -27283,13 +27389,13 @@ Phaser.Image.prototype.crop = function(rect) { } } -} +}; /** * Brings a 'dead' Image back to life, optionally giving it the health value specified. * A resurrected Image has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Image.events.onRevived for the signal. -* +* * @method Phaser.Image#revive * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27307,14 +27413,14 @@ Phaser.Image.prototype.revive = function() { return this; -} +}; /** * Kills a Image. A killed Image has its alive, exists and visible properties all set to false. * It will dispatch the onKilled event, you can listen to Image.events.onKilled for the signal. * Note that killing a Image is a way for you to quickly recycle it in a Image pool, it doesn't free it up from memory. * If you don't need this Image any more you should call Image.destroy instead. -* +* * @method Phaser.Image#kill * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27332,12 +27438,12 @@ Phaser.Image.prototype.kill = function() { return this; -} +}; /** * Destroys the Image. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Image#destroy * @memberof Phaser.Image * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -27395,11 +27501,11 @@ Phaser.Image.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Resets the Image. This places the Image at the given x/y world coordinates and then sets alive, exists, visible and renderable all to true. -* +* * @method Phaser.Image#reset * @memberof Phaser.Image * @param {number} x - The x coordinate (in world space) to position the Image at. @@ -27417,13 +27523,13 @@ Phaser.Image.prototype.reset = function(x, y) { this.renderable = true; return this; - -} + +}; /** * Brings the Image to the top of the display list it is a child of. Images that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Image#bringToTop * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27437,13 +27543,13 @@ Phaser.Image.prototype.bringToTop = function() { return this; -} +}; /** * Indicates the rotation of the Image, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Image.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Image#angle * @property {number} angle - The angle of this Image in degrees. */ @@ -27490,7 +27596,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaX", { Object.defineProperty(Phaser.Image.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -27507,7 +27613,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaY", { Object.defineProperty(Phaser.Image.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -27541,7 +27647,7 @@ Object.defineProperty(Phaser.Image.prototype, "inWorld", { Object.defineProperty(Phaser.Image.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -27555,7 +27661,7 @@ Object.defineProperty(Phaser.Image.prototype, "inCamera", { Object.defineProperty(Phaser.Image.prototype, "frame", { get: function() { - + return this._frame; }, @@ -27584,7 +27690,7 @@ Object.defineProperty(Phaser.Image.prototype, "frame", { Object.defineProperty(Phaser.Image.prototype, "frameName", { get: function() { - + return this._frameName; }, @@ -27629,7 +27735,7 @@ Object.defineProperty(Phaser.Image.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -27666,7 +27772,7 @@ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Image to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -27695,7 +27801,7 @@ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Image, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Image.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -27848,7 +27954,7 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -27977,7 +28083,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -27987,7 +28093,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { */ Phaser.TileSprite.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -28015,7 +28121,7 @@ Phaser.TileSprite.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Sets this TileSprite to automatically scroll in the given direction until stopped via TileSprite.stopScroll(). @@ -28030,7 +28136,7 @@ Phaser.TileSprite.prototype.autoScroll = function(x, y) { this._scroll.set(x, y); -} +}; /** * Stops an automatically scrolling TileSprite. @@ -28042,7 +28148,7 @@ Phaser.TileSprite.prototype.stopScroll = function() { this._scroll.set(0, 0); -} +}; /** * Changes the Texture the TileSprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -28114,12 +28220,12 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Destroys the TileSprite. This removes it from its parent group, destroys the event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.TileSprite#destroy * @memberof Phaser.TileSprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -28175,12 +28281,12 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.TileSprite#play * @memberof Phaser.TileSprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -28193,7 +28299,7 @@ Phaser.TileSprite.prototype.play = function (name, frameRate, loop, killOnComple return this.animations.play(name, frameRate, loop, killOnComplete); -} +}; /** * Resets the TileSprite. This places the TileSprite at the given x/y world coordinates, resets the tilePosition and then @@ -28235,7 +28341,7 @@ Phaser.TileSprite.prototype.reset = function(x, y) { * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.TileSprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -28306,7 +28412,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "frameName", { * @property {boolean} fixedToCamera - Set to true to fix this TileSprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -28337,7 +28443,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { * @property {boolean} exists - If the TileSprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -28383,7 +28489,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -28411,6 +28517,60 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { }); +/** +* The position of the TileSprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#x +* @property {number} x - The position of the TileSprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the TileSprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#y +* @property {number} y - The position of the TileSprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -28451,7 +28611,7 @@ Phaser.Text = function (game, x, y, text, style) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -28588,7 +28748,7 @@ Phaser.Text.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -28598,7 +28758,7 @@ Phaser.Text.prototype.preUpdate = function () { */ Phaser.Text.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -28618,7 +28778,7 @@ Phaser.Text.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * @method Phaser.Text.prototype.destroy @@ -28678,7 +28838,7 @@ Phaser.Text.prototype.destroy = function (destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @method Phaser.Text.prototype.setShadow @@ -28695,7 +28855,7 @@ Phaser.Text.prototype.setShadow = function (x, y, color, blur) { this.style.shadowBlur = blur || 0; this.dirty = true; -} +}; /** * Set the style of the text by passing a single style object to it. @@ -28728,7 +28888,7 @@ Phaser.Text.prototype.setStyle = function (style) { this.style = style; this.dirty = true; -} +}; /** * Renders text. This replaces the Pixi.Text.updateText function as we need a few extra bits in here. @@ -28766,15 +28926,15 @@ Phaser.Text.prototype.updateText = function () { this.canvas.width = maxLineWidth + this.style.strokeThickness; //calculate text height - var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; + var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; this.canvas.height = lineHeight * lines.length; if (navigator.isCocoonJS) { - this.context.clearRect(0,0,this.canvas.width,this.canvas.height); + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); } - + //set canvas text styles this.context.fillStyle = this.style.fill; this.context.font = this.style.font; @@ -28794,30 +28954,30 @@ Phaser.Text.prototype.updateText = function () { { var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight); - if(this.style.align === 'right') + if (this.style.align === 'right') { linePosition.x += maxLineWidth - lineWidths[i]; } - else if(this.style.align === 'center') + else if (this.style.align === 'center') { linePosition.x += (maxLineWidth - lineWidths[i]) / 2; } linePosition.y += this._lineSpacing; - if(this.style.stroke && this.style.strokeThickness) + if (this.style.stroke && this.style.strokeThickness) { this.context.strokeText(lines[i], linePosition.x, linePosition.y); } - if(this.style.fill) + if (this.style.fill) { this.context.fillText(lines[i], linePosition.x, linePosition.y); } } this.updateTexture(); -} +}; /** * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal bounds. @@ -28865,7 +29025,7 @@ Phaser.Text.prototype.runWordWrap = function (text) { return result; -} +}; /** * Indicates the rotation of the Text, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -29235,7 +29395,7 @@ Object.defineProperty(Phaser.Text.prototype, 'shadowBlur', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -29272,7 +29432,7 @@ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Text to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Text.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -29332,7 +29492,7 @@ Phaser.BitmapText = function (game, x, y, font, text, size) { */ this.game = game; - /** + /** * @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all. * @default */ @@ -29473,7 +29633,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -29482,7 +29642,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { */ Phaser.BitmapText.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -29497,7 +29657,7 @@ Phaser.BitmapText.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this BitmapText instance. This will remove any filters and un-parent any children. @@ -29553,7 +29713,7 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @name Phaser.BitmapText#align @@ -29697,7 +29857,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'text', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -29734,7 +29894,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this BitmapText to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -29798,136 +29958,136 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, Phaser.Image.call(this, game, x, y, key, outFrame); - /** + /** * @property {number} type - The Phaser Object Type. */ this.type = Phaser.BUTTON; - /** + /** * @property {string} _onOverFrameName - Internal variable. * @private * @default */ this._onOverFrameName = null; - - /** + + /** * @property {string} _onOutFrameName - Internal variable. * @private * @default */ this._onOutFrameName = null; - - /** + + /** * @property {string} _onDownFrameName - Internal variable. * @private * @default */ this._onDownFrameName = null; - /** + /** * @property {string} _onUpFrameName - Internal variable. * @private * @default */ this._onUpFrameName = null; - - /** + + /** * @property {number} _onOverFrameID - Internal variable. * @private * @default */ this._onOverFrameID = null; - - /** + + /** * @property {number} _onOutFrameID - Internal variable. * @private * @default */ this._onOutFrameID = null; - - /** + + /** * @property {number} _onDownFrameID - Internal variable. * @private * @default */ this._onDownFrameID = null; - /** + /** * @property {number} _onUpFrameID - Internal variable. * @private * @default */ this._onUpFrameID = null; - /** + /** * @property {Phaser.Sound} onOverSound - The Sound to be played when this Buttons Over state is activated. * @default */ this.onOverSound = null; - /** + /** * @property {Phaser.Sound} onOutSound - The Sound to be played when this Buttons Out state is activated. * @default */ this.onOutSound = null; - /** + /** * @property {Phaser.Sound} onDownSound - The Sound to be played when this Buttons Down state is activated. * @default */ this.onDownSound = null; - /** + /** * @property {Phaser.Sound} onUpSound - The Sound to be played when this Buttons Up state is activated. * @default */ this.onUpSound = null; - /** + /** * @property {string} onOverSoundMarker - The Sound Marker used in conjunction with the onOverSound. * @default */ this.onOverSoundMarker = ''; - /** + /** * @property {string} onOutSoundMarker - The Sound Marker used in conjunction with the onOutSound. * @default */ this.onOutSoundMarker = ''; - /** + /** * @property {string} onDownSoundMarker - The Sound Marker used in conjunction with the onDownSound. * @default */ this.onDownSoundMarker = ''; - /** + /** * @property {string} onUpSoundMarker - The Sound Marker used in conjunction with the onUpSound. * @default */ this.onUpSoundMarker = ''; - /** + /** * @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state. */ this.onInputOver = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state. */ this.onInputOut = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state. */ this.onInputDown = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state. */ this.onInputUp = new Phaser.Signal(); - /** + /** * @property {boolean} freezeFrames - When true the Button will cease to change texture frame on all events (over, out, up, down). */ this.freezeFrames = false; @@ -29980,7 +30140,7 @@ Phaser.Button.prototype.clearFrames = function () { this._onUpFrameName = null; this._onUpFrameID = null; -} +}; /** * Used to manually set the frames that will be used for the different states of the Button. @@ -30000,7 +30160,7 @@ Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame, up if (typeof overFrame === 'string') { this._onOverFrameName = overFrame; - + if (this.input.pointerOver()) { this.frameName = overFrame; @@ -30107,7 +30267,7 @@ Phaser.Button.prototype.setSounds = function (overSound, overMarker, downSound, this.setDownSound(downSound, downMarker); this.setUpSound(upSound, upMarker); -} +}; /** * The Sound to be played when a Pointer moves over this Button. @@ -30131,7 +30291,7 @@ Phaser.Button.prototype.setOverSound = function (sound, marker) { this.onOverSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer moves out of this Button. @@ -30155,7 +30315,7 @@ Phaser.Button.prototype.setOutSound = function (sound, marker) { this.onOutSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer presses down on this Button. @@ -30179,7 +30339,7 @@ Phaser.Button.prototype.setDownSound = function (sound, marker) { this.onDownSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer has pressed down and is released from this Button. @@ -30203,7 +30363,7 @@ Phaser.Button.prototype.setUpSound = function (sound, marker) { this.onUpSoundMarker = marker; } -} +}; /** * Internal function that handles input events. @@ -30402,7 +30562,7 @@ Phaser.Button.prototype.setState = function (newState) { /** * Creates a new `Graphics` object. -* +* * @class Phaser.Graphics * @constructor * @@ -30419,7 +30579,7 @@ Phaser.Graphics = function (game, x, y) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -30508,7 +30668,7 @@ Phaser.Graphics.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -30518,7 +30678,7 @@ Phaser.Graphics.prototype.preUpdate = function () { */ Phaser.Graphics.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -30533,11 +30693,11 @@ Phaser.Graphics.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this Graphics instance. -* +* * @method Phaser.Graphics.prototype.destroy * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? */ @@ -30581,11 +30741,11 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) { this.game = null; -} +}; /* * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled -* +* * @method Phaser.Graphics.prototype.drawPolygon */ Phaser.Graphics.prototype.drawPolygon = function (poly) { @@ -30598,8 +30758,8 @@ Phaser.Graphics.prototype.drawPolygon = function (poly) { } this.lineTo(poly.points[0].x, poly.points[0].y); - -} + +}; /** * Indicates the rotation of the Graphics, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -30629,7 +30789,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'angle', { * @property {boolean} fixedToCamera - Set to true to fix this Graphics to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -30669,7 +30829,7 @@ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { Phaser.RenderTexture = function (game, width, height, key) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -30679,7 +30839,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this.key = key; /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RENDERTEXTURE; @@ -30690,7 +30850,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this._temp = new Phaser.Point(); PIXI.RenderTexture.call(this, width, height); - + }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); @@ -30711,7 +30871,7 @@ Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) this.render(displayObject, this._temp, clear); -} +}; // Documentation stubs @@ -30878,13 +31038,13 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, * @private */ this.grabData = []; - + // Now generate our rects for faster copying later on var currentX = this.offsetX; var currentY = this.offsetY; var r = 0; var data = new Phaser.FrameData(); - + for (var c = 0; c < chars.length; c++) { var uuid = game.rnd.uuid(); @@ -30899,9 +31059,9 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, width: this.characterWidth, height: this.characterHeight }); - + r++; - + if (r == this.characterPerRow) { r = 0; @@ -30921,10 +31081,10 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, Phaser.RenderTexture.call(this, game); /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RETROFONT; - + }; Phaser.RetroFont.prototype = Object.create(Phaser.RenderTexture.prototype); @@ -30936,91 +31096,91 @@ Phaser.RetroFont.prototype.constructor = Phaser.RetroFont; * @type {string} */ Phaser.RetroFont.ALIGN_LEFT = "left"; - + /** * Align each line of multi-line text to the right. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_RIGHT = "right"; - + /** * Align each line of multi-line text in the center. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_CENTER = "center"; - + /** * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - + /** * Text Set 2 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** -* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 +* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; - + /** * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"; - + /** * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789"; - + /** -* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' +* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' "; - + /** * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39"; - + /** * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?! * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!"; - + /** * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789 * @constant @@ -31044,11 +31204,11 @@ Phaser.RetroFont.prototype.setFixedWidth = function (width, lineAlignment) { this.fixedWidth = width; this.align = lineAlignment; -} +}; /** * A helper function that quickly sets lots of variables at once, and then updates the text. -* +* * @method Phaser.RetroFont#setText * @memberof Phaser.RetroFont * @param {string} content - The text of this sprite. @@ -31064,7 +31224,7 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac this.customSpacingX = characterSpacing || 0; this.customSpacingY = lineSpacing || 0; this.align = lineAlignment || 'left'; - + if (allowLowerCase) { this.autoUpperCase = false; @@ -31073,17 +31233,17 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac { this.autoUpperCase = true; } - + if (content.length > 0) { this.text = content; } -} +}; /** * Over rides the default PIXI.RenderTexture resize event as we need our baseTexture resized as well. -* +* * @method Phaser.RetroFont#resize * @memberof Phaser.RetroFont */ @@ -31105,7 +31265,7 @@ Phaser.RetroFont.prototype.resize = function (width, height) { var gl = this.renderer.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTextures[gl.id]); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { @@ -31114,11 +31274,11 @@ Phaser.RetroFont.prototype.resize = function (width, height) { PIXI.Texture.frameUpdates.push(this); -} +}; /** * Updates the BitmapData of the Sprite with the text -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont */ @@ -31130,7 +31290,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { if (this.multiLine) { var lines = this._text.split("\n"); - + if (this.fixedWidth > 0) { this.resize(this.fixedWidth, (lines.length * (this.characterHeight + this.customSpacingY)) - this.customSpacingY); @@ -31141,7 +31301,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + // Loop through each line of text for (var i = 0; i < lines.length; i++) { @@ -31151,25 +31311,25 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (lines[i].length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((lines[i].length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + // Sanity checks if (cx < 0) { cx = 0; } - + this.pasteLine(lines[i], cx, cy, this.customSpacingX); - + cy += this.characterHeight + this.customSpacingY; } } @@ -31185,32 +31345,32 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + switch (this.align) { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (this._text.length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((this._text.length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + this.pasteLine(this._text, cx, 0, this.customSpacingX); } -} +}; /** * Internal function that takes a single line of text (2nd parameter) and pastes it into the BitmapData at the given coordinates. * Used by getLine and getMultiLine -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont * @param {string} line - The single line of text to paste. @@ -31237,9 +31397,9 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { this.stamp.frame = this.grabData[line.charCodeAt(c)]; p.set(x, y); this.render(this.stamp, p, false); - + x += this.characterWidth + customSpacingX; - + if (x > this.width) { break; @@ -31247,11 +31407,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { } } } -} - +}; + /** * Works out the longest line of text in _text and returns its length -* +* * @method Phaser.RetroFont#getLongestLine * @memberof Phaser.RetroFont * @return {number} The length of the longest line of text. @@ -31259,11 +31419,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { Phaser.RetroFont.prototype.getLongestLine = function () { var longestLine = 0; - + if (this._text.length > 0) { var lines = this._text.split("\n"); - + for (var i = 0; i < lines.length; i++) { if (lines[i].length > longestLine) @@ -31272,13 +31432,13 @@ Phaser.RetroFont.prototype.getLongestLine = function () { } } } - + return longestLine; -} - +}; + /** * Internal helper function that removes all unsupported characters from the _text String, leaving only characters contained in the font set. -* +* * @method Phaser.RetroFont#removeUnsupportedCharacters * @memberof Phaser.RetroFont * @protected @@ -31288,7 +31448,7 @@ Phaser.RetroFont.prototype.getLongestLine = function () { Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { var newString = ""; - + for (var c = 0; c < this._text.length; c++) { var aChar = this._text[c]; @@ -31299,16 +31459,16 @@ Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { newString = newString.concat(aChar); } } - + return newString; -} +}; /** * @name Phaser.BitmapText#text * @property {string} text - Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true. */ Object.defineProperty(Phaser.RetroFont.prototype, "text", { - + get: function () { return this._text; @@ -31318,7 +31478,7 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { set: function (value) { var newText; - + if (this.autoUpperCase) { newText = value.toUpperCase(); @@ -31327,13 +31487,13 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { { newText = value; } - + if (newText !== this._text) { this._text = newText; - + this.removeUnsupportedCharacters(this.multiLine); - + this.buildRetroFontText(); } @@ -31457,7 +31617,7 @@ Phaser.Canvas = { color = color || 'rgb(0,0,0)'; canvas.style.backgroundColor = color; - + return canvas; }, @@ -31776,7 +31936,7 @@ Phaser.Device = function (game) { */ this.css3D = false; - /** + /** * @property {boolean} pointerLock - Is Pointer Lock available? * @default */ @@ -31957,7 +32117,7 @@ Phaser.Device = function (game) { */ this.iPhone4 = false; - /** + /** * @property {boolean} iPad - Is running on iPad? * @default */ @@ -32006,7 +32166,7 @@ Phaser.Device = function (game) { this._checkDevice(); this._checkFeatures(); this._checkOS(); - + }; Phaser.Device.prototype = { @@ -32092,7 +32252,7 @@ Phaser.Device.prototype = { } this.worker = !!window['Worker']; - + if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) { this.touch = true; @@ -32102,7 +32262,7 @@ Phaser.Device.prototype = { { this.mspointer = true; } - + this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true; @@ -32258,7 +32418,7 @@ Phaser.Device.prototype = { try { if (result = !!audioElement.canPlayType) { - + if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) { this.ogg = true; } @@ -32315,7 +32475,7 @@ Phaser.Device.prototype = { } navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - + if (navigator.vibrate) { this.vibration = true; @@ -32351,7 +32511,7 @@ Phaser.Device.prototype = { has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } - + document.body.removeChild(el); this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none"); @@ -32438,13 +32598,13 @@ Phaser.Device.prototype.constructor = Phaser.Device; /** * Abstracts away the use of RAF or setTimeOut for the core game update loop. * -* @class Phaser.RequestAnimationFrame +* @class Phaser.RequestAnimationFrame * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {boolean} [forceSetTimeOut=false] - Tell Phaser to use setTimeOut even if raf is available. */ Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) { - + if (typeof forceSetTimeOut === 'undefined') { forceSetTimeOut = false; } /** @@ -32533,7 +32693,7 @@ Phaser.RequestAnimationFrame.prototype = { /** * The update method for the requestAnimationFrame - * @method Phaser.RequestAnimationFrame#updateRAF + * @method Phaser.RequestAnimationFrame#updateRAF */ updateRAF: function () { @@ -32616,11 +32776,11 @@ Phaser.Math = { PI2: Math.PI * 2, /** - * Two number are fuzzyEqual if their difference is less than ε. + * Two number are fuzzyEqual if their difference is less than ε. * @method Phaser.Math#fuzzyEqual * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if |a-b|<ε */ fuzzyEqual: function (a, b, epsilon) { @@ -32629,11 +32789,11 @@ Phaser.Math = { }, /** - * a is fuzzyLessThan b if it is less than b + ε. + * a is fuzzyLessThan b if it is less than b + ε. * @method Phaser.Math#fuzzyLessThan * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if ab+ε */ fuzzyGreaterThan: function (a, b, epsilon) { @@ -32654,10 +32814,10 @@ Phaser.Math = { return a > b - epsilon; }, - /** + /** * @method Phaser.Math#fuzzyCeil * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} ceiling(val-ε) */ fuzzyCeil: function (val, epsilon) { @@ -32665,10 +32825,10 @@ Phaser.Math = { return Math.ceil(val - epsilon); }, - /** + /** * @method Phaser.Math#fuzzyFloor * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} floor(val-ε) */ fuzzyFloor: function (val, epsilon) { @@ -32676,7 +32836,7 @@ Phaser.Math = { return Math.floor(val + epsilon); }, - /** + /** * Averages all values passed to the function and returns the result. You can pass as many parameters as you like. * @method Phaser.Math#average * @return {number} The average of all given values. @@ -32699,7 +32859,7 @@ Phaser.Math = { }, - /** + /** * @method Phaser.Math#truncate * @param {number} n * @return {number} @@ -32708,7 +32868,7 @@ Phaser.Math = { return (n > 0) ? Math.floor(n) : Math.ceil(n); }, - /** + /** * @method Phaser.Math#shear * @param {number} n * @return {number} n mod 1 @@ -32800,7 +32960,7 @@ Phaser.Math = { * Snaps a value to the nearest value in an array. * @method Phaser.Math#snapToInArray * @param {number} input - * @param {array} arr + * @param {array} arr * @param {boolean} sort - True if the array needs to be sorted. * @return {number} */ @@ -32817,14 +32977,14 @@ Phaser.Math = { } var i = 1; - + while (arr[i] < input) { i++; } var low = arr[i - 1]; var high = (i < arr.length) ? arr[i] : Number.POSITIVE_INFINITY; - + return ((high - input) <= (input - low)) ? high : low; }, @@ -32858,7 +33018,7 @@ Phaser.Math = { * * Note what occurs when we round to the 3rd space (8ths place), 100100000, this is to be assumed * because we are rounding 100011.1011011011011011 which rounds up. - * + * * @method Phaser.Math#roundTo * @param {number} value - The value to round. * @param {number} place - The place to round to. @@ -32869,9 +33029,9 @@ Phaser.Math = { if (typeof place === "undefined") { place = 0; } if (typeof base === "undefined") { base = 10; } - + var p = Math.pow(base, -place); - + return Math.round(value * p) / p; }, @@ -32917,7 +33077,7 @@ Phaser.Math = { * @method Phaser.Math#interpolateFloat * @param {number} a * @param {number} b - * @param {number} weight + * @param {number} weight * @return {number} */ interpolateFloat: function (a, b, weight) { @@ -32968,7 +33128,7 @@ Phaser.Math = { angleRad = angleRad % (2 * Math.PI); return angleRad >= 0 ? angleRad : angleRad + 2 * Math.PI; - + }, /** @@ -33014,7 +33174,7 @@ Phaser.Math = { var rd = (radians) ? Math.PI : 180; a1 = this.normalizeAngle(a1, radians); a2 = this.normalizeAngle(a2, radians); - + if (a1 < -rd / 2 && a2 > rd / 2) { a1 += rd * 2; @@ -33064,7 +33224,7 @@ Phaser.Math = { chanceRoll: function (chance) { if (typeof chance === "undefined") { chance = 50; } - + if (chance <= 0) { return false; @@ -33142,7 +33302,7 @@ Phaser.Math = { minSub: function (value, amount, min) { value -= amount; - + if (value < min) { value = min; @@ -33177,7 +33337,7 @@ Phaser.Math = { { result += range; } - + return result + min; }, @@ -33412,7 +33572,7 @@ Phaser.Math = { * @method Phaser.Math#linearInterpolation * @param {number} v * @param {number} k - * @return {number} + * @return {number} */ linearInterpolation: function (v, k) { @@ -33525,7 +33685,7 @@ Phaser.Math = { * @param {number} p2 * @param {number} p3 * @param {number} t - * @return {number} + * @return {number} */ catmullRom: function (p0, p1, p2, p3, t) { @@ -33559,7 +33719,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -33593,7 +33753,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -33660,14 +33820,14 @@ Phaser.Math = { if (typeof sinAmplitude === "undefined") { sinAmplitude = 1.0; } if (typeof cosAmplitude === "undefined") { cosAmplitude = 1.0; } if (typeof frequency === "undefined") { frequency = 1.0; } - + var sin = sinAmplitude; var cos = cosAmplitude; var frq = frequency * Math.PI / length; - + var cosTable = []; var sinTable = []; - + for (var c = 0; c < length; c++) { cos -= sin * frq; @@ -33685,7 +33845,7 @@ Phaser.Math = { /** * Removes the top element from the stack and re-inserts it onto the bottom, then returns it. * The original stack is modified in the process. This effectively moves the position of the data from the start to the end of the table. - * + * * @method Phaser.Math#shift * @param {array} stack - The array to shift. * @return {any} The shifted value. @@ -33721,7 +33881,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates. - * + * * @method Phaser.Math#distance * @param {number} x1 * @param {number} y1 @@ -33740,7 +33900,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates at the power given. - * + * * @method Phaser.Math#distancePow * @param {number} x1 * @param {number} y1 @@ -33759,7 +33919,7 @@ Phaser.Math = { /** * Returns the rounded distance between the two given set of coordinates. - * + * * @method Phaser.Math#distanceRounded * @param {number} x1 * @param {number} y1 @@ -33776,7 +33936,7 @@ Phaser.Math = { /** * Force a value within the boundaries of two values. * Clamp value to range - * + * * @method Phaser.Math#clamp * @param {number} x * @param {number} a @@ -33788,10 +33948,10 @@ Phaser.Math = { return ( x < a ) ? a : ( ( x > b ) ? b : x ); }, - + /** * Clamp value to range to range - * + * * @method Phaser.Math#mapLinear * @param {number} x the value to map * @param {number} a1 first endpoint of the range @@ -33837,7 +33997,7 @@ Phaser.Math = { /** * Smoothstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smoothstep * @param {number} x * @param {number} min @@ -33864,7 +34024,7 @@ Phaser.Math = { /** * Smootherstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smootherstep * @param {number} x * @param {number} min @@ -33892,7 +34052,7 @@ Phaser.Math = { /** * A value representing the sign of the value. * -1 for negative, +1 for positive, 0 if value is 0 - * + * * @method Phaser.Math#sign * @param {number} x * @return {number} @@ -33905,11 +34065,11 @@ Phaser.Math = { /** * Convert degrees to radians. - * + * * @method Phaser.Math#degToRad * @return {function} */ - degToRad: function() { + degToRad: (function() { var degreeToRadiansFactor = Math.PI / 180; @@ -33919,15 +34079,15 @@ Phaser.Math = { }; - }(), + }()), /** * Convert degrees to radians. - * + * * @method Phaser.Math#radToDeg * @return {function} */ - radToDeg: function() { + radToDeg: (function() { var radianToDegreesFactor = 180 / Math.PI; @@ -33937,7 +34097,7 @@ Phaser.Math = { }; - }() + }()) }; @@ -33951,17 +34111,17 @@ Phaser.Math = { /** * Phaser.RandomDataGenerator constructor. -* +* * @class Phaser.RandomDataGenerator * @classdesc An extremely useful repeatable random data generator. Access it via Phaser.Game.rnd * Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense. * Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript -* +* * @constructor * @param {array} seeds */ Phaser.RandomDataGenerator = function (seeds) { - + if (typeof seeds === "undefined") { seeds = []; } /** @@ -34014,7 +34174,7 @@ Phaser.RandomDataGenerator.prototype = { /** * Reset the seed of the random data generator. - * + * * @method Phaser.RandomDataGenerator#sow * @param {array} seeds */ @@ -34038,7 +34198,7 @@ Phaser.RandomDataGenerator.prototype = { this.s2 -= this.hash(seed); this.s2 += ~~(this.s2 < 0); } - + }, /** @@ -34543,7 +34703,7 @@ Phaser.QuadTree.prototype.constructor = Phaser.QuadTree; * @param {Phaser.Game} game - A reference to the currently running game. */ Phaser.Net = function (game) { - + this.game = game; }; @@ -34552,7 +34712,7 @@ Phaser.Net.prototype = { /** * Returns the hostname given by the browser. - * + * * @method Phaser.Net#getHostName * @return {string} */ @@ -34571,7 +34731,7 @@ Phaser.Net.prototype = { * If the domain name is found it returns true. * You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc. * Do not include 'http://' at the start. - * + * * @method Phaser.Net#checkDomainName * @param {string} domain * @return {boolean} true if the given domain fragment can be found in the window.location.hostname @@ -34585,7 +34745,7 @@ Phaser.Net.prototype = { * If the value doesn't already exist it is set. * If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string. * Optionally you can redirect to the new url, or just return it as a string. - * + * * @method Phaser.Net#updateQueryString * @param {string} key - The querystring key to update. * @param {string} value - The new value to be set. If it already exists it will be replaced. @@ -34600,7 +34760,7 @@ Phaser.Net.prototype = { var output = ''; var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"); - + if (re.test(url)) { if (typeof value !== 'undefined' && value !== null) @@ -34647,7 +34807,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#getQueryString * @param {string} [parameter=''] - If specified this will return just the value for that key. * @return {string|object} An object containing the key value pairs found in the query string or just the value if a parameter was given. @@ -34683,7 +34843,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#decodeURI * @param {string} value - The URI component to be decoded. * @return {string} The decoded value. @@ -34704,9 +34864,9 @@ Phaser.Net.prototype.constructor = Phaser.Net; /** * Phaser - TweenManager -* +* * @class Phaser.TweenManager -* @classdesc +* @classdesc * Phaser.Game has a single instance of the TweenManager through which all Tween objects are created and updated. * Tweens are hooked into the game clock and pause system, adjusting based on the game state. * @@ -34724,13 +34884,13 @@ Phaser.TweenManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {array} _tweens - All of the currently running tweens. * @private */ this._tweens = []; - + /** * @property {array} _add - All of the tweens queued to be added in the next update. * @private @@ -34785,7 +34945,7 @@ Phaser.TweenManager.prototype = { }, /** - * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. + * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * * @method Phaser.TweenManager#create * @param {Object} object - Object the tween will be run on. @@ -35059,7 +35219,7 @@ Phaser.Tween = function (object, game, manager) { * @default null */ this._onUpdateCallback = null; - + /** * @property {object} _onUpdateCallbackContext - The context in which to call the onUpdate callback. * @private @@ -35098,7 +35258,7 @@ Phaser.Tween = function (object, game, manager) { // { // this._valuesStart[field] = parseFloat(object[field], 10); // } - + /** * @property {Phaser.Signal} onStart - The onStart event is fired when the Tween begins. */ @@ -35410,7 +35570,7 @@ Phaser.Tween.prototype = { }, /** - * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. + * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. * * @method Phaser.Tween#easing * @param {function} easing - The easing function this tween will use, i.e. Phaser.Easing.Linear.None. @@ -35454,7 +35614,7 @@ Phaser.Tween.prototype = { /** * Loop a chain of tweens - * + * * Usage: * game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true) * .to({ y: 300 }, 1000, Phaser.Easing.Linear.None) @@ -35488,7 +35648,7 @@ Phaser.Tween.prototype = { }, /** - * Pauses the tween. + * Pauses the tween. * * @method Phaser.Tween#pause */ @@ -35506,7 +35666,7 @@ Phaser.Tween.prototype = { * @private */ _pause: function () { - + if (!this._codePaused) { this._paused = true; @@ -35671,7 +35831,7 @@ Phaser.Tween.prototype = { return true; } - + }; Phaser.Tween.prototype.constructor = Phaser.Tween; @@ -35701,7 +35861,7 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Linear#In + * @method Phaser.Easing.Linear#In * @param {number} k - The value to be tweened. * @returns {number} k^2. */ @@ -35723,8 +35883,8 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Quadratic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#In + * @param {number} k - The value to be tweened. * @returns {number} k^2. */ In: function ( k ) { @@ -35736,8 +35896,8 @@ Phaser.Easing = { /** * Ease-out. * - * @method Phaser.Easing.Quadratic#Out - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#Out + * @param {number} k - The value to be tweened. * @returns {number} k* (2-k). */ Out: function ( k ) { @@ -35750,7 +35910,7 @@ Phaser.Easing = { * Ease-in/out. * * @method Phaser.Easing.Quadratic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35772,8 +35932,8 @@ Phaser.Easing = { /** * Cubic ease-in. * - * @method Phaser.Easing.Cubic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Cubic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35786,7 +35946,7 @@ Phaser.Easing = { * Cubic ease-out. * * @method Phaser.Easing.Cubic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35799,7 +35959,7 @@ Phaser.Easing = { * Cubic ease-in/out. * * @method Phaser.Easing.Cubic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35821,8 +35981,8 @@ Phaser.Easing = { /** * Quartic ease-in. * - * @method Phaser.Easing.Quartic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quartic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35835,7 +35995,7 @@ Phaser.Easing = { * Quartic ease-out. * * @method Phaser.Easing.Quartic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35848,7 +36008,7 @@ Phaser.Easing = { * Quartic ease-in/out. * * @method Phaser.Easing.Quartic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35870,8 +36030,8 @@ Phaser.Easing = { /** * Quintic ease-in. * - * @method Phaser.Easing.Quintic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quintic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35884,7 +36044,7 @@ Phaser.Easing = { * Quintic ease-out. * * @method Phaser.Easing.Quintic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35897,7 +36057,7 @@ Phaser.Easing = { * Quintic ease-in/out. * * @method Phaser.Easing.Quintic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35919,8 +36079,8 @@ Phaser.Easing = { /** * Sinusoidal ease-in. * - * @method Phaser.Easing.Sinusoidal#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Sinusoidal#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35933,7 +36093,7 @@ Phaser.Easing = { * Sinusoidal ease-out. * * @method Phaser.Easing.Sinusoidal#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35946,7 +36106,7 @@ Phaser.Easing = { * Sinusoidal ease-in/out. * * @method Phaser.Easing.Sinusoidal#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35967,8 +36127,8 @@ Phaser.Easing = { /** * Exponential ease-in. * - * @method Phaser.Easing.Exponential#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Exponential#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35981,7 +36141,7 @@ Phaser.Easing = { * Exponential ease-out. * * @method Phaser.Easing.Exponential#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35994,7 +36154,7 @@ Phaser.Easing = { * Exponential ease-in/out. * * @method Phaser.Easing.Exponential#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36018,8 +36178,8 @@ Phaser.Easing = { /** * Circular ease-in. * - * @method Phaser.Easing.Circular#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Circular#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36032,7 +36192,7 @@ Phaser.Easing = { * Circular ease-out. * * @method Phaser.Easing.Circular#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36045,7 +36205,7 @@ Phaser.Easing = { * Circular ease-in/out. * * @method Phaser.Easing.Circular#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36067,8 +36227,8 @@ Phaser.Easing = { /** * Elastic ease-in. * - * @method Phaser.Easing.Elastic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Elastic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36086,7 +36246,7 @@ Phaser.Easing = { * Elastic ease-out. * * @method Phaser.Easing.Elastic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36104,7 +36264,7 @@ Phaser.Easing = { * Elastic ease-in/out. * * @method Phaser.Easing.Elastic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36131,8 +36291,8 @@ Phaser.Easing = { /** * Back ease-in. * - * @method Phaser.Easing.Back#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Back#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36146,7 +36306,7 @@ Phaser.Easing = { * Back ease-out. * * @method Phaser.Easing.Back#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36160,7 +36320,7 @@ Phaser.Easing = { * Back ease-in/out. * * @method Phaser.Easing.Back#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36183,8 +36343,8 @@ Phaser.Easing = { /** * Bounce ease-in. * - * @method Phaser.Easing.Bounce#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Bounce#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36197,7 +36357,7 @@ Phaser.Easing = { * Bounce ease-out. * * @method Phaser.Easing.Bounce#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36226,7 +36386,7 @@ Phaser.Easing = { * Bounce ease-in/out. * * @method Phaser.Easing.Bounce#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36464,7 +36624,7 @@ Phaser.Time.prototype = { { this.time = this.now; this._justResumed = false; - + this.events.resume(); for (var i = 0; i < this._timers.length; i++) @@ -36537,7 +36697,7 @@ Phaser.Time.prototype = { * @private */ gamePaused: function () { - + this._pauseStarted = this.now; this.events.pause(); @@ -37045,7 +37205,7 @@ Phaser.Timer.prototype = { * @method Phaser.Timer#pause */ pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -37062,7 +37222,7 @@ Phaser.Timer.prototype = { * @private */ _pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -37169,7 +37329,7 @@ Object.defineProperty(Phaser.Timer.prototype, "next", { Object.defineProperty(Phaser.Timer.prototype, "duration", { get: function () { - + if (this.running && this.nextTick > this._now) { return this.nextTick - this._now; @@ -37329,7 +37489,7 @@ Phaser.AnimationManager = function (sprite) { * @default */ this.currentFrame = null; - + /** * @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false. * @default @@ -37483,7 +37643,7 @@ Phaser.AnimationManager.prototype = { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. - * + * * @method Phaser.AnimationManager#play * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". * @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used. @@ -37545,7 +37705,7 @@ Phaser.AnimationManager.prototype = { /** * The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events. - * + * * @method Phaser.AnimationManager#update * @protected * @return {boolean} True if a new animation frame has been set, otherwise false. @@ -37643,7 +37803,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameData', { * @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', { - + get: function () { if (this._frameData) @@ -37690,7 +37850,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { { return this._frameIndex; } - + }, set: function (value) { @@ -37698,12 +37858,12 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) { this.currentFrame = this._frameData.getFrame(value); - + if (this.currentFrame) { this._frameIndex = value; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -37741,7 +37901,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', { { this._frameIndex = this.currentFrame.index; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -37898,7 +38058,7 @@ Phaser.Animation = function (game, parent, name, frameData, frames, delay, loop) // Set-up some event listeners this.game.onPause.add(this.onPause, this); this.game.onResume.add(this.onResume, this); - + }; Phaser.Animation.prototype = { @@ -38097,7 +38257,7 @@ Phaser.Animation.prototype = { this._parent.tilingTexture = false; } } - + this.loopCount++; this._parent.events.onAnimationLoop.dispatch(this._parent, this); this.onLoop.dispatch(this._parent, this); @@ -38345,7 +38505,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer return output; -} +}; /** * @author Richard Davey @@ -38372,7 +38532,7 @@ Phaser.Frame = function (index, x, y, width, height, name, uuid) { * @property {number} index - The index of this Frame within the FrameData set it is being added to. */ this.index = index; - + /** * @property {number} x - X position within the image to cut from. */ @@ -38636,7 +38796,7 @@ Phaser.FrameData.prototype = { } return true; - + }, /** @@ -38649,7 +38809,7 @@ Phaser.FrameData.prototype = { * @return {Array} An array of Frames between the start and end index values, or an empty array if none were found. */ getFrameRange: function (start, end, output) { - + if (typeof output === "undefined") { output = []; } for (var i = start; i <= end; i++) @@ -38824,7 +38984,7 @@ Phaser.AnimationParser = { var row = Math.floor((width - margin) / (frameWidth + spacing)); var column = Math.floor((height - margin) / (frameHeight + spacing)); var total = row * column; - + if (frameMax !== -1) { total = frameMax; @@ -38889,11 +39049,11 @@ Phaser.AnimationParser = { // Let's create some frames then var data = new Phaser.FrameData(); - + // By this stage frames is a fully parsed array var frames = json['frames']; var newFrame; - + for (var i = 0; i < frames.length; i++) { var uuid = game.rnd.uuid(); @@ -38954,7 +39114,7 @@ Phaser.AnimationParser = { console.log(json); return; } - + // Let's create some frames then var data = new Phaser.FrameData(); @@ -38962,7 +39122,7 @@ Phaser.AnimationParser = { var frames = json['frames']; var newFrame; var i = 0; - + for (var key in frames) { var uuid = game.rnd.uuid(); @@ -39040,7 +39200,7 @@ Phaser.AnimationParser = { var frameY; var frameWidth; var frameHeight; - + for (var i = 0; i < frames.length; i++) { uuid = game.rnd.uuid(); @@ -39461,7 +39621,7 @@ Phaser.Cache.prototype = { * Add a new text data. * * @method Phaser.Cache#addText - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -39475,7 +39635,7 @@ Phaser.Cache.prototype = { * Add a new json object into the cache. * * @method Phaser.Cache#addJSON - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -39575,7 +39735,7 @@ Phaser.Cache.prototype = { * @param {string} key - Asset key for the sound. */ updateSound: function (key, property, value) { - + if (this._sounds[key]) { this._sounds[key][property] = value; @@ -39691,7 +39851,7 @@ Phaser.Cache.prototype = { console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "' + key + ' / ' + object + '"'); } } - + return null; }, @@ -39980,7 +40140,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getText: Invalid key: "' + key + '"'); } - + }, /** @@ -40000,7 +40160,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"'); } - + }, /** @@ -40020,7 +40180,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getBinary: Invalid key: "' + key + '"'); } - + }, /** @@ -40271,6 +40431,7 @@ Phaser.Cache.prototype = { Phaser.Cache.prototype.constructor = Phaser.Cache; +/* jshint wsh:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -40370,17 +40531,17 @@ Phaser.Loader = function (game) { * @property {Phaser.Signal} onFileComplete - Event signal. */ this.onFileComplete = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onFileError - Event signal. */ this.onFileError = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadStart - Event signal. */ this.onLoadStart = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadComplete - Event signal. */ @@ -40468,7 +40629,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -40493,7 +40654,7 @@ Phaser.Loader.prototype = { } return -1; - + }, /** @@ -40518,7 +40679,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -41436,11 +41597,11 @@ Phaser.Loader.prototype = { if (file.autoDecode) { - this.game.cache.updateSound(key, 'isDecoding', true); - var that = this; var key = file.key; + this.game.cache.updateSound(key, 'isDecoding', true); + this.game.sound.context.decodeAudioData(file.data, function (buffer) { if (buffer) { @@ -41675,7 +41836,7 @@ Phaser.Loader.prototype = { { this.hasLoaded = true; this.isLoading = false; - + this.removeAll(); this.onLoadComplete.dispatch(); @@ -41833,7 +41994,7 @@ Phaser.LoaderParser = { * @param {boolean} [loop=false] - Whether or not the sound will loop. */ Phaser.Sound = function (game, key, volume, loop, connect) { - + if (typeof volume == 'undefined') { volume = 1; } if (typeof loop == 'undefined') { loop = false; } if (typeof connect === 'undefined') { connect = game.sound.connectToMaster; } @@ -41869,7 +42030,7 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {object} markers - The sound markers. */ this.markers = {}; - + /** * @property {AudioContext} context - Reference to the AudioContext instance. */ @@ -41897,34 +42058,34 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {number} totalDuration - The total duration of the sound, in milliseconds */ this.totalDuration = 0; - + /** * @property {number} startTime - The time the Sound starts at (typically 0 unless starting from a marker) * @default */ this.startTime = 0; - + /** * @property {number} currentTime - The current time the sound is at. */ this.currentTime = 0; - + /** * @property {number} duration - The duration of the sound. */ this.duration = 0; - + /** * @property {number} stopTime - The time the sound stopped. */ this.stopTime = 0; - + /** * @property {boolean} paused - true if the sound is paused, otherwise false. * @default */ this.paused = false; - + /** * @property {number} pausedPosition - The position the sound had reached when it was paused. */ @@ -41940,31 +42101,31 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @default */ this.isPlaying = false; - + /** * @property {string} currentMarker - The string ID of the currently playing marker, if any. * @default */ this.currentMarker = ''; - + /** * @property {boolean} pendingPlayback - true if the sound file is pending playback * @readonly */ this.pendingPlayback = false; - + /** * @property {boolean} override - if true when you play this sound it will always start from the beginning. * @default */ this.override = false; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = this.game.sound.usingWebAudio; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. */ @@ -42018,37 +42179,37 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {Phaser.Signal} onDecoded - The onDecoded event is dispatched when the sound has finished decoding (typically for mp3 files) */ this.onDecoded = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPlay - The onPlay event is dispatched each time this sound is played. */ this.onPlay = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPause - The onPause event is dispatched when this sound is paused. */ this.onPause = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onResume - The onResume event is dispatched when this sound is resumed from a paused state. */ this.onResume = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoop - The onLoop event is dispatched when this sound loops during playback. */ this.onLoop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onStop - The onStop event is dispatched when this sound stops playback. */ this.onStop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMute - The onMouse event is dispatched when this sound is muted. */ this.onMute = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMarkerComplete - The onMarkerComplete event is dispatched when a marker within this sound completes playback. */ @@ -42309,7 +42470,7 @@ Phaser.Sound.prototype = { this._sound = this.context.createBufferSource(); this._sound.buffer = this._buffer; - + if (this.externalNode) { this._sound.connect(this.externalNode.input); @@ -42389,7 +42550,7 @@ Phaser.Sound.prototype = { // console.log('playing', this._sound); this._sound.currentTime = this.position; this._sound.muted = this._muted; - + if (this._muted) { this._sound.volume = 0; @@ -42530,7 +42691,7 @@ Phaser.Sound.prototype = { this.isPlaying = false; var prevMarker = this.currentMarker; - + if (this.currentMarker !== '') { this.onMarkerComplete.dispatch(this.currentMarker, this); @@ -42576,11 +42737,11 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoded", { * @property {boolean} mute - Gets or sets the muted state of this sound. */ Object.defineProperty(Phaser.Sound.prototype, "mute", { - + get: function () { return this._muted; }, - + set: function (value) { value = value || null; @@ -42673,12 +42834,12 @@ Phaser.SoundManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {Phaser.Signal} onSoundDecode - The event dispatched when a sound decodes (typically only for mp3 files) */ this.onSoundDecode = new Phaser.Signal(); - + /** * @property {boolean} _codeMuted - Internal mute tracking var. * @private @@ -42692,7 +42853,7 @@ Phaser.SoundManager = function (game) { * @default */ this._muted = false; - + /** * @property {Description} _unlockSource - Internal unlock tracking var. * @private @@ -42703,12 +42864,12 @@ Phaser.SoundManager = function (game) { /** * @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume). * @private - * @default + * @default */ this._volume = 1; /** - * @property {array} _sounds - An array containing all the sounds + * @property {array} _sounds - An array containing all the sounds * @private * @default The empty array. */ @@ -42719,19 +42880,19 @@ Phaser.SoundManager = function (game) { * @default */ this.context = null; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = true; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. * @readonly */ this.usingAudioTag = false; - + /** * @property {boolean} noAudio - Has audio been disabled via the PhaserGlobal object? Useful if you need to use a 3rd party audio library instead. * @default @@ -42755,7 +42916,7 @@ Phaser.SoundManager = function (game) { * @default */ this.channels = 32; - + }; Phaser.SoundManager.prototype = { @@ -42921,7 +43082,7 @@ Phaser.SoundManager.prototype = { this._sounds[i].resume(); } } - + }, /** @@ -43136,7 +43297,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { * @property {number} volume - Gets or sets the global volume of the SoundManager, a value between 0 and 1. */ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { - + get: function () { if (this.usingWebAudio) @@ -43169,7 +43330,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { } } } - + } }); @@ -43196,7 +43357,7 @@ Phaser.Utils.Debug = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {PIXI.Sprite} sprite - If debugging in WebGL mode we need this. */ @@ -43211,7 +43372,7 @@ Phaser.Utils.Debug = function (game) { * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = null; - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ @@ -43232,7 +43393,7 @@ Phaser.Utils.Debug = function (game) { * @default '14px Courier' */ this.font = '14px Courier'; - + /** * @property {number} columnWidth - The spacing between columns. */ @@ -43242,24 +43403,24 @@ Phaser.Utils.Debug = function (game) { * @property {number} lineHeight - The line height between the debug text. */ this.lineHeight = 16; - + /** * @property {boolean} renderShadow - Should the text be rendered with a slight shadow? Makes it easier to read on different types of background. */ this.renderShadow = true; - + /** * @property {Context} currentX - The current X position the debug information will be rendered at. * @default */ this.currentX = 0; - + /** * @property {number} currentY - The current Y position the debug information will be rendered at. * @default */ this.currentY = 0; - + /** * @property {number} currentAlpha - The current alpha the debug information will be rendered at. * @default @@ -43446,7 +43607,7 @@ Phaser.Utils.Debug.prototype = { this.line('Bounds x: ' + camera.bounds.x + ' Y: ' + camera.bounds.y + ' w: ' + camera.bounds.width + ' h: ' + camera.bounds.height); this.line('View x: ' + camera.view.x + ' Y: ' + camera.view.y + ' w: ' + camera.view.width + ' h: ' + camera.view.height); this.stop(); - + }, /** @@ -43739,7 +43900,7 @@ Phaser.Utils.Debug.prototype = { } this.stop(); - + }, /** @@ -43948,7 +44109,7 @@ Phaser.Color = { var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h; - if (hex16.length==3) + if (hex16.length == 3) { hex16 = hex16.charAt(0) + hex16.charAt(0) + hex16.charAt(1) + hex16.charAt(1) + hex16.charAt(2) + hex16.charAt(2); } @@ -43958,7 +44119,7 @@ Phaser.Color = { var blue = parseInt(hex16.substring(4, 6), 16); return red << 16 | green << 8 | blue; - + }, /** @@ -43974,13 +44135,13 @@ Phaser.Color = { var argb = Phaser.Color.getRGB(color); var hsl = Phaser.Color.RGBtoHSV(color); - + // Hex format var result = Phaser.Color.RGBtoHexstring(color) + "\n"; - + // RGB format result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n"; - + // HSL info result = result.concat("Hue: " + hsl.hue + " Saturation: " + hsl.saturation + " Lightnes: " + hsl.lightness); @@ -44181,7 +44342,7 @@ Phaser.Color = { var blue = color & 0xFF; return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',' + alpha.toString() + ')'; - + }, /** @@ -44243,7 +44404,7 @@ Phaser.Color = { getBlue: function (color) { return color & 0xFF; } - + }; /** @@ -44394,11 +44555,11 @@ Phaser.Physics.prototype = { } else if (system === Phaser.Physics.BOX2D && this.box2d === null) { - // Coming soon + throw new Error('The Box2D physics system has not been implemented yet.'); } else if (system === Phaser.Physics.CHIPMUNK && this.chipmunk === null) { - // Coming soon + throw new Error('The Chipmunk physics system has not been implemented yet.'); } }, @@ -44552,7 +44713,7 @@ Phaser.Physics.prototype.constructor = Phaser.Physics; * @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Arcade = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -44879,7 +45040,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if an overlap occured otherwise false. + * @return {boolean} True if an overlap occured otherwise false. */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -44920,7 +45081,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if a collision occured otherwise false. + * @return {boolean} True if a collision occured otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -45190,10 +45351,10 @@ Phaser.Physics.Arcade.prototype = { collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) { this._mapData = tilemapLayer.getTiles( - sprite.body.position.x - sprite.body.tilePadding.x, - sprite.body.position.y - sprite.body.tilePadding.y, - sprite.body.width + sprite.body.tilePadding.x, - sprite.body.height + sprite.body.tilePadding.y, + sprite.body.position.x - sprite.body.tilePadding.x, + sprite.body.position.y - sprite.body.tilePadding.y, + sprite.body.width + sprite.body.tilePadding.x, + sprite.body.height + sprite.body.tilePadding.y, false, false); if (this._mapData.length === 0) @@ -45235,8 +45396,8 @@ Phaser.Physics.Arcade.prototype = { /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * - * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @private + * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @param {Phaser.Group} group - The Group to check. * @param {Phaser.TilemapLayer} tilemapLayer - The layer to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. @@ -45264,13 +45425,14 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies. * + * @private * @method Phaser.Physics.Arcade#separate * @param {Phaser.Physics.Arcade.Body} body1 - The first Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body object to separate. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. * @param {object} [callbackContext] - The context in which to run the process callback. * @param {boolean} overlapOnly - Just run an overlap or a full collision. - * @returns {boolean} Returns true if the bodies collided, otherwise false. + * @return {boolean} Returns true if the bodies collided, otherwise false. */ separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { @@ -45342,11 +45504,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the x axis. + * + * @private * @method Phaser.Physics.Arcade#separateX * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateX: function (body1, body2, overlapOnly) { @@ -45455,11 +45619,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the y axis. + * + * @private * @method Phaser.Physics.Arcade#separateY * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateY: function (body1, body2, overlapOnly) { @@ -45581,10 +45747,12 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate a physics body and a tile. + * + * @private * @method Phaser.Physics.Arcade#separateTile * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to collide against. - * @returns {boolean} Returns true if the body was separated, otherwise false. + * @return {boolean} Returns true if the body was separated, otherwise false. */ separateTile: function (i, body, tile) { @@ -45653,7 +45821,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceTop || tile.faceBottom) { oy = this.tileCheckY(body, tile); @@ -45671,7 +45839,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceLeft || tile.faceRight) { ox = this.tileCheckX(body, tile); @@ -45685,11 +45853,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the X axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckX: function (body, tile) { @@ -45734,11 +45902,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the Y axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckY: function (body, tile) { @@ -45782,11 +45950,12 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} x - The x separation amount. - * @returns {boolean} Returns true as a pass-thru to the separateTile method. + * @return {boolean} Returns true as a pass-thru to the separateTile method. */ processTileSeparationX: function (body, x) { @@ -45814,12 +45983,13 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} y - The y separation amount. */ - processTileSeparationY: function (body, y, tile) { + processTileSeparationY: function (body, y) { if (y < 0) { @@ -45850,7 +46020,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -45864,13 +46034,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45884,7 +46054,7 @@ Phaser.Physics.Arcade.prototype = { * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#moveToPointer * @param {any} displayObject - The display object to move. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) @@ -45905,7 +46075,7 @@ Phaser.Physics.Arcade.prototype = { // We know how many pixels we need to move, but how fast? speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45920,7 +46090,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to move towards. @@ -45935,13 +46105,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(y - displayObject.y, x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45952,7 +46122,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromAngle * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -45971,7 +46141,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -45990,7 +46160,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. * One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#accelerationFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -46011,7 +46181,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -46040,7 +46210,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToPointer * @param {any} displayObject - The display object to move. * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. @@ -46057,7 +46227,7 @@ Phaser.Physics.Arcade.prototype = { if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; } this._angle = this.angleToPointer(displayObject, pointer); - + displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); @@ -46070,7 +46240,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to accelerate towards. @@ -46097,7 +46267,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the distance between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#distanceBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -46107,7 +46277,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = source.x - target.x; this._dy = source.y - target.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -46116,7 +46286,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and the given x/y coordinates. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to move towards. @@ -46127,7 +46297,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - x; this._dy = displayObject.y - y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -46136,7 +46306,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -46148,14 +46318,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - pointer.x; this._dy = displayObject.y - pointer.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, /** * Find the angle in radians between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#angleBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -46172,7 +46342,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate. - * + * * @method Phaser.Physics.Arcade#angleToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to get the angle to. @@ -46183,14 +46353,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = x - displayObject.x; this._dy = y - displayObject.y; - + return Math.atan2(this._dy, this._dx); }, - + /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account. - * + * * @method Phaser.Physics.Arcade#angleToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -46202,7 +46372,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = pointer.worldX - displayObject.x; this._dy = pointer.worldY - displayObject.y; - + return Math.atan2(this._dy, this._dx); } @@ -46402,12 +46572,6 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.speed = 0; - /** - * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to any QuadTrees. - * @default - this.skipQuadTree = false; - */ - /** * @property {number} facing - A const reference to the direction the Body is traveling or facing. * @default @@ -46503,6 +46667,17 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.tilePadding = new Phaser.Point(); + /** + * @property {number} phaser - Is this Body in a preUpdate or postUpdate state? + */ + this.phase = 0; + + /** + * @property {boolean} _reset - Internal cache var. + * @private + */ + this._reset = true; + /** * @property {number} _sx - Internal cache var. * @private @@ -46552,11 +46727,9 @@ Phaser.Physics.Arcade.Body.prototype = { this._sy = asy; this.center.setTo(this.position.x + this.halfWidth, this.position.y + this.halfHeight); - return true; + this._reset = true; } - return false; - }, /** @@ -46567,6 +46740,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ preUpdate: function () { + this.phase = 1; + // Store and reset collision flags this.wasTouching.none = this.touching.none; this.wasTouching.up = this.touching.up; @@ -46587,13 +46762,15 @@ Phaser.Physics.Arcade.Body.prototype = { this.embedded = false; + this.updateBounds(); + this.position.x = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x; this.position.y = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y; this.rotation = this.sprite.angle; this.preRotation = this.rotation; - if (this.updateBounds() || this.sprite._cache[4] === 1) + if (this._reset || this.sprite._cache[4] === 1) { this.prev.x = this.position.x; this.prev.y = this.position.y; @@ -46623,6 +46800,11 @@ Phaser.Physics.Arcade.Body.prototype = { } } + this._dx = this.deltaX(); + this._dy = this.deltaY(); + + this._reset = false; + }, /** @@ -46633,6 +46815,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ postUpdate: function () { + this.phase = 2; + if (this.deltaX() < 0) { this.facing = Phaser.LEFT; @@ -46670,7 +46854,7 @@ Phaser.Physics.Arcade.Body.prototype = { if (this.deltaMax.y !== 0 && this._dy !== 0) { - if (this._dy < 0 && this._dx < -this.deltaMax.y) + if (this._dy < 0 && this._dy < -this.deltaMax.y) { this._dy = -this.deltaMax.y; } @@ -46880,7 +47064,7 @@ Phaser.Physics.Arcade.Body.prototype = { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { - + get: function () { return this.position.y + this.height; } @@ -46893,7 +47077,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { - + get: function () { return this.position.x + this.width; } @@ -46905,12 +47089,13 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { - + get: function () { return this.position.x; }, set: function (value) { + this.position.x = value; } @@ -46921,13 +47106,15 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", { - + get: function () { return this.position.y; }, set: function (value) { + this.position.y = value; + } }); @@ -46958,7 +47145,7 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { context.strokeRect(body.position.x - body.game.camera.x, body.position.y - body.game.camera.y, body.width, body.height); } -} +}; /** * Render Sprite Body Physics Data as text. @@ -46972,14 +47159,13 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { Phaser.Physics.Arcade.Body.renderBodyInfo = function (debug, body) { debug.line('x: ' + body.x.toFixed(2), 'y: ' + body.y.toFixed(2), 'width: ' + body.width, 'height: ' + body.height); - // debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body.deltaX().toFixed(2), 'deltaY: ' + body.deltaY().toFixed(2)); - debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'new velocity x: ' + body.newVelocity.x.toFixed(2), 'y: ' + body.newVelocity.y.toFixed(2)); + debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body._dx.toFixed(2), 'deltaY: ' + body._dy.toFixed(2)); debug.line('acceleration x: ' + body.acceleration.x.toFixed(2), 'y: ' + body.acceleration.y.toFixed(2), 'speed: ' + body.speed.toFixed(2), 'angle: ' + body.angle.toFixed(2)); debug.line('gravity x: ' + body.gravity.x, 'y: ' + body.gravity.y, 'bounce x: ' + body.bounce.x.toFixed(2), 'y: ' + body.bounce.y.toFixed(2)); debug.line('touching left: ' + body.touching.left, 'right: ' + body.touching.right, 'up: ' + body.touching.up, 'down: ' + body.touching.down); debug.line('blocked left: ' + body.blocked.left, 'right: ' + body.blocked.right, 'up: ' + body.blocked.up, 'down: ' + body.blocked.down); -} +}; Phaser.Physics.Arcade.Body.prototype.constructor = Phaser.Physics.Arcade.Body; @@ -47010,7 +47196,7 @@ Phaser.Particles = function (game) { this.emitters = {}; /** - * @property {number} ID - + * @property {number} ID - * @default */ this.ID = 0; @@ -47065,7 +47251,8 @@ Phaser.Particles.prototype = { Phaser.Particles.prototype.constructor = Phaser.Particles; -Phaser.Particles.Arcade = {} +Phaser.Particles.Arcade = {}; + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -47257,7 +47444,7 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) { * @property {boolean} emitX */ this.emitX = x; - + /** * The point the particles are emitted from. * Emitter.x and Emitter.y control the containers location, which updates all current particles @@ -47297,7 +47484,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { if (this.game.time.now >= this._timer) { this.emitParticle(); - + this._counter++; if (this._quantity > 0) @@ -47313,7 +47500,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { } } -} +}; /** * This function generates a new array of particle sprites to attach to the emitter. @@ -47380,7 +47567,7 @@ Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames return this; -} +}; /** * Call this function to turn off all the particles and the emitter. @@ -47392,7 +47579,7 @@ Phaser.Particles.Arcade.Emitter.prototype.kill = function () { this.alive = false; this.exists = false; -} +}; /** * Handy for bringing game objects "back to life". Just sets alive and exists back to true. @@ -47403,7 +47590,7 @@ Phaser.Particles.Arcade.Emitter.prototype.revive = function () { this.alive = true; this.exists = true; -} +}; /** * Call this function to start emitting particles. @@ -47441,7 +47628,7 @@ Phaser.Particles.Arcade.Emitter.prototype.start = function (explode, lifespan, f this._counter = 0; this._timer = this.game.time.now + frequency; -} +}; /** * This function can be used both internally and externally to emit the next particle. @@ -47518,7 +47705,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () { particle.body.drag.y = this.particleDrag.y; particle.body.angularDrag = this.angularDrag; -} +}; /** * A more compact way of setting the width and height of the emitter. @@ -47531,7 +47718,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setSize = function (width, height) { this.width = width; this.height = height; -} +}; /** * A more compact way of setting the X velocity range of the emitter. @@ -47547,7 +47734,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setXSpeed = function (min, max) { this.minParticleSpeed.x = min; this.maxParticleSpeed.x = max; -} +}; /** * A more compact way of setting the Y velocity range of the emitter. @@ -47563,7 +47750,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setYSpeed = function (min, max) { this.minParticleSpeed.y = min; this.maxParticleSpeed.y = max; -} +}; /** * A more compact way of setting the angular velocity constraints of the emitter. @@ -47579,7 +47766,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setRotation = function (min, max) { this.minRotation = min; this.maxRotation = max; -} +}; /** * Change the emitters center to match the center of any object with a `center` property, such as a Sprite. @@ -47594,7 +47781,7 @@ Phaser.Particles.Arcade.Emitter.prototype.at = function (object) { this.emitY = object.center.y; } -} +}; /** * @name Phaser.Particles.Arcade.Emitter#x @@ -47634,7 +47821,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { - + get: function () { return Math.floor(this.x - (this.width / 2)); } @@ -47647,7 +47834,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { - + get: function () { return Math.floor(this.x + (this.width / 2)); } @@ -47660,7 +47847,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { - + get: function () { return Math.floor(this.y - (this.height / 2)); } @@ -47673,7 +47860,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { - + get: function () { return Math.floor(this.y + (this.height / 2)); } @@ -47710,12 +47897,12 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} index - The index of this tile within the map data corresponding to the tileset. */ this.index = index; - + /** * @property {number} x - The x map coordinate of this tile. */ this.x = x; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -47725,7 +47912,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} x - The x map coordinate of this tile. */ this.worldX = x * width; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -47735,7 +47922,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.width = width; - + /** * @property {number} height - The height of the tile in pixels. */ @@ -47745,7 +47932,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.centerX = Math.abs(width / 2); - + /** * @property {number} height - The height of the tile in pixels. */ @@ -47878,7 +48065,7 @@ Phaser.Tile.prototype = { /** * Set a callback to be called when this tile is hit by an object. * The callback must true true for collision processing to take place. - * + * * @method Phaser.Tile#setCollisionCallback * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. @@ -47900,7 +48087,7 @@ Phaser.Tile.prototype = { this.collisionCallback = null; this.collisionCallbackContext = null; this.properties = null; - + }, /** @@ -48002,7 +48189,7 @@ Phaser.Tile.prototype.constructor = Phaser.Tile; * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "collides", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } @@ -48015,7 +48202,7 @@ Object.defineProperty(Phaser.Tile.prototype, "collides", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); } @@ -48028,7 +48215,7 @@ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "left", { - + get: function () { return this.worldX; } @@ -48041,7 +48228,7 @@ Object.defineProperty(Phaser.Tile.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "right", { - + get: function () { return this.worldX + this.width; } @@ -48054,7 +48241,7 @@ Object.defineProperty(Phaser.Tile.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "top", { - + get: function () { return this.worldY; } @@ -48067,7 +48254,7 @@ Object.defineProperty(Phaser.Tile.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "bottom", { - + get: function () { return this.worldY + this.height; } @@ -48253,7 +48440,7 @@ Phaser.Tilemap.prototype = { * @param {Phaser.Group} [group] - Optional Group to add the layer to. If not specified it will be added to the World group. * @return {Phaser.TilemapLayer} The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly. */ - create: function (name, width, height, tileWidth, tileHeight) { + create: function (name, width, height, tileWidth, tileHeight, group) { if (typeof group === 'undefined') { group = this.game.world; } @@ -48834,7 +49021,7 @@ Phaser.Tilemap.prototype = { } } - for (var y = 0; y < this.layers[layer].height ; y++) + for (var y = 0; y < this.layers[layer].height; y++) { for (var x = 0; x < this.layers[layer].width; x++) { @@ -49133,7 +49320,7 @@ Phaser.Tilemap.prototype = { this.layers[layer].dirty = true; this.calculateFaces(layer); - + return this.layers[layer].data[y][x]; } @@ -49256,7 +49443,7 @@ Phaser.Tilemap.prototype = { this._results.length = 0; - this._results.push( { x: x, y: y, width: width, height: height, layer: layer }); + this._results.push({ x: x, y: y, width: width, height: height, layer: layer }); for (var ty = y; ty < y + height; ty++) { @@ -49283,7 +49470,7 @@ Phaser.Tilemap.prototype = { if (typeof x === "undefined") { x = 0; } if (typeof y === "undefined") { y = 0; } - + layer = this.getLayer(layer); if (!tileblock || tileblock.length < 2) @@ -49658,17 +49845,17 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. */ this.context = this.canvas.getContext('2d'); - + /** * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - Dimensions of the renderable area. */ @@ -49770,7 +49957,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {object} _mc - Local map data and calculation cache. - * @private + * @private */ this._mc = { @@ -49799,7 +49986,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {array} _results - Local render loop var to help avoid gc spikes. - * @private + * @private */ this._results = []; @@ -49820,8 +50007,8 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // console.log('layer pu'); - Phaser.Image.prototype.postUpdate.call(this); - + Phaser.Image.prototype.postUpdate.call(this); + // Stops you being able to auto-scroll the camera if it's not following a sprite this.scrollX = this.game.camera.x * this.scrollFactorX; this.scrollY = this.game.camera.y * this.scrollFactorY; @@ -49841,7 +50028,7 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // this.children[i].postUpdate(); // } -} +}; /** * Sets the world size to match the size of this layer. @@ -49853,10 +50040,10 @@ Phaser.TilemapLayer.prototype.resizeWorld = function () { this.game.world.setBounds(0, 0, this.layer.widthInPixels, this.layer.heightInPixels); -} +}; /** -* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it +* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixX * @memberof Phaser.TilemapLayer @@ -49878,10 +50065,10 @@ Phaser.TilemapLayer.prototype._fixX = function(x) { return this._mc.x + (x - (this._mc.x / this.scrollFactorX)); -} +}; /** -* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it +* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixX * @memberof Phaser.TilemapLayer @@ -49898,10 +50085,10 @@ Phaser.TilemapLayer.prototype._unfixX = function(x) { return (this._mc.x / this.scrollFactorX) + (x - this._mc.x); -} +}; /** -* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it +* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixY * @memberof Phaser.TilemapLayer @@ -49923,10 +50110,10 @@ Phaser.TilemapLayer.prototype._fixY = function(y) { return this._mc.y + (y - (this._mc.y / this.scrollFactorY)); -} +}; /** -* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it +* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixY * @memberof Phaser.TilemapLayer @@ -49943,7 +50130,7 @@ Phaser.TilemapLayer.prototype._unfixY = function(y) { return (this._mc.y / this.scrollFactorY) + (y - this._mc.y); -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49958,7 +50145,7 @@ Phaser.TilemapLayer.prototype.getTileX = function (x) { return this.game.math.snapToFloor(this._fixX(x), this.map.tileWidth) / this.map.tileWidth; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49973,7 +50160,7 @@ Phaser.TilemapLayer.prototype.getTileY = function (y) { return this.game.math.snapToFloor(this._fixY(y), this.map.tileHeight) / this.map.tileHeight; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49991,7 +50178,7 @@ Phaser.TilemapLayer.prototype.getTileXY = function (x, y, point) { return point; -} +}; /** * Gets all tiles that intersect with the given line. @@ -50037,7 +50224,7 @@ Phaser.TilemapLayer.prototype.getRayCastTiles = function (line, stepRate, collid return results; -} +}; /** * Get all tiles that exist within the given area, defined by the top-left corner, width and height. Values given are in pixels, not tiles. @@ -50096,7 +50283,7 @@ Phaser.TilemapLayer.prototype.getTiles = function (x, y, width, height, collides return this._results; -} +}; /** * Internal function to update maximum values. @@ -50123,7 +50310,7 @@ Phaser.TilemapLayer.prototype.updateMax = function () { this.dirty = true; -} +}; /** * Renders the tiles to the layer canvas and pushes to the display. @@ -50206,7 +50393,7 @@ Phaser.TilemapLayer.prototype.render = function () { if (this.game.renderType === Phaser.WEBGL) { - // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); + // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl); } @@ -50215,7 +50402,7 @@ Phaser.TilemapLayer.prototype.render = function () { return true; -} +}; /** * Renders a collision debug overlay on-top of the canvas. Called automatically by render when debug = true. @@ -50285,14 +50472,14 @@ Phaser.TilemapLayer.prototype.renderDebug = function () { } -} +}; /** * @name Phaser.TilemapLayer#scrollX * @property {number} scrollX - Scrolls the map horizontally or returns the current x position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { - + get: function () { return this._mc.x; }, @@ -50302,7 +50489,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { if (value !== this._mc.x && value >= 0 && this.layer.widthInPixels > this.width) { this._mc.x = value; - + if (this._mc.x > (this.layer.widthInPixels - this.width)) { this._mc.x = this.layer.widthInPixels - this.width; @@ -50332,7 +50519,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { * @property {number} scrollY - Scrolls the map vertically or returns the current y position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { - + get: function () { return this._mc.y; }, @@ -50372,7 +50559,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { * @property {number} collisionWidth - The width of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { - + get: function () { return this._mc.cw; }, @@ -50392,7 +50579,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { * @property {number} collisionHeight - The height of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", { - + get: function () { return this._mc.ch; }, @@ -50777,7 +50964,7 @@ Phaser.TilemapParser = { properties: json.layers[i].objects[v].properties }; - + objects[json.layers[i].name].push(object); } else if (json.layers[i].objects[v].polyline) @@ -50818,7 +51005,7 @@ Phaser.TilemapParser = { for (var i = 0; i < map.tilesets.length; i++) { var set = map.tilesets[i]; - + var x = set.tileMargin; var y = set.tileMargin; @@ -50863,7 +51050,7 @@ Phaser.TilemapParser = { } -} +}; /** * @author Richard Davey @@ -51059,4 +51246,4 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset; } else { root.Phaser = Phaser; } -}).call(this); \ No newline at end of file +}).call(this); diff --git a/build/custom/phaser-no-physics.min.js b/build/custom/phaser-no-physics.min.js index d3f0bed6be..7a5675672f 100644 --- a/build/custom/phaser-no-physics.min.js +++ b/build/custom/phaser-no-physics.min.js @@ -1,15 +1,15 @@ /* Phaser (no physics) v2.0.2 - http://phaser.io - @photonstorm - (c) 2014 Photon Storm Ltd. */ (function(){var a=this,b=b||{};b.WEBGL_RENDERER=0,b.CANVAS_RENDERER=1,b.VERSION="v1.5.0",b.blendModes={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},b.scaleModes={DEFAULT:0,LINEAR:0,NEAREST:1},b.INTERACTION_FREQUENCY=30,b.AUTO_PREVENT_DEFAULT=!0,b.RAD_TO_DEG=180/Math.PI,b.DEG_TO_RAD=Math.PI/180,b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.constructor=b.Point,b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype.clone=function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.determineMatrixArrayType=function(){return"undefined"!=typeof Float32Array?Float32Array:Array},b.Matrix2=b.determineMatrixArrayType(),b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new Float32Array(9));var b=this.array;return a?(this.array[0]=this.a,this.array[1]=this.c,this.array[2]=0,this.array[3]=this.b,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty,this.array[8]=1):(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0,this.array[8]=1),b},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new b.Rectangle(0,0,1,1),this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,b.DisplayObject.prototype.setInteractive=function(a){this.interactive=a},Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length))throw new Error(a+" The index "+b+" supplied is out of bounds "+this.children.length);a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.children.indexOf(a),d=this.children.indexOf(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(a>=0&&aa;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.getBounds=function(a){if(0===this.children.length)return b.EmptyRectangle;if(a){var c=this.worldTransform;this.worldTransform=a,this.updateTransform(),this.worldTransform=c}for(var d,e,f,g=1/0,h=1/0,i=-1/0,j=-1/0,k=!1,l=0,m=this.children.length;m>l;l++){var n=this.children[l];n.visible&&(k=!0,d=this.children[l].getBounds(a),g=ge?i:e,j=j>f?j:f)}if(!k)return b.EmptyRectangle;var o=this._bounds;return o.x=g,o.y=h,o.width=i-g,o.height=j-h,o},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){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)),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a.context);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,a.baseTexture.hasLoaded?this.onTextureUpdate():(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture.baseTexture!==a.baseTexture?(this.textureChange=!0,this.texture=a):this.texture=a,this.cachedTint=16777215,this.updateFrame=!0},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.c,k=h.b,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=-1/0,x=-1/0,y=1/0,z=1/0;y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>p?p:z,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=p>x?p:x,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x;var A=this._bounds;return A.x=y,A.width=w-y,A.y=z,A.height=x-z,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=this.texture.frame,d=a.context,e=this.texture;if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,d.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a.context),c&&c.width&&c.height&&e.baseTexture.source){d.globalAlpha=this.worldAlpha;var f=this.worldTransform;if(a.roundPixels?d.setTransform(f.a,f.c,f.b,f.d,0|f.tx,0|f.ty):d.setTransform(f.a,f.c,f.b,f.d,f.tx,f.ty),a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,d[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR),16777215!==this.tint){if(this.cachedTint!==this.tint){if(!e.baseTexture.hasLoaded)return;this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)}d.drawImage(this.tintedTexture,0,0,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}else if(e.trim){var g=e.trim;d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,g.x-this.anchor.x*g.width,g.y-this.anchor.y*g.height,c.width,c.height)}else d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}for(var h=0,i=this.children.length;i>h;h++){var j=this.children[h];j._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){b.DisplayObject.prototype.updateTransform.call(this)},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),a.spriteBatch.stop(),a.shaderManager.activateShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.shaderManager.activateShader(a.shaderManager.defaultShader),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){var c=a.context;c.globalAlpha=this.worldAlpha,b.DisplayObject.prototype.updateTransform.call(this);for(var d=this.worldTransform,e=!0,f=0;fe?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.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+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.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()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var c=0,d=["ms","moz","webkit","o"],e=0;e>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.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)}},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.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=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.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&&b.PolyK._PointInTriangle(a[2*t],a[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},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.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()},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.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]||b.createWebGLTexture(a.value.baseTexture,c)),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec2 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;"," vColor = vec4(color * aColor.x, aColor.x);","}"],b.PixiFastShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init() },b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(){this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));"," gl_FragColor = gl_FragColor * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","uniform vec2 offsetVector;","varying float vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"]},b.StripShader.prototype.init=function(){var a=b.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d=c.gl,e=c.projection,f=c.offset,g=c.shaderManager.primitiveShader;a._webGL[d.id]||(a._webGL[d.id]={points:[],indices:[],lastIndex:0,buffer:d.createBuffer(),indexBuffer:d.createBuffer()});var h=a._webGL[d.id];a.dirty&&(a.dirty=!1,a.clearDirty&&(a.clearDirty=!1,h.lastIndex=0,h.points=[],h.indices=[]),b.WebGLGraphics.updateGraphics(a,d)),c.shaderManager.activatePrimitiveShader(),d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),d.uniformMatrix3fv(g.translationMatrix,!1,a.worldTransform.toArray(!0)),d.uniform2f(g.projectionVector,e.x,-e.y),d.uniform2f(g.offsetVector,-f.x,-f.y),d.uniform3fv(g.tintColor,b.hex2rgb(a.tint)),d.uniform1f(g.alpha,a.worldAlpha),d.bindBuffer(d.ARRAY_BUFFER,h.buffer),d.vertexAttribPointer(g.aVertexPosition,2,d.FLOAT,!1,24,0),d.vertexAttribPointer(g.colorAttribute,4,d.FLOAT,!1,24,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,h.indexBuffer),d.drawElements(d.TRIANGLE_STRIP,h.indices.length,d.UNSIGNED_SHORT,0),c.shaderManager.deactivatePrimitiveShader()},b.WebGLGraphics.updateGraphics=function(a,c){for(var d=a._webGL[c.id],e=d.lastIndex;e3&&b.WebGLGraphics.buildPoly(f,d),f.lineWidth>0&&b.WebGLGraphics.buildLine(f,d)):f.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(f,d):(f.type===b.Graphics.CIRC||f.type===b.Graphics.ELIP)&&b.WebGLGraphics.buildCircle(f,d)}d.lastIndex=a.graphicsData.length,d.glPoints=new Float32Array(d.points),c.bindBuffer(c.ARRAY_BUFFER,d.buffer),c.bufferData(c.ARRAY_BUFFER,d.glPoints,c.STATIC_DRAW),d.glIndicies=new Uint16Array(d.indices),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,d.indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,d.glIndicies,c.STATIC_DRAW)},b.WebGLGraphics.buildRectangle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3];if(a.fill){var i=b.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=c.points,o=c.indices,p=n.length/6;n.push(e,f),n.push(k,l,m,j),n.push(e+g,f),n.push(k,l,m,j),n.push(e,f+h),n.push(k,l,m,j),n.push(e+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[e,f,e+g,f,e+g,f+h,e,f+h,e,f],b.WebGLGraphics.buildLine(a,c),a.points=q}},b.WebGLGraphics.buildCircle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3],i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(e,f,n,o,p,m),q.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h,n,o,p,m),r.push(s++,s++);r.push(s-1)}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d),n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i)}},b.glContexts=[],b.WebGLRenderer=function(a,c,d,e,f){b.defaultRenderer||(b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.transparent=!!e,this.width=a||800,this.height=c||600,this.view=d||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.contextLost=this.handleContextLost.bind(this),this.contextRestoredLost=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLost,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredLost,!1),this.options={alpha:this.transparent,antialias:!!f,premultipliedAlpha:!!e,stencil:!0};try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(g){try{this.gl=this.view.getContext("webgl",this.options)}catch(h){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var i=this.gl;this.glContextId=i.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=i,b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[i.SRC_ALPHA,i.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[i.SRC_ALPHA,i.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA]),this.projection=new b.Point,this.projection.x=this.width/2,this.projection.y=-this.height/2,this.offset=new b.Point(0,0),this.resize(this.width,this.height),this.contextLost=!1,this.shaderManager=new b.WebGLShaderManager(i),this.spriteBatch=new b.WebGLSpriteBatch(i),this.maskManager=new b.WebGLMaskManager(i),this.filterManager=new b.WebGLFilterManager(i,this.transparent),this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.renderer=this,i.useProgram(this.shaderManager.defaultShader.program),i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.colorMask(!0,!0,!0,this.transparent)},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),b.WebGLRenderer.updateTextures(),a.updateTransform(),a._interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)));var c=this.gl;c.viewport(0,0,this.width,this.height),c.bindFramebuffer(c.FRAMEBUFFER,null),this.transparent?c.clearColor(0,0,0,0):c.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),c.clear(c.COLOR_BUFFER_BIT),this.renderDisplayObject(a,this.projection),a.interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this))}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,b,c){this.renderSession.drawCount=0,this.renderSession.currentBlendMode=9999,this.renderSession.projection=b,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,c),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.updateTextures=function(){var a=0;for(a=0;a=0;c--){var d=a._glTextures[c],e=b.glContexts[c];e&&d&&e.deleteTexture(d)}a._glTextures.length=0},b.WebGLRenderer.updateTextureFrame=function(a){a.updateFrame=!1,a._updateWebGLuvs()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b,this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2,this.projection.y=-this.height/2},b.createWebGLTexture=function(a,c){return a.hasLoaded&&(a._glTextures[c.id]=c.createTexture(),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null)),a._glTextures[c.id]},b.updateWebGLTexture=function(a,c){a._glTextures[c.id]&&(c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null))},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(a){try{this.gl=this.view.getContext("webgl",this.options)}catch(c){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var d=this.gl;d.id=b.WebGLRenderer.glContextId++,this.shaderManager.setContext(d),this.spriteBatch.setContext(d),this.maskManager.setContext(d),this.filterManager.setContext(d),this.renderSession.gl=this.gl,d.disable(d.DEPTH_TEST),d.disable(d.CULL_FACE),d.enable(d.BLEND),d.colorMask(!0,!0,!0,this.transparent),this.gl.viewport(0,0,this.width,this.height);for(var e in b.TextureCache){var f=b.TextureCache[e].baseTexture;f._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLost),this.view.removeEventListener("webglcontextrestored",this.contextRestoredLost),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.glContextId=0,b.WebGLMaskManager=function(a){this.maskStack=[],this.maskPosition=0,this.setContext(a)},b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=this.gl;0===this.maskStack.length&&(d.enable(d.STENCIL_TEST),d.stencilFunc(d.ALWAYS,1,1)),this.maskStack.push(a),d.colorMask(!1,!1,!1,!0),d.stencilOp(d.KEEP,d.KEEP,d.INCR),b.WebGLGraphics.renderGraphics(a,c),d.colorMask(!0,!0,!0,!0),d.stencilFunc(d.NOTEQUAL,0,this.maskStack.length),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)},b.WebGLMaskManager.prototype.popMask=function(a){var c=this.gl,d=this.maskStack.pop();d&&(c.colorMask(!1,!1,!1,!1),c.stencilOp(c.KEEP,c.KEEP,c.DECR),b.WebGLGraphics.renderGraphics(d,a),c.colorMask(!0,!0,!0,!0),c.stencilFunc(c.NOTEQUAL,0,this.maskStack.length),c.stencilOp(c.KEEP,c.KEEP,c.KEEP)),0===this.maskStack.length&&c.disable(c.STENCIL_TEST)},b.WebGLMaskManager.prototype.destroy=function(){this.maskStack=null,this.gl=null},b.WebGLShaderManager=function(a){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var b=0;bd;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.setContext(a)},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},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;(b.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=b.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var c=a._uvs||a.texture._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(a.texture.trim){var m=a.texture.trim;e=m.x-k*m.width,d=e+b.frame.width,g=m.y-l*m.height,f=g+b.frame.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=a.worldTransform,p=o.a,q=o.c,r=o.b,s=o.d,t=o.tx,u=o.ty;j[n++]=p*e+r*g+t,j[n++]=s*g+q*e+u,j[n++]=c.x0,j[n++]=c.y0,j[n++]=h,j[n++]=i,j[n++]=p*d+r*g+t,j[n++]=s*g+q*d+u,j[n++]=c.x1,j[n++]=c.y1,j[n++]=h,j[n++]=i,j[n++]=p*d+r*f+t,j[n++]=s*f+q*d+u,j[n++]=c.x2,j[n++]=c.y2,j[n++]=h,j[n++]=i,j[n++]=p*e+r*f+t,j[n++]=s*f+q*e+u,j[n++]=c.x3,j[n++]=c.y3,j[n++]=h,j[n++]=i,this.currentBatchSize++}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;(c.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=c.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode),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,u=a.worldTransform,v=u.a,w=u.c,x=u.b,y=u.d,z=u.tx,A=u.ty;k[t++]=v*q+x*s+z,k[t++]=y*s+w*q+A,k[t++]=d.x0,k[t++]=d.y0,k[t++]=i,k[t++]=j,k[t++]=v*p+x*s+z,k[t++]=y*s+w*p+A,k[t++]=d.x1,k[t++]=d.y1,k[t++]=i,k[t++]=j,k[t++]=v*p+x*r+z,k[t++]=y*r+w*p+A,k[t++]=d.x2,k[t++]=d.y2,k[t++]=i,k[t++]=j,k[t++]=v*q+x*r+z,k[t++]=y*r+w*q+A,k[t++]=d.x3,k[t++]=d.y3,k[t++]=i,k[t++]=j,this.currentBatchSize++},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a)),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.colorAttribute,2,a.FLOAT,!1,d,16),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var b=4*this.size*this.vertSize,c=6*this.maxSize;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var d=0,e=0;c>d;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.currentBlendMode&&this.setBlendMode(c.blendMode);for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.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()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,d,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,d,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,d,36),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLFastSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLFilterManager=function(a,b){this.transparent=b,this.filterStack=[],this.offsetX=0,this.offsetY=0,this.setContext(a)},b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a.target.filterArea.x,this.offsetY+=a.target.filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture),a.target.filterArea=a.target.getBounds();var h=a.target.filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.uniform2f(this.defaultShader.projectionVector,h.width/2,-h.height/2),c.uniform2f(this.defaultShader.offsetVector,-h.x,-h.y),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c.target.filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;j0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},b.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},b.CanvasRenderer.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.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},b.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},b.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},b.CanvasGraphics=function(){},b.CanvasGraphics.renderGraphics=function(a,c){for(var d=a.worldAlpha,e="",f=0;f1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===b.Graphics.POLY){c.beginPath(),c.moveTo(g[0],g[1]);for(var h=1;hd;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),b.CanvasGraphics.renderGraphics(this,c);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},b.Graphics.prototype.getBounds=function(a){this.bounds||this.updateBounds();var b=this.bounds.x,c=this.bounds.width+this.bounds.x,d=this.bounds.y,e=this.bounds.height+this.bounds.y,f=a||this.worldTransform,g=f.a,h=f.c,i=f.b,j=f.d,k=f.tx,l=f.ty,m=g*c+i*e+k,n=j*e+h*c+l,o=g*b+i*e+k,p=j*e+h*b+l,q=g*b+i*d+k,r=j*d+h*b+l,s=g*c+i*d+k,t=j*d+h*c+l,u=-1/0,v=-1/0,w=1/0,x=1/0;w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v;var y=this._bounds;return y.x=w,y.width=u-w,y.y=x,y.height=v-x,y},b.Graphics.prototype.updateBounds=function(){for(var a,c,d,e,f,g=1/0,h=-1/0,i=1/0,j=-1/0,k=0;kc?c:g,h=c+e>h?c+e:h,i=i>d?c:i,j=d+f>j?d+f:j;else if(m===b.Graphics.CIRC||m===b.Graphics.ELIP)c=a[0],d=a[1],e=a[2]+n/2,f=a[3]+n/2,g=g>c-e?c-e:g,h=c+e>h?c+e:h,i=i>d-f?d-f:i,j=d+f>j?d+f:j;else for(var o=0;oc-n?c-n:g,h=c+n>h?c+n:h,i=i>d-n?d-n:i,j=d+n>j?d+n:j}var p=this.boundsPadding;this.bounds=new b.Rectangle(g-p,i-p,h-g+2*p,j-i+2*p)},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.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.onTextureUpdate=function(){this.updateFrame=!0},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.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,c),c.globalAlpha=this.worldAlpha;var d=this.worldTransform;c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),(!this.__tilePattern||this.refreshTexture)&&(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.beginPath();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&&a.maskManager.popMask(a.context)}},b.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},b.TilingSprite.prototype.generateTilingTexture=function(a){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(a?(d=b.getNextPowerOfTwo(g.width),e=b.getNextPowerOfTwo(g.height),g.width!==d&&g.height!==e&&(i=!0)):h&&(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 b.CanvasBuffer(d,e),this.tilingTexture=b.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}},b.BaseTextureCache={},b.texturesToUpdate=[],b.texturesToDestroy=[],b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(b.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this.id=b.BaseTextureCacheIdGenerator++,this._glTextures=[],a){if(this.source.complete||this.source.getContext)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,b.texturesToUpdate.push(this);else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.width,d.height=d.source.height,b.texturesToUpdate.push(d),d.dispatchEvent({type:"loaded",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.BaseTexture.prototype.destroy=function(){this.imageUrl&&(delete b.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,b.texturesToDestroy.push(this)},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c){if(b.EventTarget.call(this),c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=null,this.scope=this,this._uvs=null,a.hasLoaded)this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var d=this;a.addEventListener("loaded",function(){d.onBaseTextureLoaded()})}},b.Texture.prototype.constructor=b.Texture,b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},b.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,b.Texture.frameUpdates.push(this)},b.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.frame,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.Texture.frameUpdates=[],b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y4=0},b.RenderTexture=function(a,c,d){if(b.EventTarget.call(this),this.width=a||100,this.height=c||100,this.frame=new b.Rectangle(0,0,this.width,this.height),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new b.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(this.width/2,-this.height/2)}else console.log("renderer canvas"),this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c){if(this.width=a,this.height=c,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===b.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var d=this.renderer.gl;d.bindTexture(d.TEXTURE_2D,this.baseTexture._glTextures[d.id]),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.width,this.height,0,d.RGBA,d.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype.renderWebGL=function(a,c,d){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),d&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,a.worldTransform.d=-1,a.worldTransform.ty=-2*this.projection.y,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty-=c.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();b.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},b.RenderTexture.prototype.renderCanvas=function(a,c,d){var e=a.children,f=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty=c.y);for(var g=0,h=e.length;h>g;g++)e[g].updateTransform();d&&this.textureBuffer.clear();var i=this.textureBuffer.context;this.renderer.renderDisplayObject(a,i),i.setTransform(1,0,0,1,0,0),a.worldTransform=f},b.RenderTexture.tempMatrix=new b.Matrix,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define("PIXI",function(){return a.PIXI=b}()):a.PIXI=b}).call(this),function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f; -a=Array(g+1).join(c)+a+Array(f+1).join(c);break;default:a+=Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!hasOwn.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a +},b.WebGLFilterManager.prototype.applyFilterPass=function(a,c,d,e){var f=this.gl,g=a.shaders[f.id];g||(g=new b.PixiShader(f),g.fragmentSrc=a.fragmentSrc,g.uniforms=a.uniforms,g.init(),a.shaders[f.id]=g),f.useProgram(g.program),f.uniform2f(g.projectionVector,d/2,-e/2),f.uniform2f(g.offsetVector,0,0),a.uniforms.dimensions&&(a.uniforms.dimensions.value[0]=this.width,a.uniforms.dimensions.value[1]=this.height,a.uniforms.dimensions.value[2]=this.vertexArray[0],a.uniforms.dimensions.value[3]=this.vertexArray[5]),g.syncUniforms(),f.bindBuffer(f.ARRAY_BUFFER,this.vertexBuffer),f.vertexAttribPointer(g.aVertexPosition,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.uvBuffer),f.vertexAttribPointer(g.aTextureCoord,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.colorBuffer),f.vertexAttribPointer(g.colorAttribute,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,this.indexBuffer),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),this.renderSession.drawCount++},b.WebGLFilterManager.prototype.initShaderBuffers=function(){var a=this.gl;this.vertexBuffer=a.createBuffer(),this.uvBuffer=a.createBuffer(),this.colorBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.vertexArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertexArray,a.STATIC_DRAW),this.uvArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),a.bufferData(a.ARRAY_BUFFER,this.uvArray,a.STATIC_DRAW),this.colorArray=new Float32Array([1,16777215,1,16777215,1,16777215,1,16777215]),a.bindBuffer(a.ARRAY_BUFFER,this.colorBuffer),a.bufferData(a.ARRAY_BUFFER,this.colorArray,a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,1,3,2]),a.STATIC_DRAW)},b.WebGLFilterManager.prototype.destroy=function(){var a=this.gl;this.filterStack=null,this.offsetX=0,this.offsetY=0;for(var b=0;b0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},b.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},b.CanvasRenderer.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.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},b.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},b.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},b.CanvasGraphics=function(){},b.CanvasGraphics.renderGraphics=function(a,c){for(var d=a.worldAlpha,e="",f=0;f1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===b.Graphics.POLY){c.beginPath(),c.moveTo(g[0],g[1]);for(var h=1;hd;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),b.CanvasGraphics.renderGraphics(this,c);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},b.Graphics.prototype.getBounds=function(a){this.bounds||this.updateBounds();var b=this.bounds.x,c=this.bounds.width+this.bounds.x,d=this.bounds.y,e=this.bounds.height+this.bounds.y,f=a||this.worldTransform,g=f.a,h=f.c,i=f.b,j=f.d,k=f.tx,l=f.ty,m=g*c+i*e+k,n=j*e+h*c+l,o=g*b+i*e+k,p=j*e+h*b+l,q=g*b+i*d+k,r=j*d+h*b+l,s=g*c+i*d+k,t=j*d+h*c+l,u=-1/0,v=-1/0,w=1/0,x=1/0;w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v;var y=this._bounds;return y.x=w,y.width=u-w,y.y=x,y.height=v-x,y},b.Graphics.prototype.updateBounds=function(){for(var a,c,d,e,f,g=1/0,h=-1/0,i=1/0,j=-1/0,k=0;kc?c:g,h=c+e>h?c+e:h,i=i>d?c:i,j=d+f>j?d+f:j;else if(m===b.Graphics.CIRC||m===b.Graphics.ELIP)c=a[0],d=a[1],e=a[2]+n/2,f=a[3]+n/2,g=g>c-e?c-e:g,h=c+e>h?c+e:h,i=i>d-f?d-f:i,j=d+f>j?d+f:j;else for(var o=0;oc-n?c-n:g,h=c+n>h?c+n:h,i=i>d-n?d-n:i,j=d+n>j?d+n:j}var p=this.boundsPadding;this.bounds=new b.Rectangle(g-p,i-p,h-g+2*p,j-i+2*p)},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.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.onTextureUpdate=function(){this.updateFrame=!0},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.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,c),c.globalAlpha=this.worldAlpha;var d=this.worldTransform;c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),(!this.__tilePattern||this.refreshTexture)&&(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.beginPath();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&&a.maskManager.popMask(a.context)}},b.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},b.TilingSprite.prototype.generateTilingTexture=function(a){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(a?(d=b.getNextPowerOfTwo(g.width),e=b.getNextPowerOfTwo(g.height),g.width!==d&&g.height!==e&&(i=!0)):h&&(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 b.CanvasBuffer(d,e),this.tilingTexture=b.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}},b.BaseTextureCache={},b.texturesToUpdate=[],b.texturesToDestroy=[],b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(b.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this.id=b.BaseTextureCacheIdGenerator++,this._glTextures=[],a){if(this.source.complete||this.source.getContext)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,b.texturesToUpdate.push(this);else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.width,d.height=d.source.height,b.texturesToUpdate.push(d),d.dispatchEvent({type:"loaded",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.BaseTexture.prototype.destroy=function(){this.imageUrl&&(delete b.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,b.texturesToDestroy.push(this)},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c){if(b.EventTarget.call(this),c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=null,this.scope=this,this._uvs=null,a.hasLoaded)this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var d=this;a.addEventListener("loaded",function(){d.onBaseTextureLoaded()})}},b.Texture.prototype.constructor=b.Texture,b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},b.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,b.Texture.frameUpdates.push(this)},b.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.frame,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.Texture.frameUpdates=[],b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y4=0},b.RenderTexture=function(a,c,d){if(b.EventTarget.call(this),this.width=a||100,this.height=c||100,this.frame=new b.Rectangle(0,0,this.width,this.height),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new b.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(this.width/2,-this.height/2)}else console.log("renderer canvas"),this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c){if(this.width=a,this.height=c,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===b.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var d=this.renderer.gl;d.bindTexture(d.TEXTURE_2D,this.baseTexture._glTextures[d.id]),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.width,this.height,0,d.RGBA,d.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype.renderWebGL=function(a,c,d){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),d&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,a.worldTransform.d=-1,a.worldTransform.ty=-2*this.projection.y,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty-=c.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();b.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},b.RenderTexture.prototype.renderCanvas=function(a,c,d){var e=a.children,f=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty=c.y);for(var g=0,h=e.length;h>g;g++)e[g].updateTransform();d&&this.textureBuffer.clear();var i=this.textureBuffer.context;this.renderer.renderDisplayObject(a,i),i.setTransform(1,0,0,1,0,0),a.worldTransform=f},b.RenderTexture.tempMatrix=new b.Matrix,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define("PIXI",function(){return a.PIXI=b}()):a.PIXI=b}).call(this),function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=new Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f; +a=new Array(g+1).join(c)+a+new Array(f+1).join(c);break;default:a+=new Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!{}.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a }}),b.Plugin=function(a,b){"undefined"==typeof b&&(b=null),this.game=a,this.parent=b,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},b.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},b.Plugin.prototype.constructor=b.Plugin,b.PluginManager=function(a,b){this.game=a,this._parent=b,this.plugins=[],this._pluginsLength=0},b.PluginManager.prototype={add:function(a){var b=!1;return"function"==typeof a?a=new a(this.game,this._parent):(a.game=this.game,a.parent=this._parent),"function"==typeof a.preUpdate&&(a.hasPreUpdate=!0,b=!0),"function"==typeof a.update&&(a.hasUpdate=!0,b=!0),"function"==typeof a.postUpdate&&(a.hasPostUpdate=!0,b=!0),"function"==typeof a.render&&(a.hasRender=!0,b=!0),"function"==typeof a.postRender&&(a.hasPostRender=!0,b=!0),b?((a.hasPreUpdate||a.hasUpdate||a.hasPostUpdate)&&(a.active=!0),(a.hasRender||a.hasPostRender)&&(a.visible=!0),this._pluginsLength=this.plugins.push(a),"function"==typeof a.init&&a.init(),a):null},remove:function(a){if(0!==this._pluginsLength)for(this._p=0;this._pb;b++)this.children[b].preUpdate()},b.Stage.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Stage.prototype.postUpdate=function(){if(this.game.world.camera.target){this.game.world.camera.target.postUpdate(),this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a]!==this.game.world.camera.target&&this.children[a].postUpdate()}else{this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a].postUpdate()}this.checkOffsetInterval!==!1&&this.game.time.now>this._nextOffsetCheck&&(b.Canvas.getOffset(this.game.canvas,this.offset),this._nextOffsetCheck=this.game.time.now+this.checkOffsetInterval)},b.Stage.prototype.parseConfig=function(a){this.game.canvas=a.canvasID?b.Canvas.create(this.game.width,this.game.height,a.canvasID):b.Canvas.create(this.game.width,this.game.height),a.canvasStyle?this.game.canvas.stlye=a.canvasStyle:this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",a.checkOffsetInterval&&(this.checkOffsetInterval=a.checkOffsetInterval),a.disableVisibilityChange&&(this.disableVisibilityChange=a.disableVisibilityChange),a.fullScreenScaleMode&&(this.fullScreenScaleMode=a.fullScreenScaleMode),a.scaleMode&&(this.scaleMode=a.scaleMode),a.backgroundColor&&(this.backgroundColor=a.backgroundColor)},b.Stage.prototype.boot=function(){b.Canvas.getOffset(this.game.canvas,this.offset),this.bounds=new b.Rectangle(this.offset.x,this.offset.y,this.game.width,this.game.height);var a=this;this._onChange=function(b){return a.visibilityChange(b)},b.Canvas.setUserSelect(this.game.canvas,"none"),b.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},b.Stage.prototype.checkVisibility=function(){this._hiddenVar=void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.hidden?"visibilitychange":null,this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.onblur=this._onChange,window.onfocus=this._onChange},b.Stage.prototype.visibilityChange=function(a){return this.disableVisibilityChange?void 0:"pagehide"===a.type||"blur"===a.type||"pageshow"===a.type||"focus"===a.type?void("pagehide"===a.type||"blur"===a.type?this.game.focusLoss(a):("pageshow"===a.type||"focus"===a.type)&&this.game.focusGain(a)):void(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden?this.game.gamePaused(a):this.game.gameResumed(a))},b.Stage.prototype.setBackgroundColor=function(a){this._backgroundColor=a||0,this.backgroundColorSplit=PIXI.hex2rgb(this.backgroundColor);var b=this._backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},Object.defineProperty(b.Stage.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this.game.transparent===!1&&("string"==typeof a&&(a=b.Color.hexToRGB(a)),this.setBackgroundColor(a))}}),Object.defineProperty(b.Stage.prototype,"smoothed",{get:function(){return!PIXI.scaleModes.LINEAR},set:function(a){PIXI.scaleModes.LINEAR=a?0:1}}),b.Group=function(a,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=b.Physics.ARCADE),this.game=a,"undefined"==typeof c&&(c=a.world),this.name=d||"group",PIXI.DisplayObjectContainer.call(this),e?this.game.stage.addChild(this):c&&c.addChild(this),this.z=0,this.type=b.GROUP,this.alive=!0,this.exists=!0,this.scale=new b.Point(1,1),this.cursor=null,this.cameraOffset=new b.Point,this.enableBody=f,this.enableBodyDebug=!1,this.physicsBodyType=g,this._sortProperty="z",this._cache=[0,0,0,0,1,0,1,0,0,0]},b.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),b.Group.prototype.constructor=b.Group,b.Group.RETURN_NONE=0,b.Group.RETURN_TOTAL=1,b.Group.RETURN_CHILD=2,b.Group.SORT_ASCENDING=-1,b.Group.SORT_DESCENDING=1,b.Group.prototype.add=function(a){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChild(a),a.z=this.children.length,a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.addAt=function(a,b){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChildAt(a,b),this.updateZ(),a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.getAt=function(a){return 0>a||a>=this.children.length?-1:this.getChildAt(a)},b.Group.prototype.create=function(a,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new b.Sprite(this.game,a,c,d,e);return this.enableBody&&this.game.physics.enable(g,this.physicsBodyType),g.exists=f,g.visible=f,g.alive=f,this.addChild(g),g.z=this.children.length,g.events&&g.events.onAddedToGroup.dispatch(g,this),null===this.cursor&&(this.cursor=g),g},b.Group.prototype.createMultiple=function(a,b,c,d){"undefined"==typeof d&&(d=!1);for(var e=0;a>e;e++)this.create(0,0,b,c,d)},b.Group.prototype.updateZ=function(){for(var a=this.children.length;a--;)this.children[a].z=a},b.Group.prototype.next=function(){this.cursor&&(this._cache[8]===this.children.length?this._cache[8]=0:this._cache[8]++,this.cursor=this.children[this._cache[8]])},b.Group.prototype.previous=function(){this.cursor&&(0===this._cache[8]?this._cache[8]=this.children.length-1:this._cache[8]--,this.cursor=this.children[this._cache[8]])},b.Group.prototype.swap=function(a,b){var c=this.swapChildren(a,b);return c&&this.updateZ(),c},b.Group.prototype.bringToTop=function(a){return a.parent===this&&this.getIndex(a)0&&(this.remove(a),this.addAt(a,0)),a},b.Group.prototype.moveUp=function(a){if(a.parent===this&&this.getIndex(a)0){var b=this.getIndex(a),c=this.getAt(b-1);c&&this.swap(b,c)}return a},b.Group.prototype.xy=function(a,b,c){return 0>a||a>this.children.length?-1:(this.getChildAt(a).x=b,void(this.getChildAt(a).y=c))},b.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},b.Group.prototype.getIndex=function(a){return this.children.indexOf(a)},b.Group.prototype.replace=function(a,c){var d=this.getIndex(a);if(-1!==d){void 0!==c.parent&&(c.events.onRemovedFromGroup.dispatch(c,this),c.parent.removeChild(c),c.parent instanceof b.Group&&c.parent.updateZ());var e=a;return this.remove(e),this.addAt(c,d),e}},b.Group.prototype.setProperty=function(a,b,c,d){d=d||0;var e=b.length;1==e?0===d?a[b[0]]=c:1==d?a[b[0]]+=c:2==d?a[b[0]]-=c:3==d?a[b[0]]*=c:4==d&&(a[b[0]]/=c):2==e?0===d?a[b[0]][b[1]]=c:1==d?a[b[0]][b[1]]+=c:2==d?a[b[0]][b[1]]-=c:3==d?a[b[0]][b[1]]*=c:4==d&&(a[b[0]][b[1]]/=c):3==e?0===d?a[b[0]][b[1]][b[2]]=c:1==d?a[b[0]][b[1]][b[2]]+=c:2==d?a[b[0]][b[1]][b[2]]-=c:3==d?a[b[0]][b[1]][b[2]]*=c:4==d&&(a[b[0]][b[1]][b[2]]/=c):4==e&&(0===d?a[b[0]][b[1]][b[2]][b[3]]=c:1==d?a[b[0]][b[1]][b[2]][b[3]]+=c:2==d?a[b[0]][b[1]][b[2]][b[3]]-=c:3==d?a[b[0]][b[1]][b[2]][b[3]]*=c:4==d&&(a[b[0]][b[1]][b[2]][b[3]]/=c))},b.Group.prototype.set=function(a,b,c,d,e,f){b=b.split("."),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),(d===!1||d&&a.alive)&&(e===!1||e&&a.visible)&&this.setProperty(a,b,c,f)},b.Group.prototype.setAll=function(a,b,c,d,e){a=a.split("."),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),e=e||0;for(var f=0,g=this.children.length;g>f;f++)(!c||c&&this.children[f].alive)&&(!d||d&&this.children[f].visible)&&this.setProperty(this.children[f],a,b,e)},b.Group.prototype.setAllChildren=function(a,c,d,e,f){"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),f=f||0;for(var g=0,h=this.children.length;h>g;g++)(!d||d&&this.children[g].alive)&&(!e||e&&this.children[g].visible)&&(this.children[g]instanceof b.Group?this.children[g].setAllChildren(a,c,d,e,f):this.setProperty(this.children[g],a.split("."),c,f))},b.Group.prototype.addAll=function(a,b,c,d){this.setAll(a,b,c,d,1)},b.Group.prototype.subAll=function(a,b,c,d){this.setAll(a,b,c,d,2)},b.Group.prototype.multiplyAll=function(a,b,c,d){this.setAll(a,b,c,d,3)},b.Group.prototype.divideAll=function(a,b,c,d){this.setAll(a,b,c,d,4)},b.Group.prototype.callAllExists=function(a,b){for(var c=Array.prototype.splice.call(arguments,2),d=0,e=this.children.length;e>d;d++)this.children[d].exists===b&&this.children[d][a]&&this.children[d][a].apply(this.children[d],c)},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||null===b||""===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){this.children.length<2||("undefined"==typeof a&&(a="z"),"undefined"==typeof c&&(c=b.Group.SORT_ASCENDING),this._sortProperty=a,this.children.sort(c===b.Group.SORT_ASCENDING?this.ascendingSortHandler.bind(this):this.descendingSortHandler.bind(this)),this.updateZ())},b.Group.prototype.ascendingSortHandler=function(a,b){return a[this._sortProperty]b[this._sortProperty]?1:a.zb[this._sortProperty]?-1:0},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.getTop=function(){return this.children.length>0?this.children[this.children.length-1]:void 0},b.Group.prototype.getBottom=function(){return this.children.length>0?this.children[0]:void 0},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.updateZ(),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===this.children[c]&&(this.cursor=null);this.updateZ()}},b.Group.prototype.destroy=function(a,b){if(null!==this.game){if("undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!1),a){if(this.children.length>0)do this.children[0].parent&&this.children[0].destroy(a);while(this.children.length>0)}else this.removeAll();this.cursor=null,b||(this.parent.removeChild(this),this.game=null,this.exists=!1)}},Object.defineProperty(b.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,b.Group.RETURN_TOTAL)}}),Object.defineProperty(b.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(b.Group.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Group.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.World=function(a){b.Group.call(this,a,null,"__world",!1),this.bounds=new b.Rectangle(0,0,a.width,a.height),this.camera=null},b.World.prototype=Object.create(b.Group.prototype),b.World.prototype.constructor=b.World,b.World.prototype.boot=function(){this.camera=new b.Camera(this.game,0,0,0,this.game.width,this.game.height),this.camera.displayObject=this,this.camera.scale=this.scale,this.game.camera=this.camera,this.game.stage.addChild(this)},b.World.prototype.setBounds=function(a,b,c,d){cwindow.outerHeight&&(this.orientation=90),this.scaleFactor=new b.Point(1,1),this.scaleFactorInversed=new b.Point(1,1),this.margin=new b.Point(0,0),this.aspectRatio=0,this.sourceAspectRatio=c/d,this.event=null,this.scaleMode=b.ScaleManager.NO_SCALE,this.fullScreenScaleMode=b.ScaleManager.NO_SCALE,this._startHeight=0,this._width=0,this._height=0;var e=this;window.addEventListener("orientationchange",function(a){return e.checkOrientation(a)},!1),window.addEventListener("resize",function(a){return e.checkResize(a)},!1),document.addEventListener("webkitfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("mozfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("fullscreenchange",function(a){return e.fullScreenChange(a)},!1)},b.ScaleManager.EXACT_FIT=0,b.ScaleManager.NO_SCALE=1,b.ScaleManager.SHOW_ALL=2,b.ScaleManager.prototype={startFullScreen:function(a){!this.isFullScreen&&this.game.device.fullscreen&&("undefined"!=typeof a&&this.game.renderType===b.CANVAS&&(this.game.stage.smoothed=a),this._width=this.width,this._height=this.height,this.game.device.fullscreenKeyboard?this.fullScreenTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):this.fullScreenTarget[this.game.device.requestFullscreen]())},stopFullScreen:function(){this.fullScreenTarget[this.game.device.cancelFullscreen]()},fullScreenChange:function(a){this.event=a,this.isFullScreen?(this.fullScreenScaleMode===b.ScaleManager.EXACT_FIT?(this.fullScreenTarget.style.width="100%",this.fullScreenTarget.style.height="100%",this.width=window.outerWidth,this.height=window.outerHeight,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.checkResize()):this.fullScreenScaleMode===b.ScaleManager.SHOW_ALL&&(this.setShowAll(),this.refresh()),this.enterFullScreen.dispatch(this.width,this.height)):(this.fullScreenTarget.style.width=this.game.width+"px",this.fullScreenTarget.style.height=this.game.height+"px",this.width=this._width,this.height=this._height,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.leaveFullScreen.dispatch(this.width,this.height))},forceOrientation:function(a,c,d){"undefined"==typeof c&&(c=!1),this.forceLandscape=a,this.forcePortrait=c,"undefined"!=typeof d&&((null==d||this.game.cache.checkImageKey(d)===!1)&&(d="__default"),this.orientationSprite=new b.Image(this.game,this.game.width/2,this.game.height/2,PIXI.TextureCache[d]),this.orientationSprite.anchor.set(.5),this.checkOrientationState(),this.incorrectOrientation?(this.orientationSprite.visible=!0,this.game.world.visible=!1):(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.game.stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()):(this.forceLandscape&&window.innerWidthwindow.outerHeight?90:0,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh(),this.checkOrientationState()},refresh:function(){if(this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),null==this._check&&this.maxIterations>0){this._iterations=this.maxIterations;var a=this;this._check=window.setInterval(function(){return a.setScreenSize()},10),this.setScreenSize()}},setScreenSize:function(a){"undefined"==typeof a&&(a=!1),this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),this._iterations--,(a||window.innerHeight>this._startHeight||this._iterations<0)&&(document.documentElement.style.minHeight=window.innerHeight+"px",this.incorrectOrientation===!0?this.setMaximum():this.isFullScreen?this.fullScreenScaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.fullScreenScaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll():this.scaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.scaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll(),this.setSize(),clearInterval(this._check),this._check=null)},setSize:function(){this.incorrectOrientation===!1&&(this.maxWidth&&this.width>this.maxWidth&&(this.width=this.maxWidth),this.maxHeight&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.minWidth&&this.widththis.maxWidth?this.maxWidth:a,this.height=this.maxHeight&&b>this.maxHeight?this.maxHeight:b}},b.ScaleManager.prototype.constructor=b.ScaleManager,Object.defineProperty(b.ScaleManager.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(b.ScaleManager.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(b.ScaleManager.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),b.Game=function(a,c,d,e,f,g,h,i){this.id=b.GAMES.push(this)-1,this.config=null,this.physicsConfig=i,this.parent="",this.width=800,this.height=600,this.transparent=!1,this.antialias=!0,this.renderer=b.AUTO,this.renderType=b.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.rnd=null,this.device=null,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof c&&(this.height=c),"undefined"!=typeof d&&(this.renderer=d,this.renderType=d),"undefined"!=typeof e&&(this.parent=e),"undefined"!=typeof g&&(this.transparent=g),"undefined"!=typeof h&&(this.antialias=h),this.rnd=new b.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new b.StateManager(this,f));var j=this;return this._onBoot=function(){return j.boot()},"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(this._onBoot,0):(document.addEventListener("DOMContentLoaded",this._onBoot,!1),window.addEventListener("load",this._onBoot,!1)),this},b.Game.prototype={parseConfig:function(a){this.config=a,a.width&&(this.width=b.Utils.parseDimension(a.width,0)),a.height&&(this.height=b.Utils.parseDimension(a.height,1)),a.renderer&&(this.renderer=a.renderer,this.renderType=a.renderer),a.parent&&(this.parent=a.parent),a.transparent&&(this.transparent=a.transparent),a.antialias&&(this.antialias=a.antialias),a.physicsConfig&&(this.physicsConfig=a.physicsConfig);var c=[(Date.now()*Math.random()).toString()];a.seed&&(c=a.seed),this.rnd=new b.RandomDataGenerator(c);var d=null;a.state&&(d=a.state),this.state=new b.StateManager(this,d)},boot:function(){this.isBooted||(document.body?(document.removeEventListener("DOMContentLoaded",this._onBoot),window.removeEventListener("load",this._onBoot),this.onPause=new b.Signal,this.onResume=new b.Signal,this.onBlur=new b.Signal,this.onFocus=new b.Signal,this.isBooted=!0,this.device=new b.Device(this),this.math=b.Math,this.stage=new b.Stage(this,this.width,this.height),this.scale=new b.ScaleManager(this,this.width,this.height),this.setUpRenderer(),this.device.checkFullScreenSupport(),this.world=new b.World(this),this.add=new b.GameObjectFactory(this),this.make=new b.GameObjectCreator(this),this.cache=new b.Cache(this),this.load=new b.Loader(this),this.time=new b.Time(this),this.tweens=new b.TweenManager(this),this.input=new b.Input(this),this.sound=new b.SoundManager(this),this.physics=new b.Physics(this,this.physicsConfig),this.particles=new b.Particles(this),this.plugins=new b.PluginManager(this,this),this.net=new b.Net(this),this.debug=new b.Utils.Debug(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.debug.boot(),this.showDebugHeader(),this.isRunning=!0,this.raf=this.config&&this.config.forceSetTimeOut?new b.RequestAnimationFrame(this,this.config.forceSetTimeOut):new b.RequestAnimationFrame(this,!1),this.raf.start()):window.setTimeout(this._onBoot,20))},showDebugHeader:function(){var a=b.DEV_VERSION,c="Canvas",d="HTML Audio",e=1;if(this.renderType===b.WEBGL?(c="WebGL",e++):this.renderType==b.HEADLESS&&(c="Headless"),this.device.webAudio&&(d="WebAudio",e++),this.device.chrome){for(var f=["%c %c %c Phaser v"+a+" - "+c+" - "+d+" %c %c http://phaser.io %c %c ♥%c♥%c♥ ","background: #0cf300","background: #00bc17","color: #ffffff; background: #00711f;","background: #00bc17","background: #0cf300","background: #00bc17"],g=0;3>g;g++)f.push(e>g?"color: #ff2424; background: #fff":"color: #959595; background: #fff");console.log.apply(console,f)}else console.log("Phaser v"+a+" - Renderer: "+c+" - Audio: "+d+" - http://phaser.io") -},setUpRenderer:function(){if(this.device.trident&&(this.renderType=b.CANVAS),this.renderType===b.HEADLESS||this.renderType===b.CANVAS||this.renderType===b.AUTO&&this.device.webGL===!1){if(!this.device.canvas)throw new Error("Phaser.Game - cannot create Canvas or WebGL context, aborting.");this.renderType===b.AUTO&&(this.renderType=b.CANVAS),this.renderer=new PIXI.CanvasRenderer(this.width,this.height,this.canvas,this.transparent),this.context=this.renderer.context}else this.renderType=b.WEBGL,this.renderer=new PIXI.WebGLRenderer(this.width,this.height,this.canvas,this.transparent,this.antialias),this.context=null;this.renderType!==b.HEADLESS&&(this.stage.smoothed=this.antialias,b.Canvas.addToDOM(this.canvas,this.parent,!0),b.Canvas.setTouchAction(this.canvas))},update:function(a){this.time.update(a),this._paused||this.pendingStep?this.debug.preUpdate():(this.stepping&&(this.pendingStep=!0),this.debug.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(),this.plugins.preUpdate(),this.stage.preUpdate(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.state.update(),this.physics.update(),this.particles.update(),this.plugins.update(),this.stage.postUpdate(),this.plugins.postUpdate()),this.renderType!=b.HEADLESS&&(this.renderer.render(this.stage),this.plugins.render(),this.state.render(),this.plugins.postRender())},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.input.destroy(),this.state.destroy(),this.physics.destroy(),this.state=null,this.cache=null,this.input=null,this.load=null,this.sound=null,this.stage=null,this.time=null,this.world=null,this.isBooted=!1},gamePaused:function(a){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.setMute(),this.onPause.dispatch(a))},gameResumed:function(a){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.unsetMute(),this.onResume.dispatch(a))},focusLoss:function(a){this.onBlur.dispatch(a),this.gamePaused(a)},focusGain:function(a){this.onFocus.dispatch(a),this.gameResumed(a)}},b.Game.prototype.constructor=b.Game,Object.defineProperty(b.Game.prototype,"paused",{get:function(){return this._paused},set:function(a){a===!0?this._paused===!1&&(this._paused=!0,this._codePaused=!0,this.sound.mute=!0,this.time.gamePaused(),this.onPause.dispatch(this)):this._paused&&(this._paused=!1,this._codePaused=!1,this.input.reset(),this.sound.mute=!1,this.time.gameResumed(),this.onResume.dispatch(this))}}),b.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.disabled=!1,this.multiInputOverride=b.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=10,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.interactiveItems=new b.LinkedList,this._localPoint=new b.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},b.Input.MOUSE_OVERRIDES_TOUCH=0,b.Input.TOUCH_OVERRIDES_MOUSE=1,b.Input.MOUSE_TOUCH_COMBINE=2,b.Input.prototype={boot:function(){this.mousePointer=new b.Pointer(this.game,0),this.pointer1=new b.Pointer(this.game,1),this.pointer2=new b.Pointer(this.game,2),this.mouse=new b.Mouse(this.game),this.keyboard=new b.Keyboard(this.game),this.touch=new b.Touch(this.game),this.mspointer=new b.MSPointer(this.game),this.gamepad=new b.Gamepad(this.game),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.scale=new b.Point(1,1),this.speed=new b.Point,this.position=new b.Point,this._oldPosition=new b.Point,this.circle=new b.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallback=null},setMoveCallback:function(a,b){this.moveCallback=a,this.moveCallbackContext=b},addPointer:function(){for(var a=0,c=10;c>0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b0&&e>this.deadZone||0>e&&e<-this.deadZone?{axis:d,value:e}:{axis:d,value:0})}this._prevTimestamp=this._rawPad.timestamp}},connect:function(a){var b=!this._connected;this._index=a.index,this._connected=!0,this._rawPad=a,this._rawButtons=a.buttons,this._axes=a.axes,b&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this._index),b&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var a=this._connected;this._connected=!1,this._rawPad=void 0,this._rawButtons=[],this._buttons=[];var b=this._index;this._index=null,a&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,b),a&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},processAxisChange:function(a){this.game.input.disabled||this.game.input.gamepad.disabled||this._axes[a.axis]!==a.value&&(this._axes[a.axis]=a.value,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,a,this._index),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,a))},processButtonDown:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,a,b,this._index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,a,b),this._buttons[a]&&this._buttons[a].isDown?this._buttons[a].duration=this.game.time.now-this._buttons[a].timeDown:this._buttons[a]?(this._buttons[a].isDown=!0,this._buttons[a].timeDown=this.game.time.now,this._buttons[a].duration=0,this._buttons[a].value=b):this._buttons[a]={isDown:!0,timeDown:this.game.time.now,timeUp:0,duration:0,value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonDown(b))},processButtonUp:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,a,b,this._index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,a,b),this._hotkeys[a]&&this._hotkeys[a].processButtonUp(b),this._buttons[a]?(this._buttons[a].isDown=!1,this._buttons[a].timeUp=this.game.time.now,this._buttons[a].value=b):this._buttons[a]={isDown:!1,timeDown:this.game.time.now,timeUp:this.game.time.now,duration:0,value:b})},processButtonFloat:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,a,b,this._index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,a,b),this._buttons[a]?this._buttons[a].value=b:this._buttons[a]={value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonFloat(b))},axis:function(a){return this._axes[a]?this._axes[a]:!1},isDown:function(a){return this._buttons[a]?this._buttons[a].isDown:!1},justReleased:function(a,b){return"undefined"==typeof b&&(b=250),this._buttons[a]&&this._buttons[a].isDown===!1&&this.game.time.now-this._buttons[a].timeUpd;d++)this._pointerData[d]={id:d,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new b.Point,this.enabled=!0,this.sprite.events&&null===this.sprite.events.onInputOver&&(this.sprite.events.onInputOver=new b.Signal,this.sprite.events.onInputOut=new b.Signal,this.sprite.events.onInputDown=new b.Signal,this.sprite.events.onInputUp=new b.Signal,this.sprite.events.onDragStart=new b.Signal,this.sprite.events.onDragStop=new b.Signal)}return this.sprite},reset:function(){this.enabled=!1;for(var a=0;10>a;a++)this._pointerData[a]={id:a,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){this.enabled!==!1&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.enabled&&(this._setHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(a,b){return 0===this.sprite.scale.x||0===this.sprite.scale.y?!1:this.pixelPerfectClick||this.pixelPerfectOver?!0:this.priorityID>a||this.priorityID===a&&this.sprite._cache[3]b;b++)if(this._pointerData[b].isOver)return!0}return!1},pointerOut:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOut;for(var b=0;10>b;b++)if(this._pointerData[b].isOut)return!0}return!1},pointerTimeOver:function(a){return a=a||0,this._pointerData[a].timeOver},pointerTimeOut:function(a){return a=a||0,this._pointerData[a].timeOut},pointerDragged:function(a){return a=a||0,this._pointerData[a].isDragged},checkPointerDown:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectClick?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPointerOver:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectOver?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPixel:function(a,b,c){if(this.sprite.texture.baseTexture.source){if(this.game.input.hitContext.clearRect(0,0,1,1),null===a&&null===b){this.game.input.getLocalPosition(this.sprite,c,this._tempPoint);var a=this._tempPoint.x,b=this._tempPoint.y}0!==this.sprite.anchor.x&&(a-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(b-=-this.sprite.texture.frame.height*this.sprite.anchor.y),a+=this.sprite.texture.frame.x,b+=this.sprite.texture.frame.y,this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,a,b,1,1,0,0,1,1);var d=this.game.input.hitContext.getImageData(0,0,1,1);if(d.data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(a){return null!==this.sprite?this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this.draggable&&this._draggedPointerID==a.id?this.updateDrag(a):this._pointerData[a.id].isOver===!0?this.checkPointerOver(a)?(this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,!0):(this._pointerOutHandler(a),!1):void 0:(this._pointerOutHandler(a),!1):void 0},_pointerOverHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isOver===!1&&(this._pointerData[a.id].isOver=!0,this._pointerData[a.id].isOut=!1,this._pointerData[a.id].timeOver=this.game.time.now,this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!1),this.sprite.events.onInputOver.dispatch(this.sprite,a))},_pointerOutHandler:function(a){null!==this.sprite&&(this._pointerData[a.id].isOver=!1,this._pointerData[a.id].isOut=!0,this._pointerData[a.id].timeOut=this.game.time.now,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.sprite&&this.sprite.events&&this.sprite.events.onInputOut.dispatch(this.sprite,a))},_touchedHandler:function(a){if(null!==this.sprite){if(this._pointerData[a.id].isDown===!1&&this._pointerData[a.id].isOver===!0){if(this.pixelPerfectClick&&!this.checkPixel(null,null,a))return;this._pointerData[a.id].isDown=!0,this._pointerData[a.id].isUp=!1,this._pointerData[a.id].timeDown=this.game.time.now,this.sprite.events.onInputDown.dispatch(this.sprite,a),this.draggable&&this.isDragged===!1&&this.startDrag(a),this.bringToTop&&this.sprite.bringToTop()}return this.consumePointerEvent}},_releasedHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isDown&&a.isUp&&(this._pointerData[a.id].isDown=!1,this._pointerData[a.id].isUp=!0,this._pointerData[a.id].timeUp=this.game.time.now,this._pointerData[a.id].downDuration=this._pointerData[a.id].timeUp-this._pointerData[a.id].timeDown,this.checkPointerOver(a)?this.sprite.events.onInputUp.dispatch(this.sprite,a,!0):(this.sprite.events.onInputUp.dispatch(this.sprite,a,!1),this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1)),this.draggable&&this.isDragged&&this._draggedPointerID==a.id&&this.stopDrag(a))},updateDrag:function(a){return a.isUp?(this.stopDrag(a),!1):(this.sprite.fixedToCamera?(this.allowHorizontalDrag&&(this.sprite.cameraOffset.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.cameraOffset.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)):(this.allowHorizontalDrag&&(this.sprite.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),!0)},justOver:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isOver&&this.overDuration(a)a;a++)this._pointerData[a].isDragged=!1;this.draggable=!1,this.isDragged=!1,this._draggedPointerID=-1},startDrag:function(a){if(this.isDragged=!0,this._draggedPointerID=a.id,this._pointerData[a.id].isDragged=!0,this.sprite.fixedToCamera)this.dragFromCenter?(this.sprite.centerOn(a.x,a.y),this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y)):this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y);else if(this.dragFromCenter){var b=this.sprite.getBounds();this.sprite.x=a.x+(this.sprite.x-b.centerX),this.sprite.y=a.y+(this.sprite.y-b.centerY),this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y)}else this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y);this.updateDrag(a),this.bringToTop&&this.sprite.bringToTop(),this.sprite.events.onDragStart.dispatch(this.sprite,a)},stopDrag:function(a){this.isDragged=!1,this._draggedPointerID=-1,this._pointerData[a.id].isDragged=!1,this.snapOnRelease&&(this.sprite.fixedToCamera?(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY):(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),this.sprite.events.onDragStop.dispatch(this.sprite,a),this.checkPointerOver(a)===!1&&this._pointerOutHandler(a)},setDragLock:function(a,b){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!0),this.allowHorizontalDrag=a,this.allowVerticalDrag=b},enableSnap:function(a,b,c,d,e,f){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.snapX=a,this.snapY=b,this.snapOffsetX=e,this.snapOffsetY=f,this.snapOnDrag=c,this.snapOnRelease=d},disableSnap:function(){this.snapOnDrag=!1,this.snapOnRelease=!1},checkBoundsRect:function(){this.sprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.ythis.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.xthis.boundsRect.right&&(this.sprite.x=this.boundsRect.right-this.sprite.width),this.sprite.ythis.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-this.sprite.height))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsSprite.camerOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.camerOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.ythis.boundsSprite.camerOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.camerOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.xthis.boundsSprite.x+this.boundsSprite.width&&(this.sprite.x=this.boundsSprite.x+this.boundsSprite.width-this.sprite.width),this.sprite.ythis.boundsSprite.y+this.boundsSprite.height&&(this.sprite.y=this.boundsSprite.y+this.boundsSprite.height-this.sprite.height))}},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.onEnterBounds=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,e,f){return new b.Group(this.game,a,c,d,e,f)},physicsGroup:function(a,c,d,e){return new b.Group(this.game,c,d,e,!0,a)},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))},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(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,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator=function(a){this.game=a,this.world=this.game.world},b.GameObjectCreator.prototype={image:function(a,c,d,e){return new b.Image(this.game,a,c,d,e)},sprite:function(a,c,d,e){return new b.Sprite(this.game,a,c,d,e)},tween:function(a){return new b.Tween(a,this.game)},group:function(a,c,d,e,f){return new b.Group(this.game,null,c,d,e,f)},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){return new b.TileSprite(this.game,a,c,d,e,f,g)},text:function(a,c,d,e){return new b.Text(this.game,a,c,d,e)},button:function(a,c,d,e,f,g,h,i,j){return new b.Button(this.game,a,c,d,e,f,g,h,i,j)},graphics:function(a,c){return new b.Graphics(this.game,a,c)},emitter:function(a,c,d){return new b.Particles.Arcade.Emitter(this.game,a,c,d)},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(this.game,a,c,d,e,f,g,h,i,j)},bitmapText:function(a,c,d,e,f){return new b.BitmapText(this.game,a,c,d,e,f)},tilemap:function(a,c,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator.prototype.constructor=b.GameObjectCreator,b.BitmapData=function(a,c,d,e){"undefined"==typeof d&&(d=100),"undefined"==typeof e&&(e=100),this.game=a,this.key=c,this.width=d,this.height=e,this.canvas=b.Canvas.create(d,e,"",!0),this.context=this.canvas.getContext("2d"),this.ctx=this.context,this.imageData=this.context.getImageData(0,0,d,e),this.pixels=this.imageData.data.buffer?this.imageData.data.buffer:this.imageData.data,this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,d,e,"bitmapData",a.rnd.uuid()),this.type=b.BITMAPDATA,this.dirty=!1},b.BitmapData.prototype={add:function(a){if(Array.isArray(a))for(var b=0;b=0&&a<=this.width&&b>=0&&b<=this.height&&(this.pixels[b*this.width+a]=f<<24|e<<16|d<<8|c,this.context.putImageData(this.imageData,0,0),this.dirty=!0)},setPixel:function(a,b,c,d,e){this.setPixel32(a,b,c,d,e,255)},getPixel:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixel32:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixels:function(a){return this.context.getImageData(a.x,a.y,a.width,a.height)},copyPixels:function(a,b,c,d){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,b.x,b.y,b.width,b.height,c,d,b.width,b.height)},draw:function(a,b,c){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0,a.width,a.height,b,c,a.width,a.height)},alphaMask:function(a,b){var c=this.context.globalCompositeOperation;"string"==typeof b&&(b=this.game.cache.getImage(b)),b&&this.context.drawImage(b,0,0),this.context.globalCompositeOperation="source-atop","string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0),this.context.globalCompositeOperation=c},render:function(){this.game.renderType===b.WEBGL&&this.dirty&&(PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1)}},b.BitmapData.prototype.constructor=b.BitmapData,b.Sprite=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.name="",this.type=b.SPRITE,this.z=0,this.events=new b.Events(this),this.animations=new b.AnimationManager(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.body=null,this.health=1,this.lifespan=0,this.checkWorldBounds=!1,this.outOfBoundsKill=!1,this.debug=!1,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0],this._bounds=new b.Rectangle},b.Sprite.prototype=Object.create(PIXI.Sprite.prototype),b.Sprite.prototype.constructor=b.Sprite,b.Sprite.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;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA?this.ninja=new b.Physics.Ninja(this.game):a===b.Physics.BOX2D&&null===this.box2d||a===b.Physics.CHIPMUNK&&null===this.chipmunk},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);return a!==this._sx||b!==this._sy?(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),!0):!1},preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this.updateBounds()||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds())},postUpdate:function(){this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dx<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0)},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY() -},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"new velocity x: "+b.newVelocity.x.toFixed(2),"y: "+b.newVelocity.y.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.prototype={create:function(a,b,c,d,e){return"undefined"==typeof group&&(group=this.game.world),this.width=b,this.height=c,this.setTileSize(d,e),this.layers.length=0,this.createBlankLayer(a,b,c,d,e,group)},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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},b.Sprite.prototype.overlap=function(a){return b.Rectangle.intersects(this.getBounds(),a.getBounds())},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),Object.defineProperty(b.Sprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.TileSprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.TileSprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){if(a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA)this.ninja=new b.Physics.Ninja(this.game);else{if(a===b.Physics.BOX2D&&null===this.box2d)throw new Error("The Box2D physics system has not been implemented yet.");if(a===b.Physics.CHIPMUNK&&null===this.chipmunk)throw new Error("The Chipmunk physics system has not been implemented yet.")}},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this.phase=0,this._reset=!0,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);(a!==this._sx||b!==this._sy)&&(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this._reset=!0)},preUpdate:function(){this.phase=1,this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.updateBounds(),this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this._reset||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds()),this._dx=this.deltaX(),this._dy=this.deltaY(),this._reset=!1},postUpdate:function(){this.phase=2,this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0) +},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"deltaX: "+b._dx.toFixed(2),"deltaY: "+b._dy.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e */ @@ -461,8 +463,8 @@ PIXI.Matrix2 = PIXI.determineMatrixArrayType(); /* * @class Matrix -* The Matrix class is now an object, which makes it a lot faster, -* here is a representation of it : +* The Matrix class is now an object, which makes it a lot faster, +* here is a representation of it : * | a | b | tx| * | c | c | ty| * | 0 | 0 | 1 | @@ -535,6 +537,7 @@ PIXI.Matrix.prototype.toArray = function(transpose) }; PIXI.identityMatrix = new PIXI.Matrix(); + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -659,7 +662,7 @@ PIXI.DisplayObject = function() /** * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * + * * @property defaultCursor * @type String * @@ -699,7 +702,7 @@ PIXI.DisplayObject = function() this._cr = 1; /** - * The area the filter is applied to + * The area the filter is applied to * * @property filterArea * @type Rectangle @@ -1053,11 +1056,11 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) { this._cacheAsBitmap = false; var bounds = this.getLocalBounds(); - + if(!this._cachedSprite) { var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - + this._cachedSprite = new PIXI.Sprite(renderTexture); this._cachedSprite.worldTransform = this.worldTransform; } @@ -1082,7 +1085,7 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._destroyCachedSprite = function() @@ -1108,7 +1111,7 @@ PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) @@ -1279,7 +1282,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) this.children[index1] = child2; this.children[index2] = child; - + }; /** @@ -1325,7 +1328,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) /** -* Removes all the children +* Removes all the children * * @method removeAll * NOT tested yet @@ -1338,7 +1341,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { this.removeChild(this.children[i]); } - + }; */ /* @@ -1397,13 +1400,13 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function(matrix) for(var i=0,j=this.children.length; i https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5483,7 +5487,7 @@ PIXI.WebGLSpriteBatch = function(gl) { /** - * + * * * @property vertSize * @type Number @@ -5520,7 +5524,7 @@ PIXI.WebGLSpriteBatch = function(gl) * @type Uint16Array */ this.indices = new Uint16Array(numIndices); - + this.lastIndexCount = 0; for (var i=0, j=0; i < numIndices; i += 6, j += 4) @@ -5537,12 +5541,12 @@ PIXI.WebGLSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.setContext(gl); }; /** -* +* * @method setContext * * @param gl {WebGLContext} the current WebGL drawing context @@ -5569,7 +5573,7 @@ PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) }; /** -* +* * @method begin * * @param renderSession {RenderSession} the RenderSession @@ -5583,7 +5587,7 @@ PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) }; /** -* +* * @method end * */ @@ -5593,9 +5597,9 @@ PIXI.WebGLSpriteBatch.prototype.end = function() }; /** -* +* * @method render -* +* * @param sprite {Sprite} the sprite to render when using this spritebatch */ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) @@ -5633,7 +5637,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) var aY = sprite.anchor.y; var w0, w1, h0, h1; - + if (sprite.texture.trim) { // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. @@ -5705,7 +5709,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // increment the batchsize this.currentBatchSize++; @@ -5715,7 +5719,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) /** * Renders a tilingSprite using the spriteBatch * @method renderTilingSprite -* +* * @param sprite {TilingSprite} the tilingSprite to render */ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) @@ -5810,7 +5814,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // xy verticies[index++] = a * w0 + c * h0 + tx; verticies[index++] = d * h0 + b * w0 + ty; @@ -5840,7 +5844,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) * Renders the content and empties the current batch * * @method flush -* +* */ PIXI.WebGLSpriteBatch.prototype.flush = function() { @@ -5848,12 +5852,12 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() if (this.currentBatchSize===0)return; var gl = this.gl; - + // bind the current texture gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id] || PIXI.createWebGLTexture(this.currentBaseTexture, gl)); // upload the verts to the buffer - + if(this.currentBatchSize > ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -5867,10 +5871,10 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() // var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); //gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -5879,7 +5883,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() }; /** -* +* * @method stop * */ @@ -5889,7 +5893,7 @@ PIXI.WebGLSpriteBatch.prototype.stop = function() }; /** -* +* * @method start * */ @@ -5923,7 +5927,7 @@ PIXI.WebGLSpriteBatch.prototype.start = function() /** * Sets-up the given blendMode from WebGL's point of view -* @method setBlendMode +* @method setBlendMode * * @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD */ @@ -5932,7 +5936,7 @@ PIXI.WebGLSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -5946,19 +5950,19 @@ PIXI.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; }; /** * @author Mat Groves - * + * * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5968,7 +5972,7 @@ PIXI.WebGLSpriteBatch.prototype.destroy = function() PIXI.WebGLFastSpriteBatch = function(gl) { - + this.vertSize = 10; this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; @@ -5983,7 +5987,7 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.vertices = new Float32Array(numVerts); //index data this.indices = new Uint16Array(numIndices); - + this.vertexBuffer = null; this.indexBuffer = null; @@ -6002,10 +6006,10 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.currentBlendMode = 0; this.renderSession = null; - + this.shader = null; @@ -6058,17 +6062,17 @@ PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) var sprite = children[0]; // if the uvs have not updated then no point rendering just yet! - + // check texture. if(!sprite.texture._uvs)return; - + this.currentBaseTexture = sprite.texture.baseTexture; // check blend mode if(sprite.blendMode !== this.currentBlendMode) { this.setBlendMode(sprite.blendMode); } - + for(var i=0,j= children.length; i ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -6242,11 +6246,11 @@ PIXI.WebGLFastSpriteBatch.prototype.flush = function() gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); } - - + + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -6300,7 +6304,7 @@ PIXI.WebGLFastSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -6323,7 +6327,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) this.transparent = transparent; this.filterStack = []; - + this.offsetX = 0; this.offsetY = 0; @@ -6333,7 +6337,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) // API /** * Initialises the context and the properties -* @method setContext +* @method setContext * @param gl {WebGLContext} the current WebGL drawing context */ PIXI.WebGLFilterManager.prototype.setContext = function(gl) @@ -6345,10 +6349,10 @@ PIXI.WebGLFilterManager.prototype.setContext = function(gl) }; /** -* +* * @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} +* @param renderSession {RenderSession} +* @param buffer {ArrayBuffer} */ PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) { @@ -6599,7 +6603,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function() // bind the buffer gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - // set the blend mode! + // set the blend mode! //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) // set texture @@ -6748,7 +6752,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() var gl = this.gl; this.filterStack = null; - + this.offsetX = 0; this.offsetY = 0; @@ -6756,7 +6760,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() for (var i = 0; i < this.texturePool.length; i++) { this.texturePool.destroy(); } - + this.texturePool = null; //destroy buffers.. @@ -6811,7 +6815,7 @@ PIXI.FilterTexture = function(gl, width, height) PIXI.FilterTexture.prototype.clear = function() { var gl = this.gl; - + gl.clearColor(0,0,0, 0); gl.clear(gl.COLOR_BUFFER_BIT); }; @@ -6853,8 +6857,8 @@ PIXI.FilterTexture.prototype.destroy = function() /** * @author Mat Groves - * - * + * + * */ /** * A set of functions used to handle masking @@ -6863,7 +6867,7 @@ PIXI.FilterTexture.prototype.destroy = function() */ PIXI.CanvasMaskManager = function() { - + }; /** @@ -6876,7 +6880,7 @@ PIXI.CanvasMaskManager = function() PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, context) { context.save(); - + var cacheAlpha = maskData.alpha; var transform = maskData.worldTransform; @@ -6900,10 +6904,11 @@ PIXI.CanvasMaskManager.prototype.popMask = function(context) context.restore(); }; + /** * @author Mat Groves - * - * + * + * */ /** @@ -6917,13 +6922,13 @@ PIXI.CanvasTinter = function() }; //PIXI.CanvasTinter.cachTint = true; - + /** - * Basically this method just needs a sprite and a color and tints the sprite + * Basically this method just needs a sprite and a color and tints the sprite * with the given color - * - * @method getTintedTexture + * + * @method getTintedTexture * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with */ @@ -6935,17 +6940,17 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) color = PIXI.CanvasTinter.roundColor(color); var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + texture.tintCache = texture.tintCache || {}; if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; // clone texture.. var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - + //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - + PIXI.CanvasTinter.tintMethod(texture, color, canvas); if(PIXI.CanvasTinter.convertTintToImage) @@ -6958,7 +6963,7 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) } else { - + texture.tintCache[stringColor] = canvas; // if we are not converting the texture to an image then we need to lose the reference to the canvas PIXI.CanvasTinter.canvas = null; @@ -6985,9 +6990,9 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) canvas.height = frame.height; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + context.fillRect(0, 0, frame.width, frame.height); - + context.globalCompositeOperation = "multiply"; context.drawImage(texture.baseTexture.source, @@ -7001,7 +7006,7 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) frame.height); context.globalCompositeOperation = "destination-atop"; - + context.drawImage(texture.baseTexture.source, frame.x, frame.y, @@ -7029,8 +7034,8 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - - + + context.globalCompositeOperation = "copy"; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); context.fillRect(0, 0, frame.width, frame.height); @@ -7046,7 +7051,7 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) frame.width, frame.height); - + //context.globalCompositeOperation = "copy"; }; @@ -7066,7 +7071,7 @@ PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - + context.globalCompositeOperation = "copy"; context.drawImage(texture.baseTexture.source, frame.x, @@ -7114,7 +7119,7 @@ PIXI.CanvasTinter.roundColor = function(color) }; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property cacheStepsPerColorChannel @@ -7122,7 +7127,7 @@ PIXI.CanvasTinter.roundColor = function(color) */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property convertTintToImage @@ -7195,7 +7200,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent) if(!PIXI.blendModesCanvas) { PIXI.blendModesCanvas = []; - + if(PIXI.canUseNewCanvasBlendModes()) { PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; @@ -7831,7 +7836,7 @@ PIXI.Graphics = function() * @default 0xFFFFFF */ this.tint = 0xFFFFFF;// * Math.random(); - + /** * The blend mode to be applied to the graphic shape * @@ -7840,7 +7845,7 @@ PIXI.Graphics = function() * @default PIXI.blendModes.NORMAL; */ this.blendMode = PIXI.blendModes.NORMAL; - + /** * Current path * @@ -8116,7 +8121,7 @@ PIXI.Graphics.prototype.generateTexture = function() var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); canvasBuffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); return texture; @@ -8126,23 +8131,23 @@ PIXI.Graphics.prototype.generateTexture = function() * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + if(this._cacheAsBitmap) { - + if(this.dirty) { this._generateCachedSprite(); // we will also need to update the texture on the gpu too! PIXI.updateWebGLTexture(this._cachedSprite.texture.baseTexture, renderSession.gl); - + this.dirty = false; } @@ -8156,7 +8161,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._mask)renderSession.maskManager.pushMask(this.mask, renderSession); if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - + // check blend mode if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) { @@ -8164,9 +8169,9 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); } - + PIXI.WebGLGraphics.renderGraphics(this, renderSession); - + // only render if it has children! if(this.children.length) { @@ -8183,7 +8188,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._filters)renderSession.filterManager.popFilter(); if(this._mask)renderSession.maskManager.popMask(renderSession); - + renderSession.drawCount++; renderSession.spriteBatch.start(); @@ -8194,17 +8199,17 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderCanvas = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + var context = renderSession.context; var transform = this.worldTransform; - + if(this.blendMode !== renderSession.currentBlendMode) { renderSession.currentBlendMode = this.blendMode; @@ -8302,7 +8307,7 @@ PIXI.Graphics.prototype.getBounds = function( matrix ) */ PIXI.Graphics.prototype.updateBounds = function() { - + var minX = Infinity; var maxX = -Infinity; @@ -8380,7 +8385,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() { var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - + this._cachedSprite = new PIXI.Sprite(texture); this._cachedSprite.buffer = canvasBuffer; @@ -8397,7 +8402,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() // this._cachedSprite.buffer.context.save(); this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); // this._cachedSprite.buffer.context.restore(); }; @@ -8467,7 +8472,7 @@ PIXI.TilingSprite = function(texture, width, height) * @type Point */ this.tileScaleOffset = new PIXI.Point(1,1); - + /** * The offset position of the image that is being tiled * @@ -8494,7 +8499,7 @@ PIXI.TilingSprite = function(texture, width, height) * @default 0xFFFFFF */ this.tint = 0xFFFFFF; - + /** * The blend mode to be applied to the sprite * @@ -8521,7 +8526,7 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { return this._width; }, set: function(value) { - + this._width = value; } }); @@ -8587,14 +8592,14 @@ PIXI.TilingSprite.prototype.setTexture = function(texture) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) { if(this.visible === false || this.alpha === 0)return; - + var i,j; if(this.mask) @@ -8623,7 +8628,7 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) } } else renderSession.spriteBatch.renderTilingSprite(this); - + // simple render children! for(i=0,j=this.children.length; i */ @@ -490,8 +492,8 @@ PIXI.Matrix2 = PIXI.determineMatrixArrayType(); /* * @class Matrix -* The Matrix class is now an object, which makes it a lot faster, -* here is a representation of it : +* The Matrix class is now an object, which makes it a lot faster, +* here is a representation of it : * | a | b | tx| * | c | c | ty| * | 0 | 0 | 1 | @@ -564,6 +566,7 @@ PIXI.Matrix.prototype.toArray = function(transpose) }; PIXI.identityMatrix = new PIXI.Matrix(); + /** * @author Mat Groves http://matgroves.com/ @Doormat23 */ @@ -688,7 +691,7 @@ PIXI.DisplayObject = function() /** * This is the cursor that will be used when the mouse is over this object. To enable this the element must have interaction = true and buttonMode = true - * + * * @property defaultCursor * @type String * @@ -728,7 +731,7 @@ PIXI.DisplayObject = function() this._cr = 1; /** - * The area the filter is applied to + * The area the filter is applied to * * @property filterArea * @type Rectangle @@ -1082,11 +1085,11 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) { this._cacheAsBitmap = false; var bounds = this.getLocalBounds(); - + if(!this._cachedSprite) { var renderTexture = new PIXI.RenderTexture(bounds.width | 0, bounds.height | 0);//, renderSession.renderer); - + this._cachedSprite = new PIXI.Sprite(renderTexture); this._cachedSprite.worldTransform = this.worldTransform; } @@ -1111,7 +1114,7 @@ PIXI.DisplayObject.prototype._generateCachedSprite = function()//renderSession) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._destroyCachedSprite = function() @@ -1137,7 +1140,7 @@ PIXI.DisplayObject.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.DisplayObject.prototype._renderCanvas = function(renderSession) @@ -1308,7 +1311,7 @@ PIXI.DisplayObjectContainer.prototype.swapChildren = function(child, child2) this.children[index1] = child2; this.children[index2] = child; - + }; /** @@ -1354,7 +1357,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) /** -* Removes all the children +* Removes all the children * * @method removeAll * NOT tested yet @@ -1367,7 +1370,7 @@ PIXI.DisplayObjectContainer.prototype.removeChild = function(child) { this.removeChild(this.children[i]); } - + }; */ /* @@ -1426,13 +1429,13 @@ PIXI.DisplayObjectContainer.prototype.getBounds = function(matrix) for(var i=0,j=this.children.length; i https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5512,7 +5516,7 @@ PIXI.WebGLSpriteBatch = function(gl) { /** - * + * * * @property vertSize * @type Number @@ -5549,7 +5553,7 @@ PIXI.WebGLSpriteBatch = function(gl) * @type Uint16Array */ this.indices = new Uint16Array(numIndices); - + this.lastIndexCount = 0; for (var i=0, j=0; i < numIndices; i += 6, j += 4) @@ -5566,12 +5570,12 @@ PIXI.WebGLSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.setContext(gl); }; /** -* +* * @method setContext * * @param gl {WebGLContext} the current WebGL drawing context @@ -5598,7 +5602,7 @@ PIXI.WebGLSpriteBatch.prototype.setContext = function(gl) }; /** -* +* * @method begin * * @param renderSession {RenderSession} the RenderSession @@ -5612,7 +5616,7 @@ PIXI.WebGLSpriteBatch.prototype.begin = function(renderSession) }; /** -* +* * @method end * */ @@ -5622,9 +5626,9 @@ PIXI.WebGLSpriteBatch.prototype.end = function() }; /** -* +* * @method render -* +* * @param sprite {Sprite} the sprite to render when using this spritebatch */ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) @@ -5662,7 +5666,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) var aY = sprite.anchor.y; var w0, w1, h0, h1; - + if (sprite.texture.trim) { // if the sprite is trimmed then we need to add the extra space before transforming the sprite coords.. @@ -5734,7 +5738,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // increment the batchsize this.currentBatchSize++; @@ -5744,7 +5748,7 @@ PIXI.WebGLSpriteBatch.prototype.render = function(sprite) /** * Renders a tilingSprite using the spriteBatch * @method renderTilingSprite -* +* * @param sprite {TilingSprite} the tilingSprite to render */ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) @@ -5839,7 +5843,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) // color verticies[index++] = alpha; verticies[index++] = tint; - + // xy verticies[index++] = a * w0 + c * h0 + tx; verticies[index++] = d * h0 + b * w0 + ty; @@ -5869,7 +5873,7 @@ PIXI.WebGLSpriteBatch.prototype.renderTilingSprite = function(tilingSprite) * Renders the content and empties the current batch * * @method flush -* +* */ PIXI.WebGLSpriteBatch.prototype.flush = function() { @@ -5877,12 +5881,12 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() if (this.currentBatchSize===0)return; var gl = this.gl; - + // bind the current texture gl.bindTexture(gl.TEXTURE_2D, this.currentBaseTexture._glTextures[gl.id] || PIXI.createWebGLTexture(this.currentBaseTexture, gl)); // upload the verts to the buffer - + if(this.currentBatchSize > ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -5896,10 +5900,10 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() // var view = this.vertices.subarray(0, this.currentBatchSize * 4 * this.vertSize); //gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); - + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -5908,7 +5912,7 @@ PIXI.WebGLSpriteBatch.prototype.flush = function() }; /** -* +* * @method stop * */ @@ -5918,7 +5922,7 @@ PIXI.WebGLSpriteBatch.prototype.stop = function() }; /** -* +* * @method start * */ @@ -5952,7 +5956,7 @@ PIXI.WebGLSpriteBatch.prototype.start = function() /** * Sets-up the given blendMode from WebGL's point of view -* @method setBlendMode +* @method setBlendMode * * @param blendMode {Number} the blendMode, should be a Pixi const, such as PIXI.BlendModes.ADD */ @@ -5961,7 +5965,7 @@ PIXI.WebGLSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -5975,19 +5979,19 @@ PIXI.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; }; /** * @author Mat Groves - * + * * Big thanks to the very clever Matt DesLauriers https://github.com/mattdesl/ * for creating the original pixi version! * @@ -5997,7 +6001,7 @@ PIXI.WebGLSpriteBatch.prototype.destroy = function() PIXI.WebGLFastSpriteBatch = function(gl) { - + this.vertSize = 10; this.maxSize = 6000;//Math.pow(2, 16) / this.vertSize; @@ -6012,7 +6016,7 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.vertices = new Float32Array(numVerts); //index data this.indices = new Uint16Array(numIndices); - + this.vertexBuffer = null; this.indexBuffer = null; @@ -6031,10 +6035,10 @@ PIXI.WebGLFastSpriteBatch = function(gl) this.drawing = false; this.currentBatchSize = 0; this.currentBaseTexture = null; - + this.currentBlendMode = 0; this.renderSession = null; - + this.shader = null; @@ -6087,17 +6091,17 @@ PIXI.WebGLFastSpriteBatch.prototype.render = function(spriteBatch) var sprite = children[0]; // if the uvs have not updated then no point rendering just yet! - + // check texture. if(!sprite.texture._uvs)return; - + this.currentBaseTexture = sprite.texture.baseTexture; // check blend mode if(sprite.blendMode !== this.currentBlendMode) { this.setBlendMode(sprite.blendMode); } - + for(var i=0,j= children.length; i ( this.size * 0.5 ) ) { gl.bufferSubData(gl.ARRAY_BUFFER, 0, this.vertices); @@ -6271,11 +6275,11 @@ PIXI.WebGLFastSpriteBatch.prototype.flush = function() gl.bufferSubData(gl.ARRAY_BUFFER, 0, view); } - - + + // now draw those suckas! gl.drawElements(gl.TRIANGLES, this.currentBatchSize * 6, gl.UNSIGNED_SHORT, 0); - + // then reset the batch! this.currentBatchSize = 0; @@ -6329,7 +6333,7 @@ PIXI.WebGLFastSpriteBatch.prototype.setBlendMode = function(blendMode) this.flush(); this.currentBlendMode = blendMode; - + var blendModeWebGL = PIXI.blendModesWebGL[this.currentBlendMode]; this.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); }; @@ -6352,7 +6356,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) this.transparent = transparent; this.filterStack = []; - + this.offsetX = 0; this.offsetY = 0; @@ -6362,7 +6366,7 @@ PIXI.WebGLFilterManager = function(gl, transparent) // API /** * Initialises the context and the properties -* @method setContext +* @method setContext * @param gl {WebGLContext} the current WebGL drawing context */ PIXI.WebGLFilterManager.prototype.setContext = function(gl) @@ -6374,10 +6378,10 @@ PIXI.WebGLFilterManager.prototype.setContext = function(gl) }; /** -* +* * @method begin -* @param renderSession {RenderSession} -* @param buffer {ArrayBuffer} +* @param renderSession {RenderSession} +* @param buffer {ArrayBuffer} */ PIXI.WebGLFilterManager.prototype.begin = function(renderSession, buffer) { @@ -6628,7 +6632,7 @@ PIXI.WebGLFilterManager.prototype.popFilter = function() // bind the buffer gl.bindFramebuffer(gl.FRAMEBUFFER, buffer ); - // set the blend mode! + // set the blend mode! //gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA) // set texture @@ -6777,7 +6781,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() var gl = this.gl; this.filterStack = null; - + this.offsetX = 0; this.offsetY = 0; @@ -6785,7 +6789,7 @@ PIXI.WebGLFilterManager.prototype.destroy = function() for (var i = 0; i < this.texturePool.length; i++) { this.texturePool.destroy(); } - + this.texturePool = null; //destroy buffers.. @@ -6840,7 +6844,7 @@ PIXI.FilterTexture = function(gl, width, height) PIXI.FilterTexture.prototype.clear = function() { var gl = this.gl; - + gl.clearColor(0,0,0, 0); gl.clear(gl.COLOR_BUFFER_BIT); }; @@ -6882,8 +6886,8 @@ PIXI.FilterTexture.prototype.destroy = function() /** * @author Mat Groves - * - * + * + * */ /** * A set of functions used to handle masking @@ -6892,7 +6896,7 @@ PIXI.FilterTexture.prototype.destroy = function() */ PIXI.CanvasMaskManager = function() { - + }; /** @@ -6905,7 +6909,7 @@ PIXI.CanvasMaskManager = function() PIXI.CanvasMaskManager.prototype.pushMask = function(maskData, context) { context.save(); - + var cacheAlpha = maskData.alpha; var transform = maskData.worldTransform; @@ -6929,10 +6933,11 @@ PIXI.CanvasMaskManager.prototype.popMask = function(context) context.restore(); }; + /** * @author Mat Groves - * - * + * + * */ /** @@ -6946,13 +6951,13 @@ PIXI.CanvasTinter = function() }; //PIXI.CanvasTinter.cachTint = true; - + /** - * Basically this method just needs a sprite and a color and tints the sprite + * Basically this method just needs a sprite and a color and tints the sprite * with the given color - * - * @method getTintedTexture + * + * @method getTintedTexture * @param sprite {Sprite} the sprite to tint * @param color {Number} the color to use to tint the sprite with */ @@ -6964,17 +6969,17 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) color = PIXI.CanvasTinter.roundColor(color); var stringColor = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + texture.tintCache = texture.tintCache || {}; if(texture.tintCache[stringColor]) return texture.tintCache[stringColor]; // clone texture.. var canvas = PIXI.CanvasTinter.canvas || document.createElement("canvas"); - + //PIXI.CanvasTinter.tintWithPerPixel(texture, stringColor, canvas); - + PIXI.CanvasTinter.tintMethod(texture, color, canvas); if(PIXI.CanvasTinter.convertTintToImage) @@ -6987,7 +6992,7 @@ PIXI.CanvasTinter.getTintedTexture = function(sprite, color) } else { - + texture.tintCache[stringColor] = canvas; // if we are not converting the texture to an image then we need to lose the reference to the canvas PIXI.CanvasTinter.canvas = null; @@ -7014,9 +7019,9 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) canvas.height = frame.height; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); - + context.fillRect(0, 0, frame.width, frame.height); - + context.globalCompositeOperation = "multiply"; context.drawImage(texture.baseTexture.source, @@ -7030,7 +7035,7 @@ PIXI.CanvasTinter.tintWithMultiply = function(texture, color, canvas) frame.height); context.globalCompositeOperation = "destination-atop"; - + context.drawImage(texture.baseTexture.source, frame.x, frame.y, @@ -7058,8 +7063,8 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - - + + context.globalCompositeOperation = "copy"; context.fillStyle = "#" + ("00000" + ( color | 0).toString(16)).substr(-6); context.fillRect(0, 0, frame.width, frame.height); @@ -7075,7 +7080,7 @@ PIXI.CanvasTinter.tintWithOverlay = function(texture, color, canvas) frame.width, frame.height); - + //context.globalCompositeOperation = "copy"; }; @@ -7095,7 +7100,7 @@ PIXI.CanvasTinter.tintWithPerPixel = function(texture, color, canvas) canvas.width = frame.width; canvas.height = frame.height; - + context.globalCompositeOperation = "copy"; context.drawImage(texture.baseTexture.source, frame.x, @@ -7143,7 +7148,7 @@ PIXI.CanvasTinter.roundColor = function(color) }; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property cacheStepsPerColorChannel @@ -7151,7 +7156,7 @@ PIXI.CanvasTinter.roundColor = function(color) */ PIXI.CanvasTinter.cacheStepsPerColorChannel = 8; /** - * + * * Number of steps which will be used as a cap when rounding colors * * @property convertTintToImage @@ -7224,7 +7229,7 @@ PIXI.CanvasRenderer = function(width, height, view, transparent) if(!PIXI.blendModesCanvas) { PIXI.blendModesCanvas = []; - + if(PIXI.canUseNewCanvasBlendModes()) { PIXI.blendModesCanvas[PIXI.blendModes.NORMAL] = "source-over"; @@ -7860,7 +7865,7 @@ PIXI.Graphics = function() * @default 0xFFFFFF */ this.tint = 0xFFFFFF;// * Math.random(); - + /** * The blend mode to be applied to the graphic shape * @@ -7869,7 +7874,7 @@ PIXI.Graphics = function() * @default PIXI.blendModes.NORMAL; */ this.blendMode = PIXI.blendModes.NORMAL; - + /** * Current path * @@ -8145,7 +8150,7 @@ PIXI.Graphics.prototype.generateTexture = function() var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); canvasBuffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, canvasBuffer.context); return texture; @@ -8155,23 +8160,23 @@ PIXI.Graphics.prototype.generateTexture = function() * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderWebGL = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + if(this._cacheAsBitmap) { - + if(this.dirty) { this._generateCachedSprite(); // we will also need to update the texture on the gpu too! PIXI.updateWebGLTexture(this._cachedSprite.texture.baseTexture, renderSession.gl); - + this.dirty = false; } @@ -8185,7 +8190,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._mask)renderSession.maskManager.pushMask(this.mask, renderSession); if(this._filters)renderSession.filterManager.pushFilter(this._filterBlock); - + // check blend mode if(this.blendMode !== renderSession.spriteBatch.currentBlendMode) { @@ -8193,9 +8198,9 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) var blendModeWebGL = PIXI.blendModesWebGL[renderSession.spriteBatch.currentBlendMode]; renderSession.spriteBatch.gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]); } - + PIXI.WebGLGraphics.renderGraphics(this, renderSession); - + // only render if it has children! if(this.children.length) { @@ -8212,7 +8217,7 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) if(this._filters)renderSession.filterManager.popFilter(); if(this._mask)renderSession.maskManager.popMask(renderSession); - + renderSession.drawCount++; renderSession.spriteBatch.start(); @@ -8223,17 +8228,17 @@ PIXI.Graphics.prototype._renderWebGL = function(renderSession) * Renders the object using the Canvas renderer * * @method _renderCanvas -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.Graphics.prototype._renderCanvas = function(renderSession) { // if the sprite is not visible or the alpha is 0 then no need to render this element if(this.visible === false || this.alpha === 0 || this.isMask === true)return; - + var context = renderSession.context; var transform = this.worldTransform; - + if(this.blendMode !== renderSession.currentBlendMode) { renderSession.currentBlendMode = this.blendMode; @@ -8331,7 +8336,7 @@ PIXI.Graphics.prototype.getBounds = function( matrix ) */ PIXI.Graphics.prototype.updateBounds = function() { - + var minX = Infinity; var maxX = -Infinity; @@ -8409,7 +8414,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() { var canvasBuffer = new PIXI.CanvasBuffer(bounds.width, bounds.height); var texture = PIXI.Texture.fromCanvas(canvasBuffer.canvas); - + this._cachedSprite = new PIXI.Sprite(texture); this._cachedSprite.buffer = canvasBuffer; @@ -8426,7 +8431,7 @@ PIXI.Graphics.prototype._generateCachedSprite = function() // this._cachedSprite.buffer.context.save(); this._cachedSprite.buffer.context.translate(-bounds.x,-bounds.y); - + PIXI.CanvasGraphics.renderGraphics(this, this._cachedSprite.buffer.context); // this._cachedSprite.buffer.context.restore(); }; @@ -8496,7 +8501,7 @@ PIXI.TilingSprite = function(texture, width, height) * @type Point */ this.tileScaleOffset = new PIXI.Point(1,1); - + /** * The offset position of the image that is being tiled * @@ -8523,7 +8528,7 @@ PIXI.TilingSprite = function(texture, width, height) * @default 0xFFFFFF */ this.tint = 0xFFFFFF; - + /** * The blend mode to be applied to the sprite * @@ -8550,7 +8555,7 @@ Object.defineProperty(PIXI.TilingSprite.prototype, 'width', { return this._width; }, set: function(value) { - + this._width = value; } }); @@ -8616,14 +8621,14 @@ PIXI.TilingSprite.prototype.setTexture = function(texture) * Renders the object using the WebGL renderer * * @method _renderWebGL -* @param renderSession {RenderSession} +* @param renderSession {RenderSession} * @private */ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) { if(this.visible === false || this.alpha === 0)return; - + var i,j; if(this.mask) @@ -8652,7 +8657,7 @@ PIXI.TilingSprite.prototype._renderWebGL = function(renderSession) } } else renderSession.spriteBatch.renderTilingSprite(this); - + // simple render children! for(i=0,j=this.children.length; i * @copyright 2014 Photon Storm Ltd. @@ -9604,7 +9611,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix(); * * Phaser - http://www.phaser.io * -* v2.0.2 "Ghealdan" - Built: Tue Mar 25 2014 05:24:26 +* v2.0.2 "Ghealdan" - Built: Fri Mar 28 2014 01:30:50 * * By Richard Davey http://www.photonstorm.com @photonstorm * @@ -9634,6 +9641,7 @@ PIXI.RenderTexture.tempMatrix = new PIXI.Matrix(); var root = this; +/* global Phaser:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -9649,70 +9657,70 @@ var Phaser = Phaser || { DEV_VERSION: '2.0.2', GAMES: [], - AUTO: 0, - CANVAS: 1, - WEBGL: 2, - HEADLESS: 3, - - NONE: 0, - LEFT: 1, - RIGHT: 2, - UP: 3, - DOWN: 4, - - SPRITE: 0, - BUTTON: 1, - IMAGE: 2, - GRAPHICS: 3, - TEXT: 4, - TILESPRITE: 5, - BITMAPTEXT: 6, - GROUP: 7, - RENDERTEXTURE: 8, - TILEMAP: 9, - TILEMAPLAYER: 10, - EMITTER: 11, - POLYGON: 12, - BITMAPDATA: 13, - CANVAS_FILTER: 14, - WEBGL_FILTER: 15, - ELLIPSE: 16, - SPRITEBATCH: 17, - RETROFONT: 18, - - // The various blend modes supported by pixi / phaser - 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 - }, - - // The scale modes - scaleModes: { - DEFAULT:0, - LINEAR:0, - NEAREST:1 - } - -}; - -PIXI.InteractionManager = function (dummy) { - // We don't need this in Pixi, so we've removed it to save space - // however the Stage object expects a reference to it, so here is a dummy entry. + AUTO: 0, + CANVAS: 1, + WEBGL: 2, + HEADLESS: 3, + + NONE: 0, + LEFT: 1, + RIGHT: 2, + UP: 3, + DOWN: 4, + + SPRITE: 0, + BUTTON: 1, + IMAGE: 2, + GRAPHICS: 3, + TEXT: 4, + TILESPRITE: 5, + BITMAPTEXT: 6, + GROUP: 7, + RENDERTEXTURE: 8, + TILEMAP: 9, + TILEMAPLAYER: 10, + EMITTER: 11, + POLYGON: 12, + BITMAPDATA: 13, + CANVAS_FILTER: 14, + WEBGL_FILTER: 15, + ELLIPSE: 16, + SPRITEBATCH: 17, + RETROFONT: 18, + + // The various blend modes supported by pixi / phaser + 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 + }, + + // The scale modes + scaleModes: { + DEFAULT:0, + LINEAR:0, + NEAREST:1 + } + +}; + +PIXI.InteractionManager = function () { + // We don't need this in Pixi, so we've removed it to save space + // however the Stage object expects a reference to it, so here is a dummy entry. }; /* jshint supernew: true */ @@ -9728,7 +9736,7 @@ PIXI.InteractionManager = function (dummy) { * @static */ Phaser.Utils = { - + /** * Get a unit dimension from a string. * @@ -9789,7 +9797,7 @@ Phaser.Utils = { } return array; - + }, /** @@ -9797,7 +9805,7 @@ Phaser.Utils = { * pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) * @method Phaser.Utils.pad - * @param {string} str - The target string. + * @param {string} str - The target string. * @param {number} len - The number of characters to be added. * @param {number} pad - The string to pad it out with (defaults to a space). * @param {number} [dir=3] The direction dir = 1 (left), 2 (right), 3 (both). @@ -9816,17 +9824,17 @@ Phaser.Utils = { switch (dir) { case 1: - str = Array(len + 1 - str.length).join(pad) + str; + str = new Array(len + 1 - str.length).join(pad) + str; break; case 3: var right = Math.ceil((padlen = len - str.length) / 2); var left = padlen - right; - str = Array(left+1).join(pad) + str + Array(right+1).join(pad); + str = new Array(left+1).join(pad) + str + new Array(right+1).join(pad); break; default: - str = str + Array(len + 1 - str.length).join(pad); + str = str + new Array(len + 1 - str.length).join(pad); break; } } @@ -9857,7 +9865,7 @@ Phaser.Utils = { // the "constructor" property of certain host objects, ie. |window.location| // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 try { - if (obj.constructor && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } @@ -9908,7 +9916,7 @@ Phaser.Utils = { --i; } - for ( ; i < length; i++ ) + for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) @@ -9962,6 +9970,7 @@ Phaser.Utils = { */ if (typeof Function.prototype.bind != 'function') { + /* jshint freeze: false */ Function.prototype.bind = (function () { var slice = Array.prototype.slice; @@ -9969,26 +9978,29 @@ if (typeof Function.prototype.bind != 'function') { return function (thisArg) { var target = this, boundArgs = slice.call(arguments, 1); - + if (typeof target != 'function') { throw new TypeError(); } - + function bound() { var args = boundArgs.concat(slice.call(arguments)); target.apply(this instanceof bound ? this : thisArg, args); } - + bound.prototype = (function F(proto) { - proto && (F.prototype = proto); + if (proto) + { + F.prototype = proto; + } if (!(this instanceof F)) { return new F; } })(target.prototype); - + return bound; }; })(); @@ -10002,7 +10014,7 @@ if (!Array.isArray) Array.isArray = function (arg) { return Object.prototype.toString.call(arg) == '[object Array]'; - } + }; } /** @@ -10126,7 +10138,7 @@ Phaser.Circle.prototype = { */ distance: function (dest, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -10254,7 +10266,7 @@ Object.defineProperty(Phaser.Circle.prototype, "diameter", { * @property {number} radius - Gets or sets the radius of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "radius", { - + get: function () { return this._radius; }, @@ -10277,7 +10289,7 @@ Object.defineProperty(Phaser.Circle.prototype, "radius", { * @propety {number} left - Gets or sets the value of the leftmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "left", { - + get: function () { return this.x - this._radius; }, @@ -10335,7 +10347,7 @@ Object.defineProperty(Phaser.Circle.prototype, "top", { get: function () { return this.y - this._radius; }, - + set: function (value) { if (value > this.y) @@ -10565,7 +10577,7 @@ Phaser.Point = function (x, y) { * @property {number} x - The x coordinate of the point. */ this.x = x; - + /** * @property {number} y - The y coordinate of the point. */ @@ -10607,7 +10619,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -10623,7 +10635,7 @@ Phaser.Point.prototype = { this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -10697,7 +10709,7 @@ Phaser.Point.prototype = { this.x = Phaser.Math.clamp(this.x, min, max); return this; - + }, /** @@ -10711,7 +10723,7 @@ Phaser.Point.prototype = { this.y = Phaser.Math.clamp(this.y, min, max); return this; - + }, /** @@ -10955,7 +10967,7 @@ Phaser.Point.equals = function (a, b) { */ Phaser.Point.distance = function (a, b, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -11030,17 +11042,17 @@ Phaser.Rectangle = function (x, y, width, height) { * @property {number} x - The x coordinate of the top-left corner of the Rectangle. */ this.x = x; - + /** * @property {number} y - The y coordinate of the top-left corner of the Rectangle. */ this.y = y; - + /** * @property {number} width - The width of the Rectangle. */ this.width = width; - + /** * @property {number} height - The height of the Rectangle. */ @@ -11065,7 +11077,7 @@ Phaser.Rectangle.prototype = { return this; }, - + /** * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. * @method Phaser.Rectangle#offsetPoint @@ -11077,7 +11089,7 @@ Phaser.Rectangle.prototype = { return this.offset(point.x, point.y); }, - + /** * Sets the members of Rectangle to the specified values. * @method Phaser.Rectangle#setTo @@ -11108,7 +11120,7 @@ Phaser.Rectangle.prototype = { this.y = Math.floor(this.y); }, - + /** * Runs Math.floor() on the x, y, width and height values of this Rectangle. * @method Phaser.Rectangle#floorAll @@ -11180,7 +11192,7 @@ Phaser.Rectangle.prototype = { * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. * @method Phaser.Rectangle#clone * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. - * @return {Phaser.Rectangle} + * @return {Phaser.Rectangle} */ clone: function (output) { @@ -11328,11 +11340,11 @@ Object.defineProperty(Phaser.Rectangle.prototype, "halfHeight", { * @property {number} bottom - The sum of the y and height properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { - + get: function () { return this.y + this.height; }, - + set: function (value) { if (value <= this.y) { this.height = 0; @@ -11349,7 +11361,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { * @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { - + get: function () { return new Phaser.Point(this.right, this.bottom); }, @@ -11367,7 +11379,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { * @property {number} left - The x coordinate of the left of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "left", { - + get: function () { return this.x; }, @@ -11389,7 +11401,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "left", { * @property {number} right - The sum of the x and width properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "right", { - + get: function () { return this.x + this.width; }, @@ -11411,7 +11423,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { - + get: function () { return this.width * this.height; } @@ -11425,7 +11437,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { * @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { - + get: function () { return (this.width * 2) + (this.height * 2); } @@ -11438,7 +11450,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { * @property {number} centerX - The x coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { - + get: function () { return this.x + this.halfWidth; }, @@ -11455,7 +11467,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { * @property {number} centerY - The y coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { - + get: function () { return this.y + this.halfHeight; }, @@ -11473,7 +11485,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { * @property {number} top - The y coordinate of the top of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "top", { - + get: function () { return this.y; }, @@ -11499,7 +11511,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { get: function () { return new Phaser.Point(this.x, this.y); }, - + set: function (value) { this.x = value.x; this.y = value.y; @@ -11509,12 +11521,12 @@ Object.defineProperty(Phaser.Rectangle.prototype, "topLeft", { /** * Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. -* If set to true then all of the Rectangle properties are set to 0. +* If set to true then all of the Rectangle properties are set to 0. * @name Phaser.Rectangle#empty * @property {boolean} empty - Gets or sets the Rectangles empty state. */ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { - + get: function () { return (!this.width || !this.height); }, @@ -11525,7 +11537,7 @@ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { { this.setTo(0, 0, 0, 0); } - + } }); @@ -11771,7 +11783,7 @@ Phaser.Rectangle.union = function (a, b, output) { } return output.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right) - Math.min(a.left, b.left), Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)); - + }; // Because PIXI uses its own Rectangle, we'll replace it with ours to avoid duplicating code or confusion. @@ -11840,12 +11852,12 @@ Phaser.Line.prototype = { * @method Phaser.Line#fromSprite * @param {Phaser.Sprite} startSprite - The coordinates of this Sprite will be set to the Line.start point. * @param {Phaser.Sprite} endSprite - The coordinates of this Sprite will be set to the Line.start point. - * @param {boolean} [useCenter=true] - If true it will use startSprite.center.x, if false startSprite.x. + * @param {boolean} [useCenter=false] - If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class. * @return {Phaser.Line} This line object */ fromSprite: function (startSprite, endSprite, useCenter) { - if (typeof useCenter === 'undefined') { useCenter = true; } + if (typeof useCenter === 'undefined') { useCenter = false; } if (useCenter) { @@ -11938,7 +11950,7 @@ Phaser.Line.prototype = { while (!((x1 == x2) && (y1 == y2))) { var e2 = err << 1; - + if (e2 > -dy) { err -= dy; @@ -12157,7 +12169,7 @@ Phaser.Line.intersectsPoints = function (a, b, e, f, asSegment, result) { result.x = ((b1 * c2) - (b2 * c1)) / denom; result.y = ((a2 * c1) - (a1 * c2)) / denom; - + if (asSegment) { if (Math.pow((result.x - b.x) + (result.y - b.y), 2) > Math.pow((a.x - b.x) + (a.y - b.y), 2)) @@ -12358,7 +12370,7 @@ Phaser.Ellipse.prototype.constructor = Phaser.Ellipse; * @propety {number} left - Gets or sets the value of the leftmost point of the ellipse. */ Object.defineProperty(Phaser.Ellipse.prototype, "left", { - + get: function () { return this.x; }, @@ -12406,7 +12418,7 @@ Object.defineProperty(Phaser.Ellipse.prototype, "top", { get: function () { return this.y; }, - + set: function (value) { this.y = value; } @@ -12511,7 +12523,7 @@ PIXI.Ellipse = Phaser.Ellipse; /** * Creates a new Polygon. You have to provide a list of points. -* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], +* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be all the points of the polygon e.g. `new Phaser.Polygon(new Phaser.Point(), new Phaser.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Phaser.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @@ -12633,7 +12645,7 @@ PIXI.Polygon = Phaser.Polygon; * @param {number} height - The height of the view rectangle */ Phaser.Camera = function (game, id, x, y, width, height) { - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -12651,7 +12663,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { this.id = 0; /** - * Camera view. + * Camera view. * The view into the world we wish to render (by default the game dimensions). * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render. * Objects outside of this view are not rendered if set to camera cull. @@ -12710,7 +12722,7 @@ Phaser.Camera = function (game, id, x, y, width, height) { * @property {Phaser.Point} scale - The scale of the display object to which all game objects are added. Set by World.boot */ this.scale = null; - + }; /** @@ -12921,7 +12933,7 @@ Phaser.Camera.prototype = { /** * A helper function to set both the X and Y properties of the camera at once * without having to use game.camera.x and game.camera.y. - * + * * @method Phaser.Camera#setPosition * @param {number} x - X position. * @param {number} y - Y position. @@ -12940,7 +12952,7 @@ Phaser.Camera.prototype = { /** * Sets the size of the view rectangle given the width and height in parameters. - * + * * @method Phaser.Camera#setSize * @param {number} width - The desired width. * @param {number} height - The desired height. @@ -12954,7 +12966,7 @@ Phaser.Camera.prototype = { /** * Resets the camera back to 0,0 and un-follows any object it may have been tracking. - * + * * @method Phaser.Camera#reset */ reset: function () { @@ -12979,7 +12991,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { get: function () { return this.view.x; }, - + set: function (value) { this.view.x = value; @@ -12998,7 +13010,7 @@ Object.defineProperty(Phaser.Camera.prototype, "x", { * @property {number} y - Gets or sets the cameras y position. */ Object.defineProperty(Phaser.Camera.prototype, "y", { - + get: function () { return this.view.y; }, @@ -13069,12 +13081,12 @@ Phaser.State = function () { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = null; - + /** * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory. */ this.add = null; - + /** * @property {Phaser.GameObjectCreator} make - Reference to the GameObjectCreator. */ @@ -13084,32 +13096,32 @@ Phaser.State = function () { * @property {Phaser.Camera} camera - A handy reference to world.camera. */ this.camera = null; - + /** * @property {Phaser.Cache} cache - Reference to the assets cache. */ this.cache = null; - + /** * @property {Phaser.Input} input - Reference to the input manager */ this.input = null; - + /** * @property {Phaser.Loader} load - Reference to the assets loader. */ this.load = null; - + /** * @property {Phaser.Math} math - Reference to the math helper. */ this.math = null; - + /** * @property {Phaser.SoundManager} sound - Reference to the sound manager. */ this.sound = null; - + /** * @property {Phaser.ScaleManager} scale - Reference to the game scale manager. */ @@ -13119,27 +13131,27 @@ Phaser.State = function () { * @property {Phaser.Stage} stage - Reference to the stage. */ this.stage = null; - + /** * @property {Phaser.TimeManager} time - Reference to game clock. */ this.time = null; - + /** * @property {Phaser.TweenManager} tweens - Reference to the tween manager. */ this.tweens = null; - + /** * @property {Phaser.World} world - Reference to the world. */ this.world = null; - + /** * @property {Phaser.Particles} particles - The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it. */ this.particles = null; - + /** * @property {Phaser.Physics.World} physics - Reference to the physics manager. */ @@ -13157,7 +13169,7 @@ Phaser.State.prototype = { /** * Override this method to add some load operations. * If you need to use the loader, you may need to use them here. - * + * * @method Phaser.State#preload */ preload: function () { @@ -13165,7 +13177,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#loadUpdate */ loadUpdate: function () { @@ -13173,7 +13185,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#loadRender */ loadRender: function () { @@ -13182,7 +13194,7 @@ Phaser.State.prototype = { /** * This method is called after the game engine successfully switches states. * Feel free to add any setup code here (do not load anything here, override preload() instead). - * + * * @method Phaser.State#create */ create: function () { @@ -13190,7 +13202,7 @@ Phaser.State.prototype = { /** * Put update logic here. - * + * * @method Phaser.State#update */ update: function () { @@ -13198,7 +13210,7 @@ Phaser.State.prototype = { /** * Put render operations here. - * + * * @method Phaser.State#render */ render: function () { @@ -13206,7 +13218,7 @@ Phaser.State.prototype = { /** * This method will be called when game paused. - * + * * @method Phaser.State#paused */ paused: function () { @@ -13233,7 +13245,7 @@ Phaser.State.prototype.constructor = Phaser.State; /** * The State Manager is responsible for loading, setting up and switching game states. -* +* * @class Phaser.StateManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. @@ -13300,7 +13312,7 @@ Phaser.StateManager = function (game, pendingState) { * @property {function} onPreloadCallback - This will be called when init states (loading assets...). */ this.onPreloadCallback = null; - + /** * @property {function} onCreateCallback - This will be called when create states (setup states...). */ @@ -13481,7 +13493,7 @@ Phaser.StateManager.prototype = { } }, - + /** * Used by onInit and onShutdown when those functions don't exist on the state * @method Phaser.StateManager#dummy @@ -13844,7 +13856,7 @@ Phaser.LinkedList = function () { * @default */ this.last = null; - + /** * @property {object} game - Number of elements in the list. * @default @@ -13857,7 +13869,7 @@ Phaser.LinkedList.prototype = { /** * Adds a new element to this linked list. - * + * * @method Phaser.LinkedList#add * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through. * @return {object} The child that was added. @@ -13890,7 +13902,7 @@ Phaser.LinkedList.prototype = { /** * Removes the given element from this linked list if it exists. - * + * * @method Phaser.LinkedList#remove * @param {object} child - The child to be removed from the list. */ @@ -13933,7 +13945,7 @@ Phaser.LinkedList.prototype = { /** * Calls a function on all members of this list, using the member as the context for the callback. * The function must exist on the member. - * + * * @method Phaser.LinkedList#callAll * @param {function} callback - The function to call. */ @@ -13945,7 +13957,7 @@ Phaser.LinkedList.prototype = { } var entity = this.first; - + do { if (entity && entity[callback]) @@ -13956,7 +13968,7 @@ Phaser.LinkedList.prototype = { entity = entity.next; } - while(entity != this.last.next) + while(entity != this.last.next); } @@ -13983,7 +13995,7 @@ Phaser.Signal = function () { * @private */ this._bindings = []; - + /** * @property {any} _prevParams - Internal variable. * @private @@ -14013,7 +14025,7 @@ Phaser.Signal.prototype = { memorize: false, /** - * @property {boolean} _shouldPropagate + * @property {boolean} _shouldPropagate * @private */ _shouldPropagate: true, @@ -14034,7 +14046,7 @@ Phaser.Signal.prototype = { */ validateListener: function (listener, fnName) { if (typeof listener !== 'function') { - throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) ); + throw new Error('listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName)); } }, @@ -14055,14 +14067,14 @@ Phaser.Signal.prototype = { if (prevIndex !== -1) { binding = this._bindings[prevIndex]; if (binding.isOnce() !== isOnce) { - throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.'); + throw new Error('You cannot add' + (isOnce ? '' : 'Once') + '() then add' + (!isOnce ? '' : 'Once') + '() the same listener without removing the relationship first.'); } } else { binding = new Phaser.SignalBinding(this, listener, isOnce, listenerContext, priority); this._addBinding(binding); } - if (this.memorize && this._prevParams){ + if (this.memorize && this._prevParams) { binding.execute(this._prevParams); } @@ -14070,7 +14082,7 @@ Phaser.Signal.prototype = { }, /** - * @method Phaser.Signal#_addBinding + * @method Phaser.Signal#_addBinding * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener. * @private */ @@ -14101,7 +14113,7 @@ Phaser.Signal.prototype = { /** * Check if listener was attached to Signal. - * + * * @method Phaser.Signal#has * @param {Function} listener - Signal handler function. * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -14113,7 +14125,7 @@ Phaser.Signal.prototype = { /** * Add a listener to the signal. - * + * * @method Phaser.Signal#add * @param {function} listener - Signal handler function. * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -14231,7 +14243,7 @@ Phaser.Signal.prototype = { //execute all callbacks until end of the list or until a callback returns `false` or stops propagation //reverse loop since listeners with higher priority will be added at the end of the list do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false); - + }, /** @@ -14338,8 +14350,8 @@ Phaser.SignalBinding.prototype = { /** * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters). - * @property {array|null} params - * @default + * @property {array|null} params + * @default */ params: null, @@ -14350,13 +14362,13 @@ Phaser.SignalBinding.prototype = { * @param {array} [paramsArr] - Array of parameters that should be passed to the listener. * @return {any} Value returned by the listener. */ - execute: function (paramsArr) { + execute: function(paramsArr) { var handlerReturn, params; if (this.active && !!this._listener) { - params = this.params? this.params.concat(paramsArr) : paramsArr; + params = this.params ? this.params.concat(paramsArr) : paramsArr; handlerReturn = this._listener.apply(this.context, params); if (this._isOnce) @@ -14440,9 +14452,9 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Filter template to use for any Phaser filter development. -* +* * @class Phaser.Filter * @classdesc Phaser - Filter * @constructor @@ -14461,8 +14473,8 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @property {number} type - The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER. * @default */ - this.type = Phaser.WEBGL_FILTER; - + this.type = Phaser.WEBGL_FILTER; + /** * An array of passes - some filters contain a few steps this array simply stores the steps in a linear fashion. * For example the blur filter has two passes blurX and blurY. @@ -14470,7 +14482,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { * @private */ this.passes = [this]; - + /** * @property {array} shaders - Array an array of shaders. * @private @@ -14499,7 +14511,7 @@ Phaser.Filter = function (game, uniforms, fragmentSrc) { mouse: { type: '2f', value: { x: 0.0, y: 0.0 }} }; - + /** * @property {array} fragmentSrc - The fragment shader code. */ @@ -14561,7 +14573,7 @@ Phaser.Filter.prototype = { destroy: function () { this.game = null; - + } }; @@ -14606,9 +14618,9 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', { * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Plugin template to use for any Phaser plugin development. -* +* * @class Phaser.Plugin * @classdesc Phaser - Plugin * @constructor @@ -14623,30 +14635,30 @@ Phaser.Plugin = function (game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null. */ this.parent = parent; - + /** * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped. * @default */ this.active = false; - + /** * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped. * @default */ this.visible = false; - + /** * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method. * @default */ this.hasPreUpdate = false; - + /** * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method. * @default @@ -14658,13 +14670,13 @@ Phaser.Plugin = function (game, parent) { * @default */ this.hasPostUpdate = false; - + /** * @property {boolean} hasRender - A flag to indicate if this plugin has a render method. * @default */ this.hasRender = false; - + /** * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method. * @default @@ -14717,7 +14729,7 @@ Phaser.Plugin.prototype = { this.parent = null; this.active = false; this.visible = false; - + } }; @@ -14732,9 +14744,9 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin; * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins. -* +* * @class Phaser.PluginManager * @classdesc Phaser - PluginManager * @constructor @@ -14747,18 +14759,18 @@ Phaser.PluginManager = function(game, parent) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Description} _parent - Description. * @private */ this._parent = parent; - + /** * @property {array} plugins - Description. */ this.plugins = []; - + /** * @property {array} _pluginsLength - Description. * @private @@ -14858,7 +14870,7 @@ Phaser.PluginManager.prototype = { * @param {Phaser.Plugin} plugin - The plugin to be removed. */ remove: function (plugin) { - + if (this._pluginsLength === 0) { return; @@ -14881,7 +14893,7 @@ Phaser.PluginManager.prototype = { * @method Phaser.PluginManager#removeAll */ removeAll: function() { - + for (this._p = 0; this._p < this._pluginsLength; this._p++) { this.plugins[this._p].destroy(); @@ -14893,7 +14905,7 @@ Phaser.PluginManager.prototype = { /** * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#preUpdate */ preUpdate: function () { @@ -14916,11 +14928,11 @@ Phaser.PluginManager.prototype = { /** * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#update */ update: function () { - + if (this._pluginsLength === 0) { return; @@ -14940,11 +14952,11 @@ Phaser.PluginManager.prototype = { * PostUpdate is the last thing to be called before the world render. * In particular, it is called after the world postUpdate, which means the camera has been adjusted. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#postUpdate */ postUpdate: function () { - + if (this._pluginsLength === 0) { return; @@ -14963,7 +14975,7 @@ Phaser.PluginManager.prototype = { /** * Render is called right after the Game Renderer completes, but before the State.render. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#render */ render: function () { @@ -14986,7 +14998,7 @@ Phaser.PluginManager.prototype = { /** * Post-render is called after the Game Renderer and State.render have run. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#postRender */ postRender: function () { @@ -15008,7 +15020,7 @@ Phaser.PluginManager.prototype = { /** * Clear down this PluginManager and null out references - * + * * @method Phaser.PluginManager#destroy */ destroy: function () { @@ -15052,7 +15064,7 @@ Phaser.Stage = function (game, width, height) { * @property {Phaser.Point} offset - Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes) */ this.offset = new Phaser.Point(); - + PIXI.Stage.call(this, 0x000000, false); /** @@ -15122,11 +15134,11 @@ Phaser.Stage.prototype.constructor = Phaser.Stage; /** * This is called automatically after the plugins preUpdate and before the State.update. * Most objects have preUpdate methods and it's where initial movement and positioning is done. -* +* * @method Phaser.Stage#preUpdate */ Phaser.Stage.prototype.preUpdate = function () { - + this.currentRenderOrderID = 0; // This can't loop in reverse, we need the orderID to be in sequence @@ -15137,11 +15149,11 @@ Phaser.Stage.prototype.preUpdate = function () { this.children[i].preUpdate(); } -} +}; /** * This is called automatically after the State.update, but before particles or plugins update. -* +* * @method Phaser.Stage#update */ Phaser.Stage.prototype.update = function () { @@ -15153,14 +15165,14 @@ Phaser.Stage.prototype.update = function () { this.children[i].update(); } -} +}; /** * This is called automatically before the renderer runs and after the plugins have updated. * In postUpdate this is where all the final physics calculatations and object positioning happens. * The objects are processed in the order of the display list. * The only exception to this is if the camera is following an object, in which case that is updated first. -* +* * @method Phaser.Stage#postUpdate */ Phaser.Stage.prototype.postUpdate = function () { @@ -15202,7 +15214,7 @@ Phaser.Stage.prototype.postUpdate = function () { } } -} +}; /** * Parses a Game configuration object. @@ -15255,7 +15267,7 @@ Phaser.Stage.prototype.parseConfig = function (config) { this.backgroundColor = config['backgroundColor']; } -} +}; /** * Initialises the stage and adds the event listeners. @@ -15272,14 +15284,14 @@ Phaser.Stage.prototype.boot = function () { this._onChange = function (event) { return _this.visibilityChange(event); - } + }; Phaser.Canvas.setUserSelect(this.game.canvas, 'none'); Phaser.Canvas.setTouchAction(this.game.canvas, 'none'); this.checkVisibility(); -} +}; /** * Starts a page visibility event listener running, or window.blur/focus if not supported by the browser. @@ -15320,7 +15332,7 @@ Phaser.Stage.prototype.checkVisibility = function () { window.onblur = this._onChange; window.onfocus = this._onChange; -} +}; /** * This method is called when the document visibility is changed. @@ -15357,7 +15369,7 @@ Phaser.Stage.prototype.visibilityChange = function (event) { this.game.gameResumed(event); } -} +}; /** * Sets the background color for the stage. @@ -15372,7 +15384,7 @@ Phaser.Stage.prototype.setBackgroundColor = function(backgroundColor) var hex = this._backgroundColor.toString(16); hex = '000000'.substr(0, 6 - hex.length) + hex; this.backgroundColorString = '#' + hex; -} +}; /** * @name Phaser.Stage#backgroundColor @@ -15409,7 +15421,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", { * @property {boolean} smoothed - Set to true to smooth all sprites rendered on this Stage, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Stage.prototype, "smoothed", { - + get: function () { return !PIXI.scaleModes.LINEAR; @@ -15642,7 +15654,7 @@ Phaser.Group.prototype.add = function (child) { return child; -} +}; /** * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object. @@ -15679,7 +15691,7 @@ Phaser.Group.prototype.addAt = function (child, index) { return child; -} +}; /** * Returns the child found at the given index within this Group. @@ -15699,7 +15711,7 @@ Phaser.Group.prototype.getAt = function (index) { return this.getChildAt(index); } -} +}; /** * Automatically creates a new Phaser.Sprite object and adds it to the top of this Group. @@ -15729,9 +15741,9 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { child.alive = exists; this.addChild(child); - + child.z = this.children.length; - + if (child.events) { child.events.onAddedToGroup.dispatch(child, this); @@ -15744,7 +15756,7 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists) { return child; -} +}; /** * Automatically creates multiple Phaser.Sprite objects and adds them to the top of this Group. @@ -15766,7 +15778,7 @@ Phaser.Group.prototype.createMultiple = function (quantity, key, frame, exists) this.create(0, 0, key, frame, exists); } -} +}; /** * Internal method that re-applies all of the childrens Z values. @@ -15783,7 +15795,7 @@ Phaser.Group.prototype.updateZ = function () { this.children[i].z = i; } -} +}; /** * Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object. @@ -15807,7 +15819,7 @@ Phaser.Group.prototype.next = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object. @@ -15831,7 +15843,7 @@ Phaser.Group.prototype.previous = function () { this.cursor = this.children[this._cache[8]]; } -} +}; /** * Swaps the position of two children in this Group. Both children must be in this Group. @@ -15851,8 +15863,8 @@ Phaser.Group.prototype.swap = function (child1, child2) { } return result; - -} + +}; /** * Brings the given child to the top of this Group so it renders above all other children. @@ -15871,7 +15883,7 @@ Phaser.Group.prototype.bringToTop = function (child) { return child; -} +}; /** * Sends the given child to the bottom of this Group so it renders below all other children. @@ -15890,7 +15902,7 @@ Phaser.Group.prototype.sendToBack = function (child) { return child; -} +}; /** * Moves the given child up one place in this Group unless it's already at the top. @@ -15914,7 +15926,7 @@ Phaser.Group.prototype.moveUp = function (child) { return child; -} +}; /** * Moves the given child down one place in this Group unless it's already at the top. @@ -15938,7 +15950,7 @@ Phaser.Group.prototype.moveDown = function (child) { return child; -} +}; /** * Positions the child found at the given index within this Group to the given x and y coordinates. @@ -15960,7 +15972,7 @@ Phaser.Group.prototype.xy = function (index, x, y) { this.getChildAt(index).y = y; } -} +}; /** * Reverses all children in this Group. Note that this does not propagate, only direct children are re-ordered. @@ -15972,7 +15984,7 @@ Phaser.Group.prototype.reverse = function () { this.children.reverse(); this.updateZ(); -} +}; /** * Get the index position of the given child in this Group. This should always match the childs z property. @@ -15985,7 +15997,7 @@ Phaser.Group.prototype.getIndex = function (child) { return this.children.indexOf(child); -} +}; /** * Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group. @@ -15998,7 +16010,7 @@ Phaser.Group.prototype.getIndex = function (child) { Phaser.Group.prototype.replace = function (oldChild, newChild) { var index = this.getIndex(oldChild); - + if (index !== -1) { if (newChild.parent !== undefined) @@ -16021,7 +16033,7 @@ Phaser.Group.prototype.replace = function (oldChild, newChild) { return temp; } -} +}; /** * Sets the given property to the given value on the child. The operation controls the assignment of the value. @@ -16081,7 +16093,7 @@ Phaser.Group.prototype.setProperty = function (child, key, value, operation) { else if (operation == 4) { child[key[0]][key[1]][key[2]][key[3]] /= value; } } -} +}; /** * This function allows you to quickly set a property on a single child of this Group to a new value. @@ -16107,7 +16119,7 @@ Phaser.Group.prototype.set = function (child, key, value, checkAlive, checkVisib this.setProperty(child, key, value, operation); } -} +}; /** * This function allows you to quickly set the same property across all children of this Group to a new value. @@ -16140,7 +16152,7 @@ Phaser.Group.prototype.setAll = function (key, value, checkAlive, checkVisible, } } -} +}; /** * This function allows you to quickly set the same property across all children of this Group, and any child Groups, to a new value. @@ -16179,7 +16191,7 @@ Phaser.Group.prototype.setAllChildren = function (key, value, checkAlive, checkV } } -} +}; /** * Adds the amount to the given property on all children in this Group. @@ -16195,7 +16207,7 @@ Phaser.Group.prototype.addAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 1); -} +}; /** * Subtracts the amount from the given property on all children in this Group. @@ -16211,7 +16223,7 @@ Phaser.Group.prototype.subAll = function (property, amount, checkAlive, checkVis this.setAll(property, amount, checkAlive, checkVisible, 2); -} +}; /** * Multiplies the given property by the amount on all children in this Group. @@ -16227,7 +16239,7 @@ Phaser.Group.prototype.multiplyAll = function (property, amount, checkAlive, che this.setAll(property, amount, checkAlive, checkVisible, 3); -} +}; /** * Divides the given property by the amount on all children in this Group. @@ -16243,12 +16255,12 @@ Phaser.Group.prototype.divideAll = function (property, amount, checkAlive, check this.setAll(property, amount, checkAlive, checkVisible, 4); -} +}; /** * Calls a function on all of the children that have exists=true in this Group. * After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback. -* +* * @method Phaser.Group#callAllExists * @param {function} callback - The function that exists on the children that will be called. * @param {boolean} existsValue - Only children with exists=existsValue will be called. @@ -16266,11 +16278,11 @@ Phaser.Group.prototype.callAllExists = function (callback, existsValue) { } } -} +}; /** * Returns a reference to a function that exists on a child of the Group based on the given callback array. -* +* * @method Phaser.Group#callbackFromArray * @param {object} child - The object to inspect. * @param {array} callback - The array of function names. @@ -16319,12 +16331,12 @@ Phaser.Group.prototype.callbackFromArray = function (child, callback, length) { return false; -} +}; /** * Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that) * After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child. -* +* * @method Phaser.Group#callAll * @param {string} method - A string containing the name of the function that will be called. The function must exist on the child. * @param {string} [context=null] - A string containing the context under which the method will be executed. Set to null to default to the child. @@ -16379,7 +16391,7 @@ Phaser.Group.prototype.callAll = function (method, context) { } } -} +}; /** * The core preUpdate - as called by World. @@ -16403,7 +16415,7 @@ Phaser.Group.prototype.preUpdate = function () { return true; -} +}; /** * The core update - as called by World. @@ -16419,7 +16431,7 @@ Phaser.Group.prototype.update = function () { this.children[i].update(); } -} +}; /** * The core postUpdate - as called by World. @@ -16442,25 +16454,22 @@ Phaser.Group.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run. * After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEach(awardBonusGold, this, true, 100, 500) * Note: Currently this will skip any children which are Groups themselves. -* +* * @method Phaser.Group#forEach * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). -* @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. +* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. */ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists) { - if (typeof checkExists === 'undefined') - { - checkExists = false; - } + if (typeof checkExists === 'undefined') { checkExists = false; } var args = Array.prototype.splice.call(arguments, 3); args.unshift(null); @@ -16474,13 +16483,13 @@ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExist } } -} +}; /** * Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachExists(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachExists * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16492,13 +16501,13 @@ Phaser.Group.prototype.forEachExists = function (callback, callbackContext) { this.iterate('exists', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachAlive(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachAlive * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16510,13 +16519,13 @@ Phaser.Group.prototype.forEachAlive = function (callback, callbackContext) { this.iterate('alive', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachDead(bringToLife, this) -* +* * @method Phaser.Group#forEachDead * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -16528,7 +16537,7 @@ Phaser.Group.prototype.forEachDead = function (callback, callbackContext) { this.iterate('alive', false, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Call this function to sort the group according to a particular value and order. @@ -16562,7 +16571,7 @@ Phaser.Group.prototype.sort = function (index, order) { this.updateZ(); -} +}; /** * An internal helper function for the sort process. @@ -16593,7 +16602,7 @@ Phaser.Group.prototype.ascendingSortHandler = function (a, b) { } } -} +}; /** * An internal helper function for the sort process. @@ -16617,13 +16626,13 @@ Phaser.Group.prototype.descendingSortHandler = function (a, b) { return 0; } -} +}; /** * Iterates over the children of the Group. When a child has a property matching key that equals the given value, it is considered as a match. * Matched children can be sent to the optional callback, or simply returned or counted. * You can add as many callback parameters as you like, which will all be passed to the callback along with the child, after the callbackContext parameter. -* +* * @method Phaser.Group#iterate * @param {string} key - The child property to check, i.e. 'exists', 'alive', 'health' * @param {any} value - If child.key === this value it will be considered a match. Note that a strict comparison is used. @@ -16674,7 +16683,7 @@ Phaser.Group.prototype.iterate = function (key, value, returnType, callback, cal return null; } -} +}; /** * Call this function to retrieve the first object with exists == (the given state) in the Group. @@ -16692,7 +16701,7 @@ Phaser.Group.prototype.getFirstExists = function (state) { return this.iterate('exists', state, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === true in the group. @@ -16705,7 +16714,7 @@ Phaser.Group.prototype.getFirstAlive = function () { return this.iterate('alive', true, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === false in the group. @@ -16718,7 +16727,7 @@ Phaser.Group.prototype.getFirstDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_CHILD); -} +}; /** * Returns the child at the top of this Group. The top is the one being displayed (rendered) above every other child. @@ -16733,7 +16742,7 @@ Phaser.Group.prototype.getTop = function () { return this.children[this.children.length - 1]; } -} +}; /** * Returns the child at the bottom of this Group. The bottom is the one being displayed (rendered) below every other child. @@ -16748,7 +16757,7 @@ Phaser.Group.prototype.getBottom = function () { return this.children[0]; } -} +}; /** * Call this function to find out how many members of the group are alive. @@ -16760,7 +16769,7 @@ Phaser.Group.prototype.countLiving = function () { return this.iterate('alive', true, Phaser.Group.RETURN_TOTAL); -} +}; /** * Call this function to find out how many members of the group are dead. @@ -16772,7 +16781,7 @@ Phaser.Group.prototype.countDead = function () { return this.iterate('alive', false, Phaser.Group.RETURN_TOTAL); -} +}; /** * Returns a member at random from the group. @@ -16794,7 +16803,7 @@ Phaser.Group.prototype.getRandom = function (startIndex, length) { return this.game.math.getRandom(this.children, startIndex, length); -} +}; /** * Removes the given child from this Group and sets its group property to null. @@ -16826,7 +16835,7 @@ Phaser.Group.prototype.remove = function (child) { return true; -} +}; /** * Removes all children from this Group, setting all group properties to null. @@ -16854,7 +16863,7 @@ Phaser.Group.prototype.removeAll = function () { this.cursor = null; -} +}; /** * Removes all children from this Group whos index falls beteen the given startIndex and endIndex values. @@ -16892,7 +16901,7 @@ Phaser.Group.prototype.removeBetween = function (startIndex, endIndex) { this.updateZ(); -} +}; /** * Destroys this Group. Removes all children, then removes the container from the display list and nulls references. @@ -16938,7 +16947,7 @@ Phaser.Group.prototype.destroy = function (destroyChildren, soft) { this.exists = false; } -} +}; /** * @name Phaser.Group#total @@ -16997,7 +17006,7 @@ Object.defineProperty(Phaser.Group.prototype, "angle", { * @property {boolean} fixedToCamera - Set to true to fix this Group to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Group.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -17087,8 +17096,8 @@ Phaser.World = function (game) { * @property {Phaser.Camera} camera - Camera instance. */ this.camera = null; - -} + +}; Phaser.World.prototype = Object.create(Phaser.Group.prototype); Phaser.World.prototype.constructor = Phaser.World; @@ -17111,7 +17120,7 @@ Phaser.World.prototype.boot = function () { this.game.stage.addChild(this); -} +}; /** * Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height. @@ -17144,7 +17153,7 @@ Phaser.World.prototype.setBounds = function (x, y, width, height) { this.game.physics.setBoundsToWorld(); -} +}; /** * Destroyer of worlds. @@ -17156,7 +17165,7 @@ Phaser.World.prototype.shutdown = function () { // World is a Group, so run a soft destruction on this and all children. this.destroy(true, true); -} +}; /** * @name Phaser.World#width @@ -17269,7 +17278,7 @@ Object.defineProperty(Phaser.World.prototype, "randomY", { /** * The ScaleManager object is responsible for helping you manage the scaling, resizing and alignment of your game within the browser. * -* @class Phaser.ScaleManager +* @class Phaser.ScaleManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} width - The native width of the game. @@ -17501,7 +17510,7 @@ Phaser.ScaleManager = function (game, width, height) { document.addEventListener('fullscreenchange', function (event) { return _this.fullScreenChange(event); }, false); - + }; /** @@ -17820,7 +17829,7 @@ Phaser.ScaleManager.prototype = { { force = false; } - + if (this.game.device.iPad === false && this.game.device.webApp === false && this.game.device.desktop === false) { if (this.game.device.android && this.game.device.chrome === false) @@ -17839,7 +17848,7 @@ Phaser.ScaleManager.prototype = { { // Set minimum height of content to new window height document.documentElement['style'].minHeight = window.innerHeight + 'px'; - + if (this.incorrectOrientation === true) { this.setMaximum(); @@ -17905,7 +17914,7 @@ Phaser.ScaleManager.prototype = { this.game.canvas.style.width = this.width + 'px'; this.game.canvas.style.height = this.height + 'px'; - + this.game.input.scale.setTo(this.game.width / this.width, this.game.height / this.height); if (this.pageAlignHorizontally) @@ -17937,9 +17946,9 @@ Phaser.ScaleManager.prototype = { } Phaser.Canvas.getOffset(this.game.canvas, this.game.stage.offset); - + this.aspectRatio = this.width / this.height; - + this.scaleFactor.x = this.game.width / this.width; this.scaleFactor.y = this.game.height / this.height; @@ -18018,7 +18027,7 @@ Object.defineProperty(Phaser.ScaleManager.prototype, "isFullScreen", { get: function () { - return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']) + return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']); } @@ -18365,7 +18374,7 @@ Phaser.Game = function (width, height, renderer, parent, state, transparent, ant this._onBoot = function () { return _this.boot(); - } + }; if (document.readyState === 'complete' || document.readyState === 'interactive') { @@ -18895,7 +18904,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", { Phaser.Input = function (game) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -18904,7 +18913,7 @@ Phaser.Input = function (game) { * @default */ this.hitCanvas = null; - + /** * @property {CanvasRenderingContext2D} hitContext - The context of the pixel perfect hit canvas. * @default @@ -18937,13 +18946,13 @@ Phaser.Input = function (game) { /** * @property {number} multiInputOverride - Controls the expected behaviour when using a mouse and touch together on a multi-input device. - * @default + * @default */ this.multiInputOverride = Phaser.Input.MOUSE_TOUCH_COMBINE; /** * @property {Phaser.Point} position - A point object representing the current position of the Pointer. - * @default + * @default */ this.position = null; @@ -19090,22 +19099,22 @@ Phaser.Input = function (game) { * @property {Pointer} mousePointer - The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game. */ this.mousePointer = null; - + /** * @property {Phaser.Mouse} mouse - The Mouse Input manager. */ this.mouse = null; - + /** * @property {Phaser.Keyboard} keyboard - The Keyboard Input manager. */ this.keyboard = null; - + /** * @property {Phaser.Touch} touch - the Touch Input manager. */ this.touch = null; - + /** * @property {Phaser.MSPointer} mspointer - The MSPointer Input manager. */ @@ -19125,17 +19134,17 @@ Phaser.Input = function (game) { * @property {Phaser.Signal} onDown - A Signal that is dispatched each time a pointer is pressed down. */ this.onDown = null; - + /** * @property {Phaser.Signal} onUp - A Signal that is dispatched each time a pointer is released. */ this.onUp = null; - + /** * @property {Phaser.Signal} onTap - A Signal that is dispatched each time a pointer is tapped. */ this.onTap = null; - + /** * @property {Phaser.Signal} onHold - A Signal that is dispatched each time a pointer is held down. */ @@ -19152,7 +19161,7 @@ Phaser.Input = function (game) { * @private */ this._localPoint = new Phaser.Point(); - + /** * @property {number} _pollCounter - Internal var holding the current poll counter. * @private @@ -19593,7 +19602,7 @@ Phaser.Input.prototype = { wt.d * id * pointer.x + -wt.b * id * pointer.y + (wt.ty * wt.b - wt.tx * wt.d) * id, wt.a * id * pointer.y + -wt.c * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.c) * id ); - + }, /** @@ -19695,7 +19704,7 @@ Object.defineProperty(Phaser.Input.prototype, "x", { * @property {number} y - The Y coordinate of the most recently active pointer. */ Object.defineProperty(Phaser.Input.prototype, "y", { - + get: function () { return this._y; }, @@ -19740,7 +19749,7 @@ Object.defineProperty(Phaser.Input.prototype, "totalInactivePointers", { * @readonly */ Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", { - + get: function () { this.currentPointers = 0; @@ -19801,7 +19810,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", { Phaser.Key = function (game, keycode) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -19890,7 +19899,7 @@ Phaser.Key = function (game, keycode) { * @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again). */ this.onUp = new Phaser.Signal(); - + }; Phaser.Key.prototype = { @@ -20061,7 +20070,7 @@ Phaser.Keyboard = function (game) { * @private */ this._keys = []; - + /** * @property {array} _capture - The array the key capture values are stored in. * @private @@ -20074,14 +20083,20 @@ Phaser.Keyboard = function (game) { * @default */ this._onKeyDown = null; - + /** * @property {function} _onKeyUp * @private * @default */ this._onKeyUp = null; - + + /** + * @property {number} _i - Internal cache var + * @private + */ + this._i = 0; + }; Phaser.Keyboard.prototype = { @@ -20138,7 +20153,7 @@ Phaser.Keyboard.prototype = { if (this._keys[keycode]) { this._keys[keycode] = null; - + this.removeKeyCapture(keycode); } @@ -20157,12 +20172,12 @@ Phaser.Keyboard.prototype = { down: this.addKey(Phaser.Keyboard.DOWN), left: this.addKey(Phaser.Keyboard.LEFT), right: this.addKey(Phaser.Keyboard.RIGHT) - } + }; }, /** - * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. + * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. * This is called automatically by Phaser.Input and should not normally be invoked directly. * * @method Phaser.Keyboard#start @@ -20191,17 +20206,37 @@ Phaser.Keyboard.prototype = { }, /** - * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body. + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { + this._onKeyDown = null; + this._onKeyUp = null; + window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); }, + /** + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. + * Also clears all key captures and currently created Key objects. + * + * @method Phaser.Keyboard#destroy + */ + destroy: function () { + + this.stop(); + + this.clearCaptures(); + + this._keys.length = 0; + this._i = 0; + + }, + /** * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. @@ -20256,13 +20291,13 @@ Phaser.Keyboard.prototype = { */ update: function () { - var i = this._keys.length; + this._i = this._keys.length; - while (i--) + while (this._i--) { - if (this._keys[i]) + if (this._keys[this._i]) { - this._keys[i].update(); + this._keys[this._i].update(); } } @@ -20299,7 +20334,7 @@ Phaser.Keyboard.prototype = { { this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode); } - + this._keys[event.keyCode].processKeyDown(event); }, @@ -20542,7 +20577,7 @@ Phaser.Mouse = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called. */ @@ -20552,12 +20587,12 @@ Phaser.Mouse = function (game) { * @property {function} mouseDownCallback - A callback that can be fired when the mouse is pressed down. */ this.mouseDownCallback = null; - + /** * @property {function} mouseMoveCallback - A callback that can be fired when the mouse is moved while pressed down. */ this.mouseMoveCallback = null; - + /** * @property {function} mouseUpCallback - A callback that can be fired when the mouse is released from a pressed down state. */ @@ -20883,7 +20918,7 @@ Phaser.MSPointer = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called (defaults to game). */ @@ -20900,13 +20935,13 @@ Phaser.MSPointer = function (game) { * @private */ this._onMSPointerDown = null; - + /** * @property {function} _onMSPointerMove - Internal function to handle MSPointer events. * @private */ this._onMSPointerMove = null; - + /** * @property {function} _onMSPointerUp - Internal function to handle MSPointer events. * @private @@ -21209,7 +21244,7 @@ Phaser.Pointer = function (game, id) { * @property {Phaser.Point} position - A Phaser.Point object containing the current x/y values of the pointer on the display. */ this.position = new Phaser.Point(); - + /** * @property {Phaser.Point} positionDown - A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display. */ @@ -21316,7 +21351,7 @@ Phaser.Pointer.prototype = { x: this.position.x, y: this.position.y }); - + if (this._history.length > this.game.input.recordLimit) { this._history.shift(); @@ -21418,7 +21453,7 @@ Phaser.Pointer.prototype = { } currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this._highestRenderObject === null) @@ -21538,17 +21573,17 @@ Phaser.Pointer.prototype = { if (this.game.input.interactiveItems.total > 0) { var currentNode = this.game.input.interactiveItems.next; - + do { if (currentNode) { currentNode._releasedHandler(this); } - + currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this.targetObject) @@ -21698,7 +21733,7 @@ Phaser.Touch = function (game) { * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored. * @return {boolean} @@ -21714,32 +21749,32 @@ Phaser.Touch = function (game) { * @property {function} touchStartCallback - A callback that can be fired on a touchStart event. */ this.touchStartCallback = null; - + /** * @property {function} touchMoveCallback - A callback that can be fired on a touchMove event. */ this.touchMoveCallback = null; - + /** * @property {function} touchEndCallback - A callback that can be fired on a touchEnd event. */ this.touchEndCallback = null; - + /** * @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event. */ this.touchEnterCallback = null; - + /** * @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event. */ this.touchLeaveCallback = null; - + /** * @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event. */ this.touchCancelCallback = null; - + /** * @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it. * @default @@ -22357,7 +22392,7 @@ Phaser.Gamepad.prototype = { } var rawPad = this._rawPads[m]; - + if (rawPad) { if (validConnections.rawIndices[rawPad.index]) @@ -22920,7 +22955,7 @@ Phaser.SinglePad.prototype = { } this._axes[axisState.axis] = axisState.value; - + if (this._padParent.onAxisCallback) { this._padParent.onAxisCallback.call(this._padParent.callbackContext, axisState, this._index); @@ -23408,7 +23443,7 @@ Phaser.InputHandler = function (sprite) { this.sprite = sprite; /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = sprite.game; @@ -23423,13 +23458,13 @@ Phaser.InputHandler = function (sprite) { * @default */ this.priorityID = 0; - + /** * @property {boolean} useHandCursor - On a desktop browser you can set the 'hand' cursor to appear when moving over the Sprite. * @default */ this.useHandCursor = false; - + /** * @property {boolean} _setHandCursor - Did this Sprite trigger the hand cursor? * @private @@ -23441,19 +23476,19 @@ Phaser.InputHandler = function (sprite) { * @default */ this.isDragged = false; - + /** * @property {boolean} allowHorizontalDrag - Controls if the Sprite is allowed to be dragged horizontally. * @default */ this.allowHorizontalDrag = true; - + /** * @property {boolean} allowVerticalDrag - Controls if the Sprite is allowed to be dragged vertically. * @default */ this.allowVerticalDrag = true; - + /** * @property {boolean} bringToTop - If true when this Sprite is clicked or dragged it will automatically be bought to the top of the Group it is within. * @default @@ -23465,25 +23500,25 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffset = null; - + /** * @property {boolean} snapOnDrag - When the Sprite is dragged this controls if the center of the Sprite will snap to the pointer on drag or not. * @default */ this.snapOnDrag = false; - + /** * @property {boolean} snapOnRelease - When the Sprite is dragged this controls if the Sprite will be snapped on release. * @default */ this.snapOnRelease = false; - + /** * @property {number} snapX - When a Sprite has snapping enabled this holds the width of the snap grid. * @default */ this.snapX = 0; - + /** * @property {number} snapY - When a Sprite has snapping enabled this holds the height of the snap grid. * @default @@ -23495,7 +23530,7 @@ Phaser.InputHandler = function (sprite) { * @default */ this.snapOffsetX = 0; - + /** * @property {number} snapOffsetY - This defines the top-left Y coordinate of the snap grid.. * @default @@ -23528,13 +23563,13 @@ Phaser.InputHandler = function (sprite) { /** * @property {boolean} draggable - Is this sprite allowed to be dragged by the mouse? true = yes, false = no - * @default + * @default */ this.draggable = false; /** * @property {Phaser.Rectangle} boundsRect - A region of the game world within which the sprite is restricted during drag. - * @default + * @default */ this.boundsRect = null; @@ -24034,7 +24069,7 @@ Phaser.InputHandler.prototype = { y += this.sprite.texture.frame.y; this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1); if (rgb.data[3] >= this.pixelPerfectAlpha) @@ -24520,7 +24555,7 @@ Phaser.InputHandler.prototype = { } this.updateDrag(pointer); - + if (this.bringToTop) { this.sprite.bringToTop(); @@ -24540,7 +24575,7 @@ Phaser.InputHandler.prototype = { this.isDragged = false; this._draggedPointerID = -1; this._pointerData[pointer.id].isDragged = false; - + if (this.snapOnRelease) { if (this.sprite.fixedToCamera) @@ -24744,7 +24779,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler; * @param {Phaser.Sprite} sprite - A reference to Description. */ Phaser.Events = function (sprite) { - + this.parent = sprite; this.onAddedToGroup = new Phaser.Signal(); @@ -24820,7 +24855,7 @@ Phaser.GameObjectFactory = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -24960,7 +24995,7 @@ Phaser.GameObjectFactory.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -24976,7 +25011,7 @@ Phaser.GameObjectFactory.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25082,7 +25117,7 @@ Phaser.GameObjectFactory.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectFactory#retroFont @@ -25240,7 +25275,7 @@ Phaser.GameObjectCreator = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -25343,7 +25378,7 @@ Phaser.GameObjectCreator.prototype = { audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25359,7 +25394,7 @@ Phaser.GameObjectCreator.prototype = { sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -25453,7 +25488,7 @@ Phaser.GameObjectCreator.prototype = { * A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectCreator#retroFont @@ -25613,7 +25648,7 @@ Phaser.BitmapData = function (game, key, width, height) { if (typeof height === 'undefined') { height = 100; } /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -25626,7 +25661,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @property {number} width - The width of the BitmapData in pixels. */ this.width = width; - + /** * @property {number} height - The height of the BitmapData in pixels. */ @@ -25637,7 +25672,7 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.canvas = Phaser.Canvas.create(width, height, '', true); - + /** * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. * @default @@ -25671,13 +25706,13 @@ Phaser.BitmapData = function (game, key, width, height) { * @default */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - The PIXI.Texture. * @default */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - The Frame this BitmapData uses for rendering. * @default @@ -25695,13 +25730,13 @@ Phaser.BitmapData = function (game, key, width, height) { */ this.dirty = false; -} +}; Phaser.BitmapData.prototype = { /** * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. - * + * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. */ @@ -25731,7 +25766,7 @@ Phaser.BitmapData.prototype = { clear: function () { this.context.clearRect(0, 0, this.width, this.height); - + this.dirty = true; }, @@ -25752,7 +25787,7 @@ Phaser.BitmapData.prototype = { this.textureFrame.height = height; this.imageData = this.context.getImageData(0, 0, width, height); } - + this.dirty = true; }, @@ -25997,7 +26032,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -26075,7 +26110,7 @@ Phaser.Sprite = function (game, x, y, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -26378,6 +26413,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) { /** * Crop allows you to crop the texture used to display this Sprite. * Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite. * * @method Phaser.Sprite#crop * @memberof Phaser.Sprite @@ -26426,7 +26462,7 @@ Phaser.Sprite.prototype.crop = function(rect) { * Brings a 'dead' Sprite back to life, optionally giving it the health value specified. * A resurrected Sprite has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal. -* +* * @method Phaser.Sprite#revive * @memberof Phaser.Sprite * @param {number} [health=1] - The health to give the Sprite. @@ -26455,7 +26491,7 @@ Phaser.Sprite.prototype.revive = function(health) { * It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal. * Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory. * If you don't need this Sprite any more you should call Sprite.destroy instead. -* +* * @method Phaser.Sprite#kill * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -26478,7 +26514,7 @@ Phaser.Sprite.prototype.kill = function() { /** * Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Sprite#destroy * @memberof Phaser.Sprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -26551,7 +26587,7 @@ Phaser.Sprite.prototype.destroy = function(destroyChildren) { /** * Damages the Sprite, this removes the given amount from the Sprites health property. * If health is then taken below or is equal to zero `Sprite.kill` is called. -* +* * @method Phaser.Sprite#damage * @memberof Phaser.Sprite * @param {number} amount - The amount to subtract from the Sprite.health value. @@ -26577,7 +26613,7 @@ Phaser.Sprite.prototype.damage = function(amount) { * Resets the Sprite. This places the Sprite at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. * If the Sprite has a physics body that too is reset. -* +* * @method Phaser.Sprite#reset * @memberof Phaser.Sprite * @param {number} x - The x coordinate (in world space) to position the Sprite at. @@ -26608,13 +26644,13 @@ Phaser.Sprite.prototype.reset = function(x, y, health) { this._cache[4] = 1; return this; - + }; /** * Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Sprite#bringToTop * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -26633,7 +26669,7 @@ Phaser.Sprite.prototype.bringToTop = function() { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.Sprite#play * @memberof Phaser.Sprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -26651,11 +26687,27 @@ Phaser.Sprite.prototype.play = function (name, frameRate, loop, killOnComplete) }; +/** +* Checks to see if the bounds of this Sprite overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as a Button. +* This check ignores the Sprites hitArea property and runs a Sprite.getBounds comparison on both objects to determine the result. +* Therefore it's relatively expensive to use in large quantities (i.e. with lots of Sprites at a high frequency), but should be fine for low-volume testing where physics isn't required. +* +* @method Phaser.Sprite#overlap +* @memberof Phaser.Sprite +* @param {Phaser.Sprite|Phaser.Image|Phaser.TileSprite|Phaser.Button|PIXI.DisplayObject} displayObject - The display object to check against. +* @return {boolean} True if the bounds of this Sprite intersects at any point with the bounds of the given display object. +*/ +Phaser.Sprite.prototype.overlap = function (displayObject) { + + return Phaser.Rectangle.intersects(this.getBounds(), displayObject.getBounds()); + +}; + /** * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Sprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -26702,7 +26754,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaX", { Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -26719,7 +26771,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { Object.defineProperty(Phaser.Sprite.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -26753,7 +26805,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inWorld", { Object.defineProperty(Phaser.Sprite.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -26815,7 +26867,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -26852,7 +26904,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { * @property {boolean} exists - If the Sprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.Sprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -26899,7 +26951,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "exists", { * @property {boolean} fixedToCamera - Set to true to fix this Sprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -26928,7 +26980,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Sprite, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -26955,6 +27007,60 @@ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { }); +/** +* The position of the Sprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#x +* @property {number} x - The position of the Sprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the Sprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#y +* @property {number} y - The position of the Sprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -26980,12 +27086,12 @@ Phaser.Image = function (game, x, y, key, frame) { y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Image isn't updated by the core game loop. * @default @@ -27121,7 +27227,7 @@ Phaser.Image.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -27131,7 +27237,7 @@ Phaser.Image.prototype.preUpdate = function() { */ Phaser.Image.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -27159,7 +27265,7 @@ Phaser.Image.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Changes the Texture the Image is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -27236,7 +27342,7 @@ Phaser.Image.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Crop allows you to crop the texture used to display this Image. @@ -27283,13 +27389,13 @@ Phaser.Image.prototype.crop = function(rect) { } } -} +}; /** * Brings a 'dead' Image back to life, optionally giving it the health value specified. * A resurrected Image has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Image.events.onRevived for the signal. -* +* * @method Phaser.Image#revive * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27307,14 +27413,14 @@ Phaser.Image.prototype.revive = function() { return this; -} +}; /** * Kills a Image. A killed Image has its alive, exists and visible properties all set to false. * It will dispatch the onKilled event, you can listen to Image.events.onKilled for the signal. * Note that killing a Image is a way for you to quickly recycle it in a Image pool, it doesn't free it up from memory. * If you don't need this Image any more you should call Image.destroy instead. -* +* * @method Phaser.Image#kill * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27332,12 +27438,12 @@ Phaser.Image.prototype.kill = function() { return this; -} +}; /** * Destroys the Image. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Image#destroy * @memberof Phaser.Image * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -27395,11 +27501,11 @@ Phaser.Image.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Resets the Image. This places the Image at the given x/y world coordinates and then sets alive, exists, visible and renderable all to true. -* +* * @method Phaser.Image#reset * @memberof Phaser.Image * @param {number} x - The x coordinate (in world space) to position the Image at. @@ -27417,13 +27523,13 @@ Phaser.Image.prototype.reset = function(x, y) { this.renderable = true; return this; - -} + +}; /** * Brings the Image to the top of the display list it is a child of. Images that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Image#bringToTop * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -27437,13 +27543,13 @@ Phaser.Image.prototype.bringToTop = function() { return this; -} +}; /** * Indicates the rotation of the Image, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Image.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Image#angle * @property {number} angle - The angle of this Image in degrees. */ @@ -27490,7 +27596,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaX", { Object.defineProperty(Phaser.Image.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -27507,7 +27613,7 @@ Object.defineProperty(Phaser.Image.prototype, "deltaY", { Object.defineProperty(Phaser.Image.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -27541,7 +27647,7 @@ Object.defineProperty(Phaser.Image.prototype, "inWorld", { Object.defineProperty(Phaser.Image.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -27555,7 +27661,7 @@ Object.defineProperty(Phaser.Image.prototype, "inCamera", { Object.defineProperty(Phaser.Image.prototype, "frame", { get: function() { - + return this._frame; }, @@ -27584,7 +27690,7 @@ Object.defineProperty(Phaser.Image.prototype, "frame", { Object.defineProperty(Phaser.Image.prototype, "frameName", { get: function() { - + return this._frameName; }, @@ -27629,7 +27735,7 @@ Object.defineProperty(Phaser.Image.prototype, "renderOrderID", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -27666,7 +27772,7 @@ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Image to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -27695,7 +27801,7 @@ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { * @property {boolean} smoothed - Set to true to smooth the texture of this Image, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Image.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -27848,7 +27954,7 @@ Phaser.TileSprite = function (game, x, y, width, height, key, frame) { /** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -27977,7 +28083,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -27987,7 +28093,7 @@ Phaser.TileSprite.prototype.preUpdate = function() { */ Phaser.TileSprite.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -28015,7 +28121,7 @@ Phaser.TileSprite.prototype.postUpdate = function() { this.children[i].postUpdate(); } -} +}; /** * Sets this TileSprite to automatically scroll in the given direction until stopped via TileSprite.stopScroll(). @@ -28030,7 +28136,7 @@ Phaser.TileSprite.prototype.autoScroll = function(x, y) { this._scroll.set(x, y); -} +}; /** * Stops an automatically scrolling TileSprite. @@ -28042,7 +28148,7 @@ Phaser.TileSprite.prototype.stopScroll = function() { this._scroll.set(0, 0); -} +}; /** * Changes the Texture the TileSprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -28114,12 +28220,12 @@ Phaser.TileSprite.prototype.loadTexture = function (key, frame) { } } -} +}; /** * Destroys the TileSprite. This removes it from its parent group, destroys the event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.TileSprite#destroy * @memberof Phaser.TileSprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -28175,12 +28281,12 @@ Phaser.TileSprite.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.TileSprite#play * @memberof Phaser.TileSprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -28193,7 +28299,7 @@ Phaser.TileSprite.prototype.play = function (name, frameRate, loop, killOnComple return this.animations.play(name, frameRate, loop, killOnComplete); -} +}; /** * Resets the TileSprite. This places the TileSprite at the given x/y world coordinates, resets the tilePosition and then @@ -28235,7 +28341,7 @@ Phaser.TileSprite.prototype.reset = function(x, y) { * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.TileSprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -28306,7 +28412,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "frameName", { * @property {boolean} fixedToCamera - Set to true to fix this TileSprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -28337,7 +28443,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { * @property {boolean} exists - If the TileSprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -28383,7 +28489,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -28411,6 +28517,60 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { }); +/** +* The position of the TileSprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#x +* @property {number} x - The position of the TileSprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the TileSprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#y +* @property {number} y - The position of the TileSprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -28451,7 +28611,7 @@ Phaser.Text = function (game, x, y, text, style) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -28588,7 +28748,7 @@ Phaser.Text.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -28598,7 +28758,7 @@ Phaser.Text.prototype.preUpdate = function () { */ Phaser.Text.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -28618,7 +28778,7 @@ Phaser.Text.prototype.postUpdate = function () { this.children[i].postUpdate(); } -} +}; /** * @method Phaser.Text.prototype.destroy @@ -28678,7 +28838,7 @@ Phaser.Text.prototype.destroy = function (destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @method Phaser.Text.prototype.setShadow @@ -28695,7 +28855,7 @@ Phaser.Text.prototype.setShadow = function (x, y, color, blur) { this.style.shadowBlur = blur || 0; this.dirty = true; -} +}; /** * Set the style of the text by passing a single style object to it. @@ -28728,7 +28888,7 @@ Phaser.Text.prototype.setStyle = function (style) { this.style = style; this.dirty = true; -} +}; /** * Renders text. This replaces the Pixi.Text.updateText function as we need a few extra bits in here. @@ -28766,15 +28926,15 @@ Phaser.Text.prototype.updateText = function () { this.canvas.width = maxLineWidth + this.style.strokeThickness; //calculate text height - var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; + var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; this.canvas.height = lineHeight * lines.length; if (navigator.isCocoonJS) { - this.context.clearRect(0,0,this.canvas.width,this.canvas.height); + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); } - + //set canvas text styles this.context.fillStyle = this.style.fill; this.context.font = this.style.font; @@ -28794,30 +28954,30 @@ Phaser.Text.prototype.updateText = function () { { var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight); - if(this.style.align === 'right') + if (this.style.align === 'right') { linePosition.x += maxLineWidth - lineWidths[i]; } - else if(this.style.align === 'center') + else if (this.style.align === 'center') { linePosition.x += (maxLineWidth - lineWidths[i]) / 2; } linePosition.y += this._lineSpacing; - if(this.style.stroke && this.style.strokeThickness) + if (this.style.stroke && this.style.strokeThickness) { this.context.strokeText(lines[i], linePosition.x, linePosition.y); } - if(this.style.fill) + if (this.style.fill) { this.context.fillText(lines[i], linePosition.x, linePosition.y); } } this.updateTexture(); -} +}; /** * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal bounds. @@ -28865,7 +29025,7 @@ Phaser.Text.prototype.runWordWrap = function (text) { return result; -} +}; /** * Indicates the rotation of the Text, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -29235,7 +29395,7 @@ Object.defineProperty(Phaser.Text.prototype, 'shadowBlur', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -29272,7 +29432,7 @@ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this Text to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Text.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -29332,7 +29492,7 @@ Phaser.BitmapText = function (game, x, y, font, text, size) { */ this.game = game; - /** + /** * @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all. * @default */ @@ -29473,7 +29633,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -29482,7 +29642,7 @@ Phaser.BitmapText.prototype.preUpdate = function () { */ Phaser.BitmapText.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -29497,7 +29657,7 @@ Phaser.BitmapText.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this BitmapText instance. This will remove any filters and un-parent any children. @@ -29553,7 +29713,7 @@ Phaser.BitmapText.prototype.destroy = function(destroyChildren) { this.mask = null; this.game = null; -} +}; /** * @name Phaser.BitmapText#align @@ -29697,7 +29857,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'text', { * @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -29734,7 +29894,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { * @property {boolean} fixedToCamera - Set to true to fix this BitmapText to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -29798,136 +29958,136 @@ Phaser.Button = function (game, x, y, key, callback, callbackContext, overFrame, Phaser.Image.call(this, game, x, y, key, outFrame); - /** + /** * @property {number} type - The Phaser Object Type. */ this.type = Phaser.BUTTON; - /** + /** * @property {string} _onOverFrameName - Internal variable. * @private * @default */ this._onOverFrameName = null; - - /** + + /** * @property {string} _onOutFrameName - Internal variable. * @private * @default */ this._onOutFrameName = null; - - /** + + /** * @property {string} _onDownFrameName - Internal variable. * @private * @default */ this._onDownFrameName = null; - /** + /** * @property {string} _onUpFrameName - Internal variable. * @private * @default */ this._onUpFrameName = null; - - /** + + /** * @property {number} _onOverFrameID - Internal variable. * @private * @default */ this._onOverFrameID = null; - - /** + + /** * @property {number} _onOutFrameID - Internal variable. * @private * @default */ this._onOutFrameID = null; - - /** + + /** * @property {number} _onDownFrameID - Internal variable. * @private * @default */ this._onDownFrameID = null; - /** + /** * @property {number} _onUpFrameID - Internal variable. * @private * @default */ this._onUpFrameID = null; - /** + /** * @property {Phaser.Sound} onOverSound - The Sound to be played when this Buttons Over state is activated. * @default */ this.onOverSound = null; - /** + /** * @property {Phaser.Sound} onOutSound - The Sound to be played when this Buttons Out state is activated. * @default */ this.onOutSound = null; - /** + /** * @property {Phaser.Sound} onDownSound - The Sound to be played when this Buttons Down state is activated. * @default */ this.onDownSound = null; - /** + /** * @property {Phaser.Sound} onUpSound - The Sound to be played when this Buttons Up state is activated. * @default */ this.onUpSound = null; - /** + /** * @property {string} onOverSoundMarker - The Sound Marker used in conjunction with the onOverSound. * @default */ this.onOverSoundMarker = ''; - /** + /** * @property {string} onOutSoundMarker - The Sound Marker used in conjunction with the onOutSound. * @default */ this.onOutSoundMarker = ''; - /** + /** * @property {string} onDownSoundMarker - The Sound Marker used in conjunction with the onDownSound. * @default */ this.onDownSoundMarker = ''; - /** + /** * @property {string} onUpSoundMarker - The Sound Marker used in conjunction with the onUpSound. * @default */ this.onUpSoundMarker = ''; - /** + /** * @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state. */ this.onInputOver = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state. */ this.onInputOut = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state. */ this.onInputDown = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state. */ this.onInputUp = new Phaser.Signal(); - /** + /** * @property {boolean} freezeFrames - When true the Button will cease to change texture frame on all events (over, out, up, down). */ this.freezeFrames = false; @@ -29980,7 +30140,7 @@ Phaser.Button.prototype.clearFrames = function () { this._onUpFrameName = null; this._onUpFrameID = null; -} +}; /** * Used to manually set the frames that will be used for the different states of the Button. @@ -30000,7 +30160,7 @@ Phaser.Button.prototype.setFrames = function (overFrame, outFrame, downFrame, up if (typeof overFrame === 'string') { this._onOverFrameName = overFrame; - + if (this.input.pointerOver()) { this.frameName = overFrame; @@ -30107,7 +30267,7 @@ Phaser.Button.prototype.setSounds = function (overSound, overMarker, downSound, this.setDownSound(downSound, downMarker); this.setUpSound(upSound, upMarker); -} +}; /** * The Sound to be played when a Pointer moves over this Button. @@ -30131,7 +30291,7 @@ Phaser.Button.prototype.setOverSound = function (sound, marker) { this.onOverSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer moves out of this Button. @@ -30155,7 +30315,7 @@ Phaser.Button.prototype.setOutSound = function (sound, marker) { this.onOutSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer presses down on this Button. @@ -30179,7 +30339,7 @@ Phaser.Button.prototype.setDownSound = function (sound, marker) { this.onDownSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer has pressed down and is released from this Button. @@ -30203,7 +30363,7 @@ Phaser.Button.prototype.setUpSound = function (sound, marker) { this.onUpSoundMarker = marker; } -} +}; /** * Internal function that handles input events. @@ -30402,7 +30562,7 @@ Phaser.Button.prototype.setState = function (newState) { /** * Creates a new `Graphics` object. -* +* * @class Phaser.Graphics * @constructor * @@ -30419,7 +30579,7 @@ Phaser.Graphics = function (game, x, y) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -30508,7 +30668,7 @@ Phaser.Graphics.prototype.preUpdate = function () { return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -30518,7 +30678,7 @@ Phaser.Graphics.prototype.preUpdate = function () { */ Phaser.Graphics.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -30533,11 +30693,11 @@ Phaser.Graphics.prototype.postUpdate = function () { this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this Graphics instance. -* +* * @method Phaser.Graphics.prototype.destroy * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? */ @@ -30581,11 +30741,11 @@ Phaser.Graphics.prototype.destroy = function(destroyChildren) { this.game = null; -} +}; /* * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled -* +* * @method Phaser.Graphics.prototype.drawPolygon */ Phaser.Graphics.prototype.drawPolygon = function (poly) { @@ -30598,8 +30758,8 @@ Phaser.Graphics.prototype.drawPolygon = function (poly) { } this.lineTo(poly.points[0].x, poly.points[0].y); - -} + +}; /** * Indicates the rotation of the Graphics, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -30629,7 +30789,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'angle', { * @property {boolean} fixedToCamera - Set to true to fix this Graphics to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -30669,7 +30829,7 @@ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { Phaser.RenderTexture = function (game, width, height, key) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -30679,7 +30839,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this.key = key; /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RENDERTEXTURE; @@ -30690,7 +30850,7 @@ Phaser.RenderTexture = function (game, width, height, key) { this._temp = new Phaser.Point(); PIXI.RenderTexture.call(this, width, height); - + }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); @@ -30711,7 +30871,7 @@ Phaser.RenderTexture.prototype.renderXY = function (displayObject, x, y, clear) this.render(displayObject, this._temp, clear); -} +}; // Documentation stubs @@ -30878,13 +31038,13 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, * @private */ this.grabData = []; - + // Now generate our rects for faster copying later on var currentX = this.offsetX; var currentY = this.offsetY; var r = 0; var data = new Phaser.FrameData(); - + for (var c = 0; c < chars.length; c++) { var uuid = game.rnd.uuid(); @@ -30899,9 +31059,9 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, width: this.characterWidth, height: this.characterHeight }); - + r++; - + if (r == this.characterPerRow) { r = 0; @@ -30921,10 +31081,10 @@ Phaser.RetroFont = function (game, key, characterWidth, characterHeight, chars, Phaser.RenderTexture.call(this, game); /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RETROFONT; - + }; Phaser.RetroFont.prototype = Object.create(Phaser.RenderTexture.prototype); @@ -30936,91 +31096,91 @@ Phaser.RetroFont.prototype.constructor = Phaser.RetroFont; * @type {string} */ Phaser.RetroFont.ALIGN_LEFT = "left"; - + /** * Align each line of multi-line text to the right. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_RIGHT = "right"; - + /** * Align each line of multi-line text in the center. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_CENTER = "center"; - + /** * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - + /** * Text Set 2 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** -* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 +* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; - + /** * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"; - + /** * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789"; - + /** -* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' +* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' "; - + /** * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39"; - + /** * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?! * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!"; - + /** * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789 * @constant @@ -31044,11 +31204,11 @@ Phaser.RetroFont.prototype.setFixedWidth = function (width, lineAlignment) { this.fixedWidth = width; this.align = lineAlignment; -} +}; /** * A helper function that quickly sets lots of variables at once, and then updates the text. -* +* * @method Phaser.RetroFont#setText * @memberof Phaser.RetroFont * @param {string} content - The text of this sprite. @@ -31064,7 +31224,7 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac this.customSpacingX = characterSpacing || 0; this.customSpacingY = lineSpacing || 0; this.align = lineAlignment || 'left'; - + if (allowLowerCase) { this.autoUpperCase = false; @@ -31073,17 +31233,17 @@ Phaser.RetroFont.prototype.setText = function (content, multiLine, characterSpac { this.autoUpperCase = true; } - + if (content.length > 0) { this.text = content; } -} +}; /** * Over rides the default PIXI.RenderTexture resize event as we need our baseTexture resized as well. -* +* * @method Phaser.RetroFont#resize * @memberof Phaser.RetroFont */ @@ -31105,7 +31265,7 @@ Phaser.RetroFont.prototype.resize = function (width, height) { var gl = this.renderer.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTextures[gl.id]); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { @@ -31114,11 +31274,11 @@ Phaser.RetroFont.prototype.resize = function (width, height) { PIXI.Texture.frameUpdates.push(this); -} +}; /** * Updates the BitmapData of the Sprite with the text -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont */ @@ -31130,7 +31290,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { if (this.multiLine) { var lines = this._text.split("\n"); - + if (this.fixedWidth > 0) { this.resize(this.fixedWidth, (lines.length * (this.characterHeight + this.customSpacingY)) - this.customSpacingY); @@ -31141,7 +31301,7 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + // Loop through each line of text for (var i = 0; i < lines.length; i++) { @@ -31151,25 +31311,25 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (lines[i].length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((lines[i].length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + // Sanity checks if (cx < 0) { cx = 0; } - + this.pasteLine(lines[i], cx, cy, this.customSpacingX); - + cy += this.characterHeight + this.customSpacingY; } } @@ -31185,32 +31345,32 @@ Phaser.RetroFont.prototype.buildRetroFontText = function () { } this.textureBuffer.clear(); - + switch (this.align) { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (this._text.length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((this._text.length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + this.pasteLine(this._text, cx, 0, this.customSpacingX); } -} +}; /** * Internal function that takes a single line of text (2nd parameter) and pastes it into the BitmapData at the given coordinates. * Used by getLine and getMultiLine -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont * @param {string} line - The single line of text to paste. @@ -31237,9 +31397,9 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { this.stamp.frame = this.grabData[line.charCodeAt(c)]; p.set(x, y); this.render(this.stamp, p, false); - + x += this.characterWidth + customSpacingX; - + if (x > this.width) { break; @@ -31247,11 +31407,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { } } } -} - +}; + /** * Works out the longest line of text in _text and returns its length -* +* * @method Phaser.RetroFont#getLongestLine * @memberof Phaser.RetroFont * @return {number} The length of the longest line of text. @@ -31259,11 +31419,11 @@ Phaser.RetroFont.prototype.pasteLine = function (line, x, y, customSpacingX) { Phaser.RetroFont.prototype.getLongestLine = function () { var longestLine = 0; - + if (this._text.length > 0) { var lines = this._text.split("\n"); - + for (var i = 0; i < lines.length; i++) { if (lines[i].length > longestLine) @@ -31272,13 +31432,13 @@ Phaser.RetroFont.prototype.getLongestLine = function () { } } } - + return longestLine; -} - +}; + /** * Internal helper function that removes all unsupported characters from the _text String, leaving only characters contained in the font set. -* +* * @method Phaser.RetroFont#removeUnsupportedCharacters * @memberof Phaser.RetroFont * @protected @@ -31288,7 +31448,7 @@ Phaser.RetroFont.prototype.getLongestLine = function () { Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { var newString = ""; - + for (var c = 0; c < this._text.length; c++) { var aChar = this._text[c]; @@ -31299,16 +31459,16 @@ Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { newString = newString.concat(aChar); } } - + return newString; -} +}; /** * @name Phaser.BitmapText#text * @property {string} text - Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true. */ Object.defineProperty(Phaser.RetroFont.prototype, "text", { - + get: function () { return this._text; @@ -31318,7 +31478,7 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { set: function (value) { var newText; - + if (this.autoUpperCase) { newText = value.toUpperCase(); @@ -31327,13 +31487,13 @@ Object.defineProperty(Phaser.RetroFont.prototype, "text", { { newText = value; } - + if (newText !== this._text) { this._text = newText; - + this.removeUnsupportedCharacters(this.multiLine); - + this.buildRetroFontText(); } @@ -31457,7 +31617,7 @@ Phaser.Canvas = { color = color || 'rgb(0,0,0)'; canvas.style.backgroundColor = color; - + return canvas; }, @@ -31776,7 +31936,7 @@ Phaser.Device = function (game) { */ this.css3D = false; - /** + /** * @property {boolean} pointerLock - Is Pointer Lock available? * @default */ @@ -31957,7 +32117,7 @@ Phaser.Device = function (game) { */ this.iPhone4 = false; - /** + /** * @property {boolean} iPad - Is running on iPad? * @default */ @@ -32006,7 +32166,7 @@ Phaser.Device = function (game) { this._checkDevice(); this._checkFeatures(); this._checkOS(); - + }; Phaser.Device.prototype = { @@ -32092,7 +32252,7 @@ Phaser.Device.prototype = { } this.worker = !!window['Worker']; - + if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) { this.touch = true; @@ -32102,7 +32262,7 @@ Phaser.Device.prototype = { { this.mspointer = true; } - + this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true; @@ -32258,7 +32418,7 @@ Phaser.Device.prototype = { try { if (result = !!audioElement.canPlayType) { - + if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) { this.ogg = true; } @@ -32315,7 +32475,7 @@ Phaser.Device.prototype = { } navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - + if (navigator.vibrate) { this.vibration = true; @@ -32351,7 +32511,7 @@ Phaser.Device.prototype = { has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } - + document.body.removeChild(el); this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none"); @@ -32438,13 +32598,13 @@ Phaser.Device.prototype.constructor = Phaser.Device; /** * Abstracts away the use of RAF or setTimeOut for the core game update loop. * -* @class Phaser.RequestAnimationFrame +* @class Phaser.RequestAnimationFrame * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {boolean} [forceSetTimeOut=false] - Tell Phaser to use setTimeOut even if raf is available. */ Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) { - + if (typeof forceSetTimeOut === 'undefined') { forceSetTimeOut = false; } /** @@ -32533,7 +32693,7 @@ Phaser.RequestAnimationFrame.prototype = { /** * The update method for the requestAnimationFrame - * @method Phaser.RequestAnimationFrame#updateRAF + * @method Phaser.RequestAnimationFrame#updateRAF */ updateRAF: function () { @@ -32616,11 +32776,11 @@ Phaser.Math = { PI2: Math.PI * 2, /** - * Two number are fuzzyEqual if their difference is less than ε. + * Two number are fuzzyEqual if their difference is less than ε. * @method Phaser.Math#fuzzyEqual * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if |a-b|<ε */ fuzzyEqual: function (a, b, epsilon) { @@ -32629,11 +32789,11 @@ Phaser.Math = { }, /** - * a is fuzzyLessThan b if it is less than b + ε. + * a is fuzzyLessThan b if it is less than b + ε. * @method Phaser.Math#fuzzyLessThan * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if ab+ε */ fuzzyGreaterThan: function (a, b, epsilon) { @@ -32654,10 +32814,10 @@ Phaser.Math = { return a > b - epsilon; }, - /** + /** * @method Phaser.Math#fuzzyCeil * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} ceiling(val-ε) */ fuzzyCeil: function (val, epsilon) { @@ -32665,10 +32825,10 @@ Phaser.Math = { return Math.ceil(val - epsilon); }, - /** + /** * @method Phaser.Math#fuzzyFloor * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} floor(val-ε) */ fuzzyFloor: function (val, epsilon) { @@ -32676,7 +32836,7 @@ Phaser.Math = { return Math.floor(val + epsilon); }, - /** + /** * Averages all values passed to the function and returns the result. You can pass as many parameters as you like. * @method Phaser.Math#average * @return {number} The average of all given values. @@ -32699,7 +32859,7 @@ Phaser.Math = { }, - /** + /** * @method Phaser.Math#truncate * @param {number} n * @return {number} @@ -32708,7 +32868,7 @@ Phaser.Math = { return (n > 0) ? Math.floor(n) : Math.ceil(n); }, - /** + /** * @method Phaser.Math#shear * @param {number} n * @return {number} n mod 1 @@ -32800,7 +32960,7 @@ Phaser.Math = { * Snaps a value to the nearest value in an array. * @method Phaser.Math#snapToInArray * @param {number} input - * @param {array} arr + * @param {array} arr * @param {boolean} sort - True if the array needs to be sorted. * @return {number} */ @@ -32817,14 +32977,14 @@ Phaser.Math = { } var i = 1; - + while (arr[i] < input) { i++; } var low = arr[i - 1]; var high = (i < arr.length) ? arr[i] : Number.POSITIVE_INFINITY; - + return ((high - input) <= (input - low)) ? high : low; }, @@ -32858,7 +33018,7 @@ Phaser.Math = { * * Note what occurs when we round to the 3rd space (8ths place), 100100000, this is to be assumed * because we are rounding 100011.1011011011011011 which rounds up. - * + * * @method Phaser.Math#roundTo * @param {number} value - The value to round. * @param {number} place - The place to round to. @@ -32869,9 +33029,9 @@ Phaser.Math = { if (typeof place === "undefined") { place = 0; } if (typeof base === "undefined") { base = 10; } - + var p = Math.pow(base, -place); - + return Math.round(value * p) / p; }, @@ -32917,7 +33077,7 @@ Phaser.Math = { * @method Phaser.Math#interpolateFloat * @param {number} a * @param {number} b - * @param {number} weight + * @param {number} weight * @return {number} */ interpolateFloat: function (a, b, weight) { @@ -32968,7 +33128,7 @@ Phaser.Math = { angleRad = angleRad % (2 * Math.PI); return angleRad >= 0 ? angleRad : angleRad + 2 * Math.PI; - + }, /** @@ -33014,7 +33174,7 @@ Phaser.Math = { var rd = (radians) ? Math.PI : 180; a1 = this.normalizeAngle(a1, radians); a2 = this.normalizeAngle(a2, radians); - + if (a1 < -rd / 2 && a2 > rd / 2) { a1 += rd * 2; @@ -33064,7 +33224,7 @@ Phaser.Math = { chanceRoll: function (chance) { if (typeof chance === "undefined") { chance = 50; } - + if (chance <= 0) { return false; @@ -33142,7 +33302,7 @@ Phaser.Math = { minSub: function (value, amount, min) { value -= amount; - + if (value < min) { value = min; @@ -33177,7 +33337,7 @@ Phaser.Math = { { result += range; } - + return result + min; }, @@ -33412,7 +33572,7 @@ Phaser.Math = { * @method Phaser.Math#linearInterpolation * @param {number} v * @param {number} k - * @return {number} + * @return {number} */ linearInterpolation: function (v, k) { @@ -33525,7 +33685,7 @@ Phaser.Math = { * @param {number} p2 * @param {number} p3 * @param {number} t - * @return {number} + * @return {number} */ catmullRom: function (p0, p1, p2, p3, t) { @@ -33559,7 +33719,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -33593,7 +33753,7 @@ Phaser.Math = { if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -33660,14 +33820,14 @@ Phaser.Math = { if (typeof sinAmplitude === "undefined") { sinAmplitude = 1.0; } if (typeof cosAmplitude === "undefined") { cosAmplitude = 1.0; } if (typeof frequency === "undefined") { frequency = 1.0; } - + var sin = sinAmplitude; var cos = cosAmplitude; var frq = frequency * Math.PI / length; - + var cosTable = []; var sinTable = []; - + for (var c = 0; c < length; c++) { cos -= sin * frq; @@ -33685,7 +33845,7 @@ Phaser.Math = { /** * Removes the top element from the stack and re-inserts it onto the bottom, then returns it. * The original stack is modified in the process. This effectively moves the position of the data from the start to the end of the table. - * + * * @method Phaser.Math#shift * @param {array} stack - The array to shift. * @return {any} The shifted value. @@ -33721,7 +33881,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates. - * + * * @method Phaser.Math#distance * @param {number} x1 * @param {number} y1 @@ -33740,7 +33900,7 @@ Phaser.Math = { /** * Returns the distance between the two given set of coordinates at the power given. - * + * * @method Phaser.Math#distancePow * @param {number} x1 * @param {number} y1 @@ -33759,7 +33919,7 @@ Phaser.Math = { /** * Returns the rounded distance between the two given set of coordinates. - * + * * @method Phaser.Math#distanceRounded * @param {number} x1 * @param {number} y1 @@ -33776,7 +33936,7 @@ Phaser.Math = { /** * Force a value within the boundaries of two values. * Clamp value to range - * + * * @method Phaser.Math#clamp * @param {number} x * @param {number} a @@ -33788,10 +33948,10 @@ Phaser.Math = { return ( x < a ) ? a : ( ( x > b ) ? b : x ); }, - + /** * Clamp value to range to range - * + * * @method Phaser.Math#mapLinear * @param {number} x the value to map * @param {number} a1 first endpoint of the range @@ -33837,7 +33997,7 @@ Phaser.Math = { /** * Smoothstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smoothstep * @param {number} x * @param {number} min @@ -33864,7 +34024,7 @@ Phaser.Math = { /** * Smootherstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smootherstep * @param {number} x * @param {number} min @@ -33892,7 +34052,7 @@ Phaser.Math = { /** * A value representing the sign of the value. * -1 for negative, +1 for positive, 0 if value is 0 - * + * * @method Phaser.Math#sign * @param {number} x * @return {number} @@ -33905,11 +34065,11 @@ Phaser.Math = { /** * Convert degrees to radians. - * + * * @method Phaser.Math#degToRad * @return {function} */ - degToRad: function() { + degToRad: (function() { var degreeToRadiansFactor = Math.PI / 180; @@ -33919,15 +34079,15 @@ Phaser.Math = { }; - }(), + }()), /** * Convert degrees to radians. - * + * * @method Phaser.Math#radToDeg * @return {function} */ - radToDeg: function() { + radToDeg: (function() { var radianToDegreesFactor = 180 / Math.PI; @@ -33937,7 +34097,7 @@ Phaser.Math = { }; - }() + }()) }; @@ -33951,17 +34111,17 @@ Phaser.Math = { /** * Phaser.RandomDataGenerator constructor. -* +* * @class Phaser.RandomDataGenerator * @classdesc An extremely useful repeatable random data generator. Access it via Phaser.Game.rnd * Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense. * Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript -* +* * @constructor * @param {array} seeds */ Phaser.RandomDataGenerator = function (seeds) { - + if (typeof seeds === "undefined") { seeds = []; } /** @@ -34014,7 +34174,7 @@ Phaser.RandomDataGenerator.prototype = { /** * Reset the seed of the random data generator. - * + * * @method Phaser.RandomDataGenerator#sow * @param {array} seeds */ @@ -34038,7 +34198,7 @@ Phaser.RandomDataGenerator.prototype = { this.s2 -= this.hash(seed); this.s2 += ~~(this.s2 < 0); } - + }, /** @@ -34543,7 +34703,7 @@ Phaser.QuadTree.prototype.constructor = Phaser.QuadTree; * @param {Phaser.Game} game - A reference to the currently running game. */ Phaser.Net = function (game) { - + this.game = game; }; @@ -34552,7 +34712,7 @@ Phaser.Net.prototype = { /** * Returns the hostname given by the browser. - * + * * @method Phaser.Net#getHostName * @return {string} */ @@ -34571,7 +34731,7 @@ Phaser.Net.prototype = { * If the domain name is found it returns true. * You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc. * Do not include 'http://' at the start. - * + * * @method Phaser.Net#checkDomainName * @param {string} domain * @return {boolean} true if the given domain fragment can be found in the window.location.hostname @@ -34585,7 +34745,7 @@ Phaser.Net.prototype = { * If the value doesn't already exist it is set. * If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string. * Optionally you can redirect to the new url, or just return it as a string. - * + * * @method Phaser.Net#updateQueryString * @param {string} key - The querystring key to update. * @param {string} value - The new value to be set. If it already exists it will be replaced. @@ -34600,7 +34760,7 @@ Phaser.Net.prototype = { var output = ''; var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"); - + if (re.test(url)) { if (typeof value !== 'undefined' && value !== null) @@ -34647,7 +34807,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#getQueryString * @param {string} [parameter=''] - If specified this will return just the value for that key. * @return {string|object} An object containing the key value pairs found in the query string or just the value if a parameter was given. @@ -34683,7 +34843,7 @@ Phaser.Net.prototype = { /** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#decodeURI * @param {string} value - The URI component to be decoded. * @return {string} The decoded value. @@ -34704,9 +34864,9 @@ Phaser.Net.prototype.constructor = Phaser.Net; /** * Phaser - TweenManager -* +* * @class Phaser.TweenManager -* @classdesc +* @classdesc * Phaser.Game has a single instance of the TweenManager through which all Tween objects are created and updated. * Tweens are hooked into the game clock and pause system, adjusting based on the game state. * @@ -34724,13 +34884,13 @@ Phaser.TweenManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {array} _tweens - All of the currently running tweens. * @private */ this._tweens = []; - + /** * @property {array} _add - All of the tweens queued to be added in the next update. * @private @@ -34785,7 +34945,7 @@ Phaser.TweenManager.prototype = { }, /** - * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. + * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * * @method Phaser.TweenManager#create * @param {Object} object - Object the tween will be run on. @@ -35059,7 +35219,7 @@ Phaser.Tween = function (object, game, manager) { * @default null */ this._onUpdateCallback = null; - + /** * @property {object} _onUpdateCallbackContext - The context in which to call the onUpdate callback. * @private @@ -35098,7 +35258,7 @@ Phaser.Tween = function (object, game, manager) { // { // this._valuesStart[field] = parseFloat(object[field], 10); // } - + /** * @property {Phaser.Signal} onStart - The onStart event is fired when the Tween begins. */ @@ -35410,7 +35570,7 @@ Phaser.Tween.prototype = { }, /** - * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. + * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. * * @method Phaser.Tween#easing * @param {function} easing - The easing function this tween will use, i.e. Phaser.Easing.Linear.None. @@ -35454,7 +35614,7 @@ Phaser.Tween.prototype = { /** * Loop a chain of tweens - * + * * Usage: * game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true) * .to({ y: 300 }, 1000, Phaser.Easing.Linear.None) @@ -35488,7 +35648,7 @@ Phaser.Tween.prototype = { }, /** - * Pauses the tween. + * Pauses the tween. * * @method Phaser.Tween#pause */ @@ -35506,7 +35666,7 @@ Phaser.Tween.prototype = { * @private */ _pause: function () { - + if (!this._codePaused) { this._paused = true; @@ -35671,7 +35831,7 @@ Phaser.Tween.prototype = { return true; } - + }; Phaser.Tween.prototype.constructor = Phaser.Tween; @@ -35701,7 +35861,7 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Linear#In + * @method Phaser.Easing.Linear#In * @param {number} k - The value to be tweened. * @returns {number} k^2. */ @@ -35723,8 +35883,8 @@ Phaser.Easing = { /** * Ease-in. * - * @method Phaser.Easing.Quadratic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#In + * @param {number} k - The value to be tweened. * @returns {number} k^2. */ In: function ( k ) { @@ -35736,8 +35896,8 @@ Phaser.Easing = { /** * Ease-out. * - * @method Phaser.Easing.Quadratic#Out - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#Out + * @param {number} k - The value to be tweened. * @returns {number} k* (2-k). */ Out: function ( k ) { @@ -35750,7 +35910,7 @@ Phaser.Easing = { * Ease-in/out. * * @method Phaser.Easing.Quadratic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35772,8 +35932,8 @@ Phaser.Easing = { /** * Cubic ease-in. * - * @method Phaser.Easing.Cubic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Cubic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35786,7 +35946,7 @@ Phaser.Easing = { * Cubic ease-out. * * @method Phaser.Easing.Cubic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35799,7 +35959,7 @@ Phaser.Easing = { * Cubic ease-in/out. * * @method Phaser.Easing.Cubic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35821,8 +35981,8 @@ Phaser.Easing = { /** * Quartic ease-in. * - * @method Phaser.Easing.Quartic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quartic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35835,7 +35995,7 @@ Phaser.Easing = { * Quartic ease-out. * * @method Phaser.Easing.Quartic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35848,7 +36008,7 @@ Phaser.Easing = { * Quartic ease-in/out. * * @method Phaser.Easing.Quartic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35870,8 +36030,8 @@ Phaser.Easing = { /** * Quintic ease-in. * - * @method Phaser.Easing.Quintic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quintic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35884,7 +36044,7 @@ Phaser.Easing = { * Quintic ease-out. * * @method Phaser.Easing.Quintic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35897,7 +36057,7 @@ Phaser.Easing = { * Quintic ease-in/out. * * @method Phaser.Easing.Quintic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35919,8 +36079,8 @@ Phaser.Easing = { /** * Sinusoidal ease-in. * - * @method Phaser.Easing.Sinusoidal#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Sinusoidal#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35933,7 +36093,7 @@ Phaser.Easing = { * Sinusoidal ease-out. * * @method Phaser.Easing.Sinusoidal#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35946,7 +36106,7 @@ Phaser.Easing = { * Sinusoidal ease-in/out. * * @method Phaser.Easing.Sinusoidal#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -35967,8 +36127,8 @@ Phaser.Easing = { /** * Exponential ease-in. * - * @method Phaser.Easing.Exponential#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Exponential#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -35981,7 +36141,7 @@ Phaser.Easing = { * Exponential ease-out. * * @method Phaser.Easing.Exponential#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -35994,7 +36154,7 @@ Phaser.Easing = { * Exponential ease-in/out. * * @method Phaser.Easing.Exponential#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36018,8 +36178,8 @@ Phaser.Easing = { /** * Circular ease-in. * - * @method Phaser.Easing.Circular#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Circular#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36032,7 +36192,7 @@ Phaser.Easing = { * Circular ease-out. * * @method Phaser.Easing.Circular#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36045,7 +36205,7 @@ Phaser.Easing = { * Circular ease-in/out. * * @method Phaser.Easing.Circular#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36067,8 +36227,8 @@ Phaser.Easing = { /** * Elastic ease-in. * - * @method Phaser.Easing.Elastic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Elastic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36086,7 +36246,7 @@ Phaser.Easing = { * Elastic ease-out. * * @method Phaser.Easing.Elastic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36104,7 +36264,7 @@ Phaser.Easing = { * Elastic ease-in/out. * * @method Phaser.Easing.Elastic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36131,8 +36291,8 @@ Phaser.Easing = { /** * Back ease-in. * - * @method Phaser.Easing.Back#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Back#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36146,7 +36306,7 @@ Phaser.Easing = { * Back ease-out. * * @method Phaser.Easing.Back#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36160,7 +36320,7 @@ Phaser.Easing = { * Back ease-in/out. * * @method Phaser.Easing.Back#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36183,8 +36343,8 @@ Phaser.Easing = { /** * Bounce ease-in. * - * @method Phaser.Easing.Bounce#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Bounce#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -36197,7 +36357,7 @@ Phaser.Easing = { * Bounce ease-out. * * @method Phaser.Easing.Bounce#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -36226,7 +36386,7 @@ Phaser.Easing = { * Bounce ease-in/out. * * @method Phaser.Easing.Bounce#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -36464,7 +36624,7 @@ Phaser.Time.prototype = { { this.time = this.now; this._justResumed = false; - + this.events.resume(); for (var i = 0; i < this._timers.length; i++) @@ -36537,7 +36697,7 @@ Phaser.Time.prototype = { * @private */ gamePaused: function () { - + this._pauseStarted = this.now; this.events.pause(); @@ -37045,7 +37205,7 @@ Phaser.Timer.prototype = { * @method Phaser.Timer#pause */ pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -37062,7 +37222,7 @@ Phaser.Timer.prototype = { * @private */ _pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -37169,7 +37329,7 @@ Object.defineProperty(Phaser.Timer.prototype, "next", { Object.defineProperty(Phaser.Timer.prototype, "duration", { get: function () { - + if (this.running && this.nextTick > this._now) { return this.nextTick - this._now; @@ -37329,7 +37489,7 @@ Phaser.AnimationManager = function (sprite) { * @default */ this.currentFrame = null; - + /** * @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false. * @default @@ -37483,7 +37643,7 @@ Phaser.AnimationManager.prototype = { /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. - * + * * @method Phaser.AnimationManager#play * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". * @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used. @@ -37545,7 +37705,7 @@ Phaser.AnimationManager.prototype = { /** * The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events. - * + * * @method Phaser.AnimationManager#update * @protected * @return {boolean} True if a new animation frame has been set, otherwise false. @@ -37643,7 +37803,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameData', { * @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', { - + get: function () { if (this._frameData) @@ -37690,7 +37850,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { { return this._frameIndex; } - + }, set: function (value) { @@ -37698,12 +37858,12 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frame', { if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) { this.currentFrame = this._frameData.getFrame(value); - + if (this.currentFrame) { this._frameIndex = value; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -37741,7 +37901,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', { { this._frameIndex = this.currentFrame.index; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -37898,7 +38058,7 @@ Phaser.Animation = function (game, parent, name, frameData, frames, delay, loop) // Set-up some event listeners this.game.onPause.add(this.onPause, this); this.game.onResume.add(this.onResume, this); - + }; Phaser.Animation.prototype = { @@ -38097,7 +38257,7 @@ Phaser.Animation.prototype = { this._parent.tilingTexture = false; } } - + this.loopCount++; this._parent.events.onAnimationLoop.dispatch(this._parent, this); this.onLoop.dispatch(this._parent, this); @@ -38345,7 +38505,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer return output; -} +}; /** * @author Richard Davey @@ -38372,7 +38532,7 @@ Phaser.Frame = function (index, x, y, width, height, name, uuid) { * @property {number} index - The index of this Frame within the FrameData set it is being added to. */ this.index = index; - + /** * @property {number} x - X position within the image to cut from. */ @@ -38636,7 +38796,7 @@ Phaser.FrameData.prototype = { } return true; - + }, /** @@ -38649,7 +38809,7 @@ Phaser.FrameData.prototype = { * @return {Array} An array of Frames between the start and end index values, or an empty array if none were found. */ getFrameRange: function (start, end, output) { - + if (typeof output === "undefined") { output = []; } for (var i = start; i <= end; i++) @@ -38824,7 +38984,7 @@ Phaser.AnimationParser = { var row = Math.floor((width - margin) / (frameWidth + spacing)); var column = Math.floor((height - margin) / (frameHeight + spacing)); var total = row * column; - + if (frameMax !== -1) { total = frameMax; @@ -38889,11 +39049,11 @@ Phaser.AnimationParser = { // Let's create some frames then var data = new Phaser.FrameData(); - + // By this stage frames is a fully parsed array var frames = json['frames']; var newFrame; - + for (var i = 0; i < frames.length; i++) { var uuid = game.rnd.uuid(); @@ -38954,7 +39114,7 @@ Phaser.AnimationParser = { console.log(json); return; } - + // Let's create some frames then var data = new Phaser.FrameData(); @@ -38962,7 +39122,7 @@ Phaser.AnimationParser = { var frames = json['frames']; var newFrame; var i = 0; - + for (var key in frames) { var uuid = game.rnd.uuid(); @@ -39040,7 +39200,7 @@ Phaser.AnimationParser = { var frameY; var frameWidth; var frameHeight; - + for (var i = 0; i < frames.length; i++) { uuid = game.rnd.uuid(); @@ -39461,7 +39621,7 @@ Phaser.Cache.prototype = { * Add a new text data. * * @method Phaser.Cache#addText - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -39475,7 +39635,7 @@ Phaser.Cache.prototype = { * Add a new json object into the cache. * * @method Phaser.Cache#addJSON - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -39575,7 +39735,7 @@ Phaser.Cache.prototype = { * @param {string} key - Asset key for the sound. */ updateSound: function (key, property, value) { - + if (this._sounds[key]) { this._sounds[key][property] = value; @@ -39691,7 +39851,7 @@ Phaser.Cache.prototype = { console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "' + key + ' / ' + object + '"'); } } - + return null; }, @@ -39980,7 +40140,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getText: Invalid key: "' + key + '"'); } - + }, /** @@ -40000,7 +40160,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"'); } - + }, /** @@ -40020,7 +40180,7 @@ Phaser.Cache.prototype = { { console.warn('Phaser.Cache.getBinary: Invalid key: "' + key + '"'); } - + }, /** @@ -40271,6 +40431,7 @@ Phaser.Cache.prototype = { Phaser.Cache.prototype.constructor = Phaser.Cache; +/* jshint wsh:true */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -40370,17 +40531,17 @@ Phaser.Loader = function (game) { * @property {Phaser.Signal} onFileComplete - Event signal. */ this.onFileComplete = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onFileError - Event signal. */ this.onFileError = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadStart - Event signal. */ this.onLoadStart = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadComplete - Event signal. */ @@ -40468,7 +40629,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -40493,7 +40654,7 @@ Phaser.Loader.prototype = { } return -1; - + }, /** @@ -40518,7 +40679,7 @@ Phaser.Loader.prototype = { } return false; - + }, /** @@ -41436,11 +41597,11 @@ Phaser.Loader.prototype = { if (file.autoDecode) { - this.game.cache.updateSound(key, 'isDecoding', true); - var that = this; var key = file.key; + this.game.cache.updateSound(key, 'isDecoding', true); + this.game.sound.context.decodeAudioData(file.data, function (buffer) { if (buffer) { @@ -41675,7 +41836,7 @@ Phaser.Loader.prototype = { { this.hasLoaded = true; this.isLoading = false; - + this.removeAll(); this.onLoadComplete.dispatch(); @@ -41833,7 +41994,7 @@ Phaser.LoaderParser = { * @param {boolean} [loop=false] - Whether or not the sound will loop. */ Phaser.Sound = function (game, key, volume, loop, connect) { - + if (typeof volume == 'undefined') { volume = 1; } if (typeof loop == 'undefined') { loop = false; } if (typeof connect === 'undefined') { connect = game.sound.connectToMaster; } @@ -41869,7 +42030,7 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {object} markers - The sound markers. */ this.markers = {}; - + /** * @property {AudioContext} context - Reference to the AudioContext instance. */ @@ -41897,34 +42058,34 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {number} totalDuration - The total duration of the sound, in milliseconds */ this.totalDuration = 0; - + /** * @property {number} startTime - The time the Sound starts at (typically 0 unless starting from a marker) * @default */ this.startTime = 0; - + /** * @property {number} currentTime - The current time the sound is at. */ this.currentTime = 0; - + /** * @property {number} duration - The duration of the sound. */ this.duration = 0; - + /** * @property {number} stopTime - The time the sound stopped. */ this.stopTime = 0; - + /** * @property {boolean} paused - true if the sound is paused, otherwise false. * @default */ this.paused = false; - + /** * @property {number} pausedPosition - The position the sound had reached when it was paused. */ @@ -41940,31 +42101,31 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @default */ this.isPlaying = false; - + /** * @property {string} currentMarker - The string ID of the currently playing marker, if any. * @default */ this.currentMarker = ''; - + /** * @property {boolean} pendingPlayback - true if the sound file is pending playback * @readonly */ this.pendingPlayback = false; - + /** * @property {boolean} override - if true when you play this sound it will always start from the beginning. * @default */ this.override = false; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = this.game.sound.usingWebAudio; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. */ @@ -42018,37 +42179,37 @@ Phaser.Sound = function (game, key, volume, loop, connect) { * @property {Phaser.Signal} onDecoded - The onDecoded event is dispatched when the sound has finished decoding (typically for mp3 files) */ this.onDecoded = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPlay - The onPlay event is dispatched each time this sound is played. */ this.onPlay = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPause - The onPause event is dispatched when this sound is paused. */ this.onPause = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onResume - The onResume event is dispatched when this sound is resumed from a paused state. */ this.onResume = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoop - The onLoop event is dispatched when this sound loops during playback. */ this.onLoop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onStop - The onStop event is dispatched when this sound stops playback. */ this.onStop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMute - The onMouse event is dispatched when this sound is muted. */ this.onMute = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMarkerComplete - The onMarkerComplete event is dispatched when a marker within this sound completes playback. */ @@ -42309,7 +42470,7 @@ Phaser.Sound.prototype = { this._sound = this.context.createBufferSource(); this._sound.buffer = this._buffer; - + if (this.externalNode) { this._sound.connect(this.externalNode.input); @@ -42389,7 +42550,7 @@ Phaser.Sound.prototype = { // console.log('playing', this._sound); this._sound.currentTime = this.position; this._sound.muted = this._muted; - + if (this._muted) { this._sound.volume = 0; @@ -42530,7 +42691,7 @@ Phaser.Sound.prototype = { this.isPlaying = false; var prevMarker = this.currentMarker; - + if (this.currentMarker !== '') { this.onMarkerComplete.dispatch(this.currentMarker, this); @@ -42576,11 +42737,11 @@ Object.defineProperty(Phaser.Sound.prototype, "isDecoded", { * @property {boolean} mute - Gets or sets the muted state of this sound. */ Object.defineProperty(Phaser.Sound.prototype, "mute", { - + get: function () { return this._muted; }, - + set: function (value) { value = value || null; @@ -42673,12 +42834,12 @@ Phaser.SoundManager = function (game) { * @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {Phaser.Signal} onSoundDecode - The event dispatched when a sound decodes (typically only for mp3 files) */ this.onSoundDecode = new Phaser.Signal(); - + /** * @property {boolean} _codeMuted - Internal mute tracking var. * @private @@ -42692,7 +42853,7 @@ Phaser.SoundManager = function (game) { * @default */ this._muted = false; - + /** * @property {Description} _unlockSource - Internal unlock tracking var. * @private @@ -42703,12 +42864,12 @@ Phaser.SoundManager = function (game) { /** * @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume). * @private - * @default + * @default */ this._volume = 1; /** - * @property {array} _sounds - An array containing all the sounds + * @property {array} _sounds - An array containing all the sounds * @private * @default The empty array. */ @@ -42719,19 +42880,19 @@ Phaser.SoundManager = function (game) { * @default */ this.context = null; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = true; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. * @readonly */ this.usingAudioTag = false; - + /** * @property {boolean} noAudio - Has audio been disabled via the PhaserGlobal object? Useful if you need to use a 3rd party audio library instead. * @default @@ -42755,7 +42916,7 @@ Phaser.SoundManager = function (game) { * @default */ this.channels = 32; - + }; Phaser.SoundManager.prototype = { @@ -42921,7 +43082,7 @@ Phaser.SoundManager.prototype = { this._sounds[i].resume(); } } - + }, /** @@ -43136,7 +43297,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "mute", { * @property {number} volume - Gets or sets the global volume of the SoundManager, a value between 0 and 1. */ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { - + get: function () { if (this.usingWebAudio) @@ -43169,7 +43330,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { } } } - + } }); @@ -43196,7 +43357,7 @@ Phaser.Utils.Debug = function (game) { * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {PIXI.Sprite} sprite - If debugging in WebGL mode we need this. */ @@ -43211,7 +43372,7 @@ Phaser.Utils.Debug = function (game) { * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = null; - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ @@ -43232,7 +43393,7 @@ Phaser.Utils.Debug = function (game) { * @default '14px Courier' */ this.font = '14px Courier'; - + /** * @property {number} columnWidth - The spacing between columns. */ @@ -43242,24 +43403,24 @@ Phaser.Utils.Debug = function (game) { * @property {number} lineHeight - The line height between the debug text. */ this.lineHeight = 16; - + /** * @property {boolean} renderShadow - Should the text be rendered with a slight shadow? Makes it easier to read on different types of background. */ this.renderShadow = true; - + /** * @property {Context} currentX - The current X position the debug information will be rendered at. * @default */ this.currentX = 0; - + /** * @property {number} currentY - The current Y position the debug information will be rendered at. * @default */ this.currentY = 0; - + /** * @property {number} currentAlpha - The current alpha the debug information will be rendered at. * @default @@ -43446,7 +43607,7 @@ Phaser.Utils.Debug.prototype = { this.line('Bounds x: ' + camera.bounds.x + ' Y: ' + camera.bounds.y + ' w: ' + camera.bounds.width + ' h: ' + camera.bounds.height); this.line('View x: ' + camera.view.x + ' Y: ' + camera.view.y + ' w: ' + camera.view.width + ' h: ' + camera.view.height); this.stop(); - + }, /** @@ -43739,7 +43900,7 @@ Phaser.Utils.Debug.prototype = { } this.stop(); - + }, /** @@ -43948,7 +44109,7 @@ Phaser.Color = { var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h; - if (hex16.length==3) + if (hex16.length == 3) { hex16 = hex16.charAt(0) + hex16.charAt(0) + hex16.charAt(1) + hex16.charAt(1) + hex16.charAt(2) + hex16.charAt(2); } @@ -43958,7 +44119,7 @@ Phaser.Color = { var blue = parseInt(hex16.substring(4, 6), 16); return red << 16 | green << 8 | blue; - + }, /** @@ -43974,13 +44135,13 @@ Phaser.Color = { var argb = Phaser.Color.getRGB(color); var hsl = Phaser.Color.RGBtoHSV(color); - + // Hex format var result = Phaser.Color.RGBtoHexstring(color) + "\n"; - + // RGB format result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n"; - + // HSL info result = result.concat("Hue: " + hsl.hue + " Saturation: " + hsl.saturation + " Lightnes: " + hsl.lightness); @@ -44181,7 +44342,7 @@ Phaser.Color = { var blue = color & 0xFF; return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',' + alpha.toString() + ')'; - + }, /** @@ -44243,7 +44404,7 @@ Phaser.Color = { getBlue: function (color) { return color & 0xFF; } - + }; /** @@ -44394,11 +44555,11 @@ Phaser.Physics.prototype = { } else if (system === Phaser.Physics.BOX2D && this.box2d === null) { - // Coming soon + throw new Error('The Box2D physics system has not been implemented yet.'); } else if (system === Phaser.Physics.CHIPMUNK && this.chipmunk === null) { - // Coming soon + throw new Error('The Chipmunk physics system has not been implemented yet.'); } }, @@ -44552,7 +44713,7 @@ Phaser.Physics.prototype.constructor = Phaser.Physics; * @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Arcade = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -44879,7 +45040,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if an overlap occured otherwise false. + * @return {boolean} True if an overlap occured otherwise false. */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -44920,7 +45081,7 @@ Phaser.Physics.Arcade.prototype = { * @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if a collision occured otherwise false. + * @return {boolean} True if a collision occured otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -45190,10 +45351,10 @@ Phaser.Physics.Arcade.prototype = { collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) { this._mapData = tilemapLayer.getTiles( - sprite.body.position.x - sprite.body.tilePadding.x, - sprite.body.position.y - sprite.body.tilePadding.y, - sprite.body.width + sprite.body.tilePadding.x, - sprite.body.height + sprite.body.tilePadding.y, + sprite.body.position.x - sprite.body.tilePadding.x, + sprite.body.position.y - sprite.body.tilePadding.y, + sprite.body.width + sprite.body.tilePadding.x, + sprite.body.height + sprite.body.tilePadding.y, false, false); if (this._mapData.length === 0) @@ -45235,8 +45396,8 @@ Phaser.Physics.Arcade.prototype = { /** * An internal function. Use Phaser.Physics.Arcade.collide instead. * - * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @private + * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @param {Phaser.Group} group - The Group to check. * @param {Phaser.TilemapLayer} tilemapLayer - The layer to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. @@ -45264,13 +45425,14 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies. * + * @private * @method Phaser.Physics.Arcade#separate * @param {Phaser.Physics.Arcade.Body} body1 - The first Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body object to separate. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. * @param {object} [callbackContext] - The context in which to run the process callback. * @param {boolean} overlapOnly - Just run an overlap or a full collision. - * @returns {boolean} Returns true if the bodies collided, otherwise false. + * @return {boolean} Returns true if the bodies collided, otherwise false. */ separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { @@ -45342,11 +45504,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the x axis. + * + * @private * @method Phaser.Physics.Arcade#separateX * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateX: function (body1, body2, overlapOnly) { @@ -45455,11 +45619,13 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate two physics bodies on the y axis. + * + * @private * @method Phaser.Physics.Arcade#separateY * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateY: function (body1, body2, overlapOnly) { @@ -45581,10 +45747,12 @@ Phaser.Physics.Arcade.prototype = { /** * The core separation function to separate a physics body and a tile. + * + * @private * @method Phaser.Physics.Arcade#separateTile * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to collide against. - * @returns {boolean} Returns true if the body was separated, otherwise false. + * @return {boolean} Returns true if the body was separated, otherwise false. */ separateTile: function (i, body, tile) { @@ -45653,7 +45821,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceTop || tile.faceBottom) { oy = this.tileCheckY(body, tile); @@ -45671,7 +45839,7 @@ Phaser.Physics.Arcade.prototype = { return true; } } - + if (tile.faceLeft || tile.faceRight) { ox = this.tileCheckX(body, tile); @@ -45685,11 +45853,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the X axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckX: function (body, tile) { @@ -45734,11 +45902,11 @@ Phaser.Physics.Arcade.prototype = { /** * Check the body against the given tile on the Y axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckY: function (body, tile) { @@ -45782,11 +45950,12 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} x - The x separation amount. - * @returns {boolean} Returns true as a pass-thru to the separateTile method. + * @return {boolean} Returns true as a pass-thru to the separateTile method. */ processTileSeparationX: function (body, x) { @@ -45814,12 +45983,13 @@ Phaser.Physics.Arcade.prototype = { /** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} y - The y separation amount. */ - processTileSeparationY: function (body, y, tile) { + processTileSeparationY: function (body, y) { if (y < 0) { @@ -45850,7 +46020,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -45864,13 +46034,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45884,7 +46054,7 @@ Phaser.Physics.Arcade.prototype = { * Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#moveToPointer * @param {any} displayObject - The display object to move. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) @@ -45905,7 +46075,7 @@ Phaser.Physics.Arcade.prototype = { // We know how many pixels we need to move, but how fast? speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45920,7 +46090,7 @@ Phaser.Physics.Arcade.prototype = { * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to move towards. @@ -45935,13 +46105,13 @@ Phaser.Physics.Arcade.prototype = { if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(y - displayObject.y, x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -45952,7 +46122,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromAngle * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -45971,7 +46141,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -45990,7 +46160,7 @@ Phaser.Physics.Arcade.prototype = { /** * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. * One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#accelerationFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -46011,7 +46181,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -46040,7 +46210,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToPointer * @param {any} displayObject - The display object to move. * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. @@ -46057,7 +46227,7 @@ Phaser.Physics.Arcade.prototype = { if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; } this._angle = this.angleToPointer(displayObject, pointer); - + displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); @@ -46070,7 +46240,7 @@ Phaser.Physics.Arcade.prototype = { * You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to accelerate towards. @@ -46097,7 +46267,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the distance between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#distanceBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -46107,7 +46277,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = source.x - target.x; this._dy = source.y - target.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -46116,7 +46286,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and the given x/y coordinates. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to move towards. @@ -46127,7 +46297,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - x; this._dy = displayObject.y - y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -46136,7 +46306,7 @@ Phaser.Physics.Arcade.prototype = { * Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -46148,14 +46318,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = displayObject.x - pointer.x; this._dy = displayObject.y - pointer.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, /** * Find the angle in radians between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#angleBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -46172,7 +46342,7 @@ Phaser.Physics.Arcade.prototype = { /** * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate. - * + * * @method Phaser.Physics.Arcade#angleToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to get the angle to. @@ -46183,14 +46353,14 @@ Phaser.Physics.Arcade.prototype = { this._dx = x - displayObject.x; this._dy = y - displayObject.y; - + return Math.atan2(this._dy, this._dx); }, - + /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account. - * + * * @method Phaser.Physics.Arcade#angleToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -46202,7 +46372,7 @@ Phaser.Physics.Arcade.prototype = { this._dx = pointer.worldX - displayObject.x; this._dy = pointer.worldY - displayObject.y; - + return Math.atan2(this._dy, this._dx); } @@ -46402,12 +46572,6 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.speed = 0; - /** - * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to any QuadTrees. - * @default - this.skipQuadTree = false; - */ - /** * @property {number} facing - A const reference to the direction the Body is traveling or facing. * @default @@ -46503,6 +46667,17 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.tilePadding = new Phaser.Point(); + /** + * @property {number} phaser - Is this Body in a preUpdate or postUpdate state? + */ + this.phase = 0; + + /** + * @property {boolean} _reset - Internal cache var. + * @private + */ + this._reset = true; + /** * @property {number} _sx - Internal cache var. * @private @@ -46552,11 +46727,9 @@ Phaser.Physics.Arcade.Body.prototype = { this._sy = asy; this.center.setTo(this.position.x + this.halfWidth, this.position.y + this.halfHeight); - return true; + this._reset = true; } - return false; - }, /** @@ -46567,6 +46740,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ preUpdate: function () { + this.phase = 1; + // Store and reset collision flags this.wasTouching.none = this.touching.none; this.wasTouching.up = this.touching.up; @@ -46587,13 +46762,15 @@ Phaser.Physics.Arcade.Body.prototype = { this.embedded = false; + this.updateBounds(); + this.position.x = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x; this.position.y = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y; this.rotation = this.sprite.angle; this.preRotation = this.rotation; - if (this.updateBounds() || this.sprite._cache[4] === 1) + if (this._reset || this.sprite._cache[4] === 1) { this.prev.x = this.position.x; this.prev.y = this.position.y; @@ -46623,6 +46800,11 @@ Phaser.Physics.Arcade.Body.prototype = { } } + this._dx = this.deltaX(); + this._dy = this.deltaY(); + + this._reset = false; + }, /** @@ -46633,6 +46815,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ postUpdate: function () { + this.phase = 2; + if (this.deltaX() < 0) { this.facing = Phaser.LEFT; @@ -46670,7 +46854,7 @@ Phaser.Physics.Arcade.Body.prototype = { if (this.deltaMax.y !== 0 && this._dy !== 0) { - if (this._dy < 0 && this._dx < -this.deltaMax.y) + if (this._dy < 0 && this._dy < -this.deltaMax.y) { this._dy = -this.deltaMax.y; } @@ -46880,7 +47064,7 @@ Phaser.Physics.Arcade.Body.prototype = { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { - + get: function () { return this.position.y + this.height; } @@ -46893,7 +47077,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { - + get: function () { return this.position.x + this.width; } @@ -46905,12 +47089,13 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { - + get: function () { return this.position.x; }, set: function (value) { + this.position.x = value; } @@ -46921,13 +47106,15 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", { - + get: function () { return this.position.y; }, set: function (value) { + this.position.y = value; + } }); @@ -46958,7 +47145,7 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { context.strokeRect(body.position.x - body.game.camera.x, body.position.y - body.game.camera.y, body.width, body.height); } -} +}; /** * Render Sprite Body Physics Data as text. @@ -46972,14 +47159,13 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { Phaser.Physics.Arcade.Body.renderBodyInfo = function (debug, body) { debug.line('x: ' + body.x.toFixed(2), 'y: ' + body.y.toFixed(2), 'width: ' + body.width, 'height: ' + body.height); - // debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body.deltaX().toFixed(2), 'deltaY: ' + body.deltaY().toFixed(2)); - debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'new velocity x: ' + body.newVelocity.x.toFixed(2), 'y: ' + body.newVelocity.y.toFixed(2)); + debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body._dx.toFixed(2), 'deltaY: ' + body._dy.toFixed(2)); debug.line('acceleration x: ' + body.acceleration.x.toFixed(2), 'y: ' + body.acceleration.y.toFixed(2), 'speed: ' + body.speed.toFixed(2), 'angle: ' + body.angle.toFixed(2)); debug.line('gravity x: ' + body.gravity.x, 'y: ' + body.gravity.y, 'bounce x: ' + body.bounce.x.toFixed(2), 'y: ' + body.bounce.y.toFixed(2)); debug.line('touching left: ' + body.touching.left, 'right: ' + body.touching.right, 'up: ' + body.touching.up, 'down: ' + body.touching.down); debug.line('blocked left: ' + body.blocked.left, 'right: ' + body.blocked.right, 'up: ' + body.blocked.up, 'down: ' + body.blocked.down); -} +}; Phaser.Physics.Arcade.Body.prototype.constructor = Phaser.Physics.Arcade.Body; @@ -47010,7 +47196,7 @@ Phaser.Particles = function (game) { this.emitters = {}; /** - * @property {number} ID - + * @property {number} ID - * @default */ this.ID = 0; @@ -47065,7 +47251,8 @@ Phaser.Particles.prototype = { Phaser.Particles.prototype.constructor = Phaser.Particles; -Phaser.Particles.Arcade = {} +Phaser.Particles.Arcade = {}; + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -47257,7 +47444,7 @@ Phaser.Particles.Arcade.Emitter = function (game, x, y, maxParticles) { * @property {boolean} emitX */ this.emitX = x; - + /** * The point the particles are emitted from. * Emitter.x and Emitter.y control the containers location, which updates all current particles @@ -47297,7 +47484,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { if (this.game.time.now >= this._timer) { this.emitParticle(); - + this._counter++; if (this._quantity > 0) @@ -47313,7 +47500,7 @@ Phaser.Particles.Arcade.Emitter.prototype.update = function () { } } -} +}; /** * This function generates a new array of particle sprites to attach to the emitter. @@ -47380,7 +47567,7 @@ Phaser.Particles.Arcade.Emitter.prototype.makeParticles = function (keys, frames return this; -} +}; /** * Call this function to turn off all the particles and the emitter. @@ -47392,7 +47579,7 @@ Phaser.Particles.Arcade.Emitter.prototype.kill = function () { this.alive = false; this.exists = false; -} +}; /** * Handy for bringing game objects "back to life". Just sets alive and exists back to true. @@ -47403,7 +47590,7 @@ Phaser.Particles.Arcade.Emitter.prototype.revive = function () { this.alive = true; this.exists = true; -} +}; /** * Call this function to start emitting particles. @@ -47441,7 +47628,7 @@ Phaser.Particles.Arcade.Emitter.prototype.start = function (explode, lifespan, f this._counter = 0; this._timer = this.game.time.now + frequency; -} +}; /** * This function can be used both internally and externally to emit the next particle. @@ -47518,7 +47705,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () { particle.body.drag.y = this.particleDrag.y; particle.body.angularDrag = this.angularDrag; -} +}; /** * A more compact way of setting the width and height of the emitter. @@ -47531,7 +47718,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setSize = function (width, height) { this.width = width; this.height = height; -} +}; /** * A more compact way of setting the X velocity range of the emitter. @@ -47547,7 +47734,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setXSpeed = function (min, max) { this.minParticleSpeed.x = min; this.maxParticleSpeed.x = max; -} +}; /** * A more compact way of setting the Y velocity range of the emitter. @@ -47563,7 +47750,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setYSpeed = function (min, max) { this.minParticleSpeed.y = min; this.maxParticleSpeed.y = max; -} +}; /** * A more compact way of setting the angular velocity constraints of the emitter. @@ -47579,7 +47766,7 @@ Phaser.Particles.Arcade.Emitter.prototype.setRotation = function (min, max) { this.minRotation = min; this.maxRotation = max; -} +}; /** * Change the emitters center to match the center of any object with a `center` property, such as a Sprite. @@ -47594,7 +47781,7 @@ Phaser.Particles.Arcade.Emitter.prototype.at = function (object) { this.emitY = object.center.y; } -} +}; /** * @name Phaser.Particles.Arcade.Emitter#x @@ -47634,7 +47821,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { - + get: function () { return Math.floor(this.x - (this.width / 2)); } @@ -47647,7 +47834,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { - + get: function () { return Math.floor(this.x + (this.width / 2)); } @@ -47660,7 +47847,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { - + get: function () { return Math.floor(this.y - (this.height / 2)); } @@ -47673,7 +47860,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { - + get: function () { return Math.floor(this.y + (this.height / 2)); } @@ -47710,12 +47897,12 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} index - The index of this tile within the map data corresponding to the tileset. */ this.index = index; - + /** * @property {number} x - The x map coordinate of this tile. */ this.x = x; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -47725,7 +47912,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} x - The x map coordinate of this tile. */ this.worldX = x * width; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -47735,7 +47922,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.width = width; - + /** * @property {number} height - The height of the tile in pixels. */ @@ -47745,7 +47932,7 @@ Phaser.Tile = function (layer, index, x, y, width, height) { * @property {number} width - The width of the tile in pixels. */ this.centerX = Math.abs(width / 2); - + /** * @property {number} height - The height of the tile in pixels. */ @@ -47878,7 +48065,7 @@ Phaser.Tile.prototype = { /** * Set a callback to be called when this tile is hit by an object. * The callback must true true for collision processing to take place. - * + * * @method Phaser.Tile#setCollisionCallback * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. @@ -47900,7 +48087,7 @@ Phaser.Tile.prototype = { this.collisionCallback = null; this.collisionCallbackContext = null; this.properties = null; - + }, /** @@ -48002,7 +48189,7 @@ Phaser.Tile.prototype.constructor = Phaser.Tile; * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "collides", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } @@ -48015,7 +48202,7 @@ Object.defineProperty(Phaser.Tile.prototype, "collides", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); } @@ -48028,7 +48215,7 @@ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "left", { - + get: function () { return this.worldX; } @@ -48041,7 +48228,7 @@ Object.defineProperty(Phaser.Tile.prototype, "left", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "right", { - + get: function () { return this.worldX + this.width; } @@ -48054,7 +48241,7 @@ Object.defineProperty(Phaser.Tile.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "top", { - + get: function () { return this.worldY; } @@ -48067,7 +48254,7 @@ Object.defineProperty(Phaser.Tile.prototype, "top", { * @readonly */ Object.defineProperty(Phaser.Tile.prototype, "bottom", { - + get: function () { return this.worldY + this.height; } @@ -48253,7 +48440,7 @@ Phaser.Tilemap.prototype = { * @param {Phaser.Group} [group] - Optional Group to add the layer to. If not specified it will be added to the World group. * @return {Phaser.TilemapLayer} The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly. */ - create: function (name, width, height, tileWidth, tileHeight) { + create: function (name, width, height, tileWidth, tileHeight, group) { if (typeof group === 'undefined') { group = this.game.world; } @@ -48834,7 +49021,7 @@ Phaser.Tilemap.prototype = { } } - for (var y = 0; y < this.layers[layer].height ; y++) + for (var y = 0; y < this.layers[layer].height; y++) { for (var x = 0; x < this.layers[layer].width; x++) { @@ -49133,7 +49320,7 @@ Phaser.Tilemap.prototype = { this.layers[layer].dirty = true; this.calculateFaces(layer); - + return this.layers[layer].data[y][x]; } @@ -49256,7 +49443,7 @@ Phaser.Tilemap.prototype = { this._results.length = 0; - this._results.push( { x: x, y: y, width: width, height: height, layer: layer }); + this._results.push({ x: x, y: y, width: width, height: height, layer: layer }); for (var ty = y; ty < y + height; ty++) { @@ -49283,7 +49470,7 @@ Phaser.Tilemap.prototype = { if (typeof x === "undefined") { x = 0; } if (typeof y === "undefined") { y = 0; } - + layer = this.getLayer(layer); if (!tileblock || tileblock.length < 2) @@ -49658,17 +49845,17 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. */ this.context = this.canvas.getContext('2d'); - + /** * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - Dimensions of the renderable area. */ @@ -49770,7 +49957,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {object} _mc - Local map data and calculation cache. - * @private + * @private */ this._mc = { @@ -49799,7 +49986,7 @@ Phaser.TilemapLayer = function (game, tilemap, index, width, height) { /** * @property {array} _results - Local render loop var to help avoid gc spikes. - * @private + * @private */ this._results = []; @@ -49820,8 +50007,8 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // console.log('layer pu'); - Phaser.Image.prototype.postUpdate.call(this); - + Phaser.Image.prototype.postUpdate.call(this); + // Stops you being able to auto-scroll the camera if it's not following a sprite this.scrollX = this.game.camera.x * this.scrollFactorX; this.scrollY = this.game.camera.y * this.scrollFactorY; @@ -49841,7 +50028,7 @@ Phaser.TilemapLayer.prototype.postUpdate = function () { // this.children[i].postUpdate(); // } -} +}; /** * Sets the world size to match the size of this layer. @@ -49853,10 +50040,10 @@ Phaser.TilemapLayer.prototype.resizeWorld = function () { this.game.world.setBounds(0, 0, this.layer.widthInPixels, this.layer.heightInPixels); -} +}; /** -* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it +* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixX * @memberof Phaser.TilemapLayer @@ -49878,10 +50065,10 @@ Phaser.TilemapLayer.prototype._fixX = function(x) { return this._mc.x + (x - (this._mc.x / this.scrollFactorX)); -} +}; /** -* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it +* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixX * @memberof Phaser.TilemapLayer @@ -49898,10 +50085,10 @@ Phaser.TilemapLayer.prototype._unfixX = function(x) { return (this._mc.x / this.scrollFactorX) + (x - this._mc.x); -} +}; /** -* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it +* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixY * @memberof Phaser.TilemapLayer @@ -49923,10 +50110,10 @@ Phaser.TilemapLayer.prototype._fixY = function(y) { return this._mc.y + (y - (this._mc.y / this.scrollFactorY)); -} +}; /** -* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it +* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixY * @memberof Phaser.TilemapLayer @@ -49943,7 +50130,7 @@ Phaser.TilemapLayer.prototype._unfixY = function(y) { return (this._mc.y / this.scrollFactorY) + (y - this._mc.y); -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49958,7 +50145,7 @@ Phaser.TilemapLayer.prototype.getTileX = function (x) { return this.game.math.snapToFloor(this._fixX(x), this.map.tileWidth) / this.map.tileWidth; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49973,7 +50160,7 @@ Phaser.TilemapLayer.prototype.getTileY = function (y) { return this.game.math.snapToFloor(this._fixY(y), this.map.tileHeight) / this.map.tileHeight; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -49991,7 +50178,7 @@ Phaser.TilemapLayer.prototype.getTileXY = function (x, y, point) { return point; -} +}; /** * Gets all tiles that intersect with the given line. @@ -50037,7 +50224,7 @@ Phaser.TilemapLayer.prototype.getRayCastTiles = function (line, stepRate, collid return results; -} +}; /** * Get all tiles that exist within the given area, defined by the top-left corner, width and height. Values given are in pixels, not tiles. @@ -50096,7 +50283,7 @@ Phaser.TilemapLayer.prototype.getTiles = function (x, y, width, height, collides return this._results; -} +}; /** * Internal function to update maximum values. @@ -50123,7 +50310,7 @@ Phaser.TilemapLayer.prototype.updateMax = function () { this.dirty = true; -} +}; /** * Renders the tiles to the layer canvas and pushes to the display. @@ -50206,7 +50393,7 @@ Phaser.TilemapLayer.prototype.render = function () { if (this.game.renderType === Phaser.WEBGL) { - // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); + // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl); } @@ -50215,7 +50402,7 @@ Phaser.TilemapLayer.prototype.render = function () { return true; -} +}; /** * Renders a collision debug overlay on-top of the canvas. Called automatically by render when debug = true. @@ -50285,14 +50472,14 @@ Phaser.TilemapLayer.prototype.renderDebug = function () { } -} +}; /** * @name Phaser.TilemapLayer#scrollX * @property {number} scrollX - Scrolls the map horizontally or returns the current x position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { - + get: function () { return this._mc.x; }, @@ -50302,7 +50489,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { if (value !== this._mc.x && value >= 0 && this.layer.widthInPixels > this.width) { this._mc.x = value; - + if (this._mc.x > (this.layer.widthInPixels - this.width)) { this._mc.x = this.layer.widthInPixels - this.width; @@ -50332,7 +50519,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { * @property {number} scrollY - Scrolls the map vertically or returns the current y position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { - + get: function () { return this._mc.y; }, @@ -50372,7 +50559,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { * @property {number} collisionWidth - The width of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { - + get: function () { return this._mc.cw; }, @@ -50392,7 +50579,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { * @property {number} collisionHeight - The height of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", { - + get: function () { return this._mc.ch; }, @@ -50777,7 +50964,7 @@ Phaser.TilemapParser = { properties: json.layers[i].objects[v].properties }; - + objects[json.layers[i].name].push(object); } else if (json.layers[i].objects[v].polyline) @@ -50818,7 +51005,7 @@ Phaser.TilemapParser = { for (var i = 0; i < map.tilesets.length; i++) { var set = map.tilesets[i]; - + var x = set.tileMargin; var y = set.tileMargin; @@ -50863,7 +51050,7 @@ Phaser.TilemapParser = { } -} +}; /** * @author Richard Davey @@ -51060,6 +51247,7 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset; root.Phaser = Phaser; } }).call(this); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -51090,7 +51278,7 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset; * @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Ninja = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -51198,7 +51386,7 @@ Phaser.Physics.Ninja.prototype = { if (Array.isArray(object)) { - i = object.length; + var i = object.length; while (i--) { @@ -51326,9 +51514,6 @@ Phaser.Physics.Ninja.prototype = { layer = map.getLayer(layer); - if (typeof addToWorld === 'undefined') { addToWorld = true; } - if (typeof optimize === 'undefined') { optimize = true; } - // If the bodies array is already populated we need to nuke it this.clearTilemapLayerBodies(map, layer); @@ -51632,11 +51817,9 @@ Phaser.Physics.Ninja.prototype = { * @method Phaser.Physics.Ninja#separate * @param {Phaser.Physics.Ninja.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Ninja.Body} body2 - The Body object to separate. - * @param {function} [processCallback=null] - UN-USED: A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. - * @param {object} [callbackContext] - UN-USED: The context in which to run the process callback. * @returns {boolean} Returns true if the bodies collided, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { + separate: function (body1, body2) { if (body1.type !== Phaser.Physics.NINJA || body2.type !== Phaser.Physics.NINJA) { @@ -52115,7 +52298,7 @@ Phaser.Physics.Ninja.Body.prototype = { * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "x", { - + get: function () { return this.shape.pos.x; }, @@ -52131,7 +52314,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "y", { - + get: function () { return this.shape.pos.y; }, @@ -52148,7 +52331,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "width", { - + get: function () { return this.shape.width; } @@ -52161,7 +52344,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "width", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "height", { - + get: function () { return this.shape.height; } @@ -52174,7 +52357,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "height", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "bottom", { - + get: function () { return this.shape.pos.y + this.shape.yw; } @@ -52187,7 +52370,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "right", { - + get: function () { return this.shape.pos.x + this.shape.xw; } @@ -52200,7 +52383,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "right", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "speed", { - + get: function () { return Math.sqrt(this.shape.velocity.x * this.shape.velocity.x + this.shape.velocity.y * this.shape.velocity.y); } @@ -52213,7 +52396,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "speed", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { - + get: function () { return Math.atan2(this.shape.velocity.y, this.shape.velocity.x); } @@ -52221,6 +52404,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { }); +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -52241,7 +52425,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { * @param {number} height - The height of this AABB. */ Phaser.Physics.Ninja.AABB = function (body, x, y, width, height) { - + /** * @property {Phaser.Physics.Ninja.Body} system - A reference to the body that owns this shape. */ @@ -52358,7 +52542,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this AABB collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -52467,16 +52651,6 @@ Phaser.Physics.Ninja.AABB.prototype = { var vx1 = this.pos.x - this.oldpos.x; // Calc velocity of this object var vy1 = this.pos.y - this.oldpos.y; var dp1 = (vx1 * dx + vy1 * dy); // Find component of velocity parallel to collision normal - var nx1 = dp1 * dx; // Project velocity onto collision normal - var ny1 = dp1 * dy; // nx, ny is normal velocity - - var dx2 = dx * -1; - var dy2 = dy * -1; - var vx2 = obj.pos.x - obj.oldpos.x; // Calc velocity of colliding object - var vy2 = obj.pos.y - obj.oldpos.y; - var dp2 = (vx2 * dx2 + vy2 * dy2); // Find component of velocity parallel to collision normal - var nx2 = dp2 * dx2; // Project velocity onto collision normal - var ny2 = dp2 * dy2; // nx, ny is normal velocity // We only want to apply collision response forces if the object is travelling into, and not out of, the collision if (this.body.immovable && obj.body.immovable) @@ -52757,16 +52931,16 @@ Phaser.Physics.Ninja.AABB.prototype = { projAABB_Half: function (x, y, obj, t) { //signx or signy must be 0; the other must be -1 or 1 - //calculate the projection vector for the half-edge, and then + //calculate the projection vector for the half-edge, and then //(if collision is occuring) pick the minimum - + var sx = t.signx; var sy = t.signy; - + var ox = (obj.pos.x - (sx*obj.xw)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*obj.yw)) - t.pos.y;//point on the AABB, relative to the tile center - //we perform operations analogous to the 45deg tile, except we're using + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope @@ -52777,11 +52951,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { //project along axis; note that we're assuming that this tile is horizontal OR vertical @@ -52791,14 +52965,14 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { //note that we could use -= instead of -dp obj.reportCollisionVsWorld(sx,sy,t.signx, t.signy, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -52823,7 +52997,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var sx = t.sx; var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -52832,8 +53006,8 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -52852,7 +53026,7 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -52867,7 +53041,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @return {number} The result of the collision. */ projAABB_22DegS: function (x, y, obj, t) { - + var signx = t.signx; var signy = t.signy; @@ -52880,10 +53054,10 @@ Phaser.Physics.Ninja.AABB.prototype = { { var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -52892,11 +53066,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + var aY = Math.abs(penY); if (lenP < lenN) @@ -52904,13 +53078,13 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aY < lenP) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -52919,7 +53093,7 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aY < lenN) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else @@ -52931,7 +53105,7 @@ Phaser.Physics.Ninja.AABB.prototype = { } } } - + //if we've reached this point, no collision has occured return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -52953,10 +53127,10 @@ Phaser.Physics.Ninja.AABB.prototype = { var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -52965,7 +53139,7 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -52973,18 +53147,18 @@ Phaser.Physics.Ninja.AABB.prototype = { if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } - + } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -53014,7 +53188,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need to project it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -53023,7 +53197,7 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -53035,13 +53209,13 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aX < lenP) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -53050,11 +53224,11 @@ Phaser.Physics.Ninja.AABB.prototype = { if (aX < lenN) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.AABB.COL_OTHER; @@ -53062,9 +53236,9 @@ Phaser.Physics.Ninja.AABB.prototype = { } } } - + //if we've reached this point, no collision has occured - return Phaser.Physics.Ninja.AABB.COL_NONE; + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -53082,13 +53256,13 @@ Phaser.Physics.Ninja.AABB.prototype = { var signx = t.signx; var signy = t.signy; - + var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -53097,11 +53271,11 @@ Phaser.Physics.Ninja.AABB.prototype = { { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); @@ -53109,14 +53283,14 @@ Phaser.Physics.Ninja.AABB.prototype = { return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - - return Phaser.Physics.Ninja.AABB.COL_NONE; + + return Phaser.Physics.Ninja.AABB.COL_NONE; }, /** @@ -53153,7 +53327,7 @@ Phaser.Physics.Ninja.AABB.prototype = { var lenP = Math.sqrt(x * x + y * y); obj.reportCollisionVsWorld(x, y, x / lenP, y / lenP, t); - return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report + return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report } else if (0 < pen) { @@ -53224,7 +53398,7 @@ Phaser.Physics.Ninja.AABB.prototype = { } return Phaser.Physics.Ninja.AABB.COL_NONE; - + }, /** @@ -53237,8 +53411,9 @@ Phaser.Physics.Ninja.AABB.prototype = { this.system = null; } -} +}; +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -53250,7 +53425,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * A Tile is defined by its width, height and type. It's type can include slope data, such as 45 degree slopes, or convex slopes. * Understand that for any type including a slope (types 2 to 29) the Tile must be SQUARE, i.e. have an equal width and height. * Also note that as Tiles are primarily used for levels they have gravity disabled and world bounds collision disabled by default. -* +* * Note: This class could be massively optimised and reduced in size. I leave that challenge up to you. * * @class Phaser.Physics.Ninja.Tile @@ -53264,7 +53439,7 @@ Phaser.Physics.Ninja.AABB.prototype = { * @param {number} [type=1] - The type of Ninja shape to create. 1 = AABB, 2 = Circle or 3 = Tile. */ Phaser.Physics.Ninja.Tile = function (body, x, y, width, height, type) { - + if (typeof type === 'undefined') { type = Phaser.Physics.Ninja.Tile.EMPTY; } /** @@ -53442,8 +53617,7 @@ Phaser.Physics.Ninja.Tile.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this Tile collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { - + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -53594,28 +53768,28 @@ Phaser.Physics.Ninja.Tile.prototype = { this.signx = 1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnn) { this.signx = -1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnp) { this.signx = -1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGpp) { this.signx = 1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else { @@ -53906,14 +54080,14 @@ Phaser.Physics.Ninja.Tile.prototype = { } } -} +}; /** * @name Phaser.Physics.Ninja.Tile#x * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "x", { - + get: function () { return this.pos.x - this.xw; }, @@ -53929,7 +54103,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "x", { * @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "y", { - + get: function () { return this.pos.y - this.yw; }, @@ -53946,7 +54120,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "bottom", { - + get: function () { return this.pos.y + this.yw; } @@ -53959,7 +54133,7 @@ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "bottom", { * @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "right", { - + get: function () { return this.pos.x + this.xw; } @@ -54012,6 +54186,7 @@ Phaser.Physics.Ninja.Tile.TYPE_67DEGs = 22; Phaser.Physics.Ninja.Tile.TYPE_67DEGb = 26; Phaser.Physics.Ninja.Tile.TYPE_HALF = 30; +/* jshint camelcase: false */ /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -54113,7 +54288,7 @@ Phaser.Physics.Ninja.Circle = function (body, x, y, radius) { this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb] = this.projCircle_67DegB; this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF] = this.projCircle_Half; -} +}; Phaser.Physics.Ninja.Circle.prototype.constructor = Phaser.Physics.Ninja.Circle; @@ -54153,7 +54328,7 @@ Phaser.Physics.Ninja.Circle.prototype = { * @param {number} dy - Collision normal * @param {number} obj - Object this Circle collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -54366,9 +54541,9 @@ Phaser.Physics.Ninja.Circle.prototype = { //if we're colliding vs. horiz. or vert. neighb, we simply project horiz/vert //if we're colliding diagonally, we need to collide vs. tile corner - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //collision with current cell if (x < y) @@ -54376,7 +54551,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //penetration in x is smaller; project in x var dx = obj.pos.x - t.pos.x;//get sign for projection along x-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dx < 0) { obj.reportCollisionVsWorld(-x, 0, -1, 0, t); @@ -54390,10 +54565,10 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - //penetration in y is smaller; project in y + //penetration in y is smaller; project in y var dy = obj.pos.y - t.pos.y;//get sign for projection along y-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dy < 0) { obj.reportCollisionVsWorld(0, -y, 0, -1, t); @@ -54414,7 +54589,7 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_AXIS; } } - else if (oV == 0) + else if (oV === 0) { //collision with horizontal neighbor obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t); @@ -54428,7 +54603,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -54437,7 +54612,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -54484,9 +54659,9 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile @@ -54494,7 +54669,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = (obj.pos.x - (sx * obj.radius)) - t.pos.x;//this gives is the coordinates of the innermost - var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center + var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center //if the dotprod of (ox,oy) and (sx,sy) is negative, the innermost point is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) @@ -54513,7 +54688,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -54525,7 +54700,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -54568,13 +54743,13 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronoi region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronoi region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if (0 < (perp * signx * signy)) { @@ -54613,7 +54788,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -54632,7 +54807,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var sy = t.sy; var ox = obj.pos.x - (t.pos.x + (oH * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) @@ -54642,8 +54817,8 @@ Phaser.Physics.Ninja.Circle.prototype = { // for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if ((perp * signx * signy) < 0) { @@ -54698,7 +54873,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -54706,7 +54881,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -54754,13 +54929,13 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to + var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to var oy = (t.pos.y + (signy * t.yw)) - obj.pos.y;//tile-circle's center var twid = t.xw * 2; @@ -54779,7 +54954,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -54791,7 +54966,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -54842,7 +55017,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x - (signx * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -54850,7 +55025,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out vertically dx = 0; @@ -54869,7 +55044,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -54887,7 +55062,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y - (signy * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -54895,7 +55070,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out horizontally dx = oH; @@ -54930,7 +55105,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -54938,7 +55113,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -54988,14 +55163,14 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -55014,7 +55189,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -55026,7 +55201,7 @@ Phaser.Physics.Ninja.Circle.prototype = { lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -55042,7 +55217,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //projeciton by an axis shoudl always be shorter, and we should //never arrive here ox /= len; @@ -55070,7 +55245,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -55083,7 +55258,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -55095,7 +55270,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -55110,7 +55285,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -55123,7 +55298,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -55142,7 +55317,7 @@ Phaser.Physics.Ninja.Circle.prototype = { //obj in diag neighb cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -55155,7 +55330,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -55172,7 +55347,7 @@ Phaser.Physics.Ninja.Circle.prototype = { var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -55180,7 +55355,7 @@ Phaser.Physics.Ninja.Circle.prototype = { if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -55235,85 +55410,84 @@ Phaser.Physics.Ninja.Circle.prototype = { var signy = t.signy; var celldp = (oH*signx + oV*signy);//this tells us about the configuration of cell-offset relative to tile normal - if(0 < celldp) + if (0 < celldp) { //obj is in "far" (pointed-at-by-normal) neighbor of halffull tile, and will never hit return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile var r = obj.radius; var ox = (obj.pos.x - (signx*r)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*r)) - t.pos.y;//point on the circle, relative to the tile center - - - //we perform operations analogous to the 45deg tile, except we're using + + + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. var sx = signx; var sy = signy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - if(dp < 0) + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - - + sy *= -dp; + + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP,t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.signx,t.signy); return Phaser.Physics.Ninja.Circle.COL_OTHER; } return true; - } - + } + } else { //colliding vertically - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dx = obj.pos.x - t.pos.x; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dx*signx) < 0) + if ((dx*signx) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dy = obj.pos.y - (t.pos.y + oV*t.yw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -55324,12 +55498,12 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else @@ -55338,41 +55512,40 @@ Phaser.Physics.Ninja.Circle.prototype = { //we can only collide with the cell edge //collision with vertical neighbor obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } - + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dy = obj.pos.y - t.pos.y; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dy*signy) < 0) + if ((dy*signy) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(x*oH,0,oH,0,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dx = obj.pos.x - (t.pos.x + oH*t.xw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -55383,25 +55556,25 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else - { + { //due to the first conditional (celldp >0), we know w're in the cell "opposite" the normal, and so //we can only collide with the cell edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } else - { + { //colliding diagonally; we know, due to the initial (celldp >0) test which has failed //if we've reached this point, that we're in a diagonal neighbor on the non-normal side, so //we could only be colliding with the cell vertex, if at all. @@ -55409,16 +55582,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -55431,14 +55604,14 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } - + return Phaser.Physics.Ninja.Circle.COL_NONE; - + }, /** @@ -55454,7 +55627,7 @@ Phaser.Physics.Ninja.Circle.prototype = { * @return {number} The result of the collision. */ projCircle_22DegS: function (x,y,oH,oV,obj,t) { - + //if the object is in a cell pointed at by signy, no collision will ever occur //otherwise, // @@ -55463,115 +55636,116 @@ Phaser.Physics.Ninja.Circle.prototype = { //if obj is in this tile: collide vs slope or vertex //if obj is horiz neighb in direction of slope: collide vs. slope or vertex //if obj is horiz neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is vert neighb against direction of slope: collide vs. face + var lenP; var signx = t.signx; var signy = t.signy; - if(0 < (signy*oV)) + if (0 < (signy*oV)) { //object will never collide vs tile, it can't reach that far - + return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner - + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal or axially. - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronio region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.Circle.COL_OTHER; } - + } } - + } else { @@ -55579,42 +55753,42 @@ Phaser.Physics.Ninja.Circle.prototype = { //due to the first conditional far above obj.reportCollisionVsWorld(0,y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if((signx*oH) < 0) + if ((signx*oH) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x - (signx*t.xw); var vy = t.pos.y; - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dy*signy) < 0) + + if ((dy*signy) < 0) { //colliding vs face obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -55627,7 +55801,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -55636,13 +55810,13 @@ Phaser.Physics.Ninja.Circle.prototype = { { //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x + (oH*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal, otherwise by the vertex. @@ -55651,41 +55825,41 @@ Phaser.Physics.Ninja.Circle.prototype = { // for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -55701,16 +55875,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -55723,7 +55897,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -55758,81 +55932,82 @@ Phaser.Physics.Ninja.Circle.prototype = { // //if obj is vert neighb in direction of slope: collide vs. slope or vertex + var lenP; var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x, y, x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - } + } + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -55842,77 +56017,77 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen,sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert - - if((oy*signy) < 0) + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert + + if ((oy*signy) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -55920,79 +56095,79 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope //we should really precalc this at compile time, but for now, fuck it var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*1) / slen;//get slope _unit_ normal; var sy = (signy*2) / slen;//raw RH normal is (1,-2) - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } return Phaser.Physics.Ninja.Circle.COL_NONE; @@ -56002,16 +56177,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -56027,10 +56202,10 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -56056,47 +56231,48 @@ Phaser.Physics.Ninja.Circle.prototype = { //if obj is in this tile: collide vs slope or vertex or axis //if obj is vert neighb in direction of slope: collide vs. slope or vertex //if obj is vert neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is horiz neighb against direction of slope: collide vs. face var signx = t.signx; var signy = t.signy; - if(0 < (signx*oH)) + if (0 < (signx*oH)) { //object will never collide vs tile, it can't reach that far return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal or axis, otherwise by the corner/vertex - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronoi region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; @@ -56104,99 +56280,99 @@ Phaser.Physics.Ninja.Circle.prototype = { obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } } - + } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x; var vy = t.pos.y - (signy*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dx*signx) < 0) - { + + if ((dx*signx) < 0) + { //colliding vs face obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -56207,9 +56383,9 @@ Phaser.Physics.Ninja.Circle.prototype = { dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -56218,68 +56394,68 @@ Phaser.Physics.Ninja.Circle.prototype = { { //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally; we can assume that (signy*oV) < 0 //due to the first conditional far above - obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { //colliding diagonally; due to the first conditional above, //obj is vertically offset against slope, and offset in either direction horizontally @@ -56287,16 +56463,16 @@ Phaser.Physics.Ninja.Circle.prototype = { //get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -56309,7 +56485,7 @@ Phaser.Physics.Ninja.Circle.prototype = { } obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -56347,75 +56523,76 @@ Phaser.Physics.Ninja.Circle.prototype = { var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); @@ -56425,16 +56602,16 @@ Phaser.Physics.Ninja.Circle.prototype = { else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert - - if((ox*signx) < 0) + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + + if ((ox*signx) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - return Phaser.Physics.Ninja.Circle.COL_AXIS; + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -56442,60 +56619,60 @@ Phaser.Physics.Ninja.Circle.prototype = { var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the slope. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -56506,47 +56683,47 @@ Phaser.Physics.Ninja.Circle.prototype = { var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*2) / slen;//get slope _unit_ normal; var sy = (signy*1) / slen;//raw RH normal is (1,-2) - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -56555,27 +56732,27 @@ Phaser.Physics.Ninja.Circle.prototype = { else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); @@ -56586,20 +56763,20 @@ Phaser.Physics.Ninja.Circle.prototype = { } else { - + //collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -56615,10 +56792,10 @@ Phaser.Physics.Ninja.Circle.prototype = { return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -56632,23 +56809,23 @@ Phaser.Physics.Ninja.Circle.prototype = { this.system = null; } -} +}; /** * The MIT License (MIT) - * + * * Copyright (c) 2013 p2.js authors - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -56666,12 +56843,12 @@ are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; @@ -56767,7 +56944,7 @@ mat2.transpose = function(out, a) { out[2] = a[1]; out[3] = a[3]; } - + return out; }; @@ -56788,7 +56965,7 @@ mat2.invert = function(out, a) { return null; } det = 1.0 / det; - + out[0] = a3 * det; out[1] = -a1 * det; out[2] = -a2 * det; @@ -56909,12 +57086,12 @@ are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation + this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; @@ -56932,7 +57109,7 @@ var vec2 = {}; if(!GLMAT_EPSILON) { var GLMAT_EPSILON = 0.000001; } - + /** * Creates a new, empty vec2 * @@ -57303,7 +57480,7 @@ vec2.forEach = (function() { if(!offset) { offset = 0; } - + if(count) { l = Math.min((count * stride) + offset, a.length); } else { @@ -57315,7 +57492,7 @@ vec2.forEach = (function() { fn(vec, vec, arg); a[i] = vec[0]; a[i+1] = vec[1]; } - + return a; }; })(); @@ -67351,6 +67528,7 @@ World.prototype.hitTest = function(worldPoint,bodies,precision){ (36) }); ; + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -67390,7 +67568,7 @@ Phaser.Physics.P2 = function (game, config) { * @property {number} frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property. * @default */ - this.frameRate = 1 / 60; + this.frameRate = 1 / 60; /** * @property {boolean} useElapsedTime - If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.physicsElapsed, which is a delta time value. @@ -67500,7 +67678,7 @@ Phaser.Physics.P2 = function (game, config) { * @property {array} _toRemove - Internal var used to hold references to bodies to remove from the world on the next step. */ this._toRemove = []; - + /** * @property {array} collisionGroups - Internal var. */ @@ -67632,7 +67810,7 @@ Phaser.Physics.P2.prototype = { if (object.hasOwnProperty('body') && object.body === null) { object.body = new Phaser.Physics.P2.Body(this.game, object, object.x, object.y, 1); - object.body.debug = debug + object.body.debug = debug; object.anchor.set(0.5); } @@ -67932,7 +68110,7 @@ Phaser.Physics.P2.prototype = { } else { - this.bounds = new p2.Body({ mass: 0, position:[this.pxmi(cx), this.pxmi(cy)] }); + this.bounds = new p2.Body({ mass: 0, position: [this.pxmi(cx), this.pxmi(cy)] }); } if (left) @@ -67944,7 +68122,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[0].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966); } if (right) @@ -67956,7 +68134,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[1].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966); } if (top) @@ -67968,7 +68146,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[2].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793 ); + this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793); } if (bottom) @@ -67980,7 +68158,7 @@ Phaser.Physics.P2.prototype = { this._wallShapes[3].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)] ); + this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)]); } this.world.addBody(this.bounds); @@ -68660,12 +68838,12 @@ Phaser.Physics.P2.prototype = { * @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {Phaser.Physics.P2.Body} The body */ @@ -68702,12 +68880,12 @@ Phaser.Physics.P2.prototype = { * @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. */ createParticle: function (x, y, mass, addToWorld, options, data) { @@ -68749,8 +68927,6 @@ Phaser.Physics.P2.prototype = { if (typeof addToWorld === 'undefined') { addToWorld = true; } - layer = map.getLayer(layer); - var output = []; for (var i = 0, len = map.collision[layer].length; i < len; i++) @@ -68894,7 +69070,7 @@ Phaser.Physics.P2.prototype = { * Convert p2 physics value (meters) to pixel scale. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpx * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -68909,7 +69085,7 @@ Phaser.Physics.P2.prototype = { * Convert pixel value to p2 physics scale (meters). * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxm * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -68924,7 +69100,7 @@ Phaser.Physics.P2.prototype = { * Convert p2 physics value (meters) to pixel scale and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpxi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -68939,7 +69115,7 @@ Phaser.Physics.P2.prototype = { * Convert pixel value to p2 physics scale (meters) and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxmi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -68957,7 +69133,7 @@ Phaser.Physics.P2.prototype = { * @property {number} friction - Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", { - + get: function () { return this.world.defaultFriction; @@ -68977,7 +69153,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", { * @property {number} restitution - Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "restituion", { - + get: function () { return this.world.defaultRestitution; @@ -68997,7 +69173,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "restituion", { * @property {boolean} applySpringForces - Enable to automatically apply spring forces each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applySpringForces", { - + get: function () { return this.world.applySpringForces; @@ -69017,7 +69193,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applySpringForces", { * @property {boolean} applyDamping - Enable to automatically apply body damping each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyDamping", { - + get: function () { return this.world.applyDamping; @@ -69037,7 +69213,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applyDamping", { * @property {boolean} applyGravity - Enable to automatically apply gravity each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyGravity", { - + get: function () { return this.world.applyGravity; @@ -69057,7 +69233,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "applyGravity", { * @property {boolean} solveConstraints - Enable/disable constraint solving in each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "solveConstraints", { - + get: function () { return this.world.solveConstraints; @@ -69078,7 +69254,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "solveConstraints", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "time", { - + get: function () { return this.world.time; @@ -69092,7 +69268,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "time", { * @property {boolean} emitImpactEvent - Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance. */ Object.defineProperty(Phaser.Physics.P2.prototype, "emitImpactEvent", { - + get: function () { return this.world.emitImpactEvent; @@ -69112,7 +69288,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "emitImpactEvent", { * @property {boolean} enableBodySleeping - Enable / disable automatic body sleeping. */ Object.defineProperty(Phaser.Physics.P2.prototype, "enableBodySleeping", { - + get: function () { return this.world.enableBodySleeping; @@ -69133,7 +69309,7 @@ Object.defineProperty(Phaser.Physics.P2.prototype, "enableBodySleeping", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "total", { - + get: function () { return this.world.bodies.length; @@ -69171,7 +69347,7 @@ Phaser.Physics.P2.PointProxy.prototype.constructor = Phaser.Physics.P2.PointProx * @property {number} x - The x property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -69191,7 +69367,7 @@ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "x", { * @property {number} y - The y property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -69235,7 +69411,7 @@ Phaser.Physics.P2.InversePointProxy.prototype.constructor = Phaser.Physics.P2.In * @property {number} x - The x property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -69255,7 +69431,7 @@ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { * @property {number} y - The y property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -69406,7 +69582,7 @@ Phaser.Physics.P2.Body = function (game, sprite, x, y, mass) { /** * @property {Phaser.Physics.P2.BodyDebug} debugBody - Reference to the debug body. */ - this.debugBody = null + this.debugBody = null; // Set-up the default shape if (sprite) @@ -70035,7 +70211,7 @@ Phaser.Physics.P2.Body.prototype = { this.debugBody.destroy(); } - this.debugBody = null + this.debugBody = null; this.sprite = null; @@ -70199,12 +70375,12 @@ Phaser.Physics.P2.Body.prototype = { * This function expects the x.y values to be given in pixels. If you want to provide them at p2 world scales then call Body.data.fromPolygon directly. * * @method Phaser.Physics.P2.Body#addPolygon - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {boolean} True on success, else false. */ @@ -70237,7 +70413,7 @@ Phaser.Physics.P2.Body.prototype = { // top and tail var idx = path.length - 1; - if ( path[idx][0] === path[0][0] && path[idx][1] === path[0][1] ) + if (path[idx][0] === path[0][0] && path[idx][1] === path[0][1]) { path.pop(); } @@ -70352,7 +70528,7 @@ Phaser.Physics.P2.Body.prototype = { } }, - + /** * Updates the debug draw if any body shapes change. * @@ -70395,7 +70571,7 @@ Phaser.Physics.P2.Body.prototype = { return createdFixtures; }, - + /** * Add a polygon fixture. This is used during #loadPhaserPolygon. * @@ -70408,28 +70584,26 @@ Phaser.Physics.P2.Body.prototype = { if (fixtureData.circle) { - var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)) - shape.collisionGroup = fixtureData.filter.categoryBits - shape.collisionMask = fixtureData.filter.maskBits - shape.sensor = fixtureData.isSensor + var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)); + shape.collisionGroup = fixtureData.filter.categoryBits; + shape.collisionMask = fixtureData.filter.maskBits; + shape.sensor = fixtureData.isSensor; var offset = p2.vec2.create(); - offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2) - offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2) - + offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2); + offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2); + this.data.addShape(shape, offset); - generatedShapes.push(shape) + generatedShapes.push(shape); } else { - polygons = fixtureData.polygons; - + var polygons = fixtureData.polygons; var cm = p2.vec2.create(); for (var i = 0; i < polygons.length; i++) { - shapes = polygons[i]; - + var shapes = polygons[i]; var vertices = []; for (var s = 0; s < shapes.length; s += 2) @@ -70551,7 +70725,7 @@ Phaser.Physics.P2.Body.prototype = { * @method Phaser.Physics.P2.Body#loadPolygon * @param {string} key - The key of the Physics Data file as stored in Game.Cache. * @param {string} object - The key of the object within the Physics data file that you wish to load the shape data from. - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. @@ -70603,7 +70777,7 @@ Phaser.Physics.P2.Body.KINEMATIC = 4; * @property {boolean} static - Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.STATIC); @@ -70636,7 +70810,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", { * @property {boolean} dynamic - Returns true if the Body is dynamic. Setting Body.dynamic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC); @@ -70669,7 +70843,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", { * @property {boolean} kinematic - Returns true if the Body is kinematic. Setting Body.kinematic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC); @@ -70695,10 +70869,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", { /** * @name Phaser.Physics.P2.Body#allowSleep -* @property {boolean} allowSleep - +* @property {boolean} allowSleep - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "allowSleep", { - + get: function () { return this.data.allowSleep; @@ -70720,7 +70894,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "allowSleep", { * The angle of the Body in degrees from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement Body.angle = 450 is the same as Body.angle = 90. * If you wish to work in radians instead of degrees use the property Body.rotation instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#angle * @property {number} angle - The angle of this Body in degrees. */ @@ -70746,7 +70920,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angle", { * @property {number} angularDamping - The angular damping acting acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularDamping", { - + get: function () { return this.data.angularDamping; @@ -70766,7 +70940,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularDamping", { * @property {number} angularForce - The angular force acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularForce", { - + get: function () { return this.data.angularForce; @@ -70786,7 +70960,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularForce", { * @property {number} angularVelocity - The angular velocity of the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularVelocity", { - + get: function () { return this.data.angularVelocity; @@ -70807,7 +70981,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularVelocity", { * @property {number} damping - The linear damping acting on the body in the velocity direction. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "damping", { - + get: function () { return this.data.damping; @@ -70824,10 +70998,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "damping", { /** * @name Phaser.Physics.P2.Body#fixedRotation -* @property {boolean} fixedRotation - +* @property {boolean} fixedRotation - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "fixedRotation", { - + get: function () { return this.data.fixedRotation; @@ -70850,7 +71024,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "fixedRotation", { * @property {number} inertia - The inertia of the body around the Z axis.. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "inertia", { - + get: function () { return this.data.inertia; @@ -70867,10 +71041,10 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "inertia", { /** * @name Phaser.Physics.P2.Body#mass -* @property {number} mass - +* @property {number} mass - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "mass", { - + get: function () { return this.data.mass; @@ -70894,7 +71068,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "mass", { * @property {number} motionState - The type of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity). */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", { - + get: function () { return this.data.motionState; @@ -70915,7 +71089,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", { /** * The angle of the Body in radians. * If you wish to work in degrees instead of radians use the Body.angle property instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#rotation * @property {number} rotation - The angle of this Body in radians. */ @@ -70940,7 +71114,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "rotation", { * @property {number} sleepSpeedLimit - . */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "sleepSpeedLimit", { - + get: function () { return this.data.sleepSpeedLimit; @@ -70960,7 +71134,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "sleepSpeedLimit", { * @property {number} x - The x coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "x", { - + get: function () { return this.world.mpxi(this.data.position[0]); @@ -70980,7 +71154,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "x", { * @property {number} y - The y coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "y", { - + get: function () { return this.world.mpxi(this.data.position[1]); @@ -71001,7 +71175,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "y", { * @readonly */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "id", { - + get: function () { return this.data.id; @@ -71015,7 +71189,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "id", { * @property {boolean} debug - Enable or disable debug drawing of this body */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { - + get: function () { return (!this.debugBody); @@ -71027,7 +71201,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { if (value && !this.debugBody) { // This will be added to the global space - this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data) + this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data); } else if (!value && this.debugBody) { @@ -71046,7 +71220,7 @@ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { * @property {boolean} collideWorldBounds - Should the Body collide with the World bounds? */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "collideWorldBounds", { - + get: function () { return this._collideWorldBounds; @@ -71103,7 +71277,7 @@ Phaser.Physics.P2.BodyDebug = function(game, body, settings) { debugPolygons: false, lineWidth: 1, alpha: 0.5 - } + }; this.settings = Phaser.Utils.extend(defaultSettings, settings); @@ -71123,16 +71297,16 @@ Phaser.Physics.P2.BodyDebug = function(game, body, settings) { */ this.canvas = new Phaser.Graphics(game); - this.canvas.alpha = this.settings.alpha + this.canvas.alpha = this.settings.alpha; this.add(this.canvas); this.draw(); -} +}; -Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype) -Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug +Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype); +Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug; Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { @@ -71167,7 +71341,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { * @method Phaser.Physics.P2.BodyDebug#draw */ draw: function() { - + var angle, child, color, i, j, lineColor, lw, obj, offset, sprite, v, verts, vrot, _j, _ref1; obj = this.body; sprite = this.canvas; @@ -71178,10 +71352,10 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { if (obj instanceof p2.Body && obj.shapes.length) { - var l = obj.shapes.length + var l = obj.shapes.length; i = 0; - + while (i !== l) { child = obj.shapes[i]; @@ -71189,7 +71363,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { angle = obj.shapeAngles[i]; offset = offset || 0; angle = angle || 0; - + if (child instanceof p2.Circle) { this.drawCircle(sprite, offset[0] * this.ppu, offset[1] * this.ppu, angle, child.radius * this.ppu, color, lw); @@ -71221,7 +71395,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { this.drawRectangle(sprite, offset[0] * this.ppu, -offset[1] * this.ppu, angle, child.width * this.ppu, child.height * this.ppu, lineColor, color, lw); } - i++ + i++; } } @@ -71325,7 +71499,7 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { { colors = [0xff0000, 0x00ff00, 0x0000ff]; i = 0; - + while (i !== verts.length + 1) { v0 = verts[i % verts.length]; @@ -71496,7 +71670,8 @@ Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { } -}) +}); + /** * @author Richard Davey * @copyright 2014 Photon Storm Ltd. @@ -71566,7 +71741,7 @@ Phaser.Physics.P2.Spring = function (world, bodyA, bodyB, restLength, stiffness, p2.Spring.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.Spring.prototype = Object.create(p2.Spring.prototype); Phaser.Physics.P2.Spring.prototype.constructor = Phaser.Physics.P2.Spring; @@ -71594,7 +71769,7 @@ Phaser.Physics.P2.Material = function (name) { p2.Material.call(this); -} +}; Phaser.Physics.P2.Material.prototype = Object.create(p2.Material.prototype); Phaser.Physics.P2.Material.prototype.constructor = Phaser.Physics.P2.Material; @@ -71659,7 +71834,7 @@ Phaser.Physics.P2.ContactMaterial = function (materialA, materialB, options) { p2.ContactMaterial.call(this, materialA, materialB, options); -} +}; Phaser.Physics.P2.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype); Phaser.Physics.P2.ContactMaterial.prototype.constructor = Phaser.Physics.P2.ContactMaterial; @@ -71684,7 +71859,7 @@ Phaser.Physics.P2.CollisionGroup = function (bitmask) { */ this.mask = bitmask; -} +}; /** * @author Richard Davey @@ -71722,7 +71897,7 @@ Phaser.Physics.P2.DistanceConstraint = function (world, bodyA, bodyB, distance, p2.DistanceConstraint.call(this, bodyA, bodyB, distance, maxForce); -} +}; Phaser.Physics.P2.DistanceConstraint.prototype = Object.create(p2.DistanceConstraint.prototype); Phaser.Physics.P2.DistanceConstraint.prototype.constructor = Phaser.Physics.P2.DistanceConstraint; @@ -71764,7 +71939,7 @@ Phaser.Physics.P2.GearConstraint = function (world, bodyA, bodyB, angle, ratio) p2.GearConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.GearConstraint.prototype = Object.create(p2.GearConstraint.prototype); Phaser.Physics.P2.GearConstraint.prototype.constructor = Phaser.Physics.P2.GearConstraint; @@ -71810,7 +71985,7 @@ Phaser.Physics.P2.LockConstraint = function (world, bodyA, bodyB, offset, angle, p2.LockConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.LockConstraint.prototype = Object.create(p2.LockConstraint.prototype); Phaser.Physics.P2.LockConstraint.prototype.constructor = Phaser.Physics.P2.LockConstraint; @@ -71861,7 +72036,7 @@ Phaser.Physics.P2.PrismaticConstraint = function (world, bodyA, bodyB, lockRotat p2.PrismaticConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.PrismaticConstraint.prototype = Object.create(p2.PrismaticConstraint.prototype); Phaser.Physics.P2.PrismaticConstraint.prototype.constructor = Phaser.Physics.P2.PrismaticConstraint; @@ -71905,7 +72080,7 @@ Phaser.Physics.P2.RevoluteConstraint = function (world, bodyA, pivotA, bodyB, pi p2.RevoluteConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); -} +}; Phaser.Physics.P2.RevoluteConstraint.prototype = Object.create(p2.RevoluteConstraint.prototype); Phaser.Physics.P2.RevoluteConstraint.prototype.constructor = Phaser.Physics.P2.RevoluteConstraint; diff --git a/build/phaser.map b/build/phaser.map index a8ecdaebbc..2e0b8d4196 100644 --- a/build/phaser.map +++ b/build/phaser.map @@ -1 +1 @@ -{"version":3,"file":"phaser.min.js","sources":["phaser.js"],"names":["root","this","PIXI","WEBGL_RENDERER","CANVAS_RENDERER","VERSION","blendModes","NORMAL","ADD","MULTIPLY","SCREEN","OVERLAY","DARKEN","LIGHTEN","COLOR_DODGE","COLOR_BURN","HARD_LIGHT","SOFT_LIGHT","DIFFERENCE","EXCLUSION","HUE","SATURATION","COLOR","LUMINOSITY","scaleModes","DEFAULT","LINEAR","NEAREST","INTERACTION_FREQUENCY","AUTO_PREVENT_DEFAULT","RAD_TO_DEG","Math","PI","DEG_TO_RAD","Point","x","y","prototype","clone","constructor","set","Rectangle","width","height","contains","x1","y1","EmptyRectangle","Polygon","points","Array","slice","call","arguments","p","i","il","length","push","inside","j","xi","yi","xj","yj","intersect","Circle","radius","dx","dy","r2","Ellipse","normx","normy","getBounds","determineMatrixArrayType","Float32Array","Matrix2","Matrix","a","b","c","d","tx","ty","fromArray","array","toArray","transpose","identityMatrix","DisplayObject","position","scale","pivot","rotation","alpha","visible","hitArea","buttonMode","renderable","parent","stage","worldAlpha","_interactive","defaultCursor","worldTransform","color","dynamic","_sr","_cr","filterArea","_bounds","_currentBounds","_mask","_cacheAsBitmap","_cacheIsDirty","setInteractive","interactive","Object","defineProperty","get","value","dirty","item","isMask","_filters","passes","filterPasses","_filterBlock","target","_generateCachedSprite","_destroyCachedSprite","updateTransform","rotationCache","sin","cos","parentTransform","px","py","a00","a01","a10","a11","a02","a12","b00","b01","b10","b11","matrix","getLocalBounds","setStageReference","generateTexture","renderer","bounds","renderTexture","RenderTexture","render","updateCache","_renderCachedSprite","renderSession","gl","Sprite","_renderWebGL","_cachedSprite","_renderCanvas","texture","resize","tempFilters","filters","destroy","DisplayObjectContainer","children","create","addChild","child","addChildAt","index","Error","removeChild","splice","swapChildren","child2","index1","indexOf","index2","getChildAt","removeStageReference","undefined","matrixCache","childBounds","childMaxX","childMaxY","minX","Infinity","minY","maxX","maxY","childVisible","spriteBatch","stop","maskManager","pushMask","mask","start","flush","filterManager","pushFilter","popFilter","popMask","context","anchor","_width","_height","tint","blendMode","baseTexture","hasLoaded","onTextureUpdate","onTextureUpdateBind","bind","addEventListener","frame","setTexture","textureChange","cachedTint","updateFrame","w0","w1","h0","h1","x2","y2","x3","y3","x4","y4","currentBlendMode","globalCompositeOperation","blendModesCanvas","source","globalAlpha","transform","roundPixels","setTransform","smoothProperty","scaleMode","tintedTexture","CanvasTinter","getTintedTexture","drawImage","trim","fromFrame","frameId","TextureCache","fromImage","imageId","crossorigin","Texture","SpriteBatch","textureThing","ready","initWebGL","fastSpriteBatch","WebGLFastSpriteBatch","shaderManager","activateShader","fastShader","begin","defaultShader","isRotated","childTransform","FilterBlock","Text","text","style","canvas","document","createElement","getContext","fromCanvas","setText","setStyle","updateText","font","fill","align","stroke","strokeThickness","wordWrap","wordWrapWidth","toString","outputText","lines","split","lineWidths","maxLineWidth","lineWidth","measureText","max","lineHeight","determineFontHeight","navigator","isCocoonJS","clearRect","fillStyle","strokeStyle","textBaseline","linePosition","strokeText","fillText","updateTexture","requiresUpdate","updateWebGLTexture","fontStyle","result","heightCache","body","getElementsByTagName","dummy","dummyText","createTextNode","appendChild","setAttribute","offsetHeight","spaceLeft","words","wordWidth","wordWidthWithSpace","destroyTexture","BitmapText","_pool","fontName","fontSize","parseInt","fonts","size","data","pos","prevCharCode","chars","line","charCode","charCodeAt","test","charAt","charData","kerning","xOffset","yOffset","xAdvance","lineAlignOffsets","alignOffset","lenChildren","lenChars","pop","textWidth","textHeight","Stage","backgroundColor","interactionManager","InteractionManager","setBackgroundColor","setInteractionDelegate","domElement","setTargetDomElement","update","backgroundColorSplit","hex2rgb","hex","substr","backgroundColorString","getMousePosition","mouse","global","lastTime","vendors","window","requestAnimationFrame","cancelAnimationFrame","callback","currTime","Date","getTime","timeToCall","id","setTimeout","clearTimeout","requestAnimFrame","rgb2hex","rgb","Function","thisArg","bound","args","boundArgs","concat","apply","TypeError","F","proto","AjaxRequest","activexmodes","ActiveXObject","XMLHttpRequest","e","canUseNewCanvasBlendModes","fillRect","getImageData","getNextPowerOfTwo","number","EventTarget","listeners","on","type","listener","dispatchEvent","emit","event","l","removeEventListener","off","removeAllEventListeners","PolyK","Triangulate","sign","n","tgs","avl","al","i0","i1","i2","ax","ay","bx","by","cx","cy","earFound","_convex","vi","_PointInTriangle","console","log","v0x","v0y","v1x","v1y","v2x","v2y","dot00","dot01","dot02","dot11","dot12","invDenom","u","v","initDefaultShaders","CompileVertexShader","shaderSrc","_CompileShader","VERTEX_SHADER","CompileFragmentShader","FRAGMENT_SHADER","shaderType","src","join","shader","createShader","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","compileProgram","vertexSrc","fragmentSrc","fragmentShader","vertexShader","shaderProgram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","PixiShader","program","textureCount","attributes","init","defaultVertexSrc","useProgram","uSampler","getUniformLocation","projectionVector","offsetVector","dimensions","aVertexPosition","getAttribLocation","aTextureCoord","colorAttribute","key","uniforms","uniformLocation","initUniforms","uniform","_init","initSampler2D","glMatrix","glValueLength","glFunc","uniformMatrix2fv","uniformMatrix3fv","uniformMatrix4fv","activeTexture","bindTexture","TEXTURE_2D","_glTextures","textureData","magFilter","minFilter","wrapS","CLAMP_TO_EDGE","wrapT","format","LUMINANCE","RGBA","repeat","REPEAT","pixelStorei","UNPACK_FLIP_Y_WEBGL","flipY","border","texImage2D","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","TEXTURE_WRAP_T","uniform1i","syncUniforms","z","w","createWebGLTexture","deleteProgram","PixiFastShader","uMatrix","aPositionCoord","aScale","aRotation","StripShader","translationMatrix","PrimitiveShader","tintColor","attribute","WebGLGraphics","renderGraphics","graphics","projection","offset","primitiveShader","_webGL","indices","lastIndex","buffer","createBuffer","indexBuffer","webGL","clearDirty","updateGraphics","activatePrimitiveShader","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","uniform2f","uniform3fv","uniform1f","bindBuffer","ARRAY_BUFFER","vertexAttribPointer","FLOAT","ELEMENT_ARRAY_BUFFER","drawElements","TRIANGLE_STRIP","UNSIGNED_SHORT","deactivatePrimitiveShader","graphicsData","Graphics","POLY","buildPoly","buildLine","RECT","buildRectangle","CIRC","ELIP","buildCircle","glPoints","bufferData","STATIC_DRAW","glIndicies","Uint16Array","webGLData","rectData","fillColor","fillAlpha","r","g","verts","vertPos","tempPoints","totalSegs","seg","vecPos","firstPoint","lastPoint","midPointX","midPointY","unshift","p1x","p1y","p2x","p2y","p3x","p3y","perpx","perpy","perp2x","perp2y","perp3x","perp3y","a1","b1","c1","a2","b2","c2","denom","pdist","dist","indexCount","indexStart","lineColor","lineAlpha","sqrt","abs","triangles","glContexts","WebGLRenderer","view","transparent","antialias","defaultRenderer","contextLost","handleContextLost","contextRestoredLost","handleContextRestored","options","premultipliedAlpha","stencil","e2","glContextId","blendModesWebGL","SRC_ALPHA","DST_ALPHA","DST_COLOR","WebGLShaderManager","WebGLSpriteBatch","WebGLMaskManager","WebGLFilterManager","drawCount","disable","DEPTH_TEST","CULL_FACE","enable","BLEND","colorMask","__stage","removeEvents","updateTextures","_interactiveEventsAdded","setTarget","viewport","bindFramebuffer","FRAMEBUFFER","clearColor","clear","COLOR_BUFFER_BIT","renderDisplayObject","displayObject","end","frameUpdates","updateTextureFrame","texturesToDestroy","texturesToUpdate","glTexture","deleteTexture","_updateWebGLuvs","createTexture","UNPACK_PREMULTIPLY_ALPHA_WEBGL","_powerOf2","preventDefault","setContext","maskStack","maskPosition","maskData","STENCIL_TEST","stencilFunc","ALWAYS","stencilOp","KEEP","INCR","NOTEQUAL","DECR","maxAttibs","attribState","tempAttribState","setAttribs","attribs","attribId","enableVertexAttribArray","disableVertexAttribArray","currentShader","vertSize","numVerts","numIndices","vertices","lastIndexCount","drawing","currentBatchSize","currentBaseTexture","vertexBuffer","DYNAMIC_DRAW","sprite","setBlendMode","uvs","_uvs","verticies","aX","aY","x0","y0","renderTilingSprite","tilingSprite","tilingTexture","TextureUvs","tilePosition","tileScaleOffset","offsetX","offsetY","scaleX","tileScale","scaleY","bufferSubData","subarray","TRIANGLES","TEXTURE0","stride","blendModeWebGL","deleteBuffer","maxSize","renderSprite","filterStack","texturePool","initShaderBuffers","filterBlock","filter","FilterTexture","padidng","padding","frameBuffer","_glFilterTexture","vertexArray","uvBuffer","uvArray","inputTexture","outputTexture","filterPass","applyFilterPass","temp","sizeX","sizeY","currentFilter","shaders","colorBuffer","colorArray","createFramebuffer","framebuffer","framebufferTexture2D","COLOR_ATTACHMENT0","deleteFramebuffer","CanvasMaskManager","save","cacheAlpha","CanvasGraphics","renderGraphicsMask","clip","restore","roundColor","stringColor","tintCache","tintMethod","convertTintToImage","tintImage","Image","toDataURL","tintWithMultiply","tintWithOverlay","tintWithPerPixel","rgbValues","pixelData","pixels","putImageData","step","cacheStepsPerColorChannel","min","canUseMultiply","CanvasRenderer","clearBeforeRender","refresh","count","renderStripFlat","strip","beginPath","moveTo","lineTo","closePath","renderStrip","u0","u1","u2","v0","v1","v2","delta","deltaA","deltaB","deltaC","deltaD","deltaE","deltaF","CanvasBuffer","strokeRect","arc","ellipseData","h","kappa","ox","oy","xe","ye","xm","ym","bezierCurveTo","len","rect","currentPath","boundsPadding","destroyCachedSprite","lineStyle","filling","beginFill","endFill","drawRect","drawCircle","drawEllipse","canvasBuffer","translate","updateBounds","TilingSprite","refreshTexture","generateTilingTexture","needsUpdate","__tilePattern","createPattern","forcePowerOfTwo","targetWidth","targetHeight","isFrame","newTextureRequired","isTiling","BaseTextureCache","BaseTextureCacheIdGenerator","BaseTexture","complete","scope","onload","content","imageUrl","updateSourceImage","newSrc","image","crossOrigin","_pixiId","TextureCacheIdGenerator","FrameCache","noFrame","setFrame","onBaseTextureLoaded","onLoaded","destroyBase","tw","th","addTextureToCache","removeTextureFromCache","textureBuffer","renderWebGL","renderCanvas","originalWorldTransform","tempMatrix","exports","module","define","amd","Phaser","DEV_VERSION","GAMES","AUTO","CANVAS","WEBGL","HEADLESS","NONE","LEFT","RIGHT","UP","DOWN","SPRITE","BUTTON","IMAGE","GRAPHICS","TEXT","TILESPRITE","BITMAPTEXT","GROUP","RENDERTEXTURE","TILEMAP","TILEMAPLAYER","EMITTER","POLYGON","BITMAPDATA","CANVAS_FILTER","WEBGL_FILTER","ELLIPSE","SPRITEBATCH","RETROFONT","Utils","parseDimension","dimension","f","innerWidth","innerHeight","shuffle","floor","random","pad","str","dir","padlen","right","ceil","left","isPlainObject","obj","nodeType","hasOwn","extend","name","copy","copyIsArray","deep","isArray","arg","diameter","_diameter","_radius","circumference","setTo","copyFrom","copyTo","dest","distance","round","distanceRound","out","circumferencePoint","angle","asDegrees","offsetPoint","point","top","bottom","equals","intersects","degToRad","intersectsRectangle","halfWidth","xDist","halfHeight","yDist","xCornerDist","yCornerDist","xCornerDistSq","yCornerDistSq","maxCornerDistSq","invert","add","subtract","multiply","divide","clampX","clamp","clampY","output","rotate","getMagnitude","setMagnitude","magnitude","normalize","isZero","m","floorAll","inflate","containsRect","intersection","tolerance","intersectsRaw","union","empty","inflatePoint","containsRaw","rx","ry","rw","rh","containsPoint","volume","Line","fromSprite","startSprite","endSprite","useCenter","center","asSegment","intersectsPoints","pointOnLine","pointOnSegment","xMin","xMax","yMin","yMax","coordinatesOnLine","stepRate","results","sx","sy","err","atan2","pow","Camera","game","world","screenView","deadzone","atLimit","_edge","FOLLOW_LOCKON","FOLLOW_PLATFORMER","FOLLOW_TOPDOWN","FOLLOW_TOPDOWN_TIGHT","follow","helper","focusOn","setPosition","focusOnXY","updateTarget","checkBounds","setBoundsToWorld","setSize","reset","State","make","camera","cache","input","load","math","sound","time","tweens","particles","physics","rnd","preload","loadUpdate","loadRender","paused","shutdown","StateManager","pendingState","states","_pendingState","_clearWorld","_clearCache","_created","_args","current","onInitCallback","onPreloadCallback","onCreateCallback","onUpdateCallback","onRenderCallback","onPreRenderCallback","onLoadUpdateCallback","onLoadRenderCallback","onPausedCallback","onResumedCallback","onShutDownCallback","boot","onPause","pause","onResume","resume","onLoadComplete","loadComplete","state","autoStart","newState","isBooted","remove","callbackContext","onDestroyCallback","clearWorld","clearCache","checkState","preUpdate","removeAll","setCurrentState","totalQueuedFiles","valid","warn","link","getCurrentState","preRender","renderType","LinkedList","next","prev","first","last","total","callAll","entity","Signal","_bindings","_prevParams","self","dispatch","memorize","_shouldPropagate","active","validateListener","fnName","replace","_registerListener","isOnce","listenerContext","priority","binding","prevIndex","_indexOfListener","SignalBinding","_addBinding","execute","_priority","cur","_listener","has","addOnce","_destroy","getNumListeners","halt","bindings","paramsArr","forget","dispose","signal","_isOnce","_signal","params","handlerReturn","detach","isBound","getListener","getSignal","Filter","resolution","setResolution","pointer","toFixed","totalElapsedSeconds","Plugin","hasPreUpdate","hasUpdate","hasPostUpdate","hasRender","hasPostRender","postRender","PluginManager","_parent","plugins","_pluginsLength","plugin","_p","postUpdate","disableVisibilityChange","checkOffsetInterval","exists","currentRenderOrderID","_hiddenVar","_nextOffsetCheck","_backgroundColor","config","parseConfig","Canvas","now","getOffset","stlye","fullScreenScaleMode","_this","_onChange","visibilityChange","setUserSelect","setTouchAction","checkVisibility","webkitHidden","mozHidden","msHidden","hidden","onpagehide","onpageshow","onblur","onfocus","focusLoss","focusGain","gamePaused","gameResumed","Color","hexToRGB","Group","addToStage","enableBody","physicsBodyType","Physics","ARCADE","alive","cursor","cameraOffset","enableBodyDebug","_sortProperty","_cache","RETURN_NONE","RETURN_TOTAL","RETURN_CHILD","SORT_ASCENDING","SORT_DESCENDING","events","onAddedToGroup","addAt","updateZ","getAt","createMultiple","quantity","previous","swap","child1","bringToTop","getIndex","sendToBack","moveUp","moveDown","xy","reverse","oldChild","newChild","onRemovedFromGroup","setProperty","operation","checkAlive","checkVisible","setAll","setAllChildren","addAll","property","amount","subAll","multiplyAll","divideAll","callAllExists","existsValue","callbackFromArray","method","methodLength","contextLength","renderOrderID","forEach","checkExists","forEachExists","iterate","forEachAlive","forEachDead","sort","order","ascendingSortHandler","descendingSortHandler","returnType","getFirstExists","getFirstAlive","getFirstDead","getTop","getBottom","countLiving","countDead","getRandom","startIndex","removeBetween","endIndex","destroyChildren","soft","radToDeg","World","setBounds","integerInRange","ScaleManager","minWidth","maxWidth","minHeight","maxHeight","forceLandscape","forcePortrait","incorrectOrientation","pageAlignHorizontally","pageAlignVertically","maxIterations","orientationSprite","enterLandscape","enterPortrait","enterIncorrectOrientation","leaveIncorrectOrientation","hasResized","fullScreenTarget","enterFullScreen","leaveFullScreen","orientation","outerWidth","outerHeight","scaleFactor","scaleFactorInversed","margin","aspectRatio","sourceAspectRatio","NO_SCALE","_startHeight","checkOrientation","checkResize","fullScreenChange","EXACT_FIT","SHOW_ALL","startFullScreen","isFullScreen","device","fullscreen","smoothed","fullscreenKeyboard","requestFullscreen","Element","ALLOW_KEYBOARD_INPUT","stopFullScreen","cancelFullscreen","setShowAll","forceOrientation","orientationImage","checkImageKey","checkOrientationState","isLandscape","iPad","webApp","desktop","android","chrome","scrollTo","_check","_iterations","setInterval","setScreenSize","force","documentElement","setMaximum","setExactFit","clearInterval","marginLeft","marginTop","multiplier","availableWidth","availableHeight","Game","physicsConfig","isRunning","raf","net","debug","stepping","pendingStep","stepCount","onBlur","onFocus","_paused","_codePaused","RandomDataGenerator","_onBoot","readyState","seed","Device","setUpRenderer","checkFullScreenSupport","GameObjectFactory","GameObjectCreator","Cache","Loader","Time","TweenManager","Input","SoundManager","Particles","Net","Debug","showDebugHeader","RequestAnimationFrame","webAudio","trident","addToDOM","enableStep","disableStep","setMute","unsetMute","mute","hitCanvas","hitContext","moveCallback","moveCallbackContext","pollRate","disabled","multiInputOverride","MOUSE_TOUCH_COMBINE","speed","circle","maxPointers","currentPointers","tapRate","doubleTapRate","holdRate","justPressedRate","justReleasedRate","recordPointerHistory","recordRate","recordLimit","pointer1","pointer2","pointer3","pointer4","pointer5","pointer6","pointer7","pointer8","pointer9","pointer10","activePointer","mousePointer","keyboard","touch","mspointer","gamepad","onDown","onUp","onTap","onHold","interactiveItems","_localPoint","_pollCounter","_oldPosition","_x","_y","MOUSE_OVERRIDES_TOUCH","TOUCH_OVERRIDES_MOUSE","Pointer","Mouse","Keyboard","Touch","MSPointer","Gamepad","setMoveCallback","addPointer","hard","resetSpeed","startPointer","totalActivePointers","updatePointer","identifier","move","stopPointer","getPointer","getPointerFromIdentifier","getLocalPosition","wt","hitTest","localPoint","worldVisible","TileSprite","Key","keycode","isDown","isUp","altKey","ctrlKey","shiftKey","timeDown","duration","timeUp","repeats","keyCode","onHoldCallback","onHoldContext","processKeyDown","processKeyUp","justPressed","justReleased","onDownCallback","onUpCallback","_keys","_capture","_onKeyDown","_onKeyUp","addCallbacks","addKey","addKeyCapture","removeKey","removeKeyCapture","createCursorKeys","up","down","clearCaptures","A","B","C","D","E","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","ZERO","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","NUMPAD_0","NUMPAD_1","NUMPAD_2","NUMPAD_3","NUMPAD_4","NUMPAD_5","NUMPAD_6","NUMPAD_7","NUMPAD_8","NUMPAD_9","NUMPAD_MULTIPLY","NUMPAD_ADD","NUMPAD_ENTER","NUMPAD_SUBTRACT","NUMPAD_DECIMAL","NUMPAD_DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","COLON","EQUALS","UNDERSCORE","QUESTION_MARK","TILDE","OPEN_BRACKET","BACKWARD_SLASH","CLOSED_BRACKET","QUOTES","BACKSPACE","TAB","CLEAR","ENTER","SHIFT","CONTROL","ALT","CAPS_LOCK","ESC","SPACEBAR","PAGE_UP","PAGE_DOWN","END","HOME","INSERT","DELETE","HELP","NUM_LOCK","mouseDownCallback","mouseMoveCallback","mouseUpCallback","capture","button","locked","pointerLock","_onMouseDown","_onMouseMove","_onMouseUp","NO_BUTTON","LEFT_BUTTON","MIDDLE_BUTTON","RIGHT_BUTTON","onMouseDown","onMouseMove","onMouseUp","requestPointerLock","element","mozRequestPointerLock","webkitRequestPointerLock","_pointerLockChange","pointerLockChange","pointerLockElement","mozPointerLockElement","webkitPointerLockElement","releasePointerLock","exitPointerLock","mozExitPointerLock","webkitExitPointerLock","_onMSPointerDown","_onMSPointerMove","_onMSPointerUp","onPointerDown","onPointerMove","onPointerUp","pointerId","_holdSent","_history","_nextDrop","_stateReset","withinGame","clientX","clientY","pageX","pageY","screenX","screenY","isMouse","previousTapTime","totalTouches","msSinceLastClick","Number","MAX_VALUE","targetObject","positionDown","_touchedHandler","shift","fromClick","pollLocked","isDragged","_highestRenderOrderID","MAX_SAFE_INTEGER","_highestRenderObject","_highestInputPriorityID","currentNode","validForInput","checkPointerOver","checkPointerDown","priorityID","_pointerOutHandler","_pointerOverHandler","leave","_releasedHandler","touchStartCallback","touchMoveCallback","touchEndCallback","touchEnterCallback","touchLeaveCallback","touchCancelCallback","_onTouchStart","_onTouchMove","_onTouchEnd","_onTouchEnter","_onTouchLeave","_onTouchCancel","onTouchStart","onTouchMove","onTouchEnd","onTouchEnter","onTouchLeave","onTouchCancel","consumeDocumentTouches","_documentTouchMove","changedTouches","_gamepads","SinglePad","_gamepadIndexMap","_rawPads","_active","_gamepadSupportAvailable","webkitGetGamepads","webkitGamepads","userAgent","getGamepads","_prevRawGamepadTypes","_prevTimestamps","onConnectCallback","onDisconnectCallback","onAxisCallback","onFloatCallback","_ongamepadconnected","_gamepaddisconnected","callbacks","onConnect","onDisconnect","onAxis","onFloat","newPad","connect","_ongamepaddisconnected","removedPad","disconnect","_pollGamepads","_connected","pollStatus","rawGamepads","gamepadsChanged","singlePad","validConnections","rawIndices","padIndices","connected","k","rawPad","setDeadZones","deadZone","buttonCode","BUTTON_0","BUTTON_1","BUTTON_2","BUTTON_3","BUTTON_4","BUTTON_5","BUTTON_6","BUTTON_7","BUTTON_8","BUTTON_9","BUTTON_10","BUTTON_11","BUTTON_12","BUTTON_13","BUTTON_14","BUTTON_15","AXIS_0","AXIS_1","AXIS_2","AXIS_3","AXIS_4","AXIS_5","AXIS_6","AXIS_7","AXIS_8","AXIS_9","XBOX360_A","XBOX360_B","XBOX360_X","XBOX360_Y","XBOX360_LEFT_BUMPER","XBOX360_RIGHT_BUMPER","XBOX360_LEFT_TRIGGER","XBOX360_RIGHT_TRIGGER","XBOX360_BACK","XBOX360_START","XBOX360_STICK_LEFT_BUTTON","XBOX360_STICK_RIGHT_BUTTON","XBOX360_DPAD_LEFT","XBOX360_DPAD_RIGHT","XBOX360_DPAD_UP","XBOX360_DPAD_DOWN","XBOX360_STICK_LEFT_X","XBOX360_STICK_LEFT_Y","XBOX360_STICK_RIGHT_X","XBOX360_STICK_RIGHT_Y","padParent","_padParent","_index","_rawPad","_prevTimestamp","_rawButtons","_buttons","_axes","_hotkeys","addButton","GamepadButton","timestamp","buttons","buttonValue","processButtonDown","processButtonUp","processButtonFloat","axes","axis","processAxisChange","triggerCallback","disconnectingIndex","axisState","axisCode","buttoncode","InputHandler","enabled","useHandCursor","_setHandCursor","allowHorizontalDrag","allowVerticalDrag","snapOffset","snapOnDrag","snapOnRelease","snapX","snapY","snapOffsetX","snapOffsetY","pixelPerfectOver","pixelPerfectClick","pixelPerfectAlpha","draggable","boundsRect","boundsSprite","consumePointerEvent","_tempPoint","_pointerData","isOver","isOut","timeOver","timeOut","downDuration","onInputOver","onInputOut","onInputDown","onInputUp","onDragStart","onDragStop","highestID","highestRenderID","pointerX","pointerY","pointerDown","pointerUp","pointerTimeDown","pointerTimeUp","pointerOver","pointerOut","pointerTimeOver","pointerTimeOut","pointerDragged","checkPixel","_draggedPointerID","updateDrag","startDrag","stopDrag","fixedToCamera","_dragPoint","dragOffset","checkBoundsRect","checkBoundsSprite","justOver","delay","overDuration","justOut","enableDrag","lockCenter","pixelPerfect","alphaThreshold","dragFromCenter","disableDrag","centerOn","centerX","centerY","setDragLock","allowHorizontal","allowVertical","enableSnap","onDrag","onRelease","disableSnap","camerOffset","Events","onKilled","onRevived","onOutOfBounds","onEnterBounds","onAnimationStart","onAnimationComplete","onAnimationLoop","existing","object","group","tween","physicsGroup","audio","loop","tileSprite","overFrame","outFrame","downFrame","upFrame","Button","emitter","maxParticles","Arcade","Emitter","retroFont","characterWidth","characterHeight","charsPerRow","xSpacing","ySpacing","RetroFont","bitmapText","tilemap","tileWidth","tileHeight","Tilemap","addToCache","uuid","addRenderTexture","bitmapData","BitmapData","addBitmapData","Tween","ctx","imageData","textureFrame","Frame","loadTexture","refreshBuffer","Int32Array","setPixel32","red","green","blue","setPixel","getPixel","data32","getPixel32","getPixels","copyPixels","area","destX","destY","getImage","draw","alphaMask","animations","AnimationManager","_frame","_frameName","autoCull","health","lifespan","checkWorldBounds","outOfBoundsKill","elapsed","kill","isSpriteSheet","loadFrameData","getFrameData","frameName","crop","hasOwnProperty","sourceWidth","sourceHeight","local","revive","damage","_outOfBoundsFired","play","frameRate","killOnComplete","wrapAngle","P2JS","addToWorld","removeFromWorld","frameData","getFrameByName","getFrame","_scroll","physicsElapsed","autoScroll","stopScroll","safeRemove","_text","_font","_fontSize","_fontWeight","_lineSpacing","parentNode","setShadow","blur","shadowOffsetX","shadowOffsetY","shadowColor","shadowBlur","runWordWrap","parseFloat","_align","_tint","_onOverFrameName","_onOutFrameName","_onDownFrameName","_onUpFrameName","_onOverFrameID","_onOutFrameID","_onDownFrameID","_onUpFrameID","onOverSound","onOutSound","onDownSound","onUpSound","onOverSoundMarker","onOutSoundMarker","onDownSoundMarker","onUpSoundMarker","freezeFrames","forceOut","inputEnabled","setFrames","onInputOverHandler","onInputOutHandler","onInputDownHandler","onInputUpHandler","clearFrames","setSounds","overSound","overMarker","downSound","downMarker","outSound","outMarker","upSound","upMarker","setOverSound","setOutSound","setDownSound","setUpSound","marker","Sound","setState","drawPolygon","poly","_temp","renderXY","characterSpacingX","characterSpacingY","characterPerRow","multiLine","autoUpperCase","customSpacingX","customSpacingY","fixedWidth","fontSet","grabData","currentX","currentY","FrameData","addFrame","updateFrameData","stamp","ALIGN_LEFT","ALIGN_RIGHT","ALIGN_CENTER","TEXT_SET1","TEXT_SET2","TEXT_SET3","TEXT_SET4","TEXT_SET5","TEXT_SET6","TEXT_SET7","TEXT_SET8","TEXT_SET9","TEXT_SET10","TEXT_SET11","setFixedWidth","lineAlignment","characterSpacing","lineSpacing","allowLowerCase","buildRetroFontText","getLongestLine","pasteLine","longestLine","removeUnsupportedCharacters","stripCR","newString","aChar","code","newText","toUpperCase","noCocoon","display","box","getBoundingClientRect","clientTop","clientLeft","scrollTop","scrollLeft","compatMode","pageYOffset","pageXOffset","getAspectRatio","msTouchAction","overflowHidden","getElementById","overflow","translateX","translateY","skewX","skewY","setSmoothingEnabled","setImageRenderingCrisp","msInterpolationMode","setImageRenderingBicubic","iOS","cocoonJS","ejecta","chromeOS","linux","macOS","windows","windowsPhone","file","fileSystem","localStorage","worker","css3D","typedArray","vibration","getUserMedia","quirksMode","arora","epiphany","firefox","ie","ieVersion","tridentVersion","mobileSafari","midori","opera","safari","silk","audioData","ogg","opus","mp3","wav","m4a","webm","iPhone","iPhone4","pixelRatio","littleEndian","_checkAudio","_checkBrowser","_checkCSS3D","_checkDevice","_checkFeatures","_checkOS","ua","getItem","error","WebGLRenderingContext","maxTouchPoints","msPointerEnabled","pointerEnabled","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","fs","cfs","RegExp","$1","$3","audioElement","canPlayType","toLowerCase","Int8Array","Int16Array","vibrate","webkitVibrate","mozVibrate","msVibrate","has3d","el","transforms","webkitTransform","OTransform","msTransform","MozTransform","insertBefore","t","getComputedStyle","getPropertyValue","canPlayAudio","isConsoleOpen","profile","profileEnd","forceSetTimeOut","_isSetTimeOut","_onLoop","_timeOutID","updateSetTimeout","updateRAF","isSetTimeOut","isRAF","PI2","fuzzyEqual","epsilon","fuzzyLessThan","fuzzyGreaterThan","fuzzyCeil","val","fuzzyFloor","average","_i","avg","truncate","shear","snapTo","gap","snapToFloor","snapToCeil","snapToInArray","arr","low","high","POSITIVE_INFINITY","roundTo","place","base","floorTo","ceilTo","interpolateFloat","weight","angleBetween","angleBetweenPoints","point1","point2","reverseAngle","angleRad","normalizeAngle","normalizeLatitude","lat","normalizeLongitude","lng","nearestAngleBetween","radians","rd","interpolateAngles","ease","normalizeAngleToAnother","chanceRoll","chance","numberArray","maxAdd","minSub","wrap","range","wrapValue","diff","randomSign","isOdd","isEven","minProperty","maxProperty","radianFactor","angleLimit","linearInterpolation","linear","bezierInterpolation","bernstein","catmullRomInterpolation","catmullRom","p0","p1","factorial","p2","p3","t2","t3","difference","objects","removeRandom","idx","removed","sinCosGenerator","sinAmplitude","cosAmplitude","frequency","frq","cosTable","sinTable","stack","s","shuffleArray","distancePow","distanceRounded","clampBottom","within","mapLinear","smoothstep","smootherstep","degreeToRadiansFactor","degrees","radianToDegreesFactor","seeds","s0","s1","s2","sow","hash","integer","frac","real","realInRange","normal","pick","ary","weightedPick","QuadTree","maxObjects","maxLevels","level","nodes","subWidth","subHeight","populate","populateHandler","insert","retrieve","returnObjects","getHostName","location","hostname","checkDomainName","domain","updateQueryString","redirect","url","href","re","separator","getQueryString","parameter","keyValues","search","substring","decodeURI","decodeURIComponent","_tweens","_add","_pauseAll","_resumeAll","getAll","pendingDelete","_manager","numTweens","isTweening","some","_object","_pause","_resume","pauseAll","resumeAll","manager","_valuesStart","_valuesEnd","_valuesStartRepeat","_duration","_repeat","_yoyo","_reversed","_delayTime","_startTime","_easingFunction","Easing","Linear","None","_interpolationFunction","_chainedTweens","_onStartCallbackFired","_onUpdateCallback","_onUpdateCallbackContext","_pausedTime","onStart","onLoop","onComplete","to","properties","yoyo","_lastChild","chain","generateData","tick","blob","reversed","times","easing","interpolation","pauseDuration","isFinite","tmp","numChainedTweens","Quadratic","In","Out","InOut","Cubic","Quartic","Quintic","Sinusoidal","Exponential","Circular","Elastic","asin","Back","Bounce","pausedTime","advancedTiming","fps","fpsMin","fpsMax","msMin","msMax","deltaCap","frames","Timer","_started","_timeLastSecond","_pauseStarted","_justResumed","_timers","_len","autoDestroy","timer","elapsedSince","since","elapsedSecondsSince","running","expired","nextTick","_pauseTotal","_now","MINUTE","SECOND","HALF","QUARTER","repeatCount","TimerEvent","clearEvents","sortHandler","newTick","ms","currentFrame","updateIfVisible","isLoaded","_frameData","_anims","_outputFrames","useNumericIndex","getFrameIndexes","Animation","currentAnim","validateFrames","checkFrameName","isPlaying","resetFrame","getAnimation","refreshFrame","_frameIndex","isPaused","_frames","loopCount","isFinished","_pauseStartTime","_frameDiff","_frameSkip","_timeLastFrame","_timeNextFrame","restart","dispatchComplete","generateFrameNames","prefix","suffix","zeroPad","rotated","rotationDirection","trimmed","sourceSizeW","sourceSizeH","spriteSourceSizeX","spriteSourceSizeY","spriteSourceSizeW","spriteSourceSizeH","setTrim","actualWidth","actualHeight","destWidth","destHeight","getRect","_frameNames","getFrameRange","getFrames","AnimationParser","spriteSheet","frameWidth","frameHeight","frameMax","spacing","img","row","column","JSONData","json","cacheKey","newFrame","filename","sourceSize","spriteSourceSize","JSONDataHash","XMLData","xml","frameX","frameY","nodeValue","_canvases","_images","_textures","_sounds","_json","_physics","_tilemaps","_binary","_bitmapDatas","_bitmapFont","addDefaultImage","addMissingImage","onSoundUnlock","TEXTURE","SOUND","PHYSICS","BINARY","BITMAPFONT","JSON","addCanvas","addBinary","binaryData","addSpriteSheet","addTilemap","mapData","addTextureAtlas","atlasData","TEXTURE_ATLAS_JSON_ARRAY","TEXTURE_ATLAS_JSON_HASH","TEXTURE_ATLAS_XML_STARLING","addBitmapFont","xmlData","LoaderParser","bitmapFont","addPhysicsData","addText","addJSON","addImage","addSound","audioTag","decoded","isDecoding","touchLocked","reloadSound","reloadSoundComplete","updateSound","decodedSound","getCanvas","getBitmapData","getBitmapFont","getPhysicsData","getTilemapData","getFrameByIndex","getTextureFrame","getTexture","getSound","getSoundData","isSoundDecoded","isSoundReady","getText","getJSON","getBinary","getKeys","removeCanvas","removeImage","removeSound","removeText","removeJSON","removePhysics","removeTilemap","removeBinary","removeBitmapData","removeBitmapFont","_fileList","_fileIndex","_progressChunk","_xhr","isLoading","progress","progressFloat","preloadSprite","baseURL","onFileComplete","onFileError","onLoadStart","PHYSICS_LIME_CORONA","setPreloadSprite","direction","checkKeyExists","getAssetIndex","getAsset","addToFileList","entry","loaded","prop","replaceInFileList","overwrite","script","binary","spritesheet","urls","autoDecode","mapDataURL","CSV","TILED_JSON","parse","dataURL","jsonData","LIME_CORONA_JSON","textureURL","xmlURL","domparser","DOMParser","parseFromString","async","loadXML","atlasJSONArray","atlasURL","atlas","atlasJSONHash","atlasXML","removeFile","loadFile","fileComplete","onerror","fileError","getAudioURL","usingWebAudio","open","responseType","send","usingAudioTag","Audio","jsonLoadComplete","csvLoadComplete","dataLoadError","extension","lastIndexOf","nextFile","loadNext","xmlLoadComplete","response","that","decodeAudioData","onSoundDecode","responseText","language","defer","head","previousIndex","success","totalLoadedFiles","ajaxRequest","div","innerHTML","info","common","getAttribute","letters","textureRect","kernings","second","connectToMaster","_volume","markers","_buffer","_muted","autoplay","totalDuration","startTime","currentTime","stopTime","pausedPosition","currentMarker","pendingPlayback","override","externalNode","masterGainNode","masterGain","gainNode","createGain","createGainNode","gain","_sound","soundHasUnlocked","onDecoded","onPlay","onStop","onMute","onMarkerComplete","addMarker","durationMS","removeMarker","_tempMarker","_tempPosition","_tempVolume","_tempLoop","forceRestart","noteOff","createBufferSource","noteGrainOn","decode","muted","prevMarker","_muteVolume","_codeMuted","_unlockSource","noAudio","channels","fakeiOSTouchLock","unlock","disableAudio","disableWebAudio","destination","noteOn","stopAll","soundData","playbackState","PLAYING_STATE","FINISHED_STATE","columnWidth","renderShadow","currentAlpha","currentColor","soundInfo","isDecoded","cameraInfo","hideIfUp","downColor","upColor","worldX","worldY","spriteInputInfo","inputInfo","spriteBounds","filled","rectangle","spriteInfo","inCamera","spriteCoords","lineInfo","pixel","geom","forceType","quadTree","quadtree","Body","bodyInfo","renderBodyInfo","getColor32","getColor","hex16","getColorInfo","argb","getRGB","hsl","RGBtoHSV","RGBtoHexstring","hue","saturation","lightness","colorToHexstring","RGBtoWebstring","digits","lsd","msd","hexified","interpolateColor","color1","color2","steps","currentStep","src1","src2","interpolateColorWithRGB","or","og","ob","interpolateRGB","r1","g1","g2","getRandomColor","getWebRGB","getAlpha","getAlphaFloat","getRed","getGreen","getBlue","arcade","ninja","box2d","chipmunk","NINJA","BOX2D","CHIPMUNK","Ninja","P2","startSystem","system","enableAABB","gravity","checkCollision","OVERLAP_BIAS","TILE_BIAS","forceX","_overlap","_maxOverlap","_velocity1","_velocity2","_newVelocity1","_newVelocity2","_average","_mapData","_result","_total","_angle","_dx","_dy","updateMotion","_velocityDelta","computeVelocity","angularVelocity","angularAcceleration","angularDrag","maxAngular","velocity","acceleration","drag","maxVelocity","allowGravity","_drag","overlap","object1","object2","overlapCallback","processCallback","collideHandler","collide","collideCallback","overlapOnly","collideSpriteVsSprite","collideSpriteVsGroup","collideSpriteVsTilemapLayer","collideGroupVsGroup","collideGroupVsTilemapLayer","collideGroupVsSelf","sprite1","sprite2","separate","_potentials","group1","group2","tilemapLayer","getTiles","tilePadding","separateTile","body1","body2","separateX","separateY","immovable","deltaAbsX","deltaX","embedded","touching","none","overlapX","customSeparateX","bounce","mass","deltaAbsY","deltaY","overlapY","customSeparateY","moves","tile","collisionCallback","collisionCallbackContext","layer","faceLeft","faceRight","faceTop","faceBottom","tileCheckX","tileCheckY","blocked","collideRight","collideLeft","processTileSeparationX","collideDown","collideUp","processTileSeparationY","moveToObject","maxTime","distanceBetween","moveToPointer","angleToPointer","distanceToPointer","moveToXY","distanceToXY","velocityFromAngle","velocityFromRotation","accelerationFromRotation","accelerateToObject","xSpeedMax","ySpeedMax","accelerateToPointer","accelerateToXY","angleToXY","allowRotation","preRotation","newVelocity","deltaMax","facing","collideWorldBounds","any","wasTouching","_sx","_sy","asx","asy","deltaZ","onFloor","onWall","emitters","ID","minParticleSpeed","maxParticleSpeed","minParticleScale","maxParticleScale","minRotation","maxRotation","particleClass","particleDrag","_quantity","_timer","_counter","_explode","emitX","emitY","emitParticle","makeParticles","keys","particle","rndKey","rndFrame","explode","setXSpeed","setYSpeed","setRotation","at","Tile","scanned","setCollisionCallback","setCollision","resetCollision","isInteresting","collides","faces","TilemapParser","version","widthInPixels","heightInPixels","layers","tilesets","tiles","collideIndexes","collision","images","currentLayer","debugMap","_results","_tempA","_tempB","setTileSize","createBlankLayer","addTilesetImage","tileset","tileMargin","tileSpacing","gid","getTilesetIndex","setImage","newSet","Tileset","countX","countY","columns","rows","createFromObjects","CustomClass","adjustY","createLayer","getLayerIndex","TilemapLayer","indexes","bodies","getImageIndex","getObjectIndex","setTileIndexCallback","getLayer","setTileLocationCallback","setCollisionByIndex","calculateFaces","setCollisionBetween","setCollisionByExclusion","recalculate","above","below","getTileAbove","getTileBelow","getTileLeft","getTileRight","setLayer","hasTile","putTile","putTileWorldXY","getTile","getTileWorldXY","paste","tileblock","diffX","diffY","tileA","tileB","swapHandler","removeAllLayers","dump","txt","map","tileColor","debugAlpha","debugColor","debugFill","debugFillColor","debugCallbackColor","scrollFactorX","scrollFactorY","rayStepRate","_mc","cw","ch","ga","dw","dh","tl","startX","startY","prevX","prevY","updateMax","scrollX","scrollY","resizeWorld","_fixX","_unfixX","_fixY","_unfixY","getTileX","getTileY","getTileXY","getRayCastTiles","interestingFace","coords","wy","wx","lenY","_column","lenX","renderDebug","getEmptyData","parseCSV","parseTiledJSON","tilewidth","tileheight","opacity","firstgid","tileproperties","tileProperties","imageheight","imagewidth","polyline","drawCoords","setSpacing","enableCircle","enableTile","clearTilemapLayerBodies","convertTilemap","slopeMap","optimize","aabb","collideAABBVsAABB","collideAABBVsTile","collideCircleVsTile","shape","friction","gravityScale","maxSpeed","AABB","integrate","xw","yw","setZeroVelocity","oldpos","moveFrom","moveLeft","fx","moveRight","oH","oV","aabbTileProjections","TYPE_FULL","projAABB_Full","TYPE_45DEG","projAABB_45Deg","TYPE_CONCAVE","projAABB_Concave","TYPE_CONVEX","projAABB_Convex","TYPE_22DEGs","projAABB_22DegS","TYPE_22DEGb","projAABB_22DegB","TYPE_67DEGs","projAABB_67DegS","TYPE_67DEGb","projAABB_67DegB","TYPE_HALF","projAABB_Half","COL_NONE","COL_AXIS","COL_OTHER","reportCollisionVsWorld","fy","o","vx","vy","dp","nx","ny","reportCollisionVsBody","vx1","vy1","dp1","txw","tyw","resolveTile","signx","signy","lenN","lenP","penY","penX","twid","rad","pen","EMPTY","TYPE_EMPTY","setType","updateType","SLOPE_45DEGpn","SQRT2","SLOPE_45DEGnn","SLOPE_45DEGnp","SLOPE_45DEGpp","CONCAVEpn","CONCAVEnn","CONCAVEnp","CONCAVEpp","CONVEXpn","CONVEXnn","CONVEXnp","CONVEXpp","SLOPE_22DEGpnS","slen","SLOPE_22DEGnnS","SLOPE_22DEGnpS","SLOPE_22DEGppS","SLOPE_22DEGpnB","SLOPE_22DEGnnB","SLOPE_22DEGnpB","SLOPE_22DEGppB","SLOPE_67DEGpnS","SLOPE_67DEGnnS","SLOPE_67DEGnpS","SLOPE_67DEGppS","SLOPE_67DEGpnB","SLOPE_67DEGnnB","SLOPE_67DEGnpB","SLOPE_67DEGppB","HALFd","HALFu","HALFl","HALFr","FULL","circleTileProjections","projCircle_Full","projCircle_45Deg","projCircle_Concave","projCircle_Convex","projCircle_22DegS","projCircle_22DegB","projCircle_67DegS","projCircle_67DegB","projCircle_Half","resolveCircleTile","perp","trad","celldp","require",1,"mat2","mat2Identity","GLMAT_EPSILON","identity","a0","a3","det","adjoint","determinant","b0","b3","mul",2,"vec2","fromValues","sub","squaredDistance","sqrDist","squaredLength","sqrLen","negate","dot","cross","lerp","transformMat2","vec","fn",3,"Scalar","lineInt","l1","l2","precision","eq","segmentsIntersect","q1","q2","da","db","./Scalar",4,"leftOn","rightOn","tmpPoint1","tmpPoint2","collinear","thresholdAngle","ab","bc","magA","magB","acos","sqdist",5,"getIntersectionPoint","append","from","makeCCW","br","isReflex","tmpLine1","tmpLine2","canSee","targetPoly","getCutEdges","tmp1","tmp2","tmpPoly","nDiags","decomp","edges","cutEdges","polys","cutEdge","isSimple","path","quickDecomp","reflexVertices","steinerPoints","maxlevel","upperInt","lowerInt","upperDist","lowerDist","closestDist","upperIndex","lowerIndex","closestIndex","lowerPoly","upperPoly","removeCollinearPoints","num","./Line","./Point",6,7,"./Polygon",8,"description","author","keywords","main","engines","node","repository","bugs","licenses","devDependencies","jshint","nodeunit","grunt","grunt-contrib-jshint","grunt-contrib-nodeunit","grunt-contrib-concat","grunt-contrib-uglify","grunt-browserify","browserify","dependencies","underscore","poly-decomp","gl-matrix","jsonschema",9,"lowerBound","upperBound","setFromPoints","overlaps","../math/vec2","../utils/Utils",10,"Broadphase","setWorld","getCollisionPairs","boundingRadiusCheck","bodyA","bodyB","d2","boundingRadius","aabbCheck","aabbNeedsUpdate","updateAABB","canCollide","motionState","STATIC","KINEMATIC","sleepState","SLEEPING","NAIVE","SAP","../objects/Body",11,"GridBroadphase","xmin","xmax","ymin","ymax","binsizeX","binsizeY","Plane","Particle","getBinIndex","collidingBodies","Ncolliding","bins","Nbins","xmult","ymult","bi","si","xi1","yi1","xi2","yi2","bin","NbodiesInBin","bj","sj","circleCircle","circleParticle","circlePlane","../collision/Broadphase","../shapes/Circle","../shapes/Particle","../shapes/Plane",12,"NaiveBroadphase","useBoundingBoxes","check","../shapes/Shape",13,"Narrowphase","contactEquations","frictionEquations","enableFriction","slipForce","frictionCoefficient","surfaceVelocity","reuseObjects","reusableContactEquations","reusableFrictionEquations","restitution","stiffness","relaxation","frictionStiffness","frictionRelaxation","collidingBodiesLastStep","clearObject","setConvexToCapsuleShapeMiddle","convexShape","capsuleShape","pointInConvex","worldPoint","convexOffset","convexAngle","worldVertex0","pic_worldVertex0","worldVertex1","pic_worldVertex1","r0","pic_r0","pic_r1","lastCross","crossLength","ContactEquation","FrictionEquation","Shape","yAxis","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmpArray","collidedLastStep","id1","id2","ce","fe","rfe","rce","appendArray","createContactEquation","shapeA","shapeB","firstImpact","allowSleep","DYNAMIC","SLEEPY","wakeUp","createFrictionEquation","setSlipForce","relativeVelocity","createFrictionFromContact","ri","rj","ni","contactEquation","LINE","CONVEX","convexLine","ai","aj","justTest","RECTANGLE","lineRectangle","convexCapsule_tempRect","convexCapsule_tempVec","CAPSULE","convexCapsule","circlePos","result1","circleConvex","result2","convexConvex","lineCapsule","capsuleCapsule_tempVec1","capsuleCapsule_tempVec2","capsuleCapsule_tempRect1","capsuleCapsule","circlePosi","circlePosj","numContacts","lineLine","PLANE","planeLine","planeBody","planeShape","planeOffset","planeAngle","lineBody","lineShape","lineOffset","lineAngle","worldVertex01","worldVertex11","worldEdge","worldEdgeUnit","worldNormal","worldTangent","PARTICLE","particleCapsule","circleLine","CIRCLE","lineRadius","circleRadius","circleOffset","circleBody","circleShape","orthoDist","lineToCircleOrthoUnit","projectedPoint","centerDist","lineToCircle","lineEndToLineRadius","pos0","pos1","circleCapsule","convexBody","worldVertex","closestEdgeProjectedPoint","candidate","candidateDist","minCandidate","found","minCandidateDistance","candidateDistance","localVertex","particleConvex","particleOffset","particleBody","convexToparticle","minEdgeNormal","radiusA","radiusB","offsetA","offsetB","planeConvex","numReported","convexPlane","particlePlane","capsulePlane_tmpCircle","capsulePlane_tmp1","capsulePlane_tmp2","planeCapsule","end1","end2","numContacts1","numContacts2","capsulePlane","planeToCircle","contact","convexPrecision","sepAxis","worldPoint0","worldPoint1","penetrationVec","findSeparatingAxis","closestEdge1","getClosestEdge","closestEdge2","closestEdgeA","closestEdgeB","angleA","angleB","insideNumEdges","pcoa_tmp1","projectConvexOntoAxis","worldAxis","localAxis","fsa_tmp1","fsa_tmp2","fsa_tmp3","fsa_tmp4","fsa_tmp5","fsa_tmp6","offset1","angle1","offset2","angle2","maxDist","edge","span1","span2","swapped","gce_tmp1","gce_tmp2","gce_tmp3","flip","closestEdge","halfPi","maxDot","circleHeightfield_candidate","circleHeightfield_dist","circleHeightfield_v0","circleHeightfield_v1","circleHeightfield_minCandidate","circleHeightfield_worldNormal","circleHeightfield_minCandidateNormal","HEIGHTFIELD","circleHeightfield","circleAngle","hfBody","hfShape","hfPos","hfAngle","elementWidth","minCandidateNormal","idxA","idxB","minDist","../equations/ContactEquation","../equations/FrictionEquation","../shapes/Rectangle",14,"pointQuad","maxDepth","maxChildren","Node","BoundsNode","depth","stuckChildren","items","numAdded","classConstructor","TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT","findIndex","subdivide","b_w_h","b_h_h","bx_b_w_h","by_b_h_h","getChildren",15,"SAPBroadphase","axisListX","axisListY","_addBodyHandler","_removeBodyHandler","sortAxisListX","sortAxisListY","preliminaryList","bodiesX","bodiesY","axisIndex",16,"Constraint","equations","DISTANCE","GEAR","LOCK","PRISMATIC","REVOLUTE",17,"DistanceConstraint","maxForce","Equation","computeGq","setMaxForce","minForce","getMaxForce","../equations/Equation","./Constraint",18,"GearConstraint","AngleLockEquation","ratio","setRatio","../equations/AngleLockEquation",19,"LockConstraint","localOffsetB","localAngleB","rot","xAxis",20,"PrismaticConstraint","localAnchorA","localAxisA","localAnchorB","trans","gg","disableRotationalLock","RotationalLockEquation","lowerLimitEnabled","upperLimitEnabled","lowerLimit","upperLimit","upperLimitEquation","lowerLimitEquation","motorEquation","motorEnabled","motorSpeed","computeGW","vj","wi","wj","transformedGmult","worldAxisA","worldAnchorA","worldAnchorB","orientedAnchorA","orientedAnchorB","eqs","relPosition","enableMotor","disableMotor","../equations/RotationalLockEquation",21,"RevoluteConstraint","pivotA","pivotB","worldPivotA","worldPivotB","RotationalVelocityEquation","relAngle","motorIsEnabled","setMotorSpeed","getMotorSpeed","../equations/RotationalVelocityEquation",22,"./Equation",23,"computeB","rixn","rjxn","GW","Gq","GiMf","computeGiMf","../math/mat2",24,"ARRAY_TYPE","eps","updateSpookParams","Gmult","timeStep","qi","qj","computeGWlambda","vlambda","wlambda","iMfi","iMfj","fi","ti","angularForce","fj","tj","invMassi","invMass","invMassj","invIi","invInertia","invIj","computeGiMGt","addToWlambda_temp","addToWlambda_Gi","addToWlambda_Gj","addToWlambda","deltalambda","Gi","Gj","computeInvC",25,26,"worldVectorA","worldVectorB",27,28,"EventEmitter","_listeners","listenerArray",29,"ContactMaterial","materialA","materialB","Material","idCounter","./Material",30,31,"../../node_modules/gl-matrix/src/gl-matrix/mat2",32,"GetArea","sum",33,"getX","getY","crossVZ","zcomp","crossZV","toLocalFrame","framePosition","frameAngle","toGlobalFrame","centroid","../../node_modules/gl-matrix/src/gl-matrix/vec2",34,"_idCounter","shapes","shapeOffsets","shapeAngles","inertia","fixedRotation","interpolatedPosition","damping","angularDamping","AWAKE","sleepSpeedLimit","sleepTimeLimit","timeLastSleepy","concavePath","lastDampingScale","lastAngularDampingScale","lastDampingTimeStep","updateMassProperties","Convex","setDensity","density","totalArea","getArea","shapeAABB","computeAABB","updateBoundingRadius","addShape","removeShape","Icm","computeMomentOfInertia","Body_applyForce_r","applyForce","rotForce","toWorldFrame","fromPolygon","convexes","optimalDecomp","cm","centerOfMass","updateTriangles","updateCenterOfMass","adjustCenterOfMass","adjustCenterOfMass_tmp2","adjustCenterOfMass_tmp3","adjustCenterOfMass_tmp4","offset_times_area","setZeroForce","resetConstraintVelocity","addConstraintVelocity","applyDamping","dt","wakeUpEvent","sleep","sleepEvent","sleepTick","speedSquared","speedLimitSquared","sleepyEvent","../collision/AABB","../events/EventEmitter","../shapes/Convex",35,"Spring","restLength","setWorldAnchorA","setWorldAnchorB","getWorldAnchorA","getWorldAnchorB","applyForce_r","applyForce_r_unit","applyForce_u","applyForce_f","applyForce_worldAnchorA","applyForce_worldAnchorB","applyForce_ri","applyForce_rj","applyForce_tmp","r_unit","rlen","ri_x_f","rj_x_f",36,"Capsule","GSSolver","Heightfield","Island","IslandSolver","Solver","../package.json","./collision/AABB","./collision/Broadphase","./collision/GridBroadphase","./collision/NaiveBroadphase","./collision/Narrowphase","./collision/QuadTree","./collision/SAPBroadphase","./constraints/Constraint","./constraints/DistanceConstraint","./constraints/GearConstraint","./constraints/LockConstraint","./constraints/PrismaticConstraint","./constraints/RevoluteConstraint","./equations/AngleLockEquation","./equations/ContactEquation","./equations/Equation","./equations/FrictionEquation","./equations/RotationalVelocityEquation","./events/EventEmitter","./material/ContactMaterial","./material/Material","./math/vec2","./objects/Body","./objects/Spring","./shapes/Capsule","./shapes/Circle","./shapes/Convex","./shapes/Heightfield","./shapes/Line","./shapes/Particle","./shapes/Plane","./shapes/Rectangle","./shapes/Shape","./solver/GSSolver","./solver/IslandSolver","./solver/Solver","./utils/Utils","./world/World",37,"updateArea","./Shape",38,39,"polyk","polykVerts","id3","updateCenterOfMass_centroid","updateCenterOfMass_centroid_times_mass","updateCenterOfMass_a","updateCenterOfMass_b","updateCenterOfMass_c","centroid_times_mass","triangleArea","numer","../math/polyk",40,"maxValue",41,42,43,44,"./Convex",45,"collisionGroup","collisionMask","material","sensor",46,"GS","iterations","arrayStep","lambda","Bs","invCs","useGlobalEquationParameters","useZeroRHS","useNormalForceForFriction","skipFrictionIterations","setArrayZero","solve","sortEquations","iter","maxIter","skipFrictionIter","tolSquared","Neq","Nbodies","useGlobalParams","deltalambdaTot","_eps","iterateEquation","useNormal","invC","lambdaj","GWlambda","lambdaj_plus_deltalambda","./Solver",47,"getBodies","bodyIds","solver","removeAllEquations","numEquations","addEquation","islandBodies","numBodies",48,"subsolver","ISLAND","numIslands","_nodePool","_islandPool","beforeSolveIslandEvent","island","getUnvisitedNode","Nnodes","visited","visitFunc","bds","Neqs","bfs","queue","tmpArray2","tmpArray3","tmpArray4","islandPool","_workers","_workerData","_workerIslandGroups","nj","islands","../solver/Island",49,"equationSortFunction","addEquations","removeEquation",50,"howmany",51,"springs","narrowphase","doProfiling","lastStepTime","broadphase","constraints","defaultFriction","defaultRestitution","defaultMaterial","defaultContactMaterial","lastTimeStep","applySpringForces","applyGravity","solveConstraints","contactMaterials","fixedStepTime","emitImpactEvent","_constraintIdCounter","_bodyIdCounter","postStepEvent","addBodyEvent","removeBodyEvent","addSpringEvent","spring","impactEvent","postBroadphaseEvent","pairs","enableBodySleeping","beginContactEvent","endContactEvent","preSolveEvent","overlappingShapesLastState","overlappingShapesCurrentState","overlappingShapeLookup","pkg","currentVersion","performance","nowOffset","timing","navigationStart","addConstraint","addContactMaterial","contactMaterial","removeContactMaterial","getContactMaterial","cmats","removeConstraint","step_mg","xiw","xjw","timeSinceLastCalled","maxSubSteps","internalStep","internalSteps","t0","t1","Nsprings","np","mg","glen","Nresults","Nshapesi","Nshapesj","runNarrowphase","Nconstraints","integrateBody","ev","ib_fhMinv","ib_velodt","minv","velo","aiw","ajw","reducedMass","resolver","addSpring","removeSpring","addBody","removeBody","getBodyById","toJSON","v2a","jc","ss","jsonShapes","jsonShape","upgradeJSON","stringify","localAxisB","fromJSON","id2material","jb","jss","js","jm","cs","cms","hitTest_tmp1","hitTest_zero","hitTest_tmp2","pb","ps","pa","zero","NS","../../package.json","../collision/NaiveBroadphase","../collision/Narrowphase","../constraints/DistanceConstraint","../constraints/LockConstraint","../constraints/PrismaticConstraint","../constraints/RevoluteConstraint","../material/ContactMaterial","../material/Material","../objects/Spring","../shapes/Capsule","../shapes/Line","../solver/GSSolver","useElapsedTime","materials","InversePointProxy","_wallShapes","onBodyAdded","onBodyRemoved","onSpringAdded","onSpringRemoved","onConstraintAdded","onConstraintRemoved","onContactMaterialAdded","onContactMaterialRemoved","postBroadphaseCallback","impactCallback","onBeginContact","onEndContact","mpx","mpxi","pxm","pxmi","beginContactHandler","endContactHandler","_toRemove","collisionGroups","_collisionGroupID","nothingCollisionGroup","CollisionGroup","boundsCollisionGroup","everythingCollisionGroup","boundsCollidesWith","removeBodyNextStep","setImpactEvents","impactHandler","setPostBroadphaseCallback","postBroadphaseHandler","_bodyCallbacks","_bodyCallbackContext","_groupCallbacks","_groupCallbackContext","setCollisionGroup","setWorldMaterial","updateBoundsCollisionGroup","hw","hh","createDistanceConstraint","getBody","createGearConstraint","createRevoluteConstraint","createLockConstraint","createPrismaticConstraint","lockRotation","anchorA","anchorB","constraint","setMaterial","createMaterial","createContactMaterial","getSprings","getConstraints","filterStatic","physicsPosition","query","createCollisionGroup","bitmask","createSpring","worldA","worldB","localA","localB","createBody","addPolygon","createParticle","convertCollisionObjects","addRectangle","PointProxy","onImpact","collidesWith","removeNextStep","_collideWorldBounds","debugBody","setRectangleFromSprite","createBodyCallback","createGroupCallback","_groupCallbacksContext","getCollisionMask","updateCollisionMask","clearCollision","clearGroup","clearMask","setZeroRotation","setZeroDamping","rotateLeft","rotateRight","moveForward","moveBackward","thrust","resetDamping","resetMass","clearShapes","shapeChanged","addCircle","addPlane","addParticle","addLine","addCapsule","setCircle","setRectangle","addPhaserPolygon","createdFixtures","fixtureData","shapesOfFixture","addFixture","generatedShapes","categoryBits","maskBits","isSensor","polygons","loadPolygon","localData","loadData","BodyDebug","settings","defaultSettings","pixelsPerLengthUnit","debugPolygons","ppu","updateSpriteTransform","lw","vrot","_j","_ref1","randomPastelHex","drawConvex","drawPlane","drawLine","drawRectangle","colors","drawPath","lastx","lasty","diagMargin","diagSize","maxLength","xd","yd","mix","rgbToHex","componentToHex"],"mappings":";;CAiCA,WAEI,GAAIA,GAAOC,KASXC,EAAOA,KAOXA,GAAKC,eAAiB,EACtBD,EAAKE,gBAAkB,EAGvBF,EAAKG,QAAU,SAGfH,EAAKI,YACDC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EAC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GAAG28C,mBAAmB/rH,WACrF+2B,OAAOkV,QAAQqlD,GAAGy6B,mBAAmB/rH,UAAUE,YAAc62B,OAAOkV,QAAQqlD,GAAGy6B"} \ No newline at end of file +{"version":3,"file":"phaser.min.js","sources":["phaser.js"],"names":["root","this","PIXI","WEBGL_RENDERER","CANVAS_RENDERER","VERSION","blendModes","NORMAL","ADD","MULTIPLY","SCREEN","OVERLAY","DARKEN","LIGHTEN","COLOR_DODGE","COLOR_BURN","HARD_LIGHT","SOFT_LIGHT","DIFFERENCE","EXCLUSION","HUE","SATURATION","COLOR","LUMINOSITY","scaleModes","DEFAULT","LINEAR","NEAREST","INTERACTION_FREQUENCY","AUTO_PREVENT_DEFAULT","RAD_TO_DEG","Math","PI","DEG_TO_RAD","Point","x","y","prototype","clone","constructor","set","Rectangle","width","height","contains","x1","y1","EmptyRectangle","Polygon","points","Array","slice","call","arguments","p","i","il","length","push","inside","j","xi","yi","xj","yj","intersect","Circle","radius","dx","dy","r2","Ellipse","normx","normy","getBounds","determineMatrixArrayType","Float32Array","Matrix2","Matrix","a","b","c","d","tx","ty","fromArray","array","toArray","transpose","identityMatrix","DisplayObject","position","scale","pivot","rotation","alpha","visible","hitArea","buttonMode","renderable","parent","stage","worldAlpha","_interactive","defaultCursor","worldTransform","color","dynamic","_sr","_cr","filterArea","_bounds","_currentBounds","_mask","_cacheAsBitmap","_cacheIsDirty","setInteractive","interactive","Object","defineProperty","get","value","dirty","item","isMask","_filters","passes","filterPasses","_filterBlock","target","_generateCachedSprite","_destroyCachedSprite","updateTransform","rotationCache","sin","cos","parentTransform","px","py","a00","a01","a10","a11","a02","a12","b00","b01","b10","b11","matrix","getLocalBounds","setStageReference","generateTexture","renderer","bounds","renderTexture","RenderTexture","render","updateCache","_renderCachedSprite","renderSession","gl","Sprite","_renderWebGL","_cachedSprite","_renderCanvas","texture","resize","tempFilters","filters","destroy","DisplayObjectContainer","children","create","addChild","child","addChildAt","index","Error","removeChild","splice","swapChildren","child2","index1","indexOf","index2","getChildAt","removeStageReference","undefined","matrixCache","childBounds","childMaxX","childMaxY","minX","Infinity","minY","maxX","maxY","childVisible","spriteBatch","stop","maskManager","pushMask","mask","start","flush","filterManager","pushFilter","popFilter","popMask","context","anchor","_width","_height","tint","blendMode","baseTexture","hasLoaded","onTextureUpdate","onTextureUpdateBind","bind","addEventListener","frame","setTexture","textureChange","cachedTint","updateFrame","w0","w1","h0","h1","x2","y2","x3","y3","x4","y4","currentBlendMode","globalCompositeOperation","blendModesCanvas","source","globalAlpha","transform","roundPixels","setTransform","smoothProperty","scaleMode","tintedTexture","CanvasTinter","getTintedTexture","drawImage","trim","fromFrame","frameId","TextureCache","fromImage","imageId","crossorigin","Texture","SpriteBatch","textureThing","ready","initWebGL","fastSpriteBatch","WebGLFastSpriteBatch","shaderManager","activateShader","fastShader","begin","defaultShader","isRotated","childTransform","FilterBlock","Text","text","style","canvas","document","createElement","getContext","fromCanvas","setText","setStyle","updateText","font","fill","align","stroke","strokeThickness","wordWrap","wordWrapWidth","toString","outputText","lines","split","lineWidths","maxLineWidth","lineWidth","measureText","max","lineHeight","determineFontHeight","navigator","isCocoonJS","clearRect","fillStyle","strokeStyle","textBaseline","linePosition","strokeText","fillText","updateTexture","requiresUpdate","updateWebGLTexture","fontStyle","result","heightCache","body","getElementsByTagName","dummy","dummyText","createTextNode","appendChild","setAttribute","offsetHeight","spaceLeft","words","wordWidth","wordWidthWithSpace","destroyTexture","BitmapText","_pool","fontName","fontSize","parseInt","fonts","size","data","pos","prevCharCode","chars","line","charCode","charCodeAt","test","charAt","charData","kerning","xOffset","yOffset","xAdvance","lineAlignOffsets","alignOffset","lenChildren","lenChars","pop","textWidth","textHeight","Stage","backgroundColor","interactionManager","InteractionManager","setBackgroundColor","setInteractionDelegate","domElement","setTargetDomElement","update","backgroundColorSplit","hex2rgb","hex","substr","backgroundColorString","getMousePosition","mouse","global","lastTime","vendors","window","requestAnimationFrame","cancelAnimationFrame","callback","currTime","Date","getTime","timeToCall","id","setTimeout","clearTimeout","requestAnimFrame","rgb2hex","rgb","Function","thisArg","bound","args","boundArgs","concat","apply","TypeError","F","proto","AjaxRequest","activexmodes","ActiveXObject","XMLHttpRequest","e","canUseNewCanvasBlendModes","fillRect","getImageData","getNextPowerOfTwo","number","EventTarget","listeners","on","type","listener","dispatchEvent","emit","event","l","removeEventListener","off","removeAllEventListeners","PolyK","Triangulate","sign","n","tgs","avl","al","i0","i1","i2","ax","ay","bx","by","cx","cy","earFound","_convex","vi","_PointInTriangle","console","log","v0x","v0y","v1x","v1y","v2x","v2y","dot00","dot01","dot02","dot11","dot12","invDenom","u","v","initDefaultShaders","CompileVertexShader","shaderSrc","_CompileShader","VERTEX_SHADER","CompileFragmentShader","FRAGMENT_SHADER","shaderType","src","join","shader","createShader","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","getShaderInfoLog","compileProgram","vertexSrc","fragmentSrc","fragmentShader","vertexShader","shaderProgram","createProgram","attachShader","linkProgram","getProgramParameter","LINK_STATUS","PixiShader","program","textureCount","attributes","init","defaultVertexSrc","useProgram","uSampler","getUniformLocation","projectionVector","offsetVector","dimensions","aVertexPosition","getAttribLocation","aTextureCoord","colorAttribute","key","uniforms","uniformLocation","initUniforms","uniform","_init","initSampler2D","glMatrix","glValueLength","glFunc","uniformMatrix2fv","uniformMatrix3fv","uniformMatrix4fv","activeTexture","bindTexture","TEXTURE_2D","_glTextures","textureData","magFilter","minFilter","wrapS","CLAMP_TO_EDGE","wrapT","format","LUMINANCE","RGBA","repeat","REPEAT","pixelStorei","UNPACK_FLIP_Y_WEBGL","flipY","border","texImage2D","UNSIGNED_BYTE","texParameteri","TEXTURE_MAG_FILTER","TEXTURE_MIN_FILTER","TEXTURE_WRAP_S","TEXTURE_WRAP_T","uniform1i","syncUniforms","z","w","createWebGLTexture","deleteProgram","PixiFastShader","uMatrix","aPositionCoord","aScale","aRotation","StripShader","translationMatrix","PrimitiveShader","tintColor","attribute","WebGLGraphics","renderGraphics","graphics","projection","offset","primitiveShader","_webGL","indices","lastIndex","buffer","createBuffer","indexBuffer","webGL","clearDirty","updateGraphics","activatePrimitiveShader","blendFunc","ONE","ONE_MINUS_SRC_ALPHA","uniform2f","uniform3fv","uniform1f","bindBuffer","ARRAY_BUFFER","vertexAttribPointer","FLOAT","ELEMENT_ARRAY_BUFFER","drawElements","TRIANGLE_STRIP","UNSIGNED_SHORT","deactivatePrimitiveShader","graphicsData","Graphics","POLY","buildPoly","buildLine","RECT","buildRectangle","CIRC","ELIP","buildCircle","glPoints","bufferData","STATIC_DRAW","glIndicies","Uint16Array","webGLData","rectData","fillColor","fillAlpha","r","g","verts","vertPos","tempPoints","totalSegs","seg","vecPos","firstPoint","lastPoint","midPointX","midPointY","unshift","p1x","p1y","p2x","p2y","p3x","p3y","perpx","perpy","perp2x","perp2y","perp3x","perp3y","a1","b1","c1","a2","b2","c2","denom","pdist","dist","indexCount","indexStart","lineColor","lineAlpha","sqrt","abs","triangles","glContexts","WebGLRenderer","view","transparent","antialias","defaultRenderer","contextLost","handleContextLost","contextRestoredLost","handleContextRestored","options","premultipliedAlpha","stencil","e2","glContextId","blendModesWebGL","SRC_ALPHA","DST_ALPHA","DST_COLOR","WebGLShaderManager","WebGLSpriteBatch","WebGLMaskManager","WebGLFilterManager","drawCount","disable","DEPTH_TEST","CULL_FACE","enable","BLEND","colorMask","__stage","removeEvents","updateTextures","_interactiveEventsAdded","setTarget","viewport","bindFramebuffer","FRAMEBUFFER","clearColor","clear","COLOR_BUFFER_BIT","renderDisplayObject","displayObject","end","frameUpdates","updateTextureFrame","texturesToDestroy","texturesToUpdate","glTexture","deleteTexture","_updateWebGLuvs","createTexture","UNPACK_PREMULTIPLY_ALPHA_WEBGL","_powerOf2","preventDefault","setContext","maskStack","maskPosition","maskData","STENCIL_TEST","stencilFunc","ALWAYS","stencilOp","KEEP","INCR","NOTEQUAL","DECR","maxAttibs","attribState","tempAttribState","setAttribs","attribs","attribId","enableVertexAttribArray","disableVertexAttribArray","currentShader","vertSize","numVerts","numIndices","vertices","lastIndexCount","drawing","currentBatchSize","currentBaseTexture","vertexBuffer","DYNAMIC_DRAW","sprite","setBlendMode","uvs","_uvs","verticies","aX","aY","x0","y0","renderTilingSprite","tilingSprite","tilingTexture","TextureUvs","tilePosition","tileScaleOffset","offsetX","offsetY","scaleX","tileScale","scaleY","bufferSubData","subarray","TRIANGLES","TEXTURE0","stride","blendModeWebGL","deleteBuffer","maxSize","renderSprite","filterStack","texturePool","initShaderBuffers","filterBlock","filter","FilterTexture","padidng","padding","frameBuffer","_glFilterTexture","vertexArray","uvBuffer","uvArray","inputTexture","outputTexture","filterPass","applyFilterPass","temp","sizeX","sizeY","currentFilter","shaders","colorBuffer","colorArray","createFramebuffer","framebuffer","framebufferTexture2D","COLOR_ATTACHMENT0","deleteFramebuffer","CanvasMaskManager","save","cacheAlpha","CanvasGraphics","renderGraphicsMask","clip","restore","roundColor","stringColor","tintCache","tintMethod","convertTintToImage","tintImage","Image","toDataURL","tintWithMultiply","tintWithOverlay","tintWithPerPixel","rgbValues","pixelData","pixels","putImageData","step","cacheStepsPerColorChannel","min","canUseMultiply","CanvasRenderer","clearBeforeRender","refresh","count","renderStripFlat","strip","beginPath","moveTo","lineTo","closePath","renderStrip","u0","u1","u2","v0","v1","v2","delta","deltaA","deltaB","deltaC","deltaD","deltaE","deltaF","CanvasBuffer","strokeRect","arc","ellipseData","h","kappa","ox","oy","xe","ye","xm","ym","bezierCurveTo","len","rect","currentPath","boundsPadding","destroyCachedSprite","lineStyle","filling","beginFill","endFill","drawRect","drawCircle","drawEllipse","canvasBuffer","translate","updateBounds","TilingSprite","refreshTexture","generateTilingTexture","needsUpdate","__tilePattern","createPattern","forcePowerOfTwo","targetWidth","targetHeight","isFrame","newTextureRequired","isTiling","BaseTextureCache","BaseTextureCacheIdGenerator","BaseTexture","complete","scope","onload","content","imageUrl","updateSourceImage","newSrc","image","crossOrigin","_pixiId","TextureCacheIdGenerator","FrameCache","noFrame","setFrame","onBaseTextureLoaded","onLoaded","destroyBase","tw","th","addTextureToCache","removeTextureFromCache","textureBuffer","renderWebGL","renderCanvas","originalWorldTransform","tempMatrix","exports","module","define","amd","Phaser","DEV_VERSION","GAMES","AUTO","CANVAS","WEBGL","HEADLESS","NONE","LEFT","RIGHT","UP","DOWN","SPRITE","BUTTON","IMAGE","GRAPHICS","TEXT","TILESPRITE","BITMAPTEXT","GROUP","RENDERTEXTURE","TILEMAP","TILEMAPLAYER","EMITTER","POLYGON","BITMAPDATA","CANVAS_FILTER","WEBGL_FILTER","ELLIPSE","SPRITEBATCH","RETROFONT","Utils","parseDimension","dimension","f","innerWidth","innerHeight","shuffle","floor","random","pad","str","dir","padlen","right","ceil","left","isPlainObject","obj","nodeType","hasOwnProperty","extend","name","copy","copyIsArray","deep","isArray","arg","diameter","_diameter","_radius","circumference","setTo","copyFrom","copyTo","dest","distance","round","distanceRound","out","circumferencePoint","angle","asDegrees","offsetPoint","point","top","bottom","equals","intersects","degToRad","intersectsRectangle","halfWidth","xDist","halfHeight","yDist","xCornerDist","yCornerDist","xCornerDistSq","yCornerDistSq","maxCornerDistSq","invert","add","subtract","multiply","divide","clampX","clamp","clampY","output","rotate","getMagnitude","setMagnitude","magnitude","normalize","isZero","m","floorAll","inflate","containsRect","intersection","tolerance","intersectsRaw","union","empty","inflatePoint","containsRaw","rx","ry","rw","rh","containsPoint","volume","Line","fromSprite","startSprite","endSprite","useCenter","center","asSegment","intersectsPoints","pointOnLine","pointOnSegment","xMin","xMax","yMin","yMax","coordinatesOnLine","stepRate","results","sx","sy","err","atan2","pow","Camera","game","world","screenView","deadzone","atLimit","_edge","FOLLOW_LOCKON","FOLLOW_PLATFORMER","FOLLOW_TOPDOWN","FOLLOW_TOPDOWN_TIGHT","follow","helper","focusOn","setPosition","focusOnXY","updateTarget","checkBounds","setBoundsToWorld","setSize","reset","State","make","camera","cache","input","load","math","sound","time","tweens","particles","physics","rnd","preload","loadUpdate","loadRender","paused","shutdown","StateManager","pendingState","states","_pendingState","_clearWorld","_clearCache","_created","_args","current","onInitCallback","onPreloadCallback","onCreateCallback","onUpdateCallback","onRenderCallback","onPreRenderCallback","onLoadUpdateCallback","onLoadRenderCallback","onPausedCallback","onResumedCallback","onShutDownCallback","boot","onPause","pause","onResume","resume","onLoadComplete","loadComplete","state","autoStart","newState","isBooted","remove","callbackContext","onDestroyCallback","clearWorld","clearCache","checkState","preUpdate","removeAll","setCurrentState","totalQueuedFiles","valid","warn","link","getCurrentState","preRender","renderType","LinkedList","next","prev","first","last","total","callAll","entity","Signal","_bindings","_prevParams","self","dispatch","memorize","_shouldPropagate","active","validateListener","fnName","replace","_registerListener","isOnce","listenerContext","priority","binding","prevIndex","_indexOfListener","SignalBinding","_addBinding","execute","_priority","cur","_listener","has","addOnce","_destroy","getNumListeners","halt","bindings","paramsArr","forget","dispose","signal","_isOnce","_signal","params","handlerReturn","detach","isBound","getListener","getSignal","Filter","resolution","setResolution","pointer","toFixed","totalElapsedSeconds","Plugin","hasPreUpdate","hasUpdate","hasPostUpdate","hasRender","hasPostRender","postRender","PluginManager","_parent","plugins","_pluginsLength","plugin","_p","postUpdate","disableVisibilityChange","checkOffsetInterval","exists","currentRenderOrderID","_hiddenVar","_nextOffsetCheck","_backgroundColor","config","parseConfig","Canvas","now","getOffset","stlye","fullScreenScaleMode","_this","_onChange","visibilityChange","setUserSelect","setTouchAction","checkVisibility","webkitHidden","mozHidden","msHidden","hidden","onpagehide","onpageshow","onblur","onfocus","focusLoss","focusGain","gamePaused","gameResumed","Color","hexToRGB","Group","addToStage","enableBody","physicsBodyType","Physics","ARCADE","alive","cursor","cameraOffset","enableBodyDebug","_sortProperty","_cache","RETURN_NONE","RETURN_TOTAL","RETURN_CHILD","SORT_ASCENDING","SORT_DESCENDING","events","onAddedToGroup","addAt","updateZ","getAt","createMultiple","quantity","previous","swap","child1","bringToTop","getIndex","sendToBack","moveUp","moveDown","xy","reverse","oldChild","newChild","onRemovedFromGroup","setProperty","operation","checkAlive","checkVisible","setAll","setAllChildren","addAll","property","amount","subAll","multiplyAll","divideAll","callAllExists","existsValue","callbackFromArray","method","methodLength","contextLength","renderOrderID","forEach","checkExists","forEachExists","iterate","forEachAlive","forEachDead","sort","order","ascendingSortHandler","descendingSortHandler","returnType","getFirstExists","getFirstAlive","getFirstDead","getTop","getBottom","countLiving","countDead","getRandom","startIndex","removeBetween","endIndex","destroyChildren","soft","radToDeg","World","setBounds","integerInRange","ScaleManager","minWidth","maxWidth","minHeight","maxHeight","forceLandscape","forcePortrait","incorrectOrientation","pageAlignHorizontally","pageAlignVertically","maxIterations","orientationSprite","enterLandscape","enterPortrait","enterIncorrectOrientation","leaveIncorrectOrientation","hasResized","fullScreenTarget","enterFullScreen","leaveFullScreen","orientation","outerWidth","outerHeight","scaleFactor","scaleFactorInversed","margin","aspectRatio","sourceAspectRatio","NO_SCALE","_startHeight","checkOrientation","checkResize","fullScreenChange","EXACT_FIT","SHOW_ALL","startFullScreen","isFullScreen","device","fullscreen","smoothed","fullscreenKeyboard","requestFullscreen","Element","ALLOW_KEYBOARD_INPUT","stopFullScreen","cancelFullscreen","setShowAll","forceOrientation","orientationImage","checkImageKey","checkOrientationState","isLandscape","iPad","webApp","desktop","android","chrome","scrollTo","_check","_iterations","setInterval","setScreenSize","force","documentElement","setMaximum","setExactFit","clearInterval","marginLeft","marginTop","multiplier","availableWidth","availableHeight","Game","physicsConfig","isRunning","raf","net","debug","stepping","pendingStep","stepCount","onBlur","onFocus","_paused","_codePaused","RandomDataGenerator","_onBoot","readyState","seed","Device","setUpRenderer","checkFullScreenSupport","GameObjectFactory","GameObjectCreator","Cache","Loader","Time","TweenManager","Input","SoundManager","Particles","Net","Debug","showDebugHeader","RequestAnimationFrame","webAudio","trident","addToDOM","enableStep","disableStep","setMute","unsetMute","mute","hitCanvas","hitContext","moveCallback","moveCallbackContext","pollRate","disabled","multiInputOverride","MOUSE_TOUCH_COMBINE","speed","circle","maxPointers","currentPointers","tapRate","doubleTapRate","holdRate","justPressedRate","justReleasedRate","recordPointerHistory","recordRate","recordLimit","pointer1","pointer2","pointer3","pointer4","pointer5","pointer6","pointer7","pointer8","pointer9","pointer10","activePointer","mousePointer","keyboard","touch","mspointer","gamepad","onDown","onUp","onTap","onHold","interactiveItems","_localPoint","_pollCounter","_oldPosition","_x","_y","MOUSE_OVERRIDES_TOUCH","TOUCH_OVERRIDES_MOUSE","Pointer","Mouse","Keyboard","Touch","MSPointer","Gamepad","setMoveCallback","addPointer","hard","resetSpeed","startPointer","totalActivePointers","updatePointer","identifier","move","stopPointer","getPointer","getPointerFromIdentifier","getLocalPosition","wt","hitTest","localPoint","worldVisible","TileSprite","Key","keycode","isDown","isUp","altKey","ctrlKey","shiftKey","timeDown","duration","timeUp","repeats","keyCode","onHoldCallback","onHoldContext","processKeyDown","processKeyUp","justPressed","justReleased","onDownCallback","onUpCallback","_keys","_capture","_onKeyDown","_onKeyUp","_i","addCallbacks","addKey","addKeyCapture","removeKey","removeKeyCapture","createCursorKeys","up","down","clearCaptures","A","B","C","D","E","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","ZERO","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE","NUMPAD_0","NUMPAD_1","NUMPAD_2","NUMPAD_3","NUMPAD_4","NUMPAD_5","NUMPAD_6","NUMPAD_7","NUMPAD_8","NUMPAD_9","NUMPAD_MULTIPLY","NUMPAD_ADD","NUMPAD_ENTER","NUMPAD_SUBTRACT","NUMPAD_DECIMAL","NUMPAD_DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","COLON","EQUALS","UNDERSCORE","QUESTION_MARK","TILDE","OPEN_BRACKET","BACKWARD_SLASH","CLOSED_BRACKET","QUOTES","BACKSPACE","TAB","CLEAR","ENTER","SHIFT","CONTROL","ALT","CAPS_LOCK","ESC","SPACEBAR","PAGE_UP","PAGE_DOWN","END","HOME","INSERT","DELETE","HELP","NUM_LOCK","mouseDownCallback","mouseMoveCallback","mouseUpCallback","capture","button","locked","pointerLock","_onMouseDown","_onMouseMove","_onMouseUp","NO_BUTTON","LEFT_BUTTON","MIDDLE_BUTTON","RIGHT_BUTTON","onMouseDown","onMouseMove","onMouseUp","requestPointerLock","element","mozRequestPointerLock","webkitRequestPointerLock","_pointerLockChange","pointerLockChange","pointerLockElement","mozPointerLockElement","webkitPointerLockElement","releasePointerLock","exitPointerLock","mozExitPointerLock","webkitExitPointerLock","_onMSPointerDown","_onMSPointerMove","_onMSPointerUp","onPointerDown","onPointerMove","onPointerUp","pointerId","_holdSent","_history","_nextDrop","_stateReset","withinGame","clientX","clientY","pageX","pageY","screenX","screenY","isMouse","previousTapTime","totalTouches","msSinceLastClick","Number","MAX_VALUE","targetObject","positionDown","_touchedHandler","shift","fromClick","pollLocked","isDragged","_highestRenderOrderID","MAX_SAFE_INTEGER","_highestRenderObject","_highestInputPriorityID","currentNode","validForInput","checkPointerOver","checkPointerDown","priorityID","_pointerOutHandler","_pointerOverHandler","leave","_releasedHandler","touchStartCallback","touchMoveCallback","touchEndCallback","touchEnterCallback","touchLeaveCallback","touchCancelCallback","_onTouchStart","_onTouchMove","_onTouchEnd","_onTouchEnter","_onTouchLeave","_onTouchCancel","onTouchStart","onTouchMove","onTouchEnd","onTouchEnter","onTouchLeave","onTouchCancel","consumeDocumentTouches","_documentTouchMove","changedTouches","_gamepads","SinglePad","_gamepadIndexMap","_rawPads","_active","_gamepadSupportAvailable","webkitGetGamepads","webkitGamepads","userAgent","getGamepads","_prevRawGamepadTypes","_prevTimestamps","onConnectCallback","onDisconnectCallback","onAxisCallback","onFloatCallback","_ongamepadconnected","_gamepaddisconnected","callbacks","onConnect","onDisconnect","onAxis","onFloat","newPad","connect","_ongamepaddisconnected","removedPad","disconnect","_pollGamepads","_connected","pollStatus","rawGamepads","gamepadsChanged","singlePad","validConnections","rawIndices","padIndices","connected","k","rawPad","setDeadZones","deadZone","buttonCode","BUTTON_0","BUTTON_1","BUTTON_2","BUTTON_3","BUTTON_4","BUTTON_5","BUTTON_6","BUTTON_7","BUTTON_8","BUTTON_9","BUTTON_10","BUTTON_11","BUTTON_12","BUTTON_13","BUTTON_14","BUTTON_15","AXIS_0","AXIS_1","AXIS_2","AXIS_3","AXIS_4","AXIS_5","AXIS_6","AXIS_7","AXIS_8","AXIS_9","XBOX360_A","XBOX360_B","XBOX360_X","XBOX360_Y","XBOX360_LEFT_BUMPER","XBOX360_RIGHT_BUMPER","XBOX360_LEFT_TRIGGER","XBOX360_RIGHT_TRIGGER","XBOX360_BACK","XBOX360_START","XBOX360_STICK_LEFT_BUTTON","XBOX360_STICK_RIGHT_BUTTON","XBOX360_DPAD_LEFT","XBOX360_DPAD_RIGHT","XBOX360_DPAD_UP","XBOX360_DPAD_DOWN","XBOX360_STICK_LEFT_X","XBOX360_STICK_LEFT_Y","XBOX360_STICK_RIGHT_X","XBOX360_STICK_RIGHT_Y","padParent","_padParent","_index","_rawPad","_prevTimestamp","_rawButtons","_buttons","_axes","_hotkeys","addButton","GamepadButton","timestamp","buttons","buttonValue","processButtonDown","processButtonUp","processButtonFloat","axes","axis","processAxisChange","triggerCallback","disconnectingIndex","axisState","axisCode","buttoncode","InputHandler","enabled","useHandCursor","_setHandCursor","allowHorizontalDrag","allowVerticalDrag","snapOffset","snapOnDrag","snapOnRelease","snapX","snapY","snapOffsetX","snapOffsetY","pixelPerfectOver","pixelPerfectClick","pixelPerfectAlpha","draggable","boundsRect","boundsSprite","consumePointerEvent","_tempPoint","_pointerData","isOver","isOut","timeOver","timeOut","downDuration","onInputOver","onInputOut","onInputDown","onInputUp","onDragStart","onDragStop","highestID","highestRenderID","pointerX","pointerY","pointerDown","pointerUp","pointerTimeDown","pointerTimeUp","pointerOver","pointerOut","pointerTimeOver","pointerTimeOut","pointerDragged","checkPixel","_draggedPointerID","updateDrag","startDrag","stopDrag","fixedToCamera","_dragPoint","dragOffset","checkBoundsRect","checkBoundsSprite","justOver","delay","overDuration","justOut","enableDrag","lockCenter","pixelPerfect","alphaThreshold","dragFromCenter","disableDrag","centerOn","centerX","centerY","setDragLock","allowHorizontal","allowVertical","enableSnap","onDrag","onRelease","disableSnap","camerOffset","Events","onKilled","onRevived","onOutOfBounds","onEnterBounds","onAnimationStart","onAnimationComplete","onAnimationLoop","existing","object","group","tween","physicsGroup","audio","loop","tileSprite","overFrame","outFrame","downFrame","upFrame","Button","emitter","maxParticles","Arcade","Emitter","retroFont","characterWidth","characterHeight","charsPerRow","xSpacing","ySpacing","RetroFont","bitmapText","tilemap","tileWidth","tileHeight","Tilemap","addToCache","uuid","addRenderTexture","bitmapData","BitmapData","addBitmapData","Tween","ctx","imageData","textureFrame","Frame","loadTexture","refreshBuffer","Int32Array","setPixel32","red","green","blue","setPixel","getPixel","data32","getPixel32","getPixels","copyPixels","area","destX","destY","getImage","draw","alphaMask","animations","AnimationManager","_frame","_frameName","autoCull","health","lifespan","checkWorldBounds","outOfBoundsKill","elapsed","kill","isSpriteSheet","loadFrameData","getFrameData","frameName","crop","sourceWidth","sourceHeight","local","revive","damage","_outOfBoundsFired","play","frameRate","killOnComplete","overlap","wrapAngle","P2JS","addToWorld","removeFromWorld","phase","_reset","frameData","getFrameByName","getFrame","_scroll","physicsElapsed","autoScroll","stopScroll","safeRemove","_text","_font","_fontSize","_fontWeight","_lineSpacing","parentNode","setShadow","blur","shadowOffsetX","shadowOffsetY","shadowColor","shadowBlur","runWordWrap","parseFloat","_align","_tint","_onOverFrameName","_onOutFrameName","_onDownFrameName","_onUpFrameName","_onOverFrameID","_onOutFrameID","_onDownFrameID","_onUpFrameID","onOverSound","onOutSound","onDownSound","onUpSound","onOverSoundMarker","onOutSoundMarker","onDownSoundMarker","onUpSoundMarker","freezeFrames","forceOut","inputEnabled","setFrames","onInputOverHandler","onInputOutHandler","onInputDownHandler","onInputUpHandler","clearFrames","setSounds","overSound","overMarker","downSound","downMarker","outSound","outMarker","upSound","upMarker","setOverSound","setOutSound","setDownSound","setUpSound","marker","Sound","setState","drawPolygon","poly","_temp","renderXY","characterSpacingX","characterSpacingY","characterPerRow","multiLine","autoUpperCase","customSpacingX","customSpacingY","fixedWidth","fontSet","grabData","currentX","currentY","FrameData","addFrame","updateFrameData","stamp","ALIGN_LEFT","ALIGN_RIGHT","ALIGN_CENTER","TEXT_SET1","TEXT_SET2","TEXT_SET3","TEXT_SET4","TEXT_SET5","TEXT_SET6","TEXT_SET7","TEXT_SET8","TEXT_SET9","TEXT_SET10","TEXT_SET11","setFixedWidth","lineAlignment","characterSpacing","lineSpacing","allowLowerCase","buildRetroFontText","getLongestLine","pasteLine","longestLine","removeUnsupportedCharacters","stripCR","newString","aChar","code","newText","toUpperCase","noCocoon","display","box","getBoundingClientRect","clientTop","clientLeft","scrollTop","scrollLeft","compatMode","pageYOffset","pageXOffset","getAspectRatio","msTouchAction","overflowHidden","getElementById","overflow","translateX","translateY","skewX","skewY","setSmoothingEnabled","setImageRenderingCrisp","msInterpolationMode","setImageRenderingBicubic","iOS","cocoonJS","ejecta","chromeOS","linux","macOS","windows","windowsPhone","file","fileSystem","localStorage","worker","css3D","typedArray","vibration","getUserMedia","quirksMode","arora","epiphany","firefox","ie","ieVersion","tridentVersion","mobileSafari","midori","opera","safari","silk","audioData","ogg","opus","mp3","wav","m4a","webm","iPhone","iPhone4","pixelRatio","littleEndian","_checkAudio","_checkBrowser","_checkCSS3D","_checkDevice","_checkFeatures","_checkOS","ua","getItem","error","WebGLRenderingContext","maxTouchPoints","msPointerEnabled","pointerEnabled","webkitGetUserMedia","mozGetUserMedia","msGetUserMedia","fs","cfs","RegExp","$1","$3","audioElement","canPlayType","toLowerCase","Int8Array","Int16Array","vibrate","webkitVibrate","mozVibrate","msVibrate","has3d","el","transforms","webkitTransform","OTransform","msTransform","MozTransform","insertBefore","t","getComputedStyle","getPropertyValue","canPlayAudio","isConsoleOpen","profile","profileEnd","forceSetTimeOut","_isSetTimeOut","_onLoop","_timeOutID","updateSetTimeout","updateRAF","isSetTimeOut","isRAF","PI2","fuzzyEqual","epsilon","fuzzyLessThan","fuzzyGreaterThan","fuzzyCeil","val","fuzzyFloor","average","avg","truncate","shear","snapTo","gap","snapToFloor","snapToCeil","snapToInArray","arr","low","high","POSITIVE_INFINITY","roundTo","place","base","floorTo","ceilTo","interpolateFloat","weight","angleBetween","angleBetweenPoints","point1","point2","reverseAngle","angleRad","normalizeAngle","normalizeLatitude","lat","normalizeLongitude","lng","nearestAngleBetween","radians","rd","interpolateAngles","ease","normalizeAngleToAnother","chanceRoll","chance","numberArray","maxAdd","minSub","wrap","range","wrapValue","diff","randomSign","isOdd","isEven","minProperty","maxProperty","radianFactor","angleLimit","linearInterpolation","linear","bezierInterpolation","bernstein","catmullRomInterpolation","catmullRom","p0","p1","factorial","p2","p3","t2","t3","difference","objects","removeRandom","idx","removed","sinCosGenerator","sinAmplitude","cosAmplitude","frequency","frq","cosTable","sinTable","stack","s","shuffleArray","distancePow","distanceRounded","clampBottom","within","mapLinear","smoothstep","smootherstep","degreeToRadiansFactor","degrees","radianToDegreesFactor","seeds","s0","s1","s2","sow","hash","integer","frac","real","realInRange","normal","pick","ary","weightedPick","QuadTree","maxObjects","maxLevels","level","nodes","subWidth","subHeight","populate","populateHandler","insert","retrieve","returnObjects","getHostName","location","hostname","checkDomainName","domain","updateQueryString","redirect","url","href","re","separator","getQueryString","parameter","keyValues","search","substring","decodeURI","decodeURIComponent","_tweens","_add","_pauseAll","_resumeAll","getAll","pendingDelete","_manager","numTweens","isTweening","some","_object","_pause","_resume","pauseAll","resumeAll","manager","_valuesStart","_valuesEnd","_valuesStartRepeat","_duration","_repeat","_yoyo","_reversed","_delayTime","_startTime","_easingFunction","Easing","Linear","None","_interpolationFunction","_chainedTweens","_onStartCallbackFired","_onUpdateCallback","_onUpdateCallbackContext","_pausedTime","onStart","onLoop","onComplete","to","properties","yoyo","_lastChild","chain","generateData","tick","blob","reversed","times","easing","interpolation","pauseDuration","isFinite","tmp","numChainedTweens","Quadratic","In","Out","InOut","Cubic","Quartic","Quintic","Sinusoidal","Exponential","Circular","Elastic","asin","Back","Bounce","pausedTime","advancedTiming","fps","fpsMin","fpsMax","msMin","msMax","deltaCap","frames","Timer","_started","_timeLastSecond","_pauseStarted","_justResumed","_timers","_len","autoDestroy","timer","elapsedSince","since","elapsedSecondsSince","running","expired","nextTick","_pauseTotal","_now","MINUTE","SECOND","HALF","QUARTER","repeatCount","TimerEvent","clearEvents","sortHandler","newTick","ms","currentFrame","updateIfVisible","isLoaded","_frameData","_anims","_outputFrames","useNumericIndex","getFrameIndexes","Animation","currentAnim","validateFrames","checkFrameName","isPlaying","resetFrame","getAnimation","refreshFrame","_frameIndex","isPaused","_frames","loopCount","isFinished","_pauseStartTime","_frameDiff","_frameSkip","_timeLastFrame","_timeNextFrame","restart","dispatchComplete","generateFrameNames","prefix","suffix","zeroPad","rotated","rotationDirection","trimmed","sourceSizeW","sourceSizeH","spriteSourceSizeX","spriteSourceSizeY","spriteSourceSizeW","spriteSourceSizeH","setTrim","actualWidth","actualHeight","destWidth","destHeight","getRect","_frameNames","getFrameRange","getFrames","AnimationParser","spriteSheet","frameWidth","frameHeight","frameMax","spacing","img","row","column","JSONData","json","cacheKey","newFrame","filename","sourceSize","spriteSourceSize","JSONDataHash","XMLData","xml","frameX","frameY","nodeValue","_canvases","_images","_textures","_sounds","_json","_physics","_tilemaps","_binary","_bitmapDatas","_bitmapFont","addDefaultImage","addMissingImage","onSoundUnlock","TEXTURE","SOUND","PHYSICS","BINARY","BITMAPFONT","JSON","addCanvas","addBinary","binaryData","addSpriteSheet","addTilemap","mapData","addTextureAtlas","atlasData","TEXTURE_ATLAS_JSON_ARRAY","TEXTURE_ATLAS_JSON_HASH","TEXTURE_ATLAS_XML_STARLING","addBitmapFont","xmlData","LoaderParser","bitmapFont","addPhysicsData","addText","addJSON","addImage","addSound","audioTag","decoded","isDecoding","touchLocked","reloadSound","reloadSoundComplete","updateSound","decodedSound","getCanvas","getBitmapData","getBitmapFont","getPhysicsData","getTilemapData","getFrameByIndex","getTextureFrame","getTexture","getSound","getSoundData","isSoundDecoded","isSoundReady","getText","getJSON","getBinary","getKeys","removeCanvas","removeImage","removeSound","removeText","removeJSON","removePhysics","removeTilemap","removeBinary","removeBitmapData","removeBitmapFont","_fileList","_fileIndex","_progressChunk","_xhr","isLoading","progress","progressFloat","preloadSprite","baseURL","onFileComplete","onFileError","onLoadStart","PHYSICS_LIME_CORONA","setPreloadSprite","direction","checkKeyExists","getAssetIndex","getAsset","addToFileList","entry","loaded","prop","replaceInFileList","overwrite","script","binary","spritesheet","urls","autoDecode","mapDataURL","CSV","TILED_JSON","parse","dataURL","jsonData","LIME_CORONA_JSON","textureURL","xmlURL","domparser","DOMParser","parseFromString","async","loadXML","atlasJSONArray","atlasURL","atlas","atlasJSONHash","atlasXML","removeFile","loadFile","fileComplete","onerror","fileError","getAudioURL","usingWebAudio","open","responseType","send","usingAudioTag","Audio","jsonLoadComplete","csvLoadComplete","dataLoadError","extension","lastIndexOf","nextFile","loadNext","xmlLoadComplete","response","that","decodeAudioData","onSoundDecode","responseText","language","defer","head","previousIndex","success","totalLoadedFiles","ajaxRequest","div","innerHTML","info","common","getAttribute","letters","textureRect","kernings","second","connectToMaster","_volume","markers","_buffer","_muted","autoplay","totalDuration","startTime","currentTime","stopTime","pausedPosition","currentMarker","pendingPlayback","override","externalNode","masterGainNode","masterGain","gainNode","createGain","createGainNode","gain","_sound","soundHasUnlocked","onDecoded","onPlay","onStop","onMute","onMarkerComplete","addMarker","durationMS","removeMarker","_tempMarker","_tempPosition","_tempVolume","_tempLoop","forceRestart","noteOff","createBufferSource","noteGrainOn","decode","muted","prevMarker","_muteVolume","_codeMuted","_unlockSource","noAudio","channels","fakeiOSTouchLock","unlock","disableAudio","disableWebAudio","destination","noteOn","stopAll","soundData","playbackState","PLAYING_STATE","FINISHED_STATE","columnWidth","renderShadow","currentAlpha","currentColor","soundInfo","isDecoded","cameraInfo","hideIfUp","downColor","upColor","worldX","worldY","spriteInputInfo","inputInfo","spriteBounds","filled","rectangle","spriteInfo","inCamera","spriteCoords","lineInfo","pixel","geom","forceType","quadTree","quadtree","Body","bodyInfo","renderBodyInfo","getColor32","getColor","hex16","getColorInfo","argb","getRGB","hsl","RGBtoHSV","RGBtoHexstring","hue","saturation","lightness","colorToHexstring","RGBtoWebstring","digits","lsd","msd","hexified","interpolateColor","color1","color2","steps","currentStep","src1","src2","interpolateColorWithRGB","or","og","ob","interpolateRGB","r1","g1","g2","getRandomColor","getWebRGB","getAlpha","getAlphaFloat","getRed","getGreen","getBlue","arcade","ninja","box2d","chipmunk","NINJA","BOX2D","CHIPMUNK","Ninja","P2","startSystem","system","enableAABB","gravity","checkCollision","OVERLAP_BIAS","TILE_BIAS","forceX","_overlap","_maxOverlap","_velocity1","_velocity2","_newVelocity1","_newVelocity2","_average","_mapData","_result","_total","_angle","_dx","_dy","updateMotion","_velocityDelta","computeVelocity","angularVelocity","angularAcceleration","angularDrag","maxAngular","velocity","acceleration","drag","maxVelocity","allowGravity","_drag","object1","object2","overlapCallback","processCallback","collideHandler","collide","collideCallback","overlapOnly","collideSpriteVsSprite","collideSpriteVsGroup","collideSpriteVsTilemapLayer","collideGroupVsGroup","collideGroupVsTilemapLayer","collideGroupVsSelf","sprite1","sprite2","separate","_potentials","group1","group2","tilemapLayer","getTiles","tilePadding","separateTile","body1","body2","separateX","separateY","immovable","deltaAbsX","deltaX","embedded","touching","none","overlapX","customSeparateX","bounce","mass","deltaAbsY","deltaY","overlapY","customSeparateY","moves","tile","collisionCallback","collisionCallbackContext","layer","faceLeft","faceRight","faceTop","faceBottom","tileCheckX","tileCheckY","blocked","collideRight","collideLeft","processTileSeparationX","collideDown","collideUp","processTileSeparationY","moveToObject","maxTime","distanceBetween","moveToPointer","angleToPointer","distanceToPointer","moveToXY","distanceToXY","velocityFromAngle","velocityFromRotation","accelerationFromRotation","accelerateToObject","xSpeedMax","ySpeedMax","accelerateToPointer","accelerateToXY","angleToXY","allowRotation","preRotation","newVelocity","deltaMax","facing","collideWorldBounds","any","wasTouching","_sx","_sy","asx","asy","deltaZ","onFloor","onWall","emitters","ID","minParticleSpeed","maxParticleSpeed","minParticleScale","maxParticleScale","minRotation","maxRotation","particleClass","particleDrag","_quantity","_timer","_counter","_explode","emitX","emitY","emitParticle","makeParticles","keys","particle","rndKey","rndFrame","explode","setXSpeed","setYSpeed","setRotation","at","Tile","scanned","setCollisionCallback","setCollision","resetCollision","isInteresting","collides","faces","TilemapParser","version","widthInPixels","heightInPixels","layers","tilesets","tiles","collideIndexes","collision","images","currentLayer","debugMap","_results","_tempA","_tempB","setTileSize","createBlankLayer","addTilesetImage","tileset","tileMargin","tileSpacing","gid","getTilesetIndex","setImage","newSet","Tileset","countX","countY","columns","rows","createFromObjects","CustomClass","adjustY","createLayer","getLayerIndex","TilemapLayer","indexes","bodies","getImageIndex","getObjectIndex","setTileIndexCallback","getLayer","setTileLocationCallback","setCollisionByIndex","calculateFaces","setCollisionBetween","setCollisionByExclusion","recalculate","above","below","getTileAbove","getTileBelow","getTileLeft","getTileRight","setLayer","hasTile","putTile","putTileWorldXY","getTile","getTileWorldXY","paste","tileblock","diffX","diffY","tileA","tileB","swapHandler","removeAllLayers","dump","txt","map","tileColor","debugAlpha","debugColor","debugFill","debugFillColor","debugCallbackColor","scrollFactorX","scrollFactorY","rayStepRate","_mc","cw","ch","ga","dw","dh","tl","startX","startY","prevX","prevY","updateMax","scrollX","scrollY","resizeWorld","_fixX","_unfixX","_fixY","_unfixY","getTileX","getTileY","getTileXY","getRayCastTiles","interestingFace","coords","wy","wx","lenY","_column","lenX","renderDebug","getEmptyData","parseCSV","parseTiledJSON","tilewidth","tileheight","opacity","firstgid","tileproperties","tileProperties","imageheight","imagewidth","polyline","drawCoords","setSpacing","enableCircle","enableTile","clearTilemapLayerBodies","convertTilemap","slopeMap","aabb","collideAABBVsAABB","collideAABBVsTile","collideCircleVsTile","shape","friction","gravityScale","maxSpeed","AABB","integrate","xw","yw","setZeroVelocity","oldpos","moveFrom","moveLeft","fx","moveRight","oH","oV","aabbTileProjections","TYPE_FULL","projAABB_Full","TYPE_45DEG","projAABB_45Deg","TYPE_CONCAVE","projAABB_Concave","TYPE_CONVEX","projAABB_Convex","TYPE_22DEGs","projAABB_22DegS","TYPE_22DEGb","projAABB_22DegB","TYPE_67DEGs","projAABB_67DegS","TYPE_67DEGb","projAABB_67DegB","TYPE_HALF","projAABB_Half","COL_NONE","COL_AXIS","COL_OTHER","reportCollisionVsWorld","fy","o","vx","vy","dp","nx","ny","reportCollisionVsBody","vx1","vy1","dp1","txw","tyw","resolveTile","signx","signy","lenN","lenP","penY","penX","twid","rad","pen","EMPTY","TYPE_EMPTY","setType","updateType","SLOPE_45DEGpn","SQRT2","SLOPE_45DEGnn","SLOPE_45DEGnp","SLOPE_45DEGpp","CONCAVEpn","CONCAVEnn","CONCAVEnp","CONCAVEpp","CONVEXpn","CONVEXnn","CONVEXnp","CONVEXpp","SLOPE_22DEGpnS","slen","SLOPE_22DEGnnS","SLOPE_22DEGnpS","SLOPE_22DEGppS","SLOPE_22DEGpnB","SLOPE_22DEGnnB","SLOPE_22DEGnpB","SLOPE_22DEGppB","SLOPE_67DEGpnS","SLOPE_67DEGnnS","SLOPE_67DEGnpS","SLOPE_67DEGppS","SLOPE_67DEGpnB","SLOPE_67DEGnnB","SLOPE_67DEGnpB","SLOPE_67DEGppB","HALFd","HALFu","HALFl","HALFr","FULL","circleTileProjections","projCircle_Full","projCircle_45Deg","projCircle_Concave","projCircle_Convex","projCircle_22DegS","projCircle_22DegB","projCircle_67DegS","projCircle_67DegB","projCircle_Half","resolveCircleTile","perp","trad","celldp","require",1,"mat2","mat2Identity","GLMAT_EPSILON","identity","a0","a3","det","adjoint","determinant","b0","b3","mul",2,"vec2","fromValues","sub","squaredDistance","sqrDist","squaredLength","sqrLen","negate","dot","cross","lerp","transformMat2","vec","fn",3,"Scalar","lineInt","l1","l2","precision","eq","segmentsIntersect","q1","q2","da","db","./Scalar",4,"leftOn","rightOn","tmpPoint1","tmpPoint2","collinear","thresholdAngle","ab","bc","magA","magB","acos","sqdist",5,"getIntersectionPoint","append","from","makeCCW","br","isReflex","tmpLine1","tmpLine2","canSee","targetPoly","getCutEdges","tmp1","tmp2","tmpPoly","nDiags","decomp","edges","cutEdges","polys","cutEdge","isSimple","path","quickDecomp","reflexVertices","steinerPoints","maxlevel","upperInt","lowerInt","upperDist","lowerDist","closestDist","upperIndex","lowerIndex","closestIndex","lowerPoly","upperPoly","removeCollinearPoints","num","./Line","./Point",6,7,"./Polygon",8,"description","author","keywords","main","engines","node","repository","bugs","licenses","devDependencies","jshint","nodeunit","grunt","grunt-contrib-jshint","grunt-contrib-nodeunit","grunt-contrib-concat","grunt-contrib-uglify","grunt-browserify","browserify","dependencies","underscore","poly-decomp","gl-matrix","jsonschema",9,"lowerBound","upperBound","setFromPoints","overlaps","../math/vec2","../utils/Utils",10,"Broadphase","setWorld","getCollisionPairs","boundingRadiusCheck","bodyA","bodyB","d2","boundingRadius","aabbCheck","aabbNeedsUpdate","updateAABB","canCollide","motionState","STATIC","KINEMATIC","sleepState","SLEEPING","NAIVE","SAP","../objects/Body",11,"GridBroadphase","xmin","xmax","ymin","ymax","binsizeX","binsizeY","Plane","Particle","getBinIndex","collidingBodies","Ncolliding","bins","Nbins","xmult","ymult","bi","si","xi1","yi1","xi2","yi2","bin","NbodiesInBin","bj","sj","circleCircle","circleParticle","circlePlane","../collision/Broadphase","../shapes/Circle","../shapes/Particle","../shapes/Plane",12,"NaiveBroadphase","useBoundingBoxes","check","../shapes/Shape",13,"Narrowphase","contactEquations","frictionEquations","enableFriction","slipForce","frictionCoefficient","surfaceVelocity","reuseObjects","reusableContactEquations","reusableFrictionEquations","restitution","stiffness","relaxation","frictionStiffness","frictionRelaxation","collidingBodiesLastStep","clearObject","setConvexToCapsuleShapeMiddle","convexShape","capsuleShape","pointInConvex","worldPoint","convexOffset","convexAngle","worldVertex0","pic_worldVertex0","worldVertex1","pic_worldVertex1","r0","pic_r0","pic_r1","lastCross","crossLength","ContactEquation","FrictionEquation","Shape","yAxis","tmp3","tmp4","tmp5","tmp6","tmp7","tmp8","tmp9","tmp10","tmp11","tmp12","tmp13","tmp14","tmp15","tmp16","tmp17","tmp18","tmpArray","collidedLastStep","id1","id2","ce","fe","rfe","rce","appendArray","createContactEquation","shapeA","shapeB","firstImpact","allowSleep","DYNAMIC","SLEEPY","wakeUp","createFrictionEquation","setSlipForce","relativeVelocity","createFrictionFromContact","ri","rj","ni","contactEquation","LINE","CONVEX","convexLine","ai","aj","justTest","RECTANGLE","lineRectangle","convexCapsule_tempRect","convexCapsule_tempVec","CAPSULE","convexCapsule","circlePos","result1","circleConvex","result2","convexConvex","lineCapsule","capsuleCapsule_tempVec1","capsuleCapsule_tempVec2","capsuleCapsule_tempRect1","capsuleCapsule","circlePosi","circlePosj","numContacts","lineLine","PLANE","planeLine","planeBody","planeShape","planeOffset","planeAngle","lineBody","lineShape","lineOffset","lineAngle","worldVertex01","worldVertex11","worldEdge","worldEdgeUnit","worldNormal","worldTangent","PARTICLE","particleCapsule","circleLine","CIRCLE","lineRadius","circleRadius","circleOffset","circleBody","circleShape","orthoDist","lineToCircleOrthoUnit","projectedPoint","centerDist","lineToCircle","lineEndToLineRadius","pos0","pos1","circleCapsule","convexBody","worldVertex","closestEdgeProjectedPoint","candidate","candidateDist","minCandidate","found","minCandidateDistance","candidateDistance","localVertex","particleConvex","particleOffset","particleBody","convexToparticle","minEdgeNormal","radiusA","radiusB","offsetA","offsetB","planeConvex","numReported","convexPlane","particlePlane","capsulePlane_tmpCircle","capsulePlane_tmp1","capsulePlane_tmp2","planeCapsule","end1","end2","numContacts1","numContacts2","capsulePlane","planeToCircle","contact","convexPrecision","sepAxis","worldPoint0","worldPoint1","penetrationVec","findSeparatingAxis","closestEdge1","getClosestEdge","closestEdge2","closestEdgeA","closestEdgeB","angleA","angleB","insideNumEdges","pcoa_tmp1","projectConvexOntoAxis","worldAxis","localAxis","fsa_tmp1","fsa_tmp2","fsa_tmp3","fsa_tmp4","fsa_tmp5","fsa_tmp6","offset1","angle1","offset2","angle2","maxDist","edge","span1","span2","swapped","gce_tmp1","gce_tmp2","gce_tmp3","flip","closestEdge","halfPi","maxDot","circleHeightfield_candidate","circleHeightfield_dist","circleHeightfield_v0","circleHeightfield_v1","circleHeightfield_minCandidate","circleHeightfield_worldNormal","circleHeightfield_minCandidateNormal","HEIGHTFIELD","circleHeightfield","circleAngle","hfBody","hfShape","hfPos","hfAngle","elementWidth","minCandidateNormal","idxA","idxB","minDist","../equations/ContactEquation","../equations/FrictionEquation","../shapes/Rectangle",14,"pointQuad","maxDepth","maxChildren","Node","BoundsNode","depth","stuckChildren","items","numAdded","classConstructor","TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT","findIndex","subdivide","b_w_h","b_h_h","bx_b_w_h","by_b_h_h","getChildren",15,"SAPBroadphase","axisListX","axisListY","_addBodyHandler","_removeBodyHandler","sortAxisListX","sortAxisListY","preliminaryList","bodiesX","bodiesY","axisIndex",16,"Constraint","equations","DISTANCE","GEAR","LOCK","PRISMATIC","REVOLUTE",17,"DistanceConstraint","maxForce","Equation","computeGq","setMaxForce","minForce","getMaxForce","../equations/Equation","./Constraint",18,"GearConstraint","AngleLockEquation","ratio","setRatio","../equations/AngleLockEquation",19,"LockConstraint","localOffsetB","localAngleB","rot","xAxis",20,"PrismaticConstraint","localAnchorA","localAxisA","localAnchorB","trans","gg","disableRotationalLock","RotationalLockEquation","lowerLimitEnabled","upperLimitEnabled","lowerLimit","upperLimit","upperLimitEquation","lowerLimitEquation","motorEquation","motorEnabled","motorSpeed","computeGW","vj","wi","wj","transformedGmult","worldAxisA","worldAnchorA","worldAnchorB","orientedAnchorA","orientedAnchorB","eqs","relPosition","enableMotor","disableMotor","../equations/RotationalLockEquation",21,"RevoluteConstraint","pivotA","pivotB","worldPivotA","worldPivotB","RotationalVelocityEquation","relAngle","motorIsEnabled","setMotorSpeed","getMotorSpeed","../equations/RotationalVelocityEquation",22,"./Equation",23,"computeB","rixn","rjxn","GW","Gq","GiMf","computeGiMf","../math/mat2",24,"ARRAY_TYPE","eps","updateSpookParams","Gmult","timeStep","qi","qj","computeGWlambda","vlambda","wlambda","iMfi","iMfj","fi","ti","angularForce","fj","tj","invMassi","invMass","invMassj","invIi","invInertia","invIj","computeGiMGt","addToWlambda_temp","addToWlambda_Gi","addToWlambda_Gj","addToWlambda","deltalambda","Gi","Gj","computeInvC",25,26,"worldVectorA","worldVectorB",27,28,"EventEmitter","_listeners","listenerArray",29,"ContactMaterial","materialA","materialB","Material","idCounter","./Material",30,31,"../../node_modules/gl-matrix/src/gl-matrix/mat2",32,"GetArea","sum",33,"getX","getY","crossVZ","zcomp","crossZV","toLocalFrame","framePosition","frameAngle","toGlobalFrame","centroid","../../node_modules/gl-matrix/src/gl-matrix/vec2",34,"_idCounter","shapes","shapeOffsets","shapeAngles","inertia","fixedRotation","interpolatedPosition","damping","angularDamping","AWAKE","sleepSpeedLimit","sleepTimeLimit","timeLastSleepy","concavePath","lastDampingScale","lastAngularDampingScale","lastDampingTimeStep","updateMassProperties","Convex","setDensity","density","totalArea","getArea","shapeAABB","computeAABB","updateBoundingRadius","addShape","removeShape","Icm","computeMomentOfInertia","Body_applyForce_r","applyForce","rotForce","toWorldFrame","fromPolygon","convexes","optimalDecomp","cm","centerOfMass","updateTriangles","updateCenterOfMass","adjustCenterOfMass","adjustCenterOfMass_tmp2","adjustCenterOfMass_tmp3","adjustCenterOfMass_tmp4","offset_times_area","setZeroForce","resetConstraintVelocity","addConstraintVelocity","applyDamping","dt","wakeUpEvent","sleep","sleepEvent","sleepTick","speedSquared","speedLimitSquared","sleepyEvent","../collision/AABB","../events/EventEmitter","../shapes/Convex",35,"Spring","restLength","setWorldAnchorA","setWorldAnchorB","getWorldAnchorA","getWorldAnchorB","applyForce_r","applyForce_r_unit","applyForce_u","applyForce_f","applyForce_worldAnchorA","applyForce_worldAnchorB","applyForce_ri","applyForce_rj","applyForce_tmp","r_unit","rlen","ri_x_f","rj_x_f",36,"Capsule","GSSolver","Heightfield","Island","IslandSolver","Solver","../package.json","./collision/AABB","./collision/Broadphase","./collision/GridBroadphase","./collision/NaiveBroadphase","./collision/Narrowphase","./collision/QuadTree","./collision/SAPBroadphase","./constraints/Constraint","./constraints/DistanceConstraint","./constraints/GearConstraint","./constraints/LockConstraint","./constraints/PrismaticConstraint","./constraints/RevoluteConstraint","./equations/AngleLockEquation","./equations/ContactEquation","./equations/Equation","./equations/FrictionEquation","./equations/RotationalVelocityEquation","./events/EventEmitter","./material/ContactMaterial","./material/Material","./math/vec2","./objects/Body","./objects/Spring","./shapes/Capsule","./shapes/Circle","./shapes/Convex","./shapes/Heightfield","./shapes/Line","./shapes/Particle","./shapes/Plane","./shapes/Rectangle","./shapes/Shape","./solver/GSSolver","./solver/IslandSolver","./solver/Solver","./utils/Utils","./world/World",37,"updateArea","./Shape",38,39,"polyk","polykVerts","id3","updateCenterOfMass_centroid","updateCenterOfMass_centroid_times_mass","updateCenterOfMass_a","updateCenterOfMass_b","updateCenterOfMass_c","centroid_times_mass","triangleArea","numer","../math/polyk",40,"maxValue",41,42,43,44,"./Convex",45,"collisionGroup","collisionMask","material","sensor",46,"GS","iterations","arrayStep","lambda","Bs","invCs","useGlobalEquationParameters","useZeroRHS","useNormalForceForFriction","skipFrictionIterations","setArrayZero","solve","sortEquations","iter","maxIter","skipFrictionIter","tolSquared","Neq","Nbodies","useGlobalParams","deltalambdaTot","_eps","iterateEquation","useNormal","invC","lambdaj","GWlambda","lambdaj_plus_deltalambda","./Solver",47,"getBodies","bodyIds","solver","removeAllEquations","numEquations","addEquation","islandBodies","numBodies",48,"subsolver","ISLAND","numIslands","_nodePool","_islandPool","beforeSolveIslandEvent","island","getUnvisitedNode","Nnodes","visited","visitFunc","bds","Neqs","bfs","queue","tmpArray2","tmpArray3","tmpArray4","islandPool","_workers","_workerData","_workerIslandGroups","nj","islands","../solver/Island",49,"equationSortFunction","addEquations","removeEquation",50,"howmany",51,"springs","narrowphase","doProfiling","lastStepTime","broadphase","constraints","defaultFriction","defaultRestitution","defaultMaterial","defaultContactMaterial","lastTimeStep","applySpringForces","applyGravity","solveConstraints","contactMaterials","fixedStepTime","emitImpactEvent","_constraintIdCounter","_bodyIdCounter","postStepEvent","addBodyEvent","removeBodyEvent","addSpringEvent","spring","impactEvent","postBroadphaseEvent","pairs","enableBodySleeping","beginContactEvent","endContactEvent","preSolveEvent","overlappingShapesLastState","overlappingShapesCurrentState","overlappingShapeLookup","pkg","currentVersion","performance","nowOffset","timing","navigationStart","addConstraint","addContactMaterial","contactMaterial","removeContactMaterial","getContactMaterial","cmats","removeConstraint","step_mg","xiw","xjw","timeSinceLastCalled","maxSubSteps","internalStep","internalSteps","t0","t1","Nsprings","np","mg","glen","Nresults","Nshapesi","Nshapesj","runNarrowphase","Nconstraints","integrateBody","ev","ib_fhMinv","ib_velodt","minv","velo","aiw","ajw","reducedMass","resolver","addSpring","removeSpring","addBody","removeBody","getBodyById","toJSON","v2a","jc","ss","jsonShapes","jsonShape","upgradeJSON","stringify","localAxisB","fromJSON","id2material","jb","jss","js","jm","cs","cms","hitTest_tmp1","hitTest_zero","hitTest_tmp2","pb","ps","pa","zero","NS","../../package.json","../collision/NaiveBroadphase","../collision/Narrowphase","../constraints/DistanceConstraint","../constraints/LockConstraint","../constraints/PrismaticConstraint","../constraints/RevoluteConstraint","../material/ContactMaterial","../material/Material","../objects/Spring","../shapes/Capsule","../shapes/Line","../solver/GSSolver","useElapsedTime","materials","InversePointProxy","_wallShapes","onBodyAdded","onBodyRemoved","onSpringAdded","onSpringRemoved","onConstraintAdded","onConstraintRemoved","onContactMaterialAdded","onContactMaterialRemoved","postBroadphaseCallback","impactCallback","onBeginContact","onEndContact","mpx","mpxi","pxm","pxmi","beginContactHandler","endContactHandler","_toRemove","collisionGroups","_collisionGroupID","nothingCollisionGroup","CollisionGroup","boundsCollisionGroup","everythingCollisionGroup","boundsCollidesWith","removeBodyNextStep","setImpactEvents","impactHandler","setPostBroadphaseCallback","postBroadphaseHandler","_bodyCallbacks","_bodyCallbackContext","_groupCallbacks","_groupCallbackContext","setCollisionGroup","setWorldMaterial","updateBoundsCollisionGroup","hw","hh","createDistanceConstraint","getBody","createGearConstraint","createRevoluteConstraint","createLockConstraint","createPrismaticConstraint","lockRotation","anchorA","anchorB","constraint","setMaterial","createMaterial","createContactMaterial","getSprings","getConstraints","filterStatic","physicsPosition","query","createCollisionGroup","bitmask","createSpring","worldA","worldB","localA","localB","createBody","addPolygon","createParticle","convertCollisionObjects","optimize","addRectangle","PointProxy","onImpact","collidesWith","removeNextStep","_collideWorldBounds","debugBody","setRectangleFromSprite","createBodyCallback","createGroupCallback","_groupCallbacksContext","getCollisionMask","updateCollisionMask","clearCollision","clearGroup","clearMask","setZeroRotation","setZeroDamping","rotateLeft","rotateRight","moveForward","moveBackward","thrust","resetDamping","resetMass","clearShapes","shapeChanged","addCircle","addPlane","addParticle","addLine","addCapsule","setCircle","setRectangle","addPhaserPolygon","createdFixtures","fixtureData","shapesOfFixture","addFixture","generatedShapes","categoryBits","maskBits","isSensor","polygons","loadPolygon","localData","loadData","BodyDebug","settings","defaultSettings","pixelsPerLengthUnit","debugPolygons","ppu","updateSpriteTransform","lw","vrot","_j","_ref1","randomPastelHex","drawConvex","drawPlane","drawLine","drawRectangle","colors","drawPath","lastx","lasty","diagMargin","diagSize","maxLength","xd","yd","mix","rgbToHex","componentToHex"],"mappings":";;CAiCA,WAEI,GAAIA,GAAOC,KASXC,EAAOA,KAOXA,GAAKC,eAAiB,EACtBD,EAAKE,gBAAkB,EAGvBF,EAAKG,QAAU,SAGfH,EAAKI,YACDC,OAAO,EACPC,IAAI,EACJC,SAAS,EACTC,OAAO,EACPC,QAAQ,EACRC,OAAO,EACPC,QAAQ,EACRC,YAAY,EACZC,WAAW,EACXC,WAAW,EACXC,WAAW,GACXC,WAAW,GACXC,UAAU,GACVC,IAAI,GACJC,WAAW,GACXC,MAAM,GACNC,WAAW,IAIfrB,EAAKsB,YACD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AOC,EAAMD,KAKlBpiC,KAAKqiC,MAAQA,EAEb+rF,GAAW/rF,EAAMqoG,KAAKtc,EAAO,IAAK/rF,EAAMqoG,KAAKtc,EAAO,KACpDC,GAAWhsF,EAAMqoG,KAAKrc,EAAO,IAAKhsF,EAAMqoG,KAAKrc,EAAO,KAEpD38C,GAAGy8C,mBAAmBhrH,KAAKnD,KAAM+1G,EAAOqY,EAAQpY,EAAOqY,EAAQxD,IAInE1xF,OAAOkV,QAAQulD,GAAGu6B,mBAAmB/rH,UAAYiF,OAAOuD,OAAO8mE,GAAGy8C,mBAAmB/rH,WACrF+2B,OAAOkV,QAAQulD,GAAGu6B,mBAAmB/rH,UAAUE,YAAc62B,OAAOkV,QAAQulD,GAAGu6B"} \ No newline at end of file diff --git a/build/phaser.min.js b/build/phaser.min.js index 764be02c6e..238afb15b0 100644 --- a/build/phaser.min.js +++ b/build/phaser.min.js @@ -2,21 +2,21 @@ (function(){var a=this,b=b||{};b.WEBGL_RENDERER=0,b.CANVAS_RENDERER=1,b.VERSION="v1.5.0",b.blendModes={NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16},b.scaleModes={DEFAULT:0,LINEAR:0,NEAREST:1},b.INTERACTION_FREQUENCY=30,b.AUTO_PREVENT_DEFAULT=!0,b.RAD_TO_DEG=180/Math.PI,b.DEG_TO_RAD=Math.PI/180,b.Point=function(a,b){this.x=a||0,this.y=b||0},b.Point.prototype.clone=function(){return new b.Point(this.x,this.y)},b.Point.prototype.constructor=b.Point,b.Point.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)},b.Rectangle=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Rectangle.prototype.clone=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Rectangle.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=this.x;if(a>=c&&a<=c+this.width){var d=this.y;if(b>=d&&b<=d+this.height)return!0}return!1},b.Rectangle.prototype.constructor=b.Rectangle,b.EmptyRectangle=new b.Rectangle(0,0,0,0),b.Polygon=function(a){if(a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype.clone=function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!c)}return c},b.Polygon.prototype.constructor=b.Polygon,b.Circle=function(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0},b.Circle.prototype.clone=function(){return new b.Circle(this.x,this.y,this.radius)},b.Circle.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},b.Circle.prototype.constructor=b.Circle,b.Ellipse=function(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0},b.Ellipse.prototype.clone=function(){return new b.Ellipse(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},b.Ellipse.prototype.constructor=b.Ellipse,b.determineMatrixArrayType=function(){return"undefined"!=typeof Float32Array?Float32Array:Array},b.Matrix2=b.determineMatrixArrayType(),b.Matrix=function(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0},b.Matrix.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},b.Matrix.prototype.toArray=function(a){this.array||(this.array=new Float32Array(9));var b=this.array;return a?(this.array[0]=this.a,this.array[1]=this.c,this.array[2]=0,this.array[3]=this.b,this.array[4]=this.d,this.array[5]=0,this.array[6]=this.tx,this.array[7]=this.ty,this.array[8]=1):(this.array[0]=this.a,this.array[1]=this.b,this.array[2]=this.tx,this.array[3]=this.c,this.array[4]=this.d,this.array[5]=this.ty,this.array[6]=0,this.array[7]=0,this.array[8]=1),b},b.identityMatrix=new b.Matrix,b.DisplayObject=function(){this.position=new b.Point,this.scale=new b.Point(1,1),this.pivot=new b.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor="pointer",this.worldTransform=new b.Matrix,this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new b.Rectangle(0,0,1,1),this._bounds=new b.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cacheIsDirty=!1},b.DisplayObject.prototype.constructor=b.DisplayObject,b.DisplayObject.prototype.setInteractive=function(a){this.interactive=a},Object.defineProperty(b.DisplayObject.prototype,"interactive",{get:function(){return this._interactive},set:function(a){this._interactive=a,this.stage&&(this.stage.dirty=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"worldVisible",{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}}),Object.defineProperty(b.DisplayObject.prototype,"mask",{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.isMask=!1),this._mask=a,this._mask&&(this._mask.isMask=!0)}}),Object.defineProperty(b.DisplayObject.prototype,"filters",{get:function(){return this._filters},set:function(a){if(a){for(var b=[],c=0;c=0&&b<=this.children.length))throw new Error(a+" The index "+b+" supplied is out of bounds "+this.children.length);a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this.stage&&a.setStageReference(this.stage)},b.DisplayObjectContainer.prototype.swapChildren=function(a,b){if(a!==b){var c=this.children.indexOf(a),d=this.children.indexOf(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be a child of the caller.");this.children[c]=b,this.children[d]=a}},b.DisplayObjectContainer.prototype.getChildAt=function(a){if(a>=0&&aa;a++)this.children[a].updateTransform()},b.DisplayObjectContainer.prototype.getBounds=function(a){if(0===this.children.length)return b.EmptyRectangle;if(a){var c=this.worldTransform;this.worldTransform=a,this.updateTransform(),this.worldTransform=c}for(var d,e,f,g=1/0,h=1/0,i=-1/0,j=-1/0,k=!1,l=0,m=this.children.length;m>l;l++){var n=this.children[l];n.visible&&(k=!0,d=this.children[l].getBounds(a),g=ge?i:e,j=j>f?j:f)}if(!k)return b.EmptyRectangle;var o=this._bounds;return o.x=g,o.y=h,o.width=i-g,o.height=j-h,o},b.DisplayObjectContainer.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=b.identityMatrix;for(var c=0,d=this.children.length;d>c;c++)this.children[c].updateTransform();var e=this.getBounds();return this.worldTransform=a,e},b.DisplayObjectContainer.prototype.setStageReference=function(a){this.stage=a,this._interactive&&(this.stage.dirty=!0);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d.setStageReference(a)}},b.DisplayObjectContainer.prototype.removeStageReference=function(){for(var a=0,b=this.children.length;b>a;a++){var c=this.children[a];c.removeStageReference()}this._interactive&&(this.stage.dirty=!0),this.stage=null},b.DisplayObjectContainer.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);var b,c;if(this._mask||this._filters){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)),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);a.spriteBatch.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.spriteBatch.start()}else for(b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.DisplayObjectContainer.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){if(this._cacheAsBitmap)return void this._renderCachedSprite(a);this._mask&&a.maskManager.pushMask(this._mask,a.context);for(var b=0,c=this.children.length;c>b;b++){var d=this.children[b];d._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite=function(a){b.DisplayObjectContainer.call(this),this.anchor=new b.Point,this.texture=a,this._width=0,this._height=0,this.tint=16777215,this.blendMode=b.blendModes.NORMAL,a.baseTexture.hasLoaded?this.onTextureUpdate():(this.onTextureUpdateBind=this.onTextureUpdate.bind(this),this.texture.addEventListener("update",this.onTextureUpdateBind)),this.renderable=!0},b.Sprite.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Sprite.prototype.constructor=b.Sprite,Object.defineProperty(b.Sprite.prototype,"width",{get:function(){return this.scale.x*this.texture.frame.width},set:function(a){this.scale.x=a/this.texture.frame.width,this._width=a}}),Object.defineProperty(b.Sprite.prototype,"height",{get:function(){return this.scale.y*this.texture.frame.height},set:function(a){this.scale.y=a/this.texture.frame.height,this._height=a}}),b.Sprite.prototype.setTexture=function(a){this.texture.baseTexture!==a.baseTexture?(this.textureChange=!0,this.texture=a):this.texture=a,this.cachedTint=16777215,this.updateFrame=!0},b.Sprite.prototype.onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height),this.updateFrame=!0},b.Sprite.prototype.getBounds=function(a){var b=this.texture.frame.width,c=this.texture.frame.height,d=b*(1-this.anchor.x),e=b*-this.anchor.x,f=c*(1-this.anchor.y),g=c*-this.anchor.y,h=a||this.worldTransform,i=h.a,j=h.c,k=h.b,l=h.d,m=h.tx,n=h.ty,o=i*e+k*g+m,p=l*g+j*e+n,q=i*d+k*g+m,r=l*g+j*d+n,s=i*d+k*f+m,t=l*f+j*d+n,u=i*e+k*f+m,v=l*f+j*e+n,w=-1/0,x=-1/0,y=1/0,z=1/0;y=y>o?o:y,y=y>q?q:y,y=y>s?s:y,y=y>u?u:y,z=z>p?p:z,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=o>w?o:w,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=p>x?p:x,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x;var A=this._bounds;return A.x=y,A.width=w-y,A.y=z,A.height=x-z,this._currentBounds=A,A},b.Sprite.prototype._renderWebGL=function(a){if(this.visible&&!(this.alpha<=0)){var b,c;if(this._mask||this._filters){var d=a.spriteBatch;for(this._mask&&(d.stop(),a.maskManager.pushMask(this.mask,a),d.start()),this._filters&&(d.flush(),a.filterManager.pushFilter(this._filterBlock)),d.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a);d.stop(),this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),d.start()}else for(a.spriteBatch.render(this),b=0,c=this.children.length;c>b;b++)this.children[b]._renderWebGL(a)}},b.Sprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=this.texture.frame,d=a.context,e=this.texture;if(this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,d.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),this._mask&&a.maskManager.pushMask(this._mask,a.context),c&&c.width&&c.height&&e.baseTexture.source){d.globalAlpha=this.worldAlpha;var f=this.worldTransform;if(a.roundPixels?d.setTransform(f.a,f.c,f.b,f.d,0|f.tx,0|f.ty):d.setTransform(f.a,f.c,f.b,f.d,f.tx,f.ty),a.smoothProperty&&a.scaleMode!==this.texture.baseTexture.scaleMode&&(a.scaleMode=this.texture.baseTexture.scaleMode,d[a.smoothProperty]=a.scaleMode===b.scaleModes.LINEAR),16777215!==this.tint){if(this.cachedTint!==this.tint){if(!e.baseTexture.hasLoaded)return;this.cachedTint=this.tint,this.tintedTexture=b.CanvasTinter.getTintedTexture(this,this.tint)}d.drawImage(this.tintedTexture,0,0,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}else if(e.trim){var g=e.trim;d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,g.x-this.anchor.x*g.width,g.y-this.anchor.y*g.height,c.width,c.height)}else d.drawImage(this.texture.baseTexture.source,c.x,c.y,c.width,c.height,this.anchor.x*-c.width,this.anchor.y*-c.height,c.width,c.height)}for(var h=0,i=this.children.length;i>h;h++){var j=this.children[h];j._renderCanvas(a)}this._mask&&a.maskManager.popMask(a.context)}},b.Sprite.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache'+this);return new b.Sprite(c)},b.Sprite.fromImage=function(a,c,d){var e=b.Texture.fromImage(a,c,d);return new b.Sprite(e)},b.SpriteBatch=function(a){b.DisplayObjectContainer.call(this),this.textureThing=a,this.ready=!1},b.SpriteBatch.prototype=Object.create(b.DisplayObjectContainer.prototype),b.SpriteBatch.constructor=b.SpriteBatch,b.SpriteBatch.prototype.initWebGL=function(a){this.fastSpriteBatch=new b.WebGLFastSpriteBatch(a),this.ready=!0},b.SpriteBatch.prototype.updateTransform=function(){b.DisplayObject.prototype.updateTransform.call(this)},b.SpriteBatch.prototype._renderWebGL=function(a){!this.visible||this.alpha<=0||!this.children.length||(this.ready||this.initWebGL(a.gl),a.spriteBatch.stop(),a.shaderManager.activateShader(a.shaderManager.fastShader),this.fastSpriteBatch.begin(this,a),this.fastSpriteBatch.render(this),a.shaderManager.activateShader(a.shaderManager.defaultShader),a.spriteBatch.start())},b.SpriteBatch.prototype._renderCanvas=function(a){var c=a.context;c.globalAlpha=this.worldAlpha,b.DisplayObject.prototype.updateTransform.call(this);for(var d=this.worldTransform,e=!0,f=0;fe?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d=2?parseInt(c[c.length-2],10):b.BitmapText.fonts[this.fontName].size,this.dirty=!0,this.tint=a.tint},b.BitmapText.prototype.updateText=function(){for(var a=b.BitmapText.fonts[this.fontName],c=new b.Point,d=null,e=[],f=0,g=[],h=0,i=this.fontSize/a.size,j=0;j=j;j++){var n=0;"right"===this.style.align?n=f-g[j]:"center"===this.style.align&&(n=(f-g[j])/2),m.push(n)}var o=this.children.length,p=e.length,q=this.tint||16777215;for(j=0;p>j;j++){var r=o>j?this.children[j]:this._pool.pop();r?r.setTexture(e[j].texture):r=new b.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+a.lineHeight)*i},b.BitmapText.prototype.updateTransform=function(){this.dirty&&(this.updateText(),this.dirty=!1),b.DisplayObjectContainer.prototype.updateTransform.call(this)},b.BitmapText.fonts={},b.Stage=function(a){b.DisplayObjectContainer.call(this),this.worldTransform=new b.Matrix,this.interactive=!0,this.interactionManager=new b.InteractionManager(this),this.dirty=!0,this.stage=this,this.stage.hitArea=new b.Rectangle(0,0,1e5,1e5),this.setBackgroundColor(a)},b.Stage.prototype=Object.create(b.DisplayObjectContainer.prototype),b.Stage.prototype.constructor=b.Stage,b.Stage.prototype.setInteractionDelegate=function(a){this.interactionManager.setTargetDomElement(a)},b.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()},b.Stage.prototype.setBackgroundColor=function(a){this.backgroundColor=a||0,this.backgroundColorSplit=b.hex2rgb(this.backgroundColor);var c=this.backgroundColor.toString(16);c="000000".substr(0,6-c.length)+c,this.backgroundColorString="#"+c},b.Stage.prototype.getMousePosition=function(){return this.interactionManager.mouse.global};for(var c=0,d=["ms","moz","webkit","o"],e=0;e>16&255)/255,(a>>8&255)/255,(255&a)/255]},b.rgb2hex=function(a){return(255*a[0]<<16)+(255*a[1]<<8)+255*a[2]},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),b.AjaxRequest=function(){var a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"];if(!window.ActiveXObject)return window.XMLHttpRequest?new window.XMLHttpRequest:!1;for(var b=0;b0&&0===(a&a-1))return a;for(var b=1;a>b;)b<<=1;return b},b.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)}},b.PolyK={},b.PolyK.Triangulate=function(a){var c=!0,d=a.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=a[2*i],m=a[2*i+1],n=a[2*j],o=a[2*j+1],p=a[2*k],q=a[2*k+1],r=!1;if(b.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&&b.PolyK._PointInTriangle(a[2*t],a[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},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.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()},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.glFunc.call(c,a.uniformLocation,a.transpose,a.value):a.glFunc.call(c,a.uniformLocation,a.value):2===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y):3===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z):4===a.glValueLength?a.glFunc.call(c,a.uniformLocation,a.value.x,a.value.y,a.value.z,a.value.w):"sampler2D"===a.type&&(a._init?(c.activeTexture(c["TEXTURE"+this.textureCount]),c.bindTexture(c.TEXTURE_2D,a.value.baseTexture._glTextures[c.id]||b.createWebGLTexture(a.value.baseTexture,c)),c.uniform1i(a.uniformLocation,this.textureCount),this.textureCount++):this.initSampler2D(a))},b.PixiShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.PixiShader.defaultVertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec2 aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","varying vec2 vTextureCoord;","varying vec4 vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;"," vColor = vec4(color * aColor.x, aColor.x);","}"],b.PixiFastShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform mat3 uMatrix;","varying vec2 vTextureCoord;","varying float vColor;","const vec2 center = vec2(-1.0, 1.0);","void main(void) {"," vec2 v;"," vec2 sv = aVertexPosition * aScale;"," v.x = (sv.x) * cos(aRotation) - (sv.y) * sin(aRotation);"," v.y = (sv.x) * sin(aRotation) + (sv.y) * cos(aRotation);"," v = ( uMatrix * vec3(v + aPositionCoord , 1.0) ).xy ;"," gl_Position = vec4( ( v / projectionVector) + center , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"],this.textureCount=0,this.init() },b.PixiFastShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.dimensions=a.getUniformLocation(c,"dimensions"),this.uMatrix=a.getUniformLocation(c,"uMatrix"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aPositionCoord=a.getAttribLocation(c,"aPositionCoord"),this.aScale=a.getAttribLocation(c,"aScale"),this.aRotation=a.getAttribLocation(c,"aRotation"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.colorAttribute=a.getAttribLocation(c,"aColor"),-1===this.colorAttribute&&(this.colorAttribute=2),this.attributes=[this.aVertexPosition,this.aPositionCoord,this.aScale,this.aRotation,this.aTextureCoord,this.colorAttribute],this.program=c},b.PixiFastShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attributes=null},b.StripShader=function(){this.program=null,this.fragmentSrc=["precision mediump float;","varying vec2 vTextureCoord;","varying float vColor;","uniform float alpha;","uniform sampler2D uSampler;","void main(void) {"," gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y));"," gl_FragColor = gl_FragColor * alpha;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","varying vec2 vTextureCoord;","uniform vec2 offsetVector;","varying float vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition, 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / projectionVector.y + 1.0 , 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"]},b.StripShader.prototype.init=function(){var a=b.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.uSampler=a.getUniformLocation(c,"uSampler"),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.aTextureCoord=a.getAttribLocation(c,"aTextureCoord"),this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader=function(a){this.gl=a,this.program=null,this.fragmentSrc=["precision mediump float;","varying vec4 vColor;","void main(void) {"," gl_FragColor = vColor;","}"],this.vertexSrc=["attribute vec2 aVertexPosition;","attribute vec4 aColor;","uniform mat3 translationMatrix;","uniform vec2 projectionVector;","uniform vec2 offsetVector;","uniform float alpha;","uniform vec3 tint;","varying vec4 vColor;","void main(void) {"," vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);"," v -= offsetVector.xyx;"," gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);"," vColor = aColor * vec4(tint * alpha, alpha);","}"],this.init()},b.PrimitiveShader.prototype.init=function(){var a=this.gl,c=b.compileProgram(a,this.vertexSrc,this.fragmentSrc);a.useProgram(c),this.projectionVector=a.getUniformLocation(c,"projectionVector"),this.offsetVector=a.getUniformLocation(c,"offsetVector"),this.tintColor=a.getUniformLocation(c,"tint"),this.aVertexPosition=a.getAttribLocation(c,"aVertexPosition"),this.colorAttribute=a.getAttribLocation(c,"aColor"),this.attributes=[this.aVertexPosition,this.colorAttribute],this.translationMatrix=a.getUniformLocation(c,"translationMatrix"),this.alpha=a.getUniformLocation(c,"alpha"),this.program=c},b.PrimitiveShader.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.uniforms=null,this.gl=null,this.attribute=null},b.WebGLGraphics=function(){},b.WebGLGraphics.renderGraphics=function(a,c){var d=c.gl,e=c.projection,f=c.offset,g=c.shaderManager.primitiveShader;a._webGL[d.id]||(a._webGL[d.id]={points:[],indices:[],lastIndex:0,buffer:d.createBuffer(),indexBuffer:d.createBuffer()});var h=a._webGL[d.id];a.dirty&&(a.dirty=!1,a.clearDirty&&(a.clearDirty=!1,h.lastIndex=0,h.points=[],h.indices=[]),b.WebGLGraphics.updateGraphics(a,d)),c.shaderManager.activatePrimitiveShader(),d.blendFunc(d.ONE,d.ONE_MINUS_SRC_ALPHA),d.uniformMatrix3fv(g.translationMatrix,!1,a.worldTransform.toArray(!0)),d.uniform2f(g.projectionVector,e.x,-e.y),d.uniform2f(g.offsetVector,-f.x,-f.y),d.uniform3fv(g.tintColor,b.hex2rgb(a.tint)),d.uniform1f(g.alpha,a.worldAlpha),d.bindBuffer(d.ARRAY_BUFFER,h.buffer),d.vertexAttribPointer(g.aVertexPosition,2,d.FLOAT,!1,24,0),d.vertexAttribPointer(g.colorAttribute,4,d.FLOAT,!1,24,8),d.bindBuffer(d.ELEMENT_ARRAY_BUFFER,h.indexBuffer),d.drawElements(d.TRIANGLE_STRIP,h.indices.length,d.UNSIGNED_SHORT,0),c.shaderManager.deactivatePrimitiveShader()},b.WebGLGraphics.updateGraphics=function(a,c){for(var d=a._webGL[c.id],e=d.lastIndex;e3&&b.WebGLGraphics.buildPoly(f,d),f.lineWidth>0&&b.WebGLGraphics.buildLine(f,d)):f.type===b.Graphics.RECT?b.WebGLGraphics.buildRectangle(f,d):(f.type===b.Graphics.CIRC||f.type===b.Graphics.ELIP)&&b.WebGLGraphics.buildCircle(f,d)}d.lastIndex=a.graphicsData.length,d.glPoints=new Float32Array(d.points),c.bindBuffer(c.ARRAY_BUFFER,d.buffer),c.bufferData(c.ARRAY_BUFFER,d.glPoints,c.STATIC_DRAW),d.glIndicies=new Uint16Array(d.indices),c.bindBuffer(c.ELEMENT_ARRAY_BUFFER,d.indexBuffer),c.bufferData(c.ELEMENT_ARRAY_BUFFER,d.glIndicies,c.STATIC_DRAW)},b.WebGLGraphics.buildRectangle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3];if(a.fill){var i=b.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=c.points,o=c.indices,p=n.length/6;n.push(e,f),n.push(k,l,m,j),n.push(e+g,f),n.push(k,l,m,j),n.push(e,f+h),n.push(k,l,m,j),n.push(e+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[e,f,e+g,f,e+g,f+h,e,f+h,e,f],b.WebGLGraphics.buildLine(a,c),a.points=q}},b.WebGLGraphics.buildCircle=function(a,c){var d=a.points,e=d[0],f=d[1],g=d[2],h=d[3],i=40,j=2*Math.PI/i,k=0;if(a.fill){var l=b.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=c.points,r=c.indices,s=q.length/6;for(r.push(s),k=0;i+1>k;k++)q.push(e,f,n,o,p,m),q.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h,n,o,p,m),r.push(s++,s++);r.push(s-1)}if(a.lineWidth){var t=a.points;for(a.points=[],k=0;i+1>k;k++)a.points.push(e+Math.sin(j*k)*g,f+Math.cos(j*k)*h);b.WebGLGraphics.buildLine(a,c),a.points=t}},b.WebGLGraphics.buildLine=function(a,c){var d=0,e=a.points;if(0!==e.length){if(a.lineWidth%2)for(d=0;dd;d++)l=e[2*(d-1)],m=e[2*(d-1)+1],n=e[2*d],o=e[2*d+1],p=e[2*(d+1)],q=e[2*(d+1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,t=-(o-q),u=n-p,F=Math.sqrt(t*t+u*u),t/=F,u/=F,t*=L,u*=L,x=-s+m-(-s+o),y=-r+n-(-r+l),z=(-r+l)*(-s+o)-(-r+n)*(-s+m),A=-u+q-(-u+o),B=-t+n-(-t+p),C=(-t+p)*(-u+o)-(-t+n)*(-u+q),D=x*B-A*y,Math.abs(D)<.1?(D+=10.1,G.push(n-r,o-s,O,P,Q,N),G.push(n+r,o+s,O,P,Q,N)):(j=(y*C-B*z)/D,k=(A*z-x*C)/D,E=(j-n)*(j-n)+(k-o)+(k-o),E>19600?(v=r-t,w=s-u,F=Math.sqrt(v*v+w*w),v/=F,w/=F,v*=L,w*=L,G.push(n-v,o-w),G.push(O,P,Q,N),G.push(n+v,o+w),G.push(O,P,Q,N),G.push(n-v,o-w),G.push(O,P,Q,N),J++):(G.push(j,k),G.push(O,P,Q,N),G.push(n-(j-n),o-(k-o)),G.push(O,P,Q,N)));for(l=e[2*(I-2)],m=e[2*(I-2)+1],n=e[2*(I-1)],o=e[2*(I-1)+1],r=-(m-o),s=l-n,F=Math.sqrt(r*r+s*s),r/=F,s/=F,r*=L,s*=L,G.push(n-r,o-s),G.push(O,P,Q,N),G.push(n+r,o+s),G.push(O,P,Q,N),H.push(K),d=0;J>d;d++)H.push(K++);H.push(K-1)}},b.WebGLGraphics.buildPoly=function(a,c){var d=a.points;if(!(d.length<6)){var e=c.points,f=c.indices,g=d.length/2,h=b.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,k=h[1]*i,l=h[2]*i,m=b.PolyK.Triangulate(d),n=e.length/6,o=0;for(o=0;oo;o++)e.push(d[2*o],d[2*o+1],j,k,l,i)}},b.glContexts=[],b.WebGLRenderer=function(a,c,d,e,f){b.defaultRenderer||(b.defaultRenderer=this),this.type=b.WEBGL_RENDERER,this.transparent=!!e,this.width=a||800,this.height=c||600,this.view=d||document.createElement("canvas"),this.view.width=this.width,this.view.height=this.height,this.contextLost=this.handleContextLost.bind(this),this.contextRestoredLost=this.handleContextRestored.bind(this),this.view.addEventListener("webglcontextlost",this.contextLost,!1),this.view.addEventListener("webglcontextrestored",this.contextRestoredLost,!1),this.options={alpha:this.transparent,antialias:!!f,premultipliedAlpha:!!e,stencil:!0};try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(g){try{this.gl=this.view.getContext("webgl",this.options)}catch(h){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var i=this.gl;this.glContextId=i.id=b.WebGLRenderer.glContextId++,b.glContexts[this.glContextId]=i,b.blendModesWebGL||(b.blendModesWebGL=[],b.blendModesWebGL[b.blendModes.NORMAL]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.ADD]=[i.SRC_ALPHA,i.DST_ALPHA],b.blendModesWebGL[b.blendModes.MULTIPLY]=[i.DST_COLOR,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SCREEN]=[i.SRC_ALPHA,i.ONE],b.blendModesWebGL[b.blendModes.OVERLAY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DARKEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LIGHTEN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_DODGE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR_BURN]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HARD_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SOFT_LIGHT]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.DIFFERENCE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.EXCLUSION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.HUE]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.SATURATION]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.COLOR]=[i.ONE,i.ONE_MINUS_SRC_ALPHA],b.blendModesWebGL[b.blendModes.LUMINOSITY]=[i.ONE,i.ONE_MINUS_SRC_ALPHA]),this.projection=new b.Point,this.projection.x=this.width/2,this.projection.y=-this.height/2,this.offset=new b.Point(0,0),this.resize(this.width,this.height),this.contextLost=!1,this.shaderManager=new b.WebGLShaderManager(i),this.spriteBatch=new b.WebGLSpriteBatch(i),this.maskManager=new b.WebGLMaskManager(i),this.filterManager=new b.WebGLFilterManager(i,this.transparent),this.renderSession={},this.renderSession.gl=this.gl,this.renderSession.drawCount=0,this.renderSession.shaderManager=this.shaderManager,this.renderSession.maskManager=this.maskManager,this.renderSession.filterManager=this.filterManager,this.renderSession.spriteBatch=this.spriteBatch,this.renderSession.renderer=this,i.useProgram(this.shaderManager.defaultShader.program),i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),i.enable(i.BLEND),i.colorMask(!0,!0,!0,this.transparent)},b.WebGLRenderer.prototype.constructor=b.WebGLRenderer,b.WebGLRenderer.prototype.render=function(a){if(!this.contextLost){this.__stage!==a&&(a.interactive&&a.interactionManager.removeEvents(),this.__stage=a),b.WebGLRenderer.updateTextures(),a.updateTransform(),a._interactive&&(a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)));var c=this.gl;c.viewport(0,0,this.width,this.height),c.bindFramebuffer(c.FRAMEBUFFER,null),this.transparent?c.clearColor(0,0,0,0):c.clearColor(a.backgroundColorSplit[0],a.backgroundColorSplit[1],a.backgroundColorSplit[2],1),c.clear(c.COLOR_BUFFER_BIT),this.renderDisplayObject(a,this.projection),a.interactive?a._interactiveEventsAdded||(a._interactiveEventsAdded=!0,a.interactionManager.setTarget(this)):a._interactiveEventsAdded&&(a._interactiveEventsAdded=!1,a.interactionManager.setTarget(this))}},b.WebGLRenderer.prototype.renderDisplayObject=function(a,b,c){this.renderSession.drawCount=0,this.renderSession.currentBlendMode=9999,this.renderSession.projection=b,this.renderSession.offset=this.offset,this.spriteBatch.begin(this.renderSession),this.filterManager.begin(this.renderSession,c),a._renderWebGL(this.renderSession),this.spriteBatch.end()},b.WebGLRenderer.updateTextures=function(){var a=0;for(a=0;a=0;c--){var d=a._glTextures[c],e=b.glContexts[c];e&&d&&e.deleteTexture(d)}a._glTextures.length=0},b.WebGLRenderer.updateTextureFrame=function(a){a.updateFrame=!1,a._updateWebGLuvs()},b.WebGLRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b,this.gl.viewport(0,0,this.width,this.height),this.projection.x=this.width/2,this.projection.y=-this.height/2},b.createWebGLTexture=function(a,c){return a.hasLoaded&&(a._glTextures[c.id]=c.createTexture(),c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null)),a._glTextures[c.id]},b.updateWebGLTexture=function(a,c){a._glTextures[c.id]&&(c.bindTexture(c.TEXTURE_2D,a._glTextures[c.id]),c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,c.RGBA,c.UNSIGNED_BYTE,a.source),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MAG_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_MIN_FILTER,a.scaleMode===b.scaleModes.LINEAR?c.LINEAR:c.NEAREST),a._powerOf2?(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.REPEAT),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.REPEAT)):(c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_S,c.CLAMP_TO_EDGE),c.texParameteri(c.TEXTURE_2D,c.TEXTURE_WRAP_T,c.CLAMP_TO_EDGE)),c.bindTexture(c.TEXTURE_2D,null))},b.WebGLRenderer.prototype.handleContextLost=function(a){a.preventDefault(),this.contextLost=!0},b.WebGLRenderer.prototype.handleContextRestored=function(){try{this.gl=this.view.getContext("experimental-webgl",this.options)}catch(a){try{this.gl=this.view.getContext("webgl",this.options)}catch(c){throw new Error(" This browser does not support webGL. Try using the canvas renderer"+this)}}var d=this.gl;d.id=b.WebGLRenderer.glContextId++,this.shaderManager.setContext(d),this.spriteBatch.setContext(d),this.maskManager.setContext(d),this.filterManager.setContext(d),this.renderSession.gl=this.gl,d.disable(d.DEPTH_TEST),d.disable(d.CULL_FACE),d.enable(d.BLEND),d.colorMask(!0,!0,!0,this.transparent),this.gl.viewport(0,0,this.width,this.height);for(var e in b.TextureCache){var f=b.TextureCache[e].baseTexture;f._glTextures=[]}this.contextLost=!1},b.WebGLRenderer.prototype.destroy=function(){this.view.removeEventListener("webglcontextlost",this.contextLost),this.view.removeEventListener("webglcontextrestored",this.contextRestoredLost),b.glContexts[this.glContextId]=null,this.projection=null,this.offset=null,this.shaderManager.destroy(),this.spriteBatch.destroy(),this.maskManager.destroy(),this.filterManager.destroy(),this.shaderManager=null,this.spriteBatch=null,this.maskManager=null,this.filterManager=null,this.gl=null,this.renderSession=null},b.WebGLRenderer.glContextId=0,b.WebGLMaskManager=function(a){this.maskStack=[],this.maskPosition=0,this.setContext(a)},b.WebGLMaskManager.prototype.setContext=function(a){this.gl=a},b.WebGLMaskManager.prototype.pushMask=function(a,c){var d=this.gl;0===this.maskStack.length&&(d.enable(d.STENCIL_TEST),d.stencilFunc(d.ALWAYS,1,1)),this.maskStack.push(a),d.colorMask(!1,!1,!1,!0),d.stencilOp(d.KEEP,d.KEEP,d.INCR),b.WebGLGraphics.renderGraphics(a,c),d.colorMask(!0,!0,!0,!0),d.stencilFunc(d.NOTEQUAL,0,this.maskStack.length),d.stencilOp(d.KEEP,d.KEEP,d.KEEP)},b.WebGLMaskManager.prototype.popMask=function(a){var c=this.gl,d=this.maskStack.pop();d&&(c.colorMask(!1,!1,!1,!1),c.stencilOp(c.KEEP,c.KEEP,c.DECR),b.WebGLGraphics.renderGraphics(d,a),c.colorMask(!0,!0,!0,!0),c.stencilFunc(c.NOTEQUAL,0,this.maskStack.length),c.stencilOp(c.KEEP,c.KEEP,c.KEEP)),0===this.maskStack.length&&c.disable(c.STENCIL_TEST)},b.WebGLMaskManager.prototype.destroy=function(){this.maskStack=null,this.gl=null},b.WebGLShaderManager=function(a){this.maxAttibs=10,this.attribState=[],this.tempAttribState=[];for(var b=0;bd;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.setContext(a)},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},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;(b.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=b.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var c=a._uvs||a.texture._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(a.texture.trim){var m=a.texture.trim;e=m.x-k*m.width,d=e+b.frame.width,g=m.y-l*m.height,f=g+b.frame.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=a.worldTransform,p=o.a,q=o.c,r=o.b,s=o.d,t=o.tx,u=o.ty;j[n++]=p*e+r*g+t,j[n++]=s*g+q*e+u,j[n++]=c.x0,j[n++]=c.y0,j[n++]=h,j[n++]=i,j[n++]=p*d+r*g+t,j[n++]=s*g+q*d+u,j[n++]=c.x1,j[n++]=c.y1,j[n++]=h,j[n++]=i,j[n++]=p*d+r*f+t,j[n++]=s*f+q*d+u,j[n++]=c.x2,j[n++]=c.y2,j[n++]=h,j[n++]=i,j[n++]=p*e+r*f+t,j[n++]=s*f+q*e+u,j[n++]=c.x3,j[n++]=c.y3,j[n++]=h,j[n++]=i,this.currentBatchSize++}},b.WebGLSpriteBatch.prototype.renderTilingSprite=function(a){var c=a.tilingTexture;(c.baseTexture!==this.currentBaseTexture||this.currentBatchSize>=this.size)&&(this.flush(),this.currentBaseTexture=c.baseTexture),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode),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,u=a.worldTransform,v=u.a,w=u.c,x=u.b,y=u.d,z=u.tx,A=u.ty;k[t++]=v*q+x*s+z,k[t++]=y*s+w*q+A,k[t++]=d.x0,k[t++]=d.y0,k[t++]=i,k[t++]=j,k[t++]=v*p+x*s+z,k[t++]=y*s+w*p+A,k[t++]=d.x1,k[t++]=d.y1,k[t++]=i,k[t++]=j,k[t++]=v*p+x*r+z,k[t++]=y*r+w*p+A,k[t++]=d.x2,k[t++]=d.y2,k[t++]=i,k[t++]=j,k[t++]=v*q+x*r+z,k[t++]=y*r+w*q+A,k[t++]=d.x3,k[t++]=d.y3,k[t++]=i,k[t++]=j,this.currentBatchSize++},b.WebGLSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a)),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.colorAttribute,2,a.FLOAT,!1,d,16),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLSpriteBatch.prototype.destroy=function(){this.vertices=null,this.indices=null,this.gl.deleteBuffer(this.vertexBuffer),this.gl.deleteBuffer(this.indexBuffer),this.currentBaseTexture=null,this.gl=null},b.WebGLFastSpriteBatch=function(a){this.vertSize=10,this.maxSize=6e3,this.size=this.maxSize;var b=4*this.size*this.vertSize,c=6*this.maxSize;this.vertices=new Float32Array(b),this.indices=new Uint16Array(c),this.vertexBuffer=null,this.indexBuffer=null,this.lastIndexCount=0;for(var d=0,e=0;c>d;d+=6,e+=4)this.indices[d+0]=e+0,this.indices[d+1]=e+1,this.indices[d+2]=e+2,this.indices[d+3]=e+0,this.indices[d+4]=e+2,this.indices[d+5]=e+3;this.drawing=!1,this.currentBatchSize=0,this.currentBaseTexture=null,this.currentBlendMode=0,this.renderSession=null,this.shader=null,this.matrix=null,this.setContext(a)},b.WebGLFastSpriteBatch.prototype.setContext=function(a){this.gl=a,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},b.WebGLFastSpriteBatch.prototype.begin=function(a,b){this.renderSession=b,this.shader=this.renderSession.shaderManager.fastShader,this.matrix=a.worldTransform.toArray(!0),this.start()},b.WebGLFastSpriteBatch.prototype.end=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.render=function(a){var b=a.children,c=b[0];if(c.texture._uvs){this.currentBaseTexture=c.texture.baseTexture,c.blendMode!==this.currentBlendMode&&this.setBlendMode(c.blendMode);for(var d=0,e=b.length;e>d;d++)this.renderSprite(b[d]);this.flush()}},b.WebGLFastSpriteBatch.prototype.renderSprite=function(a){if(a.visible&&(a.texture.baseTexture===this.currentBaseTexture||(this.flush(),this.currentBaseTexture=a.texture.baseTexture,a.texture._uvs))){var b,c,d,e,f,g,h,i,j=this.vertices;if(b=a.texture._uvs,c=a.texture.frame.width,d=a.texture.frame.height,a.texture.trim){var k=a.texture.trim;f=k.x-a.anchor.x*k.width,e=f+a.texture.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()}},b.WebGLFastSpriteBatch.prototype.flush=function(){if(0!==this.currentBatchSize){var a=this.gl;if(this.currentBaseTexture._glTextures[a.id]||b.createWebGLTexture(this.currentBaseTexture,a),a.bindTexture(a.TEXTURE_2D,this.currentBaseTexture._glTextures[a.id]),this.currentBatchSize>.5*this.size)a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices);else{var c=this.vertices.subarray(0,4*this.currentBatchSize*this.vertSize);a.bufferSubData(a.ARRAY_BUFFER,0,c)}a.drawElements(a.TRIANGLES,6*this.currentBatchSize,a.UNSIGNED_SHORT,0),this.currentBatchSize=0,this.renderSession.drawCount++}},b.WebGLFastSpriteBatch.prototype.stop=function(){this.flush()},b.WebGLFastSpriteBatch.prototype.start=function(){var a=this.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var c=this.renderSession.projection;a.uniform2f(this.shader.projectionVector,c.x,c.y),a.uniformMatrix3fv(this.shader.uMatrix,!1,this.matrix);var d=4*this.vertSize;a.vertexAttribPointer(this.shader.aVertexPosition,2,a.FLOAT,!1,d,0),a.vertexAttribPointer(this.shader.aPositionCoord,2,a.FLOAT,!1,d,8),a.vertexAttribPointer(this.shader.aScale,2,a.FLOAT,!1,d,16),a.vertexAttribPointer(this.shader.aRotation,1,a.FLOAT,!1,d,24),a.vertexAttribPointer(this.shader.aTextureCoord,2,a.FLOAT,!1,d,28),a.vertexAttribPointer(this.shader.colorAttribute,1,a.FLOAT,!1,d,36),this.currentBlendMode!==b.blendModes.NORMAL&&this.setBlendMode(b.blendModes.NORMAL)},b.WebGLFastSpriteBatch.prototype.setBlendMode=function(a){this.flush(),this.currentBlendMode=a;var c=b.blendModesWebGL[this.currentBlendMode];this.gl.blendFunc(c[0],c[1])},b.WebGLFilterManager=function(a,b){this.transparent=b,this.filterStack=[],this.offsetX=0,this.offsetY=0,this.setContext(a)},b.WebGLFilterManager.prototype.setContext=function(a){this.gl=a,this.texturePool=[],this.initShaderBuffers()},b.WebGLFilterManager.prototype.begin=function(a,b){this.renderSession=a,this.defaultShader=a.shaderManager.defaultShader;var c=this.renderSession.projection;this.width=2*c.x,this.height=2*-c.y,this.buffer=b},b.WebGLFilterManager.prototype.pushFilter=function(a){var c=this.gl,d=this.renderSession.projection,e=this.renderSession.offset;this.filterStack.push(a);var f=a.filterPasses[0];this.offsetX+=a.target.filterArea.x,this.offsetY+=a.target.filterArea.y;var g=this.texturePool.pop();g?g.resize(this.width,this.height):g=new b.FilterTexture(this.gl,this.width,this.height),c.bindTexture(c.TEXTURE_2D,g.texture),a.target.filterArea=a.target.getBounds();var h=a.target.filterArea,i=f.padding;h.x-=i,h.y-=i,h.width+=2*i,h.height+=2*i,h.x<0&&(h.x=0),h.width>this.width&&(h.width=this.width),h.y<0&&(h.y=0),h.height>this.height&&(h.height=this.height),c.bindFramebuffer(c.FRAMEBUFFER,g.frameBuffer),c.viewport(0,0,h.width,h.height),d.x=h.width/2,d.y=-h.height/2,e.x=-h.x,e.y=-h.y,c.uniform2f(this.defaultShader.projectionVector,h.width/2,-h.height/2),c.uniform2f(this.defaultShader.offsetVector,-h.x,-h.y),c.colorMask(!0,!0,!0,!0),c.clearColor(0,0,0,0),c.clear(c.COLOR_BUFFER_BIT),a._glFilterTexture=g},b.WebGLFilterManager.prototype.popFilter=function(){var a=this.gl,c=this.filterStack.pop(),d=c.target.filterArea,e=c._glFilterTexture,f=this.renderSession.projection,g=this.renderSession.offset;if(c.filterPasses.length>1){a.viewport(0,0,d.width,d.height),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),this.vertexArray[0]=0,this.vertexArray[1]=d.height,this.vertexArray[2]=d.width,this.vertexArray[3]=d.height,this.vertexArray[4]=0,this.vertexArray[5]=0,this.vertexArray[6]=d.width,this.vertexArray[7]=0,a.bufferSubData(a.ARRAY_BUFFER,0,this.vertexArray),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),this.uvArray[2]=d.width/this.width,this.uvArray[5]=d.height/this.height,this.uvArray[6]=d.width/this.width,this.uvArray[7]=d.height/this.height,a.bufferSubData(a.ARRAY_BUFFER,0,this.uvArray);var h=e,i=this.texturePool.pop();i||(i=new b.FilterTexture(this.gl,this.width,this.height)),i.resize(this.width,this.height),a.bindFramebuffer(a.FRAMEBUFFER,i.frameBuffer),a.clear(a.COLOR_BUFFER_BIT),a.disable(a.BLEND);for(var j=0;j0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},b.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},b.CanvasRenderer.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.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},b.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},b.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},b.CanvasGraphics=function(){},b.CanvasGraphics.renderGraphics=function(a,c){for(var d=a.worldAlpha,e="",f=0;f1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===b.Graphics.POLY){c.beginPath(),c.moveTo(g[0],g[1]);for(var h=1;hd;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),b.CanvasGraphics.renderGraphics(this,c);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},b.Graphics.prototype.getBounds=function(a){this.bounds||this.updateBounds();var b=this.bounds.x,c=this.bounds.width+this.bounds.x,d=this.bounds.y,e=this.bounds.height+this.bounds.y,f=a||this.worldTransform,g=f.a,h=f.c,i=f.b,j=f.d,k=f.tx,l=f.ty,m=g*c+i*e+k,n=j*e+h*c+l,o=g*b+i*e+k,p=j*e+h*b+l,q=g*b+i*d+k,r=j*d+h*b+l,s=g*c+i*d+k,t=j*d+h*c+l,u=-1/0,v=-1/0,w=1/0,x=1/0;w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v;var y=this._bounds;return y.x=w,y.width=u-w,y.y=x,y.height=v-x,y},b.Graphics.prototype.updateBounds=function(){for(var a,c,d,e,f,g=1/0,h=-1/0,i=1/0,j=-1/0,k=0;kc?c:g,h=c+e>h?c+e:h,i=i>d?c:i,j=d+f>j?d+f:j;else if(m===b.Graphics.CIRC||m===b.Graphics.ELIP)c=a[0],d=a[1],e=a[2]+n/2,f=a[3]+n/2,g=g>c-e?c-e:g,h=c+e>h?c+e:h,i=i>d-f?d-f:i,j=d+f>j?d+f:j;else for(var o=0;oc-n?c-n:g,h=c+n>h?c+n:h,i=i>d-n?d-n:i,j=d+n>j?d+n:j}var p=this.boundsPadding;this.bounds=new b.Rectangle(g-p,i-p,h-g+2*p,j-i+2*p)},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.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.onTextureUpdate=function(){this.updateFrame=!0},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.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,c),c.globalAlpha=this.worldAlpha;var d=this.worldTransform;c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),(!this.__tilePattern||this.refreshTexture)&&(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.beginPath();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&&a.maskManager.popMask(a.context)}},b.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},b.TilingSprite.prototype.generateTilingTexture=function(a){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(a?(d=b.getNextPowerOfTwo(g.width),e=b.getNextPowerOfTwo(g.height),g.width!==d&&g.height!==e&&(i=!0)):h&&(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 b.CanvasBuffer(d,e),this.tilingTexture=b.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}},b.BaseTextureCache={},b.texturesToUpdate=[],b.texturesToDestroy=[],b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(b.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this.id=b.BaseTextureCacheIdGenerator++,this._glTextures=[],a){if(this.source.complete||this.source.getContext)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,b.texturesToUpdate.push(this);else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.width,d.height=d.source.height,b.texturesToUpdate.push(d),d.dispatchEvent({type:"loaded",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.BaseTexture.prototype.destroy=function(){this.imageUrl&&(delete b.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,b.texturesToDestroy.push(this)},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c){if(b.EventTarget.call(this),c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=null,this.scope=this,this._uvs=null,a.hasLoaded)this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var d=this;a.addEventListener("loaded",function(){d.onBaseTextureLoaded()})}},b.Texture.prototype.constructor=b.Texture,b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},b.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,b.Texture.frameUpdates.push(this)},b.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.frame,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.Texture.frameUpdates=[],b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y4=0},b.RenderTexture=function(a,c,d){if(b.EventTarget.call(this),this.width=a||100,this.height=c||100,this.frame=new b.Rectangle(0,0,this.width,this.height),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new b.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(this.width/2,-this.height/2)}else console.log("renderer canvas"),this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c){if(this.width=a,this.height=c,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===b.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var d=this.renderer.gl;d.bindTexture(d.TEXTURE_2D,this.baseTexture._glTextures[d.id]),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.width,this.height,0,d.RGBA,d.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype.renderWebGL=function(a,c,d){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),d&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,a.worldTransform.d=-1,a.worldTransform.ty=-2*this.projection.y,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty-=c.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();b.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},b.RenderTexture.prototype.renderCanvas=function(a,c,d){var e=a.children,f=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty=c.y);for(var g=0,h=e.length;h>g;g++)e[g].updateTransform();d&&this.textureBuffer.clear();var i=this.textureBuffer.context;this.renderer.renderDisplayObject(a,i),i.setTransform(1,0,0,1,0,0),a.worldTransform=f},b.RenderTexture.tempMatrix=new b.Matrix,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define("PIXI",function(){return a.PIXI=b}()):a.PIXI=b}).call(this),function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f; -a=Array(g+1).join(c)+a+Array(f+1).join(c);break;default:a+=Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!hasOwn.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a +},b.WebGLFilterManager.prototype.applyFilterPass=function(a,c,d,e){var f=this.gl,g=a.shaders[f.id];g||(g=new b.PixiShader(f),g.fragmentSrc=a.fragmentSrc,g.uniforms=a.uniforms,g.init(),a.shaders[f.id]=g),f.useProgram(g.program),f.uniform2f(g.projectionVector,d/2,-e/2),f.uniform2f(g.offsetVector,0,0),a.uniforms.dimensions&&(a.uniforms.dimensions.value[0]=this.width,a.uniforms.dimensions.value[1]=this.height,a.uniforms.dimensions.value[2]=this.vertexArray[0],a.uniforms.dimensions.value[3]=this.vertexArray[5]),g.syncUniforms(),f.bindBuffer(f.ARRAY_BUFFER,this.vertexBuffer),f.vertexAttribPointer(g.aVertexPosition,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.uvBuffer),f.vertexAttribPointer(g.aTextureCoord,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ARRAY_BUFFER,this.colorBuffer),f.vertexAttribPointer(g.colorAttribute,2,f.FLOAT,!1,0,0),f.bindBuffer(f.ELEMENT_ARRAY_BUFFER,this.indexBuffer),f.drawElements(f.TRIANGLES,6,f.UNSIGNED_SHORT,0),this.renderSession.drawCount++},b.WebGLFilterManager.prototype.initShaderBuffers=function(){var a=this.gl;this.vertexBuffer=a.createBuffer(),this.uvBuffer=a.createBuffer(),this.colorBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.vertexArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertexArray,a.STATIC_DRAW),this.uvArray=new Float32Array([0,0,1,0,0,1,1,1]),a.bindBuffer(a.ARRAY_BUFFER,this.uvBuffer),a.bufferData(a.ARRAY_BUFFER,this.uvArray,a.STATIC_DRAW),this.colorArray=new Float32Array([1,16777215,1,16777215,1,16777215,1,16777215]),a.bindBuffer(a.ARRAY_BUFFER,this.colorBuffer),a.bufferData(a.ARRAY_BUFFER,this.colorArray,a.STATIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,1,3,2]),a.STATIC_DRAW)},b.WebGLFilterManager.prototype.destroy=function(){var a=this.gl;this.filterStack=null,this.offsetX=0,this.offsetY=0;for(var b=0;b0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.resize=function(a,b){this.width=a,this.height=b,this.view.width=a,this.view.height=b},b.CanvasRenderer.prototype.renderDisplayObject=function(a,b){this.renderSession.context=b||this.context,a._renderCanvas(this.renderSession)},b.CanvasRenderer.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.CanvasRenderer.prototype.renderStrip=function(a){var b=this.context,c=a.verticies,d=a.uvs,e=c.length/2;this.count++;for(var f=1;e-2>f;f++){var g=2*f,h=c[g],i=c[g+2],j=c[g+4],k=c[g+1],l=c[g+3],m=c[g+5],n=d[g]*a.texture.width,o=d[g+2]*a.texture.width,p=d[g+4]*a.texture.width,q=d[g+1]*a.texture.height,r=d[g+3]*a.texture.height,s=d[g+5]*a.texture.height;b.save(),b.beginPath(),b.moveTo(h,k),b.lineTo(i,l),b.lineTo(j,m),b.closePath(),b.clip();var t=n*r+q*p+o*s-r*p-q*o-n*s,u=h*r+q*j+i*s-r*j-q*i-h*s,v=n*i+h*p+o*j-i*p-h*o-n*j,w=n*r*j+q*i*p+h*o*s-h*r*p-q*o*j-n*i*s,x=k*r+q*m+l*s-r*m-q*l-k*s,y=n*l+k*p+o*m-l*p-k*o-n*m,z=n*r*m+q*l*p+k*o*s-k*r*p-q*o*m-n*l*s;b.transform(u/t,x/t,v/t,y/t,w/t,z/t),b.drawImage(a.texture.baseTexture.source,0,0),b.restore()}},b.CanvasBuffer=function(a,b){this.width=a,this.height=b,this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b},b.CanvasBuffer.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},b.CanvasBuffer.prototype.resize=function(a,b){this.width=this.canvas.width=a,this.height=this.canvas.height=b},b.CanvasGraphics=function(){},b.CanvasGraphics.renderGraphics=function(a,c){for(var d=a.worldAlpha,e="",f=0;f1&&(d=1,window.console.log("Pixi.js warning: masks in canvas can only mask using the first path in the graphics object"));for(var e=0;1>e;e++){var f=a.graphicsData[e],g=f.points;if(f.type===b.Graphics.POLY){c.beginPath(),c.moveTo(g[0],g[1]);for(var h=1;hd;d++)this.children[d]._renderWebGL(a);a.spriteBatch.stop()}this._filters&&a.filterManager.popFilter(),this._mask&&a.maskManager.popMask(a),a.drawCount++,a.spriteBatch.start()}},b.Graphics.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha&&this.isMask!==!0){var c=a.context,d=this.worldTransform;this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),b.CanvasGraphics.renderGraphics(this,c);for(var e=0,f=this.children.length;f>e;e++)this.children[e]._renderCanvas(a)}},b.Graphics.prototype.getBounds=function(a){this.bounds||this.updateBounds();var b=this.bounds.x,c=this.bounds.width+this.bounds.x,d=this.bounds.y,e=this.bounds.height+this.bounds.y,f=a||this.worldTransform,g=f.a,h=f.c,i=f.b,j=f.d,k=f.tx,l=f.ty,m=g*c+i*e+k,n=j*e+h*c+l,o=g*b+i*e+k,p=j*e+h*b+l,q=g*b+i*d+k,r=j*d+h*b+l,s=g*c+i*d+k,t=j*d+h*c+l,u=-1/0,v=-1/0,w=1/0,x=1/0;w=w>m?m:w,w=w>o?o:w,w=w>q?q:w,w=w>s?s:w,x=x>n?n:x,x=x>p?p:x,x=x>r?r:x,x=x>t?t:x,u=m>u?m:u,u=o>u?o:u,u=q>u?q:u,u=s>u?s:u,v=n>v?n:v,v=p>v?p:v,v=r>v?r:v,v=t>v?t:v;var y=this._bounds;return y.x=w,y.width=u-w,y.y=x,y.height=v-x,y},b.Graphics.prototype.updateBounds=function(){for(var a,c,d,e,f,g=1/0,h=-1/0,i=1/0,j=-1/0,k=0;kc?c:g,h=c+e>h?c+e:h,i=i>d?c:i,j=d+f>j?d+f:j;else if(m===b.Graphics.CIRC||m===b.Graphics.ELIP)c=a[0],d=a[1],e=a[2]+n/2,f=a[3]+n/2,g=g>c-e?c-e:g,h=c+e>h?c+e:h,i=i>d-f?d-f:i,j=d+f>j?d+f:j;else for(var o=0;oc-n?c-n:g,h=c+n>h?c+n:h,i=i>d-n?d-n:i,j=d+n>j?d+n:j}var p=this.boundsPadding;this.bounds=new b.Rectangle(g-p,i-p,h-g+2*p,j-i+2*p)},b.Graphics.prototype._generateCachedSprite=function(){var a=this.getLocalBounds();if(this._cachedSprite)this._cachedSprite.buffer.resize(a.width,a.height);else{var c=new b.CanvasBuffer(a.width,a.height),d=b.Texture.fromCanvas(c.canvas);this._cachedSprite=new b.Sprite(d),this._cachedSprite.buffer=c,this._cachedSprite.worldTransform=this.worldTransform}this._cachedSprite.anchor.x=-(a.x/a.width),this._cachedSprite.anchor.y=-(a.y/a.height),this._cachedSprite.buffer.context.translate(-a.x,-a.y),b.CanvasGraphics.renderGraphics(this,this._cachedSprite.buffer.context)},b.Graphics.prototype.destroyCachedSprite=function(){this._cachedSprite.texture.destroy(!0),this._cachedSprite=null},b.Graphics.POLY=0,b.Graphics.RECT=1,b.Graphics.CIRC=2,b.Graphics.ELIP=3,b.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.onTextureUpdate=function(){this.updateFrame=!0},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.spriteBatch.stop(),this.filters&&a.filterManager.popFilter(),this.mask&&a.maskManager.popMask(a),a.spriteBatch.start()}},b.TilingSprite.prototype._renderCanvas=function(a){if(this.visible!==!1&&0!==this.alpha){var c=a.context;this._mask&&a.maskManager.pushMask(this._mask,c),c.globalAlpha=this.worldAlpha;var d=this.worldTransform;c.setTransform(d.a,d.c,d.b,d.d,d.tx,d.ty),(!this.__tilePattern||this.refreshTexture)&&(this.generateTilingTexture(!1),this.tilingTexture&&(this.__tilePattern=c.createPattern(this.tilingTexture.baseTexture.source,"repeat"))),this.blendMode!==a.currentBlendMode&&(a.currentBlendMode=this.blendMode,c.globalCompositeOperation=b.blendModesCanvas[a.currentBlendMode]),c.beginPath();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&&a.maskManager.popMask(a.context)}},b.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},b.TilingSprite.prototype.generateTilingTexture=function(a){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(a?(d=b.getNextPowerOfTwo(g.width),e=b.getNextPowerOfTwo(g.height),g.width!==d&&g.height!==e&&(i=!0)):h&&(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 b.CanvasBuffer(d,e),this.tilingTexture=b.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}},b.BaseTextureCache={},b.texturesToUpdate=[],b.texturesToDestroy=[],b.BaseTextureCacheIdGenerator=0,b.BaseTexture=function(a,c){if(b.EventTarget.call(this),this.width=100,this.height=100,this.scaleMode=c||b.scaleModes.DEFAULT,this.hasLoaded=!1,this.source=a,this.id=b.BaseTextureCacheIdGenerator++,this._glTextures=[],a){if(this.source.complete||this.source.getContext)this.hasLoaded=!0,this.width=this.source.width,this.height=this.source.height,b.texturesToUpdate.push(this);else{var d=this;this.source.onload=function(){d.hasLoaded=!0,d.width=d.source.width,d.height=d.source.height,b.texturesToUpdate.push(d),d.dispatchEvent({type:"loaded",content:d})}}this.imageUrl=null,this._powerOf2=!1}},b.BaseTexture.prototype.constructor=b.BaseTexture,b.BaseTexture.prototype.destroy=function(){this.imageUrl&&(delete b.BaseTextureCache[this.imageUrl],this.imageUrl=null,this.source.src=null),this.source=null,b.texturesToDestroy.push(this)},b.BaseTexture.prototype.updateSourceImage=function(a){this.hasLoaded=!1,this.source.src=null,this.source.src=a},b.BaseTexture.fromImage=function(a,c,d){var e=b.BaseTextureCache[a];if(!e){var f=new Image;c&&(f.crossOrigin=""),f.src=a,e=new b.BaseTexture(f,d),e.imageUrl=a,b.BaseTextureCache[a]=e}return e},b.BaseTexture.fromCanvas=function(a,c){a._pixiId||(a._pixiId="canvas_"+b.TextureCacheIdGenerator++);var d=b.BaseTextureCache[a._pixiId];return d||(d=new b.BaseTexture(a,c),b.BaseTextureCache[a._pixiId]=d),d},b.TextureCache={},b.FrameCache={},b.TextureCacheIdGenerator=0,b.Texture=function(a,c){if(b.EventTarget.call(this),c||(this.noFrame=!0,c=new b.Rectangle(0,0,1,1)),a instanceof b.Texture&&(a=a.baseTexture),this.baseTexture=a,this.frame=c,this.trim=null,this.scope=this,this._uvs=null,a.hasLoaded)this.noFrame&&(c=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(c);else{var d=this;a.addEventListener("loaded",function(){d.onBaseTextureLoaded()})}},b.Texture.prototype.constructor=b.Texture,b.Texture.prototype.onBaseTextureLoaded=function(){var a=this.baseTexture;a.removeEventListener("loaded",this.onLoaded),this.noFrame&&(this.frame=new b.Rectangle(0,0,a.width,a.height)),this.setFrame(this.frame),this.scope.dispatchEvent({type:"update",content:this})},b.Texture.prototype.destroy=function(a){a&&this.baseTexture.destroy()},b.Texture.prototype.setFrame=function(a){if(this.frame=a,this.width=a.width,this.height=a.height,a.x+a.width>this.baseTexture.width||a.y+a.height>this.baseTexture.height)throw new Error("Texture Error: frame does not fit inside the base Texture dimensions "+this);this.updateFrame=!0,b.Texture.frameUpdates.push(this)},b.Texture.prototype._updateWebGLuvs=function(){this._uvs||(this._uvs=new b.TextureUvs);var a=this.frame,c=this.baseTexture.width,d=this.baseTexture.height;this._uvs.x0=a.x/c,this._uvs.y0=a.y/d,this._uvs.x1=(a.x+a.width)/c,this._uvs.y1=a.y/d,this._uvs.x2=(a.x+a.width)/c,this._uvs.y2=(a.y+a.height)/d,this._uvs.x3=a.x/c,this._uvs.y3=(a.y+a.height)/d},b.Texture.fromImage=function(a,c,d){var e=b.TextureCache[a];return e||(e=new b.Texture(b.BaseTexture.fromImage(a,c,d)),b.TextureCache[a]=e),e},b.Texture.fromFrame=function(a){var c=b.TextureCache[a];if(!c)throw new Error('The frameId "'+a+'" does not exist in the texture cache ');return c},b.Texture.fromCanvas=function(a,c){var d=b.BaseTexture.fromCanvas(a,c);return new b.Texture(d)},b.Texture.addTextureToCache=function(a,c){b.TextureCache[c]=a},b.Texture.removeTextureFromCache=function(a){var c=b.TextureCache[a];return delete b.TextureCache[a],delete b.BaseTextureCache[a],c},b.Texture.frameUpdates=[],b.TextureUvs=function(){this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y4=0},b.RenderTexture=function(a,c,d){if(b.EventTarget.call(this),this.width=a||100,this.height=c||100,this.frame=new b.Rectangle(0,0,this.width,this.height),this.baseTexture=new b.BaseTexture,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.baseTexture._glTextures=[],this.baseTexture.hasLoaded=!0,this.renderer=d||b.defaultRenderer,this.renderer.type===b.WEBGL_RENDERER){var e=this.renderer.gl;this.textureBuffer=new b.FilterTexture(e,this.width,this.height),this.baseTexture._glTextures[e.id]=this.textureBuffer.texture,this.render=this.renderWebGL,this.projection=new b.Point(this.width/2,-this.height/2)}else console.log("renderer canvas"),this.render=this.renderCanvas,this.textureBuffer=new b.CanvasBuffer(this.width,this.height),this.baseTexture.source=this.textureBuffer.canvas;b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype=Object.create(b.Texture.prototype),b.RenderTexture.prototype.constructor=b.RenderTexture,b.RenderTexture.prototype.resize=function(a,c){if(this.width=a,this.height=c,this.frame.width=this.width,this.frame.height=this.height,this.renderer.type===b.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var d=this.renderer.gl;d.bindTexture(d.TEXTURE_2D,this.baseTexture._glTextures[d.id]),d.texImage2D(d.TEXTURE_2D,0,d.RGBA,this.width,this.height,0,d.RGBA,d.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);b.Texture.frameUpdates.push(this)},b.RenderTexture.prototype.renderWebGL=function(a,c,d){var e=this.renderer.gl;e.colorMask(!0,!0,!0,!0),e.viewport(0,0,this.width,this.height),e.bindFramebuffer(e.FRAMEBUFFER,this.textureBuffer.frameBuffer),d&&this.textureBuffer.clear();var f=a.children,g=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,a.worldTransform.d=-1,a.worldTransform.ty=-2*this.projection.y,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty-=c.y);for(var h=0,i=f.length;i>h;h++)f[h].updateTransform();b.WebGLRenderer.updateTextures(),this.renderer.renderDisplayObject(a,this.projection,this.textureBuffer.frameBuffer),a.worldTransform=g},b.RenderTexture.prototype.renderCanvas=function(a,c,d){var e=a.children,f=a.worldTransform;a.worldTransform=b.RenderTexture.tempMatrix,c&&(a.worldTransform.tx=c.x,a.worldTransform.ty=c.y);for(var g=0,h=e.length;h>g;g++)e[g].updateTransform();d&&this.textureBuffer.clear();var i=this.textureBuffer.context;this.renderer.renderDisplayObject(a,i),i.setTransform(1,0,0,1,0,0),a.worldTransform=f},b.RenderTexture.tempMatrix=new b.Matrix,"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=b),exports.PIXI=b):"undefined"!=typeof define&&define.amd?define("PIXI",function(){return a.PIXI=b}()):a.PIXI=b}).call(this),function(){var a=this,b=b||{VERSION:"<%= version %>",DEV_VERSION:"2.0.2",GAMES:[],AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,NONE:0,LEFT:1,RIGHT:2,UP:3,DOWN:4,SPRITE:0,BUTTON:1,IMAGE:2,GRAPHICS:3,TEXT:4,TILESPRITE:5,BITMAPTEXT:6,GROUP:7,RENDERTEXTURE:8,TILEMAP:9,TILEMAPLAYER:10,EMITTER:11,POLYGON:12,BITMAPDATA:13,CANVAS_FILTER:14,WEBGL_FILTER:15,ELLIPSE:16,SPRITEBATCH:17,RETROFONT:18,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},scaleModes:{DEFAULT:0,LINEAR:0,NEAREST:1}};PIXI.InteractionManager=function(){},b.Utils={parseDimension:function(a,b){var c=0,d=0;return"string"==typeof a?"%"===a.substr(-1)?(c=parseInt(a,10)/100,d=0===b?window.innerWidth*c:window.innerHeight*c):d=parseInt(a,10):d=a,d},shuffle: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},pad:function(a,b,c,d){if("undefined"==typeof b)var b=0;if("undefined"==typeof c)var c=" ";if("undefined"==typeof d)var d=3;var e=0;if(b+1>=a.length)switch(d){case 1:a=new Array(b+1-a.length).join(c)+a;break;case 3:var f=Math.ceil((e=b-a.length)/2),g=e-f; +a=new Array(g+1).join(c)+a+new Array(f+1).join(c);break;default:a+=new Array(b+1-a.length).join(c)}return a},isPlainObject:function(a){if("object"!=typeof a||a.nodeType||a===a.window)return!1;try{if(a.constructor&&!{}.hasOwnProperty.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(b){return!1}return!0},extend:function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;for("boolean"==typeof h&&(k=h,h=arguments[1]||{},i=2),j===i&&(h=this,--i);j>i;i++)if(null!=(a=arguments[i]))for(c in a)d=h[c],e=a[c],h!==e&&(k&&e&&(b.Utils.isPlainObject(e)||(f=Array.isArray(e)))?(f?(f=!1,g=d&&Array.isArray(d)?d:[]):g=d&&b.Utils.isPlainObject(d)?d:{},h[c]=b.Utils.extend(k,g,e)):void 0!==e&&(h[c]=e));return h}},"function"!=typeof Function.prototype.bind&&(Function.prototype.bind=function(){var a=Array.prototype.slice;return function(b){function c(){var f=e.concat(a.call(arguments));d.apply(this instanceof c?this:b,f)}var d=this,e=a.call(arguments,1);if("function"!=typeof d)throw new TypeError;return c.prototype=function f(a){return a&&(f.prototype=a),this instanceof f?void 0:new f}(d.prototype),c}}()),Array.isArray||(Array.isArray=function(a){return"[object Array]"==Object.prototype.toString.call(a)}),b.Circle=function(a,b,c){a=a||0,b=b||0,c=c||0,this.x=a,this.y=b,this._diameter=c,this._radius=c>0?.5*c:0},b.Circle.prototype={circumference:function(){return 2*Math.PI*this._radius},setTo:function(a,b,c){return this.x=a,this.y=b,this._diameter=c,this._radius=.5*c,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.diameter)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.diameter=this._diameter,a},distance:function(a,c){return"undefined"==typeof c&&(c=!1),c?b.Math.distanceRound(this.x,this.y,a.x,a.y):b.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a?a=new b.Circle(this.x,this.y,this.diameter):a.setTo(this.x,this.y,this.diameter),a},contains:function(a,c){return b.Circle.contains(this,a,c)},circumferencePoint:function(a,c,d){return b.Circle.circumferencePoint(this,a,c,d)},offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},toString:function(){return"[{Phaser.Circle (x="+this.x+" y="+this.y+" diameter="+this.diameter+" radius="+this.radius+")}]"}},b.Circle.prototype.constructor=b.Circle,Object.defineProperty(b.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(b.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(b.Circle.prototype,"left",{get:function(){return this.x-this._radius},set:function(a){a>this.x?(this._radius=0,this._diameter=0):this.radius=this.x-a}}),Object.defineProperty(b.Circle.prototype,"right",{get:function(){return this.x+this._radius},set:function(a){athis.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){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(b.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),b.Circle.contains=function(a,b,c){if(a.radius>0&&b>=a.left&&b<=a.right&&c>=a.top&&c<=a.bottom){var d=(a.x-b)*(a.x-b),e=(a.y-c)*(a.y-c);return d+e<=a.radius*a.radius}return!1},b.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},b.Circle.intersects=function(a,c){return b.Math.distance(a.x,a.y,c.x,c.y)<=a.radius+c.radius},b.Circle.circumferencePoint=function(a,c,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new b.Point),d===!0&&(c=b.Math.degToRad(c)),e.x=a.x+a.radius*Math.cos(c),e.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},PIXI.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),d?b.Math.distanceRound(a.x,a.y,c.x,c.y):b.Math.distance(a.x,a.y,c.x,c.y)},b.Point.rotate=function(a,c,d,e,f,g){return f=f||!1,g=g||null,f&&(e=b.Math.degToRad(e)),null===g&&(g=Math.sqrt((c-a.x)*(c-a.x)+(d-a.y)*(d-a.y))),a.setTo(c+g*Math.cos(e),d+g*Math.sin(e))},PIXI.Point=b.Point,b.Rectangle=function(a,b,c,d){a=a||0,b=b||0,c=c||0,d=d||0,this.x=a,this.y=b,this.width=c,this.height=d},b.Rectangle.prototype={offset:function(a,b){return this.x+=a,this.y+=b,this},offsetPoint:function(a){return this.offset(a.x,a.y)},setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},floor:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y)},floorAll:function(){this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.width=Math.floor(this.width),this.height=Math.floor(this.height)},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},inflate:function(a,c){return b.Rectangle.inflate(this,a,c)},size:function(a){return b.Rectangle.size(this,a)},clone:function(a){return b.Rectangle.clone(this,a)},contains:function(a,c){return b.Rectangle.contains(this,a,c)},containsRect:function(a){return b.Rectangle.containsRect(this,a)},equals:function(a){return b.Rectangle.equals(this,a)},intersection:function(a,c){return b.Rectangle.intersection(this,a,c)},intersects:function(a,c){return b.Rectangle.intersects(this,a,c)},intersectsRaw:function(a,c,d,e,f){return b.Rectangle.intersectsRaw(this,a,c,d,e,f)},union:function(a,c){return b.Rectangle.union(this,a,c)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},Object.defineProperty(b.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(b.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(b.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(b.Rectangle.prototype,"bottomRight",{get:function(){return new b.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(b.Rectangle.prototype,"left",{get:function(){return this.x},set:function(a){this.width=a>=this.right?0:this.right-a,this.x=a}}),Object.defineProperty(b.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(b.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(b.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(b.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(b.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(b.Rectangle.prototype,"top",{get:function(){return this.y},set:function(a){a>=this.bottom?(this.height=0,this.y=a):this.height=this.bottom-a}}),Object.defineProperty(b.Rectangle.prototype,"topLeft",{get:function(){return new b.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(b.Rectangle.prototype,"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?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?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.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.rightb.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||ca.bottom+f||e=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}},Object.defineProperty(b.Line.prototype,"length",{get:function(){return Math.sqrt((this.end.x-this.start.x)*(this.end.x-this.start.x)+(this.end.y-this.start.y)*(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(b.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(b.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),Object.defineProperty(b.Line.prototype,"x",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"y",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"left",{get:function(){return Math.min(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"right",{get:function(){return Math.max(this.start.x,this.end.x)}}),Object.defineProperty(b.Line.prototype,"top",{get:function(){return Math.min(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"bottom",{get:function(){return Math.max(this.start.y,this.end.y)}}),Object.defineProperty(b.Line.prototype,"width",{get:function(){return Math.abs(this.start.x-this.end.x)}}),Object.defineProperty(b.Line.prototype,"height",{get:function(){return Math.abs(this.start.y-this.end.y)}}),b.Line.intersectsPoints=function(a,c,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new b.Point);var h=c.y-a.y,i=e.y-d.y,j=a.x-c.x,k=d.x-e.x,l=c.x*a.y-a.x*c.y,m=e.x*d.y-d.x*e.y,n=h*k-i*j;if(0===n)return null;if(g.x=(j*m-k*l)/n,g.y=(i*l-h*m)/n,f){if(Math.pow(g.x-c.x+(g.y-c.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-c.x+(a.y-c.y),2))return null;if(Math.pow(g.x-e.x+(g.y-e.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null;if(Math.pow(g.x-d.x+(g.y-d.y),2)>Math.pow(d.x-e.x+(d.y-e.y),2))return null}return g},b.Line.intersects=function(a,c,d,e){return b.Line.intersectsPoints(a.start,a.end,c.start,c.end,d,e)},b.Ellipse=function(a,c,d,e){this.type=b.ELLIPSE,a=a||0,c=c||0,d=d||0,e=e||0,this.x=a,this.y=c,this.width=d,this.height=e},b.Ellipse.prototype={setTo:function(a,b,c,d){return this.x=a,this.y=b,this.width=c,this.height=d,this},copyFrom:function(a){return this.setTo(a.x,a.y,a.width,a.height)},copyTo:function(a){return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},clone:function(a){return"undefined"==typeof a?a=new b.Ellipse(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a},contains:function(a,c){return b.Ellipse.contains(this,a,c)},toString:function(){return"[{Phaser.Ellipse (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+")}]"}},b.Ellipse.prototype.constructor=b.Ellipse,Object.defineProperty(b.Ellipse.prototype,"left",{get:function(){return this.x},set:function(a){this.x=a}}),Object.defineProperty(b.Ellipse.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=ad+e},b.Ellipse.prototype.getBounds=function(){return new b.Rectangle(this.x,this.y,this.width,this.height)},PIXI.Ellipse=b.Ellipse,b.Polygon=function(a){if(this.type=b.POLYGON,a instanceof Array||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var c=[],d=0,e=a.length;e>d;d+=2)c.push(new b.Point(a[d],a[d+1]));a=c}this.points=a},b.Polygon.prototype={clone:function(){for(var a=[],c=0;cb!=i>b&&(h-f)*(b-g)/(i-g)+f>a;j&&(c=!0)}return c}},b.Polygon.prototype.constructor=b.Polygon,PIXI.Polygon=b.Polygon,b.Camera=function(a,c,d,e,f,g){this.game=a,this.world=a.world,this.id=0,this.view=new b.Rectangle(d,e,f,g),this.screenView=new b.Rectangle(d,e,f,g),this.bounds=new b.Rectangle(d,e,f,g),this.deadzone=null,this.visible=!0,this.atLimit={x:!1,y:!1},this.target=null,this._edge=0,this.displayObject=null,this.scale=null},b.Camera.FOLLOW_LOCKON=0,b.Camera.FOLLOW_PLATFORMER=1,b.Camera.FOLLOW_TOPDOWN=2,b.Camera.FOLLOW_TOPDOWN_TIGHT=3,b.Camera.prototype={follow:function(a,c){"undefined"==typeof c&&(c=b.Camera.FOLLOW_LOCKON),this.target=a;var d;switch(c){case b.Camera.FOLLOW_PLATFORMER:var e=this.width/8,f=this.height/3;this.deadzone=new b.Rectangle((this.width-e)/2,(this.height-f)/2-.25*f,e,f);break;case b.Camera.FOLLOW_TOPDOWN:d=Math.max(this.width,this.height)/4,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_TOPDOWN_TIGHT:d=Math.max(this.width,this.height)/8,this.deadzone=new b.Rectangle((this.width-d)/2,(this.height-d)/2,d,d);break;case b.Camera.FOLLOW_LOCKON:this.deadzone=null;break;default:this.deadzone=null}},focusOn:function(a){this.setPosition(Math.round(a.x-this.view.halfWidth),Math.round(a.y-this.view.halfHeight))},focusOnXY:function(a,b){this.setPosition(Math.round(a-this.view.halfWidth),Math.round(b-this.view.halfHeight))},update:function(){this.target&&this.updateTarget(),this.bounds&&this.checkBounds(),this.displayObject.position.x=-this.view.x,this.displayObject.position.y=-this.view.y},updateTarget:function(){this.deadzone?(this._edge=this.target.x-this.deadzone.x,this.view.x>this._edge&&(this.view.x=this._edge),this._edge=this.target.x+this.target.width-this.deadzone.x-this.deadzone.width,this.view.xthis._edge&&(this.view.y=this._edge),this._edge=this.target.y+this.target.height-this.deadzone.y-this.deadzone.height,this.view.y=this.bounds.right&&(this.atLimit.x=!0,this.view.x=this.bounds.right-this.width),this.view.y<=this.bounds.top&&(this.atLimit.y=!0,this.view.y=this.bounds.top),this.view.bottom>=this.bounds.bottom&&(this.atLimit.y=!0,this.view.y=this.bounds.bottom-this.height),this.view.floor()},setPosition:function(a,b){this.view.x=a,this.view.y=b,this.bounds&&this.checkBounds()},setSize:function(a,b){this.view.width=a,this.view.height=b},reset:function(){this.target=null,this.view.x=0,this.view.y=0}},b.Camera.prototype.constructor=b.Camera,Object.defineProperty(b.Camera.prototype,"x",{get:function(){return this.view.x},set:function(a){this.view.x=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"y",{get:function(){return this.view.y},set:function(a){this.view.y=a,this.bounds&&this.checkBounds()}}),Object.defineProperty(b.Camera.prototype,"width",{get:function(){return this.view.width},set:function(a){this.view.width=a}}),Object.defineProperty(b.Camera.prototype,"height",{get:function(){return this.view.height},set:function(a){this.view.height=a}}),b.State=function(){this.game=null,this.add=null,this.make=null,this.camera=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.sound=null,this.scale=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.particles=null,this.physics=null,this.rnd=null},b.State.prototype={preload:function(){},loadUpdate:function(){},loadRender:function(){},create:function(){},update:function(){},render:function(){},paused:function(){},shutdown:function(){}},b.State.prototype.constructor=b.State,b.StateManager=function(a,b){this.game=a,this.states={},this._pendingState=null,"undefined"!=typeof b&&null!==b&&(this._pendingState=b),this._clearWorld=!1,this._clearCache=!1,this._created=!1,this._args=[],this.current="",this.onInitCallback=null,this.onPreloadCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPreRenderCallback=null,this.onLoadUpdateCallback=null,this.onLoadRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onShutDownCallback=null},b.StateManager.prototype={boot:function(){this.game.onPause.add(this.pause,this),this.game.onResume.add(this.resume,this),this.game.load.onLoadComplete.add(this.loadComplete,this),null!==this._pendingState&&("string"==typeof this._pendingState?this.start(this._pendingState,!1,!1):this.add("default",this._pendingState,!0))},add:function(a,c,d){"undefined"==typeof d&&(d=!1);var e;return c instanceof b.State?e=c:"object"==typeof c?(e=c,e.game=this.game):"function"==typeof c&&(e=new c(this.game)),this.states[a]=e,d&&(this.game.isBooted?this.start(a):this._pendingState=a),e},remove:function(a){this.current==a&&(this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null),delete this.states[a]},start:function(a,b,c){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!1),this.checkState(a)&&(this._pendingState=a,this._clearWorld=b,this._clearCache=c,arguments.length>3&&(this._args=Array.prototype.splice.call(arguments,3)))},dummy:function(){},preUpdate:function(){this._pendingState&&this.game.isBooted&&(this.current&&(this.onShutDownCallback.call(this.callbackContext,this.game),this.game.tweens.removeAll(),this.game.camera.reset(),this.game.input.reset(!0),this.game.physics.clear(),this.game.time.removeAll(),this._clearWorld&&(this.game.world.shutdown(),this._clearCache===!0&&this.game.cache.destroy())),this.setCurrentState(this._pendingState),this.onPreloadCallback?(this.game.load.reset(),this.onPreloadCallback.call(this.callbackContext,this.game),0===this.game.load.totalQueuedFiles()?this.loadComplete():this.game.load.start()):this.loadComplete(),this.current===this._pendingState&&(this._pendingState=null))},checkState:function(a){if(this.states[a]){var b=!1;return this.states[a].preload&&(b=!0),this.states[a].create&&(b=!0),this.states[a].update&&(b=!0),this.states[a].render&&(b=!0),b===!1?(console.warn("Invalid Phaser State object given. Must contain at least a one of the required functions: preload, create, update or render"),!1):!0}return console.warn("Phaser.StateManager - No state found with the key: "+a),!1},link:function(a){this.states[a].game=this.game,this.states[a].add=this.game.add,this.states[a].make=this.game.make,this.states[a].camera=this.game.camera,this.states[a].cache=this.game.cache,this.states[a].input=this.game.input,this.states[a].load=this.game.load,this.states[a].math=this.game.math,this.states[a].sound=this.game.sound,this.states[a].scale=this.game.scale,this.states[a].state=this,this.states[a].stage=this.game.stage,this.states[a].time=this.game.time,this.states[a].tweens=this.game.tweens,this.states[a].world=this.game.world,this.states[a].particles=this.game.particles,this.states[a].rnd=this.game.rnd,this.states[a].physics=this.game.physics},setCurrentState:function(a){this.callbackContext=this.states[a],this.link(a),this.onInitCallback=this.states[a].init||this.dummy,this.onPreloadCallback=this.states[a].preload||null,this.onLoadRenderCallback=this.states[a].loadRender||null,this.onLoadUpdateCallback=this.states[a].loadUpdate||null,this.onCreateCallback=this.states[a].create||null,this.onUpdateCallback=this.states[a].update||null,this.onPreRenderCallback=this.states[a].preRender||null,this.onRenderCallback=this.states[a].render||null,this.onPausedCallback=this.states[a].paused||null,this.onResumedCallback=this.states[a].resumed||null,this.onShutDownCallback=this.states[a].shutdown||this.dummy,this.current=a,this._created=!1,this.onInitCallback.apply(this.callbackContext,this._args),this._args=[]},getCurrentState:function(){return this.states[this.current]},loadComplete:function(){this._created===!1&&this.onCreateCallback?(this._created=!0,this.onCreateCallback.call(this.callbackContext,this.game)):this._created=!0},pause:function(){this._created&&this.onPausedCallback&&this.onPausedCallback.call(this.callbackContext,this.game)},resume:function(){this._created&&this.onResumedCallback&&this.onResumedCallback.call(this.callbackContext,this.game)},update:function(){this._created&&this.onUpdateCallback?this.onUpdateCallback.call(this.callbackContext,this.game):this.onLoadUpdateCallback&&this.onLoadUpdateCallback.call(this.callbackContext,this.game)},preRender:function(){this.onPreRenderCallback&&this.onPreRenderCallback.call(this.callbackContext,this.game)},render:function(){this._created&&this.onRenderCallback?(this.game.renderType===b.CANVAS&&(this.game.context.save(),this.game.context.setTransform(1,0,0,1,0,0)),this.onRenderCallback.call(this.callbackContext,this.game),this.game.renderType===b.CANVAS&&this.game.context.restore()):this.onLoadRenderCallback&&this.onLoadRenderCallback.call(this.callbackContext,this.game)},destroy:function(){this.callbackContext=null,this.onInitCallback=null,this.onShutDownCallback=null,this.onPreloadCallback=null,this.onLoadRenderCallback=null,this.onLoadUpdateCallback=null,this.onCreateCallback=null,this.onUpdateCallback=null,this.onRenderCallback=null,this.onPausedCallback=null,this.onResumedCallback=null,this.onDestroyCallback=null,this.game=null,this.states={},this._pendingState=null}},b.StateManager.prototype.constructor=b.StateManager,b.LinkedList=function(){this.next=null,this.prev=null,this.first=null,this.last=null,this.total=0},b.LinkedList.prototype={add:function(a){return 0===this.total&&null==this.first&&null==this.last?(this.first=a,this.last=a,this.next=a,a.prev=this,this.total++,a):(this.last.next=a,a.prev=this.last,this.last=a,this.total++,a)},remove:function(a){a==this.first?this.first=this.first.next:a==this.last&&(this.last=this.last.prev),a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.next=a.prev=null,null==this.first&&(this.last=null),this.total--},callAll:function(a){if(this.first&&this.last){var b=this.first;do b&&b[a]&&b[a].call(b),b=b.next;while(b!=this.last.next)}}},b.LinkedList.prototype.constructor=b.LinkedList,b.Signal=function(){this._bindings=[],this._prevParams=null;var a=this;this.dispatch=function(){b.Signal.prototype.dispatch.apply(a,arguments)}},b.Signal.prototype={memorize:!1,_shouldPropagate:!0,active:!0,validateListener:function(a,b){if("function"!=typeof a)throw new Error("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(){for(var a=this._bindings.length;a--;)this._bindings[a]._destroy();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},b.SignalBinding.prototype={active:!0,params:null,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._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 this._signal},_destroy:function(){delete this._signal,delete this._listener,delete this.context},toString:function(){return"[Phaser.SignalBinding isOnce:"+this._isOnce+", isBound:"+this.isBound()+", active:"+this.active+"]"}},b.SignalBinding.prototype.constructor=b.SignalBinding,b.Filter=function(a,c,d){this.game=a,this.type=b.WEBGL_FILTER,this.passes=[this],this.shaders=[],this.dirty=!0,this.padding=0,this.uniforms={time:{type:"1f",value:0},resolution:{type:"2f",value:{x:256,y:256}},mouse:{type:"2f",value:{x:0,y:0}}},this.fragmentSrc=d||[]},b.Filter.prototype={init:function(){},setResolution:function(a,b){this.uniforms.resolution.value.x=a,this.uniforms.resolution.value.y=b},update:function(a){"undefined"!=typeof a&&(a.x>0&&(this.uniforms.mouse.x=a.x.toFixed(2)),a.y>0&&(this.uniforms.mouse.y=a.y.toFixed(2))),this.uniforms.time.value=this.game.time.totalElapsedSeconds()},destroy:function(){this.game=null}},b.Filter.prototype.constructor=b.Filter,Object.defineProperty(b.Filter.prototype,"width",{get:function(){return this.uniforms.resolution.value.x},set:function(a){this.uniforms.resolution.value.x=a}}),Object.defineProperty(b.Filter.prototype,"height",{get:function(){return this.uniforms.resolution.value.y},set:function(a){this.uniforms.resolution.value.y=a }}),b.Plugin=function(a,b){"undefined"==typeof b&&(b=null),this.game=a,this.parent=b,this.active=!1,this.visible=!1,this.hasPreUpdate=!1,this.hasUpdate=!1,this.hasPostUpdate=!1,this.hasRender=!1,this.hasPostRender=!1},b.Plugin.prototype={preUpdate:function(){},update:function(){},render:function(){},postRender:function(){},destroy:function(){this.game=null,this.parent=null,this.active=!1,this.visible=!1}},b.Plugin.prototype.constructor=b.Plugin,b.PluginManager=function(a,b){this.game=a,this._parent=b,this.plugins=[],this._pluginsLength=0},b.PluginManager.prototype={add:function(a){var b=!1;return"function"==typeof a?a=new a(this.game,this._parent):(a.game=this.game,a.parent=this._parent),"function"==typeof a.preUpdate&&(a.hasPreUpdate=!0,b=!0),"function"==typeof a.update&&(a.hasUpdate=!0,b=!0),"function"==typeof a.postUpdate&&(a.hasPostUpdate=!0,b=!0),"function"==typeof a.render&&(a.hasRender=!0,b=!0),"function"==typeof a.postRender&&(a.hasPostRender=!0,b=!0),b?((a.hasPreUpdate||a.hasUpdate||a.hasPostUpdate)&&(a.active=!0),(a.hasRender||a.hasPostRender)&&(a.visible=!0),this._pluginsLength=this.plugins.push(a),"function"==typeof a.init&&a.init(),a):null},remove:function(a){if(0!==this._pluginsLength)for(this._p=0;this._pb;b++)this.children[b].preUpdate()},b.Stage.prototype.update=function(){for(var a=this.children.length;a--;)this.children[a].update()},b.Stage.prototype.postUpdate=function(){if(this.game.world.camera.target){this.game.world.camera.target.postUpdate(),this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a]!==this.game.world.camera.target&&this.children[a].postUpdate()}else{this.game.world.camera.update();for(var a=this.children.length;a--;)this.children[a].postUpdate()}this.checkOffsetInterval!==!1&&this.game.time.now>this._nextOffsetCheck&&(b.Canvas.getOffset(this.game.canvas,this.offset),this._nextOffsetCheck=this.game.time.now+this.checkOffsetInterval)},b.Stage.prototype.parseConfig=function(a){this.game.canvas=a.canvasID?b.Canvas.create(this.game.width,this.game.height,a.canvasID):b.Canvas.create(this.game.width,this.game.height),a.canvasStyle?this.game.canvas.stlye=a.canvasStyle:this.game.canvas.style["-webkit-full-screen"]="width: 100%; height: 100%",a.checkOffsetInterval&&(this.checkOffsetInterval=a.checkOffsetInterval),a.disableVisibilityChange&&(this.disableVisibilityChange=a.disableVisibilityChange),a.fullScreenScaleMode&&(this.fullScreenScaleMode=a.fullScreenScaleMode),a.scaleMode&&(this.scaleMode=a.scaleMode),a.backgroundColor&&(this.backgroundColor=a.backgroundColor)},b.Stage.prototype.boot=function(){b.Canvas.getOffset(this.game.canvas,this.offset),this.bounds=new b.Rectangle(this.offset.x,this.offset.y,this.game.width,this.game.height);var a=this;this._onChange=function(b){return a.visibilityChange(b)},b.Canvas.setUserSelect(this.game.canvas,"none"),b.Canvas.setTouchAction(this.game.canvas,"none"),this.checkVisibility()},b.Stage.prototype.checkVisibility=function(){this._hiddenVar=void 0!==document.webkitHidden?"webkitvisibilitychange":void 0!==document.mozHidden?"mozvisibilitychange":void 0!==document.msHidden?"msvisibilitychange":void 0!==document.hidden?"visibilitychange":null,this._hiddenVar&&document.addEventListener(this._hiddenVar,this._onChange,!1),window.onpagehide=this._onChange,window.onpageshow=this._onChange,window.onblur=this._onChange,window.onfocus=this._onChange},b.Stage.prototype.visibilityChange=function(a){return this.disableVisibilityChange?void 0:"pagehide"===a.type||"blur"===a.type||"pageshow"===a.type||"focus"===a.type?void("pagehide"===a.type||"blur"===a.type?this.game.focusLoss(a):("pageshow"===a.type||"focus"===a.type)&&this.game.focusGain(a)):void(document.hidden||document.mozHidden||document.msHidden||document.webkitHidden?this.game.gamePaused(a):this.game.gameResumed(a))},b.Stage.prototype.setBackgroundColor=function(a){this._backgroundColor=a||0,this.backgroundColorSplit=PIXI.hex2rgb(this.backgroundColor);var b=this._backgroundColor.toString(16);b="000000".substr(0,6-b.length)+b,this.backgroundColorString="#"+b},Object.defineProperty(b.Stage.prototype,"backgroundColor",{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this.game.transparent===!1&&("string"==typeof a&&(a=b.Color.hexToRGB(a)),this.setBackgroundColor(a))}}),Object.defineProperty(b.Stage.prototype,"smoothed",{get:function(){return!PIXI.scaleModes.LINEAR},set:function(a){PIXI.scaleModes.LINEAR=a?0:1}}),b.Group=function(a,c,d,e,f,g){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=b.Physics.ARCADE),this.game=a,"undefined"==typeof c&&(c=a.world),this.name=d||"group",PIXI.DisplayObjectContainer.call(this),e?this.game.stage.addChild(this):c&&c.addChild(this),this.z=0,this.type=b.GROUP,this.alive=!0,this.exists=!0,this.scale=new b.Point(1,1),this.cursor=null,this.cameraOffset=new b.Point,this.enableBody=f,this.enableBodyDebug=!1,this.physicsBodyType=g,this._sortProperty="z",this._cache=[0,0,0,0,1,0,1,0,0,0]},b.Group.prototype=Object.create(PIXI.DisplayObjectContainer.prototype),b.Group.prototype.constructor=b.Group,b.Group.RETURN_NONE=0,b.Group.RETURN_TOTAL=1,b.Group.RETURN_CHILD=2,b.Group.SORT_ASCENDING=-1,b.Group.SORT_DESCENDING=1,b.Group.prototype.add=function(a){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChild(a),a.z=this.children.length,a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.addAt=function(a,b){return a.parent!==this&&(this.enableBody&&this.game.physics.enable(a,this.physicsBodyType),this.addChildAt(a,b),this.updateZ(),a.events&&a.events.onAddedToGroup.dispatch(a,this),null===this.cursor&&(this.cursor=a)),a},b.Group.prototype.getAt=function(a){return 0>a||a>=this.children.length?-1:this.getChildAt(a)},b.Group.prototype.create=function(a,c,d,e,f){"undefined"==typeof f&&(f=!0);var g=new b.Sprite(this.game,a,c,d,e);return this.enableBody&&this.game.physics.enable(g,this.physicsBodyType),g.exists=f,g.visible=f,g.alive=f,this.addChild(g),g.z=this.children.length,g.events&&g.events.onAddedToGroup.dispatch(g,this),null===this.cursor&&(this.cursor=g),g},b.Group.prototype.createMultiple=function(a,b,c,d){"undefined"==typeof d&&(d=!1);for(var e=0;a>e;e++)this.create(0,0,b,c,d)},b.Group.prototype.updateZ=function(){for(var a=this.children.length;a--;)this.children[a].z=a},b.Group.prototype.next=function(){this.cursor&&(this._cache[8]===this.children.length?this._cache[8]=0:this._cache[8]++,this.cursor=this.children[this._cache[8]])},b.Group.prototype.previous=function(){this.cursor&&(0===this._cache[8]?this._cache[8]=this.children.length-1:this._cache[8]--,this.cursor=this.children[this._cache[8]])},b.Group.prototype.swap=function(a,b){var c=this.swapChildren(a,b);return c&&this.updateZ(),c},b.Group.prototype.bringToTop=function(a){return a.parent===this&&this.getIndex(a)0&&(this.remove(a),this.addAt(a,0)),a},b.Group.prototype.moveUp=function(a){if(a.parent===this&&this.getIndex(a)0){var b=this.getIndex(a),c=this.getAt(b-1);c&&this.swap(b,c)}return a},b.Group.prototype.xy=function(a,b,c){return 0>a||a>this.children.length?-1:(this.getChildAt(a).x=b,void(this.getChildAt(a).y=c))},b.Group.prototype.reverse=function(){this.children.reverse(),this.updateZ()},b.Group.prototype.getIndex=function(a){return this.children.indexOf(a)},b.Group.prototype.replace=function(a,c){var d=this.getIndex(a);if(-1!==d){void 0!==c.parent&&(c.events.onRemovedFromGroup.dispatch(c,this),c.parent.removeChild(c),c.parent instanceof b.Group&&c.parent.updateZ());var e=a;return this.remove(e),this.addAt(c,d),e}},b.Group.prototype.setProperty=function(a,b,c,d){d=d||0;var e=b.length;1==e?0===d?a[b[0]]=c:1==d?a[b[0]]+=c:2==d?a[b[0]]-=c:3==d?a[b[0]]*=c:4==d&&(a[b[0]]/=c):2==e?0===d?a[b[0]][b[1]]=c:1==d?a[b[0]][b[1]]+=c:2==d?a[b[0]][b[1]]-=c:3==d?a[b[0]][b[1]]*=c:4==d&&(a[b[0]][b[1]]/=c):3==e?0===d?a[b[0]][b[1]][b[2]]=c:1==d?a[b[0]][b[1]][b[2]]+=c:2==d?a[b[0]][b[1]][b[2]]-=c:3==d?a[b[0]][b[1]][b[2]]*=c:4==d&&(a[b[0]][b[1]][b[2]]/=c):4==e&&(0===d?a[b[0]][b[1]][b[2]][b[3]]=c:1==d?a[b[0]][b[1]][b[2]][b[3]]+=c:2==d?a[b[0]][b[1]][b[2]][b[3]]-=c:3==d?a[b[0]][b[1]][b[2]][b[3]]*=c:4==d&&(a[b[0]][b[1]][b[2]][b[3]]/=c))},b.Group.prototype.set=function(a,b,c,d,e,f){b=b.split("."),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),(d===!1||d&&a.alive)&&(e===!1||e&&a.visible)&&this.setProperty(a,b,c,f)},b.Group.prototype.setAll=function(a,b,c,d,e){a=a.split("."),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),e=e||0;for(var f=0,g=this.children.length;g>f;f++)(!c||c&&this.children[f].alive)&&(!d||d&&this.children[f].visible)&&this.setProperty(this.children[f],a,b,e)},b.Group.prototype.setAllChildren=function(a,c,d,e,f){"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1),f=f||0;for(var g=0,h=this.children.length;h>g;g++)(!d||d&&this.children[g].alive)&&(!e||e&&this.children[g].visible)&&(this.children[g]instanceof b.Group?this.children[g].setAllChildren(a,c,d,e,f):this.setProperty(this.children[g],a.split("."),c,f))},b.Group.prototype.addAll=function(a,b,c,d){this.setAll(a,b,c,d,1)},b.Group.prototype.subAll=function(a,b,c,d){this.setAll(a,b,c,d,2)},b.Group.prototype.multiplyAll=function(a,b,c,d){this.setAll(a,b,c,d,3)},b.Group.prototype.divideAll=function(a,b,c,d){this.setAll(a,b,c,d,4)},b.Group.prototype.callAllExists=function(a,b){for(var c=Array.prototype.splice.call(arguments,2),d=0,e=this.children.length;e>d;d++)this.children[d].exists===b&&this.children[d][a]&&this.children[d][a].apply(this.children[d],c)},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||null===b||""===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){this.children.length<2||("undefined"==typeof a&&(a="z"),"undefined"==typeof c&&(c=b.Group.SORT_ASCENDING),this._sortProperty=a,this.children.sort(c===b.Group.SORT_ASCENDING?this.ascendingSortHandler.bind(this):this.descendingSortHandler.bind(this)),this.updateZ())},b.Group.prototype.ascendingSortHandler=function(a,b){return a[this._sortProperty]b[this._sortProperty]?1:a.zb[this._sortProperty]?-1:0},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.getTop=function(){return this.children.length>0?this.children[this.children.length-1]:void 0},b.Group.prototype.getBottom=function(){return this.children.length>0?this.children[0]:void 0},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.updateZ(),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===this.children[c]&&(this.cursor=null);this.updateZ()}},b.Group.prototype.destroy=function(a,b){if(null!==this.game){if("undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!1),a){if(this.children.length>0)do this.children[0].parent&&this.children[0].destroy(a);while(this.children.length>0)}else this.removeAll();this.cursor=null,b||(this.parent.removeChild(this),this.game=null,this.exists=!1)}},Object.defineProperty(b.Group.prototype,"total",{get:function(){return this.iterate("exists",!0,b.Group.RETURN_TOTAL)}}),Object.defineProperty(b.Group.prototype,"length",{get:function(){return this.children.length}}),Object.defineProperty(b.Group.prototype,"angle",{get:function(){return b.Math.radToDeg(this.rotation)},set:function(a){this.rotation=b.Math.degToRad(a)}}),Object.defineProperty(b.Group.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),b.World=function(a){b.Group.call(this,a,null,"__world",!1),this.bounds=new b.Rectangle(0,0,a.width,a.height),this.camera=null},b.World.prototype=Object.create(b.Group.prototype),b.World.prototype.constructor=b.World,b.World.prototype.boot=function(){this.camera=new b.Camera(this.game,0,0,0,this.game.width,this.game.height),this.camera.displayObject=this,this.camera.scale=this.scale,this.game.camera=this.camera,this.game.stage.addChild(this)},b.World.prototype.setBounds=function(a,b,c,d){cwindow.outerHeight&&(this.orientation=90),this.scaleFactor=new b.Point(1,1),this.scaleFactorInversed=new b.Point(1,1),this.margin=new b.Point(0,0),this.aspectRatio=0,this.sourceAspectRatio=c/d,this.event=null,this.scaleMode=b.ScaleManager.NO_SCALE,this.fullScreenScaleMode=b.ScaleManager.NO_SCALE,this._startHeight=0,this._width=0,this._height=0;var e=this;window.addEventListener("orientationchange",function(a){return e.checkOrientation(a)},!1),window.addEventListener("resize",function(a){return e.checkResize(a)},!1),document.addEventListener("webkitfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("mozfullscreenchange",function(a){return e.fullScreenChange(a)},!1),document.addEventListener("fullscreenchange",function(a){return e.fullScreenChange(a)},!1)},b.ScaleManager.EXACT_FIT=0,b.ScaleManager.NO_SCALE=1,b.ScaleManager.SHOW_ALL=2,b.ScaleManager.prototype={startFullScreen:function(a){!this.isFullScreen&&this.game.device.fullscreen&&("undefined"!=typeof a&&this.game.renderType===b.CANVAS&&(this.game.stage.smoothed=a),this._width=this.width,this._height=this.height,this.game.device.fullscreenKeyboard?this.fullScreenTarget[this.game.device.requestFullscreen](Element.ALLOW_KEYBOARD_INPUT):this.fullScreenTarget[this.game.device.requestFullscreen]())},stopFullScreen:function(){this.fullScreenTarget[this.game.device.cancelFullscreen]()},fullScreenChange:function(a){this.event=a,this.isFullScreen?(this.fullScreenScaleMode===b.ScaleManager.EXACT_FIT?(this.fullScreenTarget.style.width="100%",this.fullScreenTarget.style.height="100%",this.width=window.outerWidth,this.height=window.outerHeight,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.checkResize()):this.fullScreenScaleMode===b.ScaleManager.SHOW_ALL&&(this.setShowAll(),this.refresh()),this.enterFullScreen.dispatch(this.width,this.height)):(this.fullScreenTarget.style.width=this.game.width+"px",this.fullScreenTarget.style.height=this.game.height+"px",this.width=this._width,this.height=this._height,this.game.input.scale.setTo(this.game.width/this.width,this.game.height/this.height),this.aspectRatio=this.width/this.height,this.scaleFactor.x=this.game.width/this.width,this.scaleFactor.y=this.game.height/this.height,this.leaveFullScreen.dispatch(this.width,this.height))},forceOrientation:function(a,c,d){"undefined"==typeof c&&(c=!1),this.forceLandscape=a,this.forcePortrait=c,"undefined"!=typeof d&&((null==d||this.game.cache.checkImageKey(d)===!1)&&(d="__default"),this.orientationSprite=new b.Image(this.game,this.game.width/2,this.game.height/2,PIXI.TextureCache[d]),this.orientationSprite.anchor.set(.5),this.checkOrientationState(),this.incorrectOrientation?(this.orientationSprite.visible=!0,this.game.world.visible=!1):(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.game.stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh()):(this.forceLandscape&&window.innerWidthwindow.outerHeight?90:0,this.isLandscape?this.enterLandscape.dispatch(this.orientation,!0,!1):this.enterPortrait.dispatch(this.orientation,!1,!0),this.scaleMode!==b.ScaleManager.NO_SCALE&&this.refresh(),this.checkOrientationState()},refresh:function(){if(this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),null==this._check&&this.maxIterations>0){this._iterations=this.maxIterations;var a=this;this._check=window.setInterval(function(){return a.setScreenSize()},10),this.setScreenSize()}},setScreenSize:function(a){"undefined"==typeof a&&(a=!1),this.game.device.iPad===!1&&this.game.device.webApp===!1&&this.game.device.desktop===!1&&(this.game.device.android&&this.game.device.chrome===!1?window.scrollTo(0,1):window.scrollTo(0,0)),this._iterations--,(a||window.innerHeight>this._startHeight||this._iterations<0)&&(document.documentElement.style.minHeight=window.innerHeight+"px",this.incorrectOrientation===!0?this.setMaximum():this.isFullScreen?this.fullScreenScaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.fullScreenScaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll():this.scaleMode==b.ScaleManager.EXACT_FIT?this.setExactFit():this.scaleMode==b.ScaleManager.SHOW_ALL&&this.setShowAll(),this.setSize(),clearInterval(this._check),this._check=null)},setSize:function(){this.incorrectOrientation===!1&&(this.maxWidth&&this.width>this.maxWidth&&(this.width=this.maxWidth),this.maxHeight&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.minWidth&&this.widththis.maxWidth?this.maxWidth:a,this.height=this.maxHeight&&b>this.maxHeight?this.maxHeight:b}},b.ScaleManager.prototype.constructor=b.ScaleManager,Object.defineProperty(b.ScaleManager.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(b.ScaleManager.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(b.ScaleManager.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),b.Game=function(a,c,d,e,f,g,h,i){this.id=b.GAMES.push(this)-1,this.config=null,this.physicsConfig=i,this.parent="",this.width=800,this.height=600,this.transparent=!1,this.antialias=!0,this.renderer=b.AUTO,this.renderType=b.AUTO,this.state=null,this.isBooted=!1,this.isRunning=!1,this.raf=null,this.add=null,this.make=null,this.cache=null,this.input=null,this.load=null,this.math=null,this.net=null,this.scale=null,this.sound=null,this.stage=null,this.time=null,this.tweens=null,this.world=null,this.physics=null,this.rnd=null,this.device=null,this.camera=null,this.canvas=null,this.context=null,this.debug=null,this.particles=null,this.stepping=!1,this.pendingStep=!1,this.stepCount=0,this.onPause=null,this.onResume=null,this.onBlur=null,this.onFocus=null,this._paused=!1,this._codePaused=!1,1===arguments.length&&"object"==typeof arguments[0]?this.parseConfig(arguments[0]):("undefined"!=typeof a&&(this.width=a),"undefined"!=typeof c&&(this.height=c),"undefined"!=typeof d&&(this.renderer=d,this.renderType=d),"undefined"!=typeof e&&(this.parent=e),"undefined"!=typeof g&&(this.transparent=g),"undefined"!=typeof h&&(this.antialias=h),this.rnd=new b.RandomDataGenerator([(Date.now()*Math.random()).toString()]),this.state=new b.StateManager(this,f));var j=this;return this._onBoot=function(){return j.boot()},"complete"===document.readyState||"interactive"===document.readyState?window.setTimeout(this._onBoot,0):(document.addEventListener("DOMContentLoaded",this._onBoot,!1),window.addEventListener("load",this._onBoot,!1)),this},b.Game.prototype={parseConfig:function(a){this.config=a,a.width&&(this.width=b.Utils.parseDimension(a.width,0)),a.height&&(this.height=b.Utils.parseDimension(a.height,1)),a.renderer&&(this.renderer=a.renderer,this.renderType=a.renderer),a.parent&&(this.parent=a.parent),a.transparent&&(this.transparent=a.transparent),a.antialias&&(this.antialias=a.antialias),a.physicsConfig&&(this.physicsConfig=a.physicsConfig);var c=[(Date.now()*Math.random()).toString()];a.seed&&(c=a.seed),this.rnd=new b.RandomDataGenerator(c);var d=null;a.state&&(d=a.state),this.state=new b.StateManager(this,d)},boot:function(){this.isBooted||(document.body?(document.removeEventListener("DOMContentLoaded",this._onBoot),window.removeEventListener("load",this._onBoot),this.onPause=new b.Signal,this.onResume=new b.Signal,this.onBlur=new b.Signal,this.onFocus=new b.Signal,this.isBooted=!0,this.device=new b.Device(this),this.math=b.Math,this.stage=new b.Stage(this,this.width,this.height),this.scale=new b.ScaleManager(this,this.width,this.height),this.setUpRenderer(),this.device.checkFullScreenSupport(),this.world=new b.World(this),this.add=new b.GameObjectFactory(this),this.make=new b.GameObjectCreator(this),this.cache=new b.Cache(this),this.load=new b.Loader(this),this.time=new b.Time(this),this.tweens=new b.TweenManager(this),this.input=new b.Input(this),this.sound=new b.SoundManager(this),this.physics=new b.Physics(this,this.physicsConfig),this.particles=new b.Particles(this),this.plugins=new b.PluginManager(this,this),this.net=new b.Net(this),this.debug=new b.Utils.Debug(this),this.time.boot(),this.stage.boot(),this.world.boot(),this.input.boot(),this.sound.boot(),this.state.boot(),this.debug.boot(),this.showDebugHeader(),this.isRunning=!0,this.raf=this.config&&this.config.forceSetTimeOut?new b.RequestAnimationFrame(this,this.config.forceSetTimeOut):new b.RequestAnimationFrame(this,!1),this.raf.start()):window.setTimeout(this._onBoot,20))},showDebugHeader:function(){var a=b.DEV_VERSION,c="Canvas",d="HTML Audio",e=1;if(this.renderType===b.WEBGL?(c="WebGL",e++):this.renderType==b.HEADLESS&&(c="Headless"),this.device.webAudio&&(d="WebAudio",e++),this.device.chrome){for(var f=["%c %c %c Phaser v"+a+" - "+c+" - "+d+" %c %c http://phaser.io %c %c ♥%c♥%c♥ ","background: #0cf300","background: #00bc17","color: #ffffff; background: #00711f;","background: #00bc17","background: #0cf300","background: #00bc17"],g=0;3>g;g++)f.push(e>g?"color: #ff2424; background: #fff":"color: #959595; background: #fff");console.log.apply(console,f)}else console.log("Phaser v"+a+" - Renderer: "+c+" - Audio: "+d+" - http://phaser.io") -},setUpRenderer:function(){if(this.device.trident&&(this.renderType=b.CANVAS),this.renderType===b.HEADLESS||this.renderType===b.CANVAS||this.renderType===b.AUTO&&this.device.webGL===!1){if(!this.device.canvas)throw new Error("Phaser.Game - cannot create Canvas or WebGL context, aborting.");this.renderType===b.AUTO&&(this.renderType=b.CANVAS),this.renderer=new PIXI.CanvasRenderer(this.width,this.height,this.canvas,this.transparent),this.context=this.renderer.context}else this.renderType=b.WEBGL,this.renderer=new PIXI.WebGLRenderer(this.width,this.height,this.canvas,this.transparent,this.antialias),this.context=null;this.renderType!==b.HEADLESS&&(this.stage.smoothed=this.antialias,b.Canvas.addToDOM(this.canvas,this.parent,!0),b.Canvas.setTouchAction(this.canvas))},update:function(a){this.time.update(a),this._paused||this.pendingStep?this.debug.preUpdate():(this.stepping&&(this.pendingStep=!0),this.debug.preUpdate(),this.physics.preUpdate(),this.state.preUpdate(),this.plugins.preUpdate(),this.stage.preUpdate(),this.stage.update(),this.tweens.update(),this.sound.update(),this.input.update(),this.state.update(),this.physics.update(),this.particles.update(),this.plugins.update(),this.stage.postUpdate(),this.plugins.postUpdate()),this.renderType!=b.HEADLESS&&(this.renderer.render(this.stage),this.plugins.render(),this.state.render(),this.plugins.postRender())},enableStep:function(){this.stepping=!0,this.pendingStep=!1,this.stepCount=0},disableStep:function(){this.stepping=!1,this.pendingStep=!1},step:function(){this.pendingStep=!1,this.stepCount++},destroy:function(){this.raf.stop(),this.input.destroy(),this.state.destroy(),this.physics.destroy(),this.state=null,this.cache=null,this.input=null,this.load=null,this.sound=null,this.stage=null,this.time=null,this.world=null,this.isBooted=!1},gamePaused:function(a){this._paused||(this._paused=!0,this.time.gamePaused(),this.sound.setMute(),this.onPause.dispatch(a))},gameResumed:function(a){this._paused&&!this._codePaused&&(this._paused=!1,this.time.gameResumed(),this.input.reset(),this.sound.unsetMute(),this.onResume.dispatch(a))},focusLoss:function(a){this.onBlur.dispatch(a),this.gamePaused(a)},focusGain:function(a){this.onFocus.dispatch(a),this.gameResumed(a)}},b.Game.prototype.constructor=b.Game,Object.defineProperty(b.Game.prototype,"paused",{get:function(){return this._paused},set:function(a){a===!0?this._paused===!1&&(this._paused=!0,this._codePaused=!0,this.sound.mute=!0,this.time.gamePaused(),this.onPause.dispatch(this)):this._paused&&(this._paused=!1,this._codePaused=!1,this.input.reset(),this.sound.mute=!1,this.time.gameResumed(),this.onResume.dispatch(this))}}),b.Input=function(a){this.game=a,this.hitCanvas=null,this.hitContext=null,this.moveCallback=null,this.moveCallbackContext=this,this.pollRate=0,this.disabled=!1,this.multiInputOverride=b.Input.MOUSE_TOUCH_COMBINE,this.position=null,this.speed=null,this.circle=null,this.scale=null,this.maxPointers=10,this.currentPointers=0,this.tapRate=200,this.doubleTapRate=300,this.holdRate=2e3,this.justPressedRate=200,this.justReleasedRate=200,this.recordPointerHistory=!1,this.recordRate=100,this.recordLimit=100,this.pointer1=null,this.pointer2=null,this.pointer3=null,this.pointer4=null,this.pointer5=null,this.pointer6=null,this.pointer7=null,this.pointer8=null,this.pointer9=null,this.pointer10=null,this.activePointer=null,this.mousePointer=null,this.mouse=null,this.keyboard=null,this.touch=null,this.mspointer=null,this.gamepad=null,this.onDown=null,this.onUp=null,this.onTap=null,this.onHold=null,this.interactiveItems=new b.LinkedList,this._localPoint=new b.Point,this._pollCounter=0,this._oldPosition=null,this._x=0,this._y=0},b.Input.MOUSE_OVERRIDES_TOUCH=0,b.Input.TOUCH_OVERRIDES_MOUSE=1,b.Input.MOUSE_TOUCH_COMBINE=2,b.Input.prototype={boot:function(){this.mousePointer=new b.Pointer(this.game,0),this.pointer1=new b.Pointer(this.game,1),this.pointer2=new b.Pointer(this.game,2),this.mouse=new b.Mouse(this.game),this.keyboard=new b.Keyboard(this.game),this.touch=new b.Touch(this.game),this.mspointer=new b.MSPointer(this.game),this.gamepad=new b.Gamepad(this.game),this.onDown=new b.Signal,this.onUp=new b.Signal,this.onTap=new b.Signal,this.onHold=new b.Signal,this.scale=new b.Point(1,1),this.speed=new b.Point,this.position=new b.Point,this._oldPosition=new b.Point,this.circle=new b.Circle(0,0,44),this.activePointer=this.mousePointer,this.currentPointers=0,this.hitCanvas=document.createElement("canvas"),this.hitCanvas.width=1,this.hitCanvas.height=1,this.hitContext=this.hitCanvas.getContext("2d"),this.mouse.start(),this.keyboard.start(),this.touch.start(),this.mspointer.start(),this.mousePointer.active=!0},destroy:function(){this.mouse.stop(),this.keyboard.stop(),this.touch.stop(),this.mspointer.stop(),this.gamepad.stop(),this.moveCallback=null},setMoveCallback:function(a,b){this.moveCallback=a,this.moveCallbackContext=b},addPointer:function(){for(var a=0,c=10;c>0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b0;c--)null===this["pointer"+c]&&(a=c);return 0===a?(console.warn("You can only have 10 Pointer objects"),null):(this["pointer"+a]=new b.Pointer(this.game,a),this["pointer"+a])},update:function(){return this.keyboard.update(),this.pollRate>0&&this._pollCounter=c;c++)this["pointer"+c]&&this["pointer"+c].reset();this.currentPointers=0,"none"!==this.game.canvas.style.cursor&&(this.game.canvas.style.cursor="inherit"),a===!0&&(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.interactiveItems.callAll("reset")),this._pollCounter=0}},resetSpeed:function(a,b){this._oldPosition.setTo(a,b),this.speed.setTo(0,0)},startPointer:function(a){if(this.maxPointers<10&&this.totalActivePointers==this.maxPointers)return null;if(this.pointer1.active===!1)return this.pointer1.start(a);if(this.pointer2.active===!1)return this.pointer2.start(a);for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active===!1)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].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=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active&&this["pointer"+b].identifier==a.identifier)return this["pointer"+b].stop(a);return null},getPointer:function(a){if(a=a||!1,this.pointer1.active==a)return this.pointer1;if(this.pointer2.active==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].active==a)return this["pointer"+b];return null},getPointerFromIdentifier:function(a){if(this.pointer1.identifier==a)return this.pointer1;if(this.pointer2.identifier==a)return this.pointer2;for(var b=3;10>=b;b++)if(this["pointer"+b]&&this["pointer"+b].identifier==a)return this["pointer"+b];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.b*-e.c);return d.setTo(e.d*f*c.x+-e.b*f*c.y+(e.ty*e.b-e.tx*e.d)*f,e.a*f*c.y+-e.c*f*c.x+(-e.ty*e.a+e.tx*e.c)*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)?!0:!1;if(a instanceof b.TileSprite){var e=a.width,f=a.height,g=-e*a.anchor.x;if(this._localPoint.x>g&&this._localPoint.xh&&this._localPoint.yg&&this._localPoint.xh&&this._localPoint.yi;i++)if(this.hitTest(a.children[i],c,d))return!0;return!1}},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)}}),Object.defineProperty(b.Input.prototype,"pollLocked",{get:function(){return this.pollRate>0&&this._pollCounter=a;a++)this["pointer"+a]&&this["pointer"+a].active&&this.currentPointers++;return this.currentPointers}}),Object.defineProperty(b.Input.prototype,"worldX",{get:function(){return this.game.camera.view.x+this.x}}),Object.defineProperty(b.Input.prototype,"worldY",{get:function(){return this.game.camera.view.y+this.y}}),b.Key=function(a,c){this.game=a,this.event=null,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.timeDown=0,this.duration=0,this.timeUp=-2500,this.repeats=0,this.keyCode=c,this.onDown=new b.Signal,this.onHoldCallback=null,this.onHoldContext=null,this.onUp=new b.Signal},b.Key.prototype={update:function(){this.isDown&&(this.duration=this.game.time.now-this.timeDown,this.repeats++,this.onHoldCallback&&this.onHoldCallback.call(this.onHoldContext,this))},processKeyDown:function(a){this.event=a,this.isDown||(this.altKey=a.altKey,this.ctrlKey=a.ctrlKey,this.shiftKey=a.shiftKey,this.isDown=!0,this.isUp=!1,this.timeDown=this.game.time.now,this.duration=0,this.repeats=0,this.onDown.dispatch(this))},processKeyUp:function(a){this.event=a,this.isUp||(this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown,this.onUp.dispatch(this))},reset:function(){this.isDown=!1,this.isUp=!0,this.timeUp=this.game.time.now,this.duration=this.game.time.now-this.timeDown},justPressed:function(a){return"undefined"==typeof a&&(a=2500),this.isDown&&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=Number.MAX_SAFE_INTEGER,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var d=this.game.input.interactiveItems.next;do d.validForInput(this._highestInputPriorityID,this._highestRenderOrderID)&&(!c&&d.checkPointerOver(this)||c&&d.checkPointerDown(this))&&(this._highestRenderOrderID=d.sprite._cache[3],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 void a.preventDefault();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.previousTapTime0&&(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.isDown===!0&&this.timeDown+a>this.game.time.now},justReleased:function(a){return a=a||this.game.input.justReleasedRate,this.isUp===!0&&this.timeUp+a>this.game.time.now},reset:function(){this.isMouse===!1&&(this.active=!1),this.identifier=null,this.isDown=!1,this.isUp=!0,this.totalTouches=0,this._holdSent=!1,this._history.length=0,this._stateReset=!0,this.targetObject&&this.targetObject._releasedHandler(this),this.targetObject=null}},b.Pointer.prototype.constructor=b.Pointer,Object.defineProperty(b.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(b.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(b.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),b.Touch=function(a){this.game=a,this.disabled=!1,this.callbackContext=this.game,this.touchStartCallback=null,this.touchMoveCallback=null,this.touchEndCallback=null,this.touchEnterCallback=null,this.touchLeaveCallback=null,this.touchCancelCallback=null,this.preventDefault=!0,this.event=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null,this._onTouchEnter=null,this._onTouchLeave=null,this._onTouchCancel=null,this._onTouchMove=null},b.Touch.prototype={start:function(){if(null===this._onTouchStart){var a=this;this.game.device.touch&&(this._onTouchStart=function(b){return a.onTouchStart(b)},this._onTouchMove=function(b){return a.onTouchMove(b)},this._onTouchEnd=function(b){return a.onTouchEnd(b)},this._onTouchEnter=function(b){return a.onTouchEnter(b)},this._onTouchLeave=function(b){return a.onTouchLeave(b)},this._onTouchCancel=function(b){return a.onTouchCancel(b)},this.game.canvas.addEventListener("touchstart",this._onTouchStart,!1),this.game.canvas.addEventListener("touchmove",this._onTouchMove,!1),this.game.canvas.addEventListener("touchend",this._onTouchEnd,!1),this.game.canvas.addEventListener("touchenter",this._onTouchEnter,!1),this.game.canvas.addEventListener("touchleave",this._onTouchLeave,!1),this.game.canvas.addEventListener("touchcancel",this._onTouchCancel,!1))}},consumeDocumentTouches:function(){this._documentTouchMove=function(a){a.preventDefault()},document.addEventListener("touchmove",this._documentTouchMove,!1)},onTouchStart:function(a){if(this.event=a,this.touchStartCallback&&this.touchStartCallback.call(this.callbackContext,a),!this.game.input.disabled&&!this.disabled){this.preventDefault&&a.preventDefault();for(var b=0;b0&&e>this.deadZone||0>e&&e<-this.deadZone?{axis:d,value:e}:{axis:d,value:0})}this._prevTimestamp=this._rawPad.timestamp}},connect:function(a){var b=!this._connected;this._index=a.index,this._connected=!0,this._rawPad=a,this._rawButtons=a.buttons,this._axes=a.axes,b&&this._padParent.onConnectCallback&&this._padParent.onConnectCallback.call(this._padParent.callbackContext,this._index),b&&this.onConnectCallback&&this.onConnectCallback.call(this.callbackContext)},disconnect:function(){var a=this._connected;this._connected=!1,this._rawPad=void 0,this._rawButtons=[],this._buttons=[];var b=this._index;this._index=null,a&&this._padParent.onDisconnectCallback&&this._padParent.onDisconnectCallback.call(this._padParent.callbackContext,b),a&&this.onDisconnectCallback&&this.onDisconnectCallback.call(this.callbackContext)},processAxisChange:function(a){this.game.input.disabled||this.game.input.gamepad.disabled||this._axes[a.axis]!==a.value&&(this._axes[a.axis]=a.value,this._padParent.onAxisCallback&&this._padParent.onAxisCallback.call(this._padParent.callbackContext,a,this._index),this.onAxisCallback&&this.onAxisCallback.call(this.callbackContext,a))},processButtonDown:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onDownCallback&&this._padParent.onDownCallback.call(this._padParent.callbackContext,a,b,this._index),this.onDownCallback&&this.onDownCallback.call(this.callbackContext,a,b),this._buttons[a]&&this._buttons[a].isDown?this._buttons[a].duration=this.game.time.now-this._buttons[a].timeDown:this._buttons[a]?(this._buttons[a].isDown=!0,this._buttons[a].timeDown=this.game.time.now,this._buttons[a].duration=0,this._buttons[a].value=b):this._buttons[a]={isDown:!0,timeDown:this.game.time.now,timeUp:0,duration:0,value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonDown(b))},processButtonUp:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onUpCallback&&this._padParent.onUpCallback.call(this._padParent.callbackContext,a,b,this._index),this.onUpCallback&&this.onUpCallback.call(this.callbackContext,a,b),this._hotkeys[a]&&this._hotkeys[a].processButtonUp(b),this._buttons[a]?(this._buttons[a].isDown=!1,this._buttons[a].timeUp=this.game.time.now,this._buttons[a].value=b):this._buttons[a]={isDown:!1,timeDown:this.game.time.now,timeUp:this.game.time.now,duration:0,value:b})},processButtonFloat:function(a,b){this.game.input.disabled||this.game.input.gamepad.disabled||(this._padParent.onFloatCallback&&this._padParent.onFloatCallback.call(this._padParent.callbackContext,a,b,this._index),this.onFloatCallback&&this.onFloatCallback.call(this.callbackContext,a,b),this._buttons[a]?this._buttons[a].value=b:this._buttons[a]={value:b},this._hotkeys[a]&&this._hotkeys[a].processButtonFloat(b))},axis:function(a){return this._axes[a]?this._axes[a]:!1},isDown:function(a){return this._buttons[a]?this._buttons[a].isDown:!1},justReleased:function(a,b){return"undefined"==typeof b&&(b=250),this._buttons[a]&&this._buttons[a].isDown===!1&&this.game.time.now-this._buttons[a].timeUpd;d++)this._pointerData[d]={id:d,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1};this.snapOffset=new b.Point,this.enabled=!0,this.sprite.events&&null===this.sprite.events.onInputOver&&(this.sprite.events.onInputOver=new b.Signal,this.sprite.events.onInputOut=new b.Signal,this.sprite.events.onInputDown=new b.Signal,this.sprite.events.onInputUp=new b.Signal,this.sprite.events.onDragStart=new b.Signal,this.sprite.events.onDragStop=new b.Signal)}return this.sprite},reset:function(){this.enabled=!1;for(var a=0;10>a;a++)this._pointerData[a]={id:a,x:0,y:0,isDown:!1,isUp:!1,isOver:!1,isOut:!1,timeOver:0,timeOut:0,timeDown:0,timeUp:0,downDuration:0,isDragged:!1}},stop:function(){this.enabled!==!1&&(this.enabled=!1,this.game.input.interactiveItems.remove(this))},destroy:function(){this.enabled&&(this._setHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.enabled=!1,this.game.input.interactiveItems.remove(this),this._pointerData.length=0,this.boundsRect=null,this.boundsSprite=null,this.sprite=null)},validForInput:function(a,b){return 0===this.sprite.scale.x||0===this.sprite.scale.y?!1:this.pixelPerfectClick||this.pixelPerfectOver?!0:this.priorityID>a||this.priorityID===a&&this.sprite._cache[3]b;b++)if(this._pointerData[b].isOver)return!0}return!1},pointerOut:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOut;for(var b=0;10>b;b++)if(this._pointerData[b].isOut)return!0}return!1},pointerTimeOver:function(a){return a=a||0,this._pointerData[a].timeOver},pointerTimeOut:function(a){return a=a||0,this._pointerData[a].timeOut},pointerDragged:function(a){return a=a||0,this._pointerData[a].isDragged},checkPointerDown:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectClick?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPointerOver:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.parent.visible===!1?!1:this.game.input.hitTest(this.sprite,a,this._tempPoint)?this.pixelPerfectOver?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:!1},checkPixel:function(a,b,c){if(this.sprite.texture.baseTexture.source){if(this.game.input.hitContext.clearRect(0,0,1,1),null===a&&null===b){this.game.input.getLocalPosition(this.sprite,c,this._tempPoint);var a=this._tempPoint.x,b=this._tempPoint.y}0!==this.sprite.anchor.x&&(a-=-this.sprite.texture.frame.width*this.sprite.anchor.x),0!==this.sprite.anchor.y&&(b-=-this.sprite.texture.frame.height*this.sprite.anchor.y),a+=this.sprite.texture.frame.x,b+=this.sprite.texture.frame.y,this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source,a,b,1,1,0,0,1,1);var d=this.game.input.hitContext.getImageData(0,0,1,1);if(d.data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(a){return null!==this.sprite?this.enabled&&this.sprite.visible&&this.sprite.parent.visible?this.draggable&&this._draggedPointerID==a.id?this.updateDrag(a):this._pointerData[a.id].isOver===!0?this.checkPointerOver(a)?(this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,!0):(this._pointerOutHandler(a),!1):void 0:(this._pointerOutHandler(a),!1):void 0},_pointerOverHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isOver===!1&&(this._pointerData[a.id].isOver=!0,this._pointerData[a.id].isOut=!1,this._pointerData[a.id].timeOver=this.game.time.now,this._pointerData[a.id].x=a.x-this.sprite.x,this._pointerData[a.id].y=a.y-this.sprite.y,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="pointer",this._setHandCursor=!1),this.sprite.events.onInputOver.dispatch(this.sprite,a))},_pointerOutHandler:function(a){null!==this.sprite&&(this._pointerData[a.id].isOver=!1,this._pointerData[a.id].isOut=!0,this._pointerData[a.id].timeOut=this.game.time.now,this.useHandCursor&&this._pointerData[a.id].isDragged===!1&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1),this.sprite&&this.sprite.events&&this.sprite.events.onInputOut.dispatch(this.sprite,a))},_touchedHandler:function(a){if(null!==this.sprite){if(this._pointerData[a.id].isDown===!1&&this._pointerData[a.id].isOver===!0){if(this.pixelPerfectClick&&!this.checkPixel(null,null,a))return;this._pointerData[a.id].isDown=!0,this._pointerData[a.id].isUp=!1,this._pointerData[a.id].timeDown=this.game.time.now,this.sprite.events.onInputDown.dispatch(this.sprite,a),this.draggable&&this.isDragged===!1&&this.startDrag(a),this.bringToTop&&this.sprite.bringToTop()}return this.consumePointerEvent}},_releasedHandler:function(a){null!==this.sprite&&this._pointerData[a.id].isDown&&a.isUp&&(this._pointerData[a.id].isDown=!1,this._pointerData[a.id].isUp=!0,this._pointerData[a.id].timeUp=this.game.time.now,this._pointerData[a.id].downDuration=this._pointerData[a.id].timeUp-this._pointerData[a.id].timeDown,this.checkPointerOver(a)?this.sprite.events.onInputUp.dispatch(this.sprite,a,!0):(this.sprite.events.onInputUp.dispatch(this.sprite,a,!1),this.useHandCursor&&(this.game.canvas.style.cursor="default",this._setHandCursor=!1)),this.draggable&&this.isDragged&&this._draggedPointerID==a.id&&this.stopDrag(a))},updateDrag:function(a){return a.isUp?(this.stopDrag(a),!1):(this.sprite.fixedToCamera?(this.allowHorizontalDrag&&(this.sprite.cameraOffset.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.cameraOffset.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)):(this.allowHorizontalDrag&&(this.sprite.x=a.x+this._dragPoint.x+this.dragOffset.x),this.allowVerticalDrag&&(this.sprite.y=a.y+this._dragPoint.y+this.dragOffset.y),this.boundsRect&&this.checkBoundsRect(),this.boundsSprite&&this.checkBoundsSprite(),this.snapOnDrag&&(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),!0)},justOver:function(a,b){return a=a||0,b=b||500,this._pointerData[a].isOver&&this.overDuration(a)a;a++)this._pointerData[a].isDragged=!1;this.draggable=!1,this.isDragged=!1,this._draggedPointerID=-1},startDrag:function(a){if(this.isDragged=!0,this._draggedPointerID=a.id,this._pointerData[a.id].isDragged=!0,this.sprite.fixedToCamera)this.dragFromCenter?(this.sprite.centerOn(a.x,a.y),this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y)):this._dragPoint.setTo(this.sprite.cameraOffset.x-a.x,this.sprite.cameraOffset.y-a.y);else if(this.dragFromCenter){var b=this.sprite.getBounds();this.sprite.x=a.x+(this.sprite.x-b.centerX),this.sprite.y=a.y+(this.sprite.y-b.centerY),this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y)}else this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y);this.updateDrag(a),this.bringToTop&&this.sprite.bringToTop(),this.sprite.events.onDragStart.dispatch(this.sprite,a)},stopDrag:function(a){this.isDragged=!1,this._draggedPointerID=-1,this._pointerData[a.id].isDragged=!1,this.snapOnRelease&&(this.sprite.fixedToCamera?(this.sprite.cameraOffset.x=Math.round((this.sprite.cameraOffset.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.cameraOffset.y=Math.round((this.sprite.cameraOffset.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY):(this.sprite.x=Math.round((this.sprite.x-this.snapOffsetX%this.snapX)/this.snapX)*this.snapX+this.snapOffsetX%this.snapX,this.sprite.y=Math.round((this.sprite.y-this.snapOffsetY%this.snapY)/this.snapY)*this.snapY+this.snapOffsetY%this.snapY)),this.sprite.events.onDragStop.dispatch(this.sprite,a),this.checkPointerOver(a)===!1&&this._pointerOutHandler(a)},setDragLock:function(a,b){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=!0),this.allowHorizontalDrag=a,this.allowVerticalDrag=b},enableSnap:function(a,b,c,d,e,f){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.snapX=a,this.snapY=b,this.snapOffsetX=e,this.snapOffsetY=f,this.snapOnDrag=c,this.snapOnRelease=d},disableSnap:function(){this.snapOnDrag=!1,this.snapOnRelease=!1},checkBoundsRect:function(){this.sprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsRect.right&&(this.sprite.cameraOffset.x=this.boundsRect.right-this.sprite.width),this.sprite.cameraOffset.ythis.boundsRect.bottom&&(this.sprite.cameraOffset.y=this.boundsRect.bottom-this.sprite.height)):(this.sprite.xthis.boundsRect.right&&(this.sprite.x=this.boundsRect.right-this.sprite.width),this.sprite.ythis.boundsRect.bottom&&(this.sprite.y=this.boundsRect.bottom-this.sprite.height))},checkBoundsSprite:function(){this.sprite.fixedToCamera&&this.boundsSprite.fixedToCamera?(this.sprite.cameraOffset.xthis.boundsSprite.camerOffset.x+this.boundsSprite.width&&(this.sprite.cameraOffset.x=this.boundsSprite.camerOffset.x+this.boundsSprite.width-this.sprite.width),this.sprite.cameraOffset.ythis.boundsSprite.camerOffset.y+this.boundsSprite.height&&(this.sprite.cameraOffset.y=this.boundsSprite.camerOffset.y+this.boundsSprite.height-this.sprite.height)):(this.sprite.xthis.boundsSprite.x+this.boundsSprite.width&&(this.sprite.x=this.boundsSprite.x+this.boundsSprite.width-this.sprite.width),this.sprite.ythis.boundsSprite.y+this.boundsSprite.height&&(this.sprite.y=this.boundsSprite.y+this.boundsSprite.height-this.sprite.height))}},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.onEnterBounds=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,e,f){return new b.Group(this.game,a,c,d,e,f)},physicsGroup:function(a,c,d,e){return new b.Group(this.game,c,d,e,!0,a)},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))},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(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,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator=function(a){this.game=a,this.world=this.game.world},b.GameObjectCreator.prototype={image:function(a,c,d,e){return new b.Image(this.game,a,c,d,e)},sprite:function(a,c,d,e){return new b.Sprite(this.game,a,c,d,e)},tween:function(a){return new b.Tween(a,this.game)},group:function(a,c,d,e,f){return new b.Group(this.game,null,c,d,e,f)},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){return new b.TileSprite(this.game,a,c,d,e,f,g)},text:function(a,c,d,e){return new b.Text(this.game,a,c,d,e)},button:function(a,c,d,e,f,g,h,i,j){return new b.Button(this.game,a,c,d,e,f,g,h,i,j)},graphics:function(a,c){return new b.Graphics(this.game,a,c)},emitter:function(a,c,d){return new b.Particles.Arcade.Emitter(this.game,a,c,d)},retroFont:function(a,c,d,e,f,g,h,i,j){return new b.RetroFont(this.game,a,c,d,e,f,g,h,i,j)},bitmapText:function(a,c,d,e,f){return new b.BitmapText(this.game,a,c,d,e,f)},tilemap:function(a,c,d,e,f){return new b.Tilemap(this.game,a,c,d,e,f)},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,e){"undefined"==typeof e&&(e=!1),("undefined"==typeof d||""===d)&&(d=this.game.rnd.uuid());var f=new b.BitmapData(this.game,d,a,c);return e&&this.game.cache.addBitmapData(d,f),f},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.GameObjectCreator.prototype.constructor=b.GameObjectCreator,b.BitmapData=function(a,c,d,e){"undefined"==typeof d&&(d=100),"undefined"==typeof e&&(e=100),this.game=a,this.key=c,this.width=d,this.height=e,this.canvas=b.Canvas.create(d,e,"",!0),this.context=this.canvas.getContext("2d"),this.ctx=this.context,this.imageData=this.context.getImageData(0,0,d,e),this.pixels=this.imageData.data.buffer?this.imageData.data.buffer:this.imageData.data,this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,d,e,"bitmapData",a.rnd.uuid()),this.type=b.BITMAPDATA,this.dirty=!1},b.BitmapData.prototype={add:function(a){if(Array.isArray(a))for(var b=0;b=0&&a<=this.width&&b>=0&&b<=this.height&&(this.pixels[b*this.width+a]=f<<24|e<<16|d<<8|c,this.context.putImageData(this.imageData,0,0),this.dirty=!0)},setPixel:function(a,b,c,d,e){this.setPixel32(a,b,c,d,e,255)},getPixel:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixel32:function(a,b){return a>=0&&a<=this.width&&b>=0&&b<=this.height?this.data32[b*this.width+a]:void 0},getPixels:function(a){return this.context.getImageData(a.x,a.y,a.width,a.height)},copyPixels:function(a,b,c,d){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,b.x,b.y,b.width,b.height,c,d,b.width,b.height)},draw:function(a,b,c){"string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0,a.width,a.height,b,c,a.width,a.height)},alphaMask:function(a,b){var c=this.context.globalCompositeOperation;"string"==typeof b&&(b=this.game.cache.getImage(b)),b&&this.context.drawImage(b,0,0),this.context.globalCompositeOperation="source-atop","string"==typeof a&&(a=this.game.cache.getImage(a)),a&&this.context.drawImage(a,0,0),this.context.globalCompositeOperation=c},render:function(){this.game.renderType===b.WEBGL&&this.dirty&&(PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1)}},b.BitmapData.prototype.constructor=b.BitmapData,b.Sprite=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.name="",this.type=b.SPRITE,this.z=0,this.events=new b.Events(this),this.animations=new b.AnimationManager(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.body=null,this.health=1,this.lifespan=0,this.checkWorldBounds=!1,this.outOfBoundsKill=!1,this.debug=!1,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0],this._bounds=new b.Rectangle},b.Sprite.prototype=Object.create(PIXI.Sprite.prototype),b.Sprite.prototype.constructor=b.Sprite,b.Sprite.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;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA?this.ninja=new b.Physics.Ninja(this.game):a===b.Physics.BOX2D&&null===this.box2d||a===b.Physics.CHIPMUNK&&null===this.chipmunk},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);return a!==this._sx||b!==this._sy?(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),!0):!1},preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this.updateBounds()||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds())},postUpdate:function(){this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dx<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0)},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY() -},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"new velocity x: "+b.newVelocity.x.toFixed(2),"y: "+b.newVelocity.y.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.prototype={create:function(a,b,c,d,e){return"undefined"==typeof group&&(group=this.game.world),this.width=b,this.height=c,this.setTileSize(d,e),this.layers.length=0,this.createBlankLayer(a,b,c,d,e,group)},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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e0&&this.enable(a[i],b,c,d,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c,d,e):(this.enableBody(a,b,c,d),e&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,c,d,!0))},enableBody:function(a,b,c,d){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.Ninja.Body(this,a,b,c,d),a.anchor.set(.5))},setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c){b=a.getLayer(b),"undefined"==typeof addToWorld&&(addToWorld=!0),"undefined"==typeof optimize&&(optimize=!0),this.clearTilemapLayerBodies(a,b);for(var d=0,e=a.layers[b].height;e>d;d++)for(var f=0,g=a.layers[b].width;g>f;f++){var h=a.layers[b].data[d][f];if(h&&c.hasOwnProperty(h.index)){var i=new Phaser.Physics.Ninja.Body(this,null,3,c[h.index],0,h.worldX+h.centerX,h.worldY+h.centerY,h.width,h.height);a.layers[b].bodies.push(i)}}return a.layers[b].bodies},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,b,c,d,e,f){return"undefined"!=typeof b||a.type!==Phaser.GROUP&&a.type!==Phaser.EMITTER?void(a&&b&&a.exists&&b.exists&&(a.type==Phaser.SPRITE||a.type==Phaser.TILESPRITE?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsSprite(a,b,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideSpriteVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,c,d,e):a.type==Phaser.GROUP?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e):a.type==Phaser.TILEMAPLAYER?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,c,d,e):(b.type==Phaser.GROUP||b.type==Phaser.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,c,d,e):a.type==Phaser.EMITTER&&(b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e)))):void this.collideGroupVsSelf(a,c,d,e,f)},collideSpriteVsSprite:function(a,b,c,d,e,f){this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++)},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length)for(var g=0,h=b.children.length;h>g;g++)b.children[g].exists&&b.children[g].body&&this.separate(a.body,b.children[g].body,d,e,f)&&(c&&c.call(e,a,b.children[g]),this._total++)},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},separate:function(a,b){return a.type!==Phaser.Physics.NINJA||b.type!==Phaser.Physics.NINJA?!1:a.aabb&&b.aabb?a.aabb.collideAABBVsAABB(b.aabb):a.aabb&&b.tile?a.aabb.collideAABBVsTile(b.tile):a.tile&&b.aabb?b.aabb.collideAABBVsTile(a.tile):a.circle&&b.tile?a.circle.collideCircleVsTile(b.tile):a.tile&&b.circle?b.circle.collideCircleVsTile(a.tile):void 0}},Phaser.Physics.Ninja.Body=function(a,b,c,d,e,f,g,h,i){b=b||null,"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=16),this.sprite=b,this.game=a.game,this.type=Phaser.Physics.NINJA,this.system=a,this.aabb=null,this.tile=null,this.circle=null,this.shape=null,this.drag=1,this.friction=.05,this.gravityScale=1,this.bounce=.3,this.velocity=new Phaser.Point,this.facing=Phaser.NONE,this.immovable=!1,this.collideWorldBounds=!0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.maxSpeed=8,b&&(f=b.x,g=b.y,h=b.width,i=b.height,0===b.anchor.x&&(f+=.5*b.width),0===b.anchor.y&&(g+=.5*b.height)),1===c?(this.aabb=new Phaser.Physics.Ninja.AABB(this,f,g,h,i),this.shape=this.aabb):2===c?(this.circle=new Phaser.Physics.Ninja.Circle(this,f,g,e),this.shape=this.circle):3===c&&(this.tile=new Phaser.Physics.Ninja.Tile(this,f,g,h,i,d),this.shape=this.tile)},Phaser.Physics.Ninja.Body.prototype={preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.shape.integrate(),this.collideWorldBounds&&this.shape.collideWorldBounds()},postUpdate:function(){this.sprite&&(this.sprite.type===Phaser.TILESPRITE?(this.sprite.x=this.shape.pos.x-this.shape.xw,this.sprite.y=this.shape.pos.y-this.shape.yw):(this.sprite.x=this.shape.pos.x,this.sprite.y=this.shape.pos.y)),this.velocity.x<0?this.facing=Phaser.LEFT:this.velocity.x>0&&(this.facing=Phaser.RIGHT),this.velocity.y<0?this.facing=Phaser.UP:this.velocity.y>0&&(this.facing=Phaser.DOWN)},setZeroVelocity:function(){this.shape.oldpos.x=this.shape.pos.x,this.shape.oldpos.y=this.shape.pos.y},moveTo:function(a,b){var c=a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveFrom:function(a,b){var c=-a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveLeft:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveRight:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveUp:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},moveDown:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},reset:function(){this.velocity.set(0),this.shape.pos.x=this.sprite.x,this.shape.pos.y=this.sprite.y,this.shape.oldpos.copyFrom(this.shape.pos)},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.shape.pos.x-this.shape.oldpos.x},deltaY:function(){return this.shape.pos.y-this.shape.oldpos.y},destroy:function(){this.sprite=null,this.system=null,this.aabb=null,this.tile=null,this.circle=null,this.shape.destroy(),this.shape=null}},Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"x",{get:function(){return this.shape.pos.x},set:function(a){this.shape.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"y",{get:function(){return this.shape.pos.y},set:function(a){this.shape.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"width",{get:function(){return this.shape.width}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"height",{get:function(){return this.shape.height}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"bottom",{get:function(){return this.shape.pos.y+this.shape.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"right",{get:function(){return this.shape.pos.x+this.shape.xw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"speed",{get:function(){return Math.sqrt(this.shape.velocity.x*this.shape.velocity.x+this.shape.velocity.y*this.shape.velocity.y)}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"angle",{get:function(){return Math.atan2(this.shape.velocity.y,this.shape.velocity.x)}}),Phaser.Physics.Ninja.AABB=function(a,b,c,d,e){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.aabbTileProjections={},this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projAABB_Full,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projAABB_45Deg,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projAABB_Concave,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projAABB_Convex,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projAABB_22DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projAABB_22DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projAABB_67DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projAABB_67DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projAABB_Half},Phaser.Physics.Ninja.AABB.prototype.constructor=Phaser.Physics.Ninja.AABB,Phaser.Physics.Ninja.AABB.COL_NONE=0,Phaser.Physics.Ninja.AABB.COL_AXIS=1,Phaser.Physics.Ninja.AABB.COL_OTHER=2,Phaser.Physics.Ninja.AABB.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},reverse:function(){var a=this.pos.x-this.oldpos.x,b=this.pos.y-this.oldpos.y;this.oldpos.xthis.pos.x&&(this.oldpos.x=this.pos.x-a),this.oldpos.ythis.pos.y&&(this.oldpos.y=this.pos.y-b)},reportCollisionVsBody:function(a,b,c,d,e){{var f=this.pos.x-this.oldpos.x,g=this.pos.y-this.oldpos.y,h=f*c+g*d;e.pos.x-e.oldpos.x,e.pos.y-e.oldpos.y}return this.body.immovable&&e.body.immovable?(a*=.5,b*=.5,this.pos.add(a,b),this.oldpos.set(this.pos.x,this.pos.y),e.pos.subtract(a,b),void e.oldpos.set(e.pos.x,e.pos.y)):void(this.body.immovable||e.body.immovable?this.body.immovable?e.body.immovable||(e.pos.subtract(a,b),0>h&&e.reverse()):(this.pos.subtract(a,b),0>h&&this.reverse()):(a*=.5,b*=.5,this.pos.add(a,b),e.pos.subtract(a,b),0>h&&(this.reverse(),e.reverse())))},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideAABBVsAABB:function(a){var b=this.pos,c=a,d=c.pos.x,e=c.pos.y,f=c.xw,g=c.yw,h=b.x-d,i=f+this.xw-Math.abs(h);if(i>0){var j=b.y-e,k=g+this.yw-Math.abs(j);if(k>0){k>i?0>h?(i*=-1,k=0):k=0:0>j?(i=0,k*=-1):i=0;var l=Math.sqrt(i*i+k*k);return this.reportCollisionVsBody(i,k,i/l,k/l,c),Phaser.Physics.Ninja.AABB.COL_AXIS}}return!1},collideAABBVsTile:function(a){var b=this.pos.x-a.pos.x,c=a.xw+this.xw-Math.abs(b);if(c>0){var d=this.pos.y-a.pos.y,e=a.yw+this.yw-Math.abs(d);if(e>0)return e>c?0>b?(c*=-1,e=0):e=0:0>d?(c=0,e*=-1):c=0,this.resolveTile(c,e,this,a)}return!1},resolveTile:function(a,b,c,d){return 0i){e*=-i,f*=-i;var j=Math.sqrt(e*e+f*f),k=Math.sqrt(a*a+b*b);return j>k?(c.reportCollisionVsWorld(a,b,a/k,b/k,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(e,f,d.signx,d.signy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_45Deg:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.y-f*c.yw,h=d.pos.y-g;if(h*f>0){var i=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw,h=d.pos.x-g;if(h*e>0){var i=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Convex:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=Math.sqrt(g*g+h*h),j=2*d.xw,k=Math.sqrt(j*j+0),l=k-i;if(0>e*g||0>f*h){var m=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS}return l>0?(g/=i,h/=i,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER):Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Concave:function(a,b,c,d){var e=d.signx,f=d.signy,g=d.pos.x+e*d.xw-(c.pos.x-e*c.xw),h=d.pos.y+f*d.yw-(c.pos.y-f*c.yw),i=2*d.xw,j=Math.sqrt(i*i+0),k=Math.sqrt(g*g+h*h),l=k-j;if(l>0){var m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(g/=k,h/=k,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},destroy:function(){this.body=null,this.system=null}},Phaser.Physics.Ninja.Tile=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Phaser.Physics.Ninja.Tile.EMPTY),this.body=a,this.system=a.system,this.id=f,this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.id>1&&this.id<30&&(e=d),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.velocity=new Phaser.Point,this.signx=0,this.signy=0,this.sx=0,this.sy=0,this.body.gravityScale=0,this.body.collideWorldBounds=!1,this.id>0&&this.setType(this.id)},Phaser.Physics.Ninja.Tile.prototype.constructor=Phaser.Physics.Ninja.Tile,Phaser.Physics.Ninja.Tile.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},setType:function(a){return a===Phaser.Physics.Ninja.Tile.EMPTY?this.clear():(this.id=a,this.updateType()),this},clear:function(){this.id=Phaser.Physics.Ninja.Tile.EMPTY,this.updateType()},destroy:function(){this.body=null,this.system=null},updateType:function(){if(0===this.id)return this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.signx=0,this.signy=0,this.sx=0,this.sy=0,!0;if(this.idn?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.radius); -a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.radius-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.radius);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.radius-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideCircleVsTile:function(a){var b=this.pos,c=this.radius,d=a,e=d.pos.x,f=d.pos.y,g=d.xw,h=d.yw,i=b.x-e,j=g+c-Math.abs(i);if(j>0){var k=b.y-f,l=h+c-Math.abs(k);if(l>0)return this.oH=0,this.oV=0,-g>i?this.oH=-1:i>g&&(this.oH=1),-h>k?this.oV=-1:k>h&&(this.oV=1),this.resolveCircleTile(j,l,this.oH,this.oV,this,d)}},resolveCircleTile:function(a,b,c,d,e,f){return 0a){var g=e.pos.x-f.pos.x;return 0>g?(e.reportCollisionVsWorld(-a,0,-1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(a,0,1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}var h=e.pos.y-f.pos.y;return 0>h?(e.reportCollisionVsWorld(0,-b,0,-1,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(0,b,0,1,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS}if(0==d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.pos.x+c*f.xw,j=f.pos.y+d*f.yw,g=e.pos.x-i,h=e.pos.y-j,k=Math.sqrt(g*g+h*h),l=e.radius-k;return l>0?(0==k?(g=c/Math.SQRT2,h=d/Math.SQRT2):(g/=k,h/=k),e.reportCollisionVsWorld(g*l,h*l,g,h,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_45Deg:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c)if(0==d){var j=f.sx,k=f.sy,l=e.pos.x-j*e.radius-f.pos.x,m=e.pos.y-k*e.radius-f.pos.y,n=l*j+m*k;if(0>n){j*=-n,k*=-n,b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1));var o=Math.sqrt(j*j+k*k);return o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x-h*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),p=l*-k+m*j;if(p*h*i>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-i*f.yw),p=l*-k+m*j;if(0>p*h*i){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,q=Math.sqrt(u*u+v*v),r=e.radius-q;if(r>0)return 0==q?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=q,v/=q),e.reportCollisionVsWorld(u*r,v*r,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Concave:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c){if(0==d){var j=f.pos.x+h*f.xw-e.pos.x,k=f.pos.y+i*f.yw-e.pos.y,l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=n+e.radius-m;return o>0?(b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)):Phaser.Physics.Ninja.Circle.COL_NONE}if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x-h*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=0,s=d):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x+c*f.xw,q=f.pos.y-i*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c,s=0):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Convex:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0==c)if(0==d){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(h*c+i*d>0){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0==n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Half:function(a,b,c,d,e,f){var g=f.signx,h=f.signy,i=c*g+d*h;if(i>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c)if(0==d){var j=e.radius,k=e.pos.x-g*j-f.pos.x,l=e.pos.y-h*j-f.pos.y,m=g,n=h,o=k*m+l*n;if(0>o){m*=-o,n*=-o;var p=Math.sqrt(m*m+n*n),q=Math.sqrt(a*a+b*b);return p>q?(e.reportCollisionVsWorld(a,b,a/q,b/q,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(m,n,f.signx,f.signy),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0!=i)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.radius,r=e.pos.x-f.pos.x;if(0>r*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-(f.pos.y+d*f.yw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0==d){if(0!=i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.radius,s=e.pos.y-f.pos.y;if(0>s*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-(f.pos.x+c*f.xw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var v=f.pos.x+c*f.xw,w=f.pos.y+d*f.yw,r=e.pos.x-v,s=e.pos.y-w,t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0==t?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(h*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c){if(0!=d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-f.pos.y,n=l*-j+m*i;if(n*g*h>0){var o=Math.sqrt(l*l+m*m),p=k-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{l-=k*i,m-=k*j;var q=l*i+m*j;if(0>q){i*=-q,j*=-q;var r=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),r>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0==d)if(0>g*c){var s=f.pos.x-g*f.xw,t=f.pos.y,u=e.pos.x-s,v=e.pos.y-t;if(0>v*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-h*f.yw),n=l*-j+m*i;if(0>n*g*h){var o=Math.sqrt(l*l+m*m),p=e.radius-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var q=l*i+m*j,p=e.radius-Math.abs(q);if(p>0)return e.reportCollisionVsWorld(i*p,j*p,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x-g*f.xw),m=e.pos.y-j*k-(f.pos.y+h*f.yw),n=l*i+m*j;if(0>n){i*=-n,j*=-n;var o=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-(f.pos.y+h*f.yw),p=l*-j+m*i;if(p*g*h>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var l=e.pos.x-(f.pos.x+g*f.xw),m=e.pos.y-f.pos.y;if(0>m*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,p=l*-j+m*i;if(0>p*g*h){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var s=Math.sqrt(5),i=1*g/s,j=2*h/s,k=e.radius,l=e.pos.x-i*k-(f.pos.x-g*f.xw),m=e.pos.y-j*k-(f.pos.y+h*f.yw),n=l*i+m*j;return 0>n?(e.reportCollisionVsWorld(-i*n,-j*n,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,q=Math.sqrt(v*v+w*w),r=e.radius-q;if(r>0)return 0==q?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=q,w/=q),e.reportCollisionVsWorld(v*r,w*r,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(g*c>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-f.pos.x,m=e.pos.y-(f.pos.y-h*f.yw),n=l*-j+m*i;if(0>n*g*h){var o=Math.sqrt(l*l+m*m),p=k-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{l-=k*i,m-=k*j;var q=l*i+m*j;if(0>q){i*=-q,j*=-q;var r=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),r>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0>h*d){var s=f.pos.x,t=f.pos.y-h*f.yw,u=e.pos.x-s,v=e.pos.y-t;if(0>u*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var i=f.sx,j=f.sy,l=e.pos.x-(f.pos.x-g*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),n=l*-j+m*i;if(n*g*h>0){var o=Math.sqrt(l*l+m*m),p=e.radius-o;if(p>0)return l/=o,m/=o,e.reportCollisionVsWorld(l*p,m*p,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var q=l*i+m*j,p=e.radius-Math.abs(q);if(p>0)return e.reportCollisionVsWorld(i*p,j*p,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(0==d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,o=Math.sqrt(u*u+v*v),p=e.radius-o;if(p>0)return 0==o?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=o,v/=o),e.reportCollisionVsWorld(u*p,v*p,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0==c)if(0==d){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x+g*f.xw),m=e.pos.y-j*k-(f.pos.y-h*f.yw),n=l*i+m*j;if(0>n){i*=-n,j*=-n;var o=Math.sqrt(i*i+j*j);return b>a?(lenP=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(lenP=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>lenP?(e.reportCollisionVsWorld(a,b,a/lenP,b/lenP,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(i,j,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var l=e.pos.x-f.pos.x,m=e.pos.y-(f.pos.y+h*f.yw);if(0>l*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.sx,j=f.sy,p=l*-j+m*i;if(p*g*h>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,i,j,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0==d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=Math.sqrt(5),i=2*g/s,j=1*h/s,l=e.pos.x-(f.pos.x+g*f.xw),m=e.pos.y-(f.pos.y-h*f.yw),p=l*-j+m*i;if(0>p*g*h){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*i+m*j,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(i*r,j*r,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var i=f.sx,j=f.sy,k=e.radius,l=e.pos.x-i*k-(f.pos.x+g*f.xw),m=e.pos.y-j*k-(f.pos.y-h*f.yw),n=l*i+m*j;return 0>n?(e.reportCollisionVsWorld(-i*n,-j*n,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,q=Math.sqrt(v*v+w*w),r=e.radius-q;if(r>0)return 0==q?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=q,w/=q),e.reportCollisionVsWorld(v*r,w*r,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},destroy:function(){this.body=null,this.system=null}},!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define("p2",function(){return this.p2=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;g0&&(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=d)},{}],3:[function(a,b){function c(){}var d=a("./Scalar");b.exports=c,c.lineInt=function(a,b,c){c=c||0;var e,f,g,h,i,j,k,l=[0,0];return e=a[1][1]-a[0][1],f=a[0][0]-a[1][0],g=e*a[0][0]+f*a[0][1],h=b[1][1]-b[0][1],i=b[0][0]-b[1][0],j=h*b[0][0]+i*b[0][1],k=e*i-h*f,d.eq(k,0,c)||(l[0]=(i*g-f*j)/k,l[1]=(e*j-h*g)/k),l},c.segmentsIntersect=function(a,b,c,d){var e=b[0]-a[0],f=b[1]-a[1],g=d[0]-c[0],h=d[1]-c[1];if(g*f-h*e==0)return!1;var i=(e*(c[1]-a[1])+f*(a[0]-c[0]))/(g*f-h*e),j=(g*(a[1]-c[1])+h*(c[0]-a[0]))/(h*e-g*f);return i>=0&&1>=i&&j>=0&&1>=j}},{"./Scalar":6}],4:[function(a,b){function c(){}b.exports=c,c.area=function(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])},c.left=function(a,b,d){return c.area(a,b,d)>0},c.leftOn=function(a,b,d){return c.area(a,b,d)>=0},c.right=function(a,b,d){return c.area(a,b,d)<0},c.rightOn=function(a,b,d){return c.area(a,b,d)<=0};var d=[],e=[];c.collinear=function(a,b,f,g){if(g){var h=d,i=e;h[0]=b[0]-a[0],h[1]=b[1]-a[1],i[0]=f[0]-b[0],i[1]=f[1]-b[1];var j=h[0]*i[0]+h[1]*i[1],k=Math.sqrt(h[0]*h[0]+h[1]*h[1]),l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=Math.acos(j/(k*l));return g>m}return 0==c.area(a,b,f)},c.sqdist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d}},{}],5:[function(a,b){function c(){this.vertices=[]}function d(a,b,c,d,e){e=e||0;var f=b[1]-a[1],h=a[0]-b[0],i=f*a[0]+h*a[1],j=d[1]-c[1],k=c[0]-d[0],l=j*c[0]+k*c[1],m=f*k-j*h;return g.eq(m,0,e)?[0,0]:[(k*i-h*l)/m,(f*l-j*i)/m]}var e=a("./Line"),f=a("./Point"),g=a("./Scalar");b.exports=c,c.prototype.at=function(a){var b=this.vertices,c=b.length;return b[0>a?a%c+c:a%c]},c.prototype.first=function(){return this.vertices[0]},c.prototype.last=function(){return this.vertices[this.vertices.length-1]},c.prototype.clear=function(){this.vertices.length=0},c.prototype.append=function(a,b,c){if("undefined"==typeof b)throw new Error("From is not given!");if("undefined"==typeof c)throw new Error("To is not given!");if(b>c-1)throw new Error("lol1");if(c>a.vertices.length)throw new Error("lol2");if(0>b)throw new Error("lol3");for(var d=b;c>d;d++)this.vertices.push(a.vertices[d])},c.prototype.makeCCW=function(){for(var a=0,b=this.vertices,c=1;cb[a][0])&&(a=c);f.left(this.at(a-1),this.at(a),this.at(a+1))||this.reverse()},c.prototype.reverse=function(){for(var a=[],b=0,c=this.vertices.length;b!==c;b++)a.push(this.vertices.pop());this.vertices=a},c.prototype.isReflex=function(a){return f.right(this.at(a-1),this.at(a),this.at(a+1))};var h=[],i=[];c.prototype.canSee=function(a,b){var c,d,g=h,j=i;if(f.leftOn(this.at(a+1),this.at(a),this.at(b))&&f.rightOn(this.at(a-1),this.at(a),this.at(b)))return!1;d=f.sqdist(this.at(a),this.at(b));for(var k=0;k!==this.vertices.length;++k)if((k+1)%this.vertices.length!==a&&k!==a&&f.leftOn(this.at(a),this.at(b),this.at(k+1))&&f.rightOn(this.at(a),this.at(b),this.at(k))&&(g[0]=this.at(a),g[1]=this.at(b),j[0]=this.at(k),j[1]=this.at(k+1),c=e.lineInt(g,j),f.sqdist(this.at(a),c)a)for(var f=a;b>=f;f++)e.vertices.push(this.vertices[f]);else{for(var f=0;b>=f;f++)e.vertices.push(this.vertices[f]);for(var f=a;f0?this.slice(a):[this]},c.prototype.slice=function(a){if(0==a.length)return[this];if(a instanceof Array&&a.length&&a[0]instanceof Array&&2==a[0].length&&a[0][0]instanceof Array){for(var b=[this],c=0;cc;c++)if(e.segmentsIntersect(a[b],a[b+1],a[c],a[c+1]))return!1;for(var b=1;bh)return console.warn("quickDecomp: max level ("+h+") reached."),a;for(var x=0;xo&&(n=o,k=l,r=y))),f.left(v.at(x+1),v.at(x),v.at(y+1))&&f.rightOn(v.at(x+1),v.at(x),v.at(y))&&(l=d(v.at(x+1),v.at(x),v.at(y),v.at(y+1)),f.left(v.at(x-1),v.at(x),l)&&(o=f.sqdist(v.vertices[x],l),m>o&&(m=o,j=l,q=y)));if(r==(q+1)%this.vertices.length)l[0]=(k[0]+j[0])/2,l[1]=(k[1]+j[1])/2,e.push(l),q>x?(t.append(v,x,q+1),t.vertices.push(l),u.vertices.push(l),0!=r&&u.append(v,r,v.vertices.length),u.append(v,0,x+1)):(0!=x&&t.append(v,x,v.vertices.length),t.append(v,0,q+1),t.vertices.push(l),u.vertices.push(l),u.append(v,r,x+1));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.length3&&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}],6:[function(a,b){function c(){}b.exports=c,c.eq=function(a,b,c){return c=c||0,Math.abs(a-b) (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:{jshint:"latest",nodeunit:"latest",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"~0.1.2","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"*","grunt-browserify":"*",browserify:"*"},dependencies:{underscore:"*","poly-decomp":"git://github.com/schteppe/poly-decomp.js","gl-matrix":"2.0.0",jsonschema:"*"}}},{}],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("../math/vec2");a("../utils/Utils")}b.exports=c;var e=d.create();c.prototype.setFromPoints=function(a,b,c){var f=this.lowerBound,g=this.upperBound;d.set(f,Number.MAX_VALUE,Number.MAX_VALUE),d.set(g,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var h=0;hj;j++)i[j]>g[j]&&(g[j]=i[j]),i[j]b;b++)a.lowerBound[b]this.upperBound[b]&&(this.upperBound[b]=a.upperBound[b])},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":33,"../utils/Utils":50}],10:[function(a,b){function c(a){this.type=a,this.result=[],this.world=null}var d=a("../math/vec2"),e=a("../objects/Body");b.exports=c,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.aabbNeedsUpdate&&a.updateAABB(),b.aabbNeedsUpdate&&b.updateAABB(),a.aabb.overlaps(b.aabb)},c.canCollide=function(a,b){return a.motionState==e.STATIC&&b.motionState==e.STATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.STATIC||a.motionState==e.STATIC&&b.motionState==e.KINEMATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.KINEMATIC?!1:a.sleepState==e.SLEEPING&&b.sleepState==e.SLEEPING?!1:!0},c.NAIVE=1,c.SAP=2},{"../math/vec2":33,"../objects/Body":34}],11:[function(a,b){function d(a,b,c,d,e,f){h.apply(this),e=e||10,f=f||10,this.binsizeX=(b-a)/e,this.binsizeY=(d-c)/f,this.nx=e,this.ny=f,this.xmin=a,this.ymin=c,this.xmax=b,this.ymax=d}{var e=a("../shapes/Circle"),f=a("../shapes/Plane"),g=a("../shapes/Particle"),h=a("../collision/Broadphase");a("../math/vec2")}b.exports=d,d.prototype=new h,d.prototype.getBinIndex=function(a,b){var c=this.nx,d=this.ny,e=this.xmin,f=this.ymin,g=this.xmax,h=this.ymax,i=Math.floor(c*(a-e)/(g-e)),j=Math.floor(d*(b-f)/(h-f));return i*d+j},d.prototype.getCollisionPairs=function(a){for(var b=[],d=a.bodies,i=i=d.length,j=this.binsizeX,k=this.binsizeY,l=[],m=nx*ny,n=0;m>n;n++)l.push([]);for(var o=nx/(xmax-xmin),p=ny/(ymax-ymin),n=0;n!==i;n++){var q=d[n],r=q.shape;if(void 0!==r)if(r instanceof e)for(var s=q.position[0],t=q.position[1],u=r.radius,v=Math.floor(o*(s-u-xmin)),w=Math.floor(p*(t-u-ymin)),x=Math.floor(o*(s+u-xmin)),y=Math.floor(p*(t+u-ymin)),z=v;x>=z;z++)for(var A=w;y>=A;A++){var B=z,C=A;B*(ny-1)+C>=0&&m>B*(ny-1)+C&&l[B*(ny-1)+C].push(q)}else{if(!(r instanceof f))throw new Error("Shape not supported in GridBroadphase!");if(0==q.angle)for(var t=q.position[1],z=0;z!==m&&t>ymin+k*(z-1);z++)for(var A=0;nx>A;A++){var B=A,C=Math.floor(p*(k*z-ymin));l[B*(ny-1)+C].push(q)}else if(q.angle==.5*Math.PI)for(var s=q.position[0],z=0;z!==m&&s>xmin+j*(z-1);z++)for(var A=0;ny>A;A++){var C=A,B=Math.floor(o*(j*z-xmin));l[B*(ny-1)+C].push(q)}else for(var z=0;z!==m;z++)l[z].push(q)}}for(var n=0;n!==m;n++)for(var D=l[n],z=0,E=D.length;z!==E;z++)for(var q=D[z],r=q.shape,A=0;A!==z;A++){var F=D[A],G=F.shape;r instanceof e?G instanceof e?c=h.circleCircle(q,F):G instanceof g?c=h.circleParticle(q,F):G instanceof f&&(c=h.circlePlane(q,F)):r instanceof g?G instanceof e&&(c=h.circleParticle(F,q)):r instanceof f&&G instanceof e&&(c=h.circlePlane(F,q))}return b}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43}],12:[function(a,b){function c(){d.call(this,d.NAIVE),this.useBoundingBoxes=!1}{var d=(a("../shapes/Circle"),a("../shapes/Plane"),a("../shapes/Shape"),a("../shapes/Particle"),a("../collision/Broadphase"));a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.getCollisionPairs=function(a){var b,c,e,f,g=a.bodies,h=this.result,i=this.useBoundingBoxes?d.aabbCheck:d.boundingRadiusCheck;for(h.length=0,b=0,Ncolliding=g.length;b!==Ncolliding;b++)for(e=g[b],c=0;b>c;c++)f=g[c],d.canCollide(e,f)&&i(e,f)&&h.push(e,f);return h}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Shape":45}],13:[function(a,b){function c(){this.contactEquations=[],this.frictionEquations=[],this.enableFriction=!0,this.slipForce=10,this.frictionCoefficient=.3,this.surfaceVelocity=0,this.reuseObjects=!0,this.reusableContactEquations=[],this.reusableFrictionEquations=[],this.restitution=0,this.stiffness=1e7,this.relaxation=3,this.frictionStiffness=1e7,this.frictionRelaxation=3,this.collidingBodiesLastStep={keys:[]} -}function d(a){for(var b=0,c=a.keys.length;c>b;b++)delete a[a.keys[b]];a.keys.length=0}function e(a,b){g.set(a.vertices[0],.5*-b.length,-b.radius),g.set(a.vertices[1],.5*b.length,-b.radius),g.set(a.vertices[2],.5*b.length,b.radius),g.set(a.vertices[3],.5*-b.length,b.radius)}function f(a,b,c,d){for(var e=Q,f=R,j=S,k=T,l=a,m=b.vertices,n=null,o=0;o!==m.length+1;o++){var p=m[o%m.length],q=m[(o+1)%m.length];g.rotate(e,p,d),g.rotate(f,q,d),i(e,e,c),i(f,f,c),h(j,e,l),h(k,f,l);var r=g.crossLength(j,k);if(null===n&&(n=r),0>=r*n)return!1;n=r}return!0}var g=a("../math/vec2"),h=g.sub,i=g.add,j=g.dot,k=a("../utils/Utils"),l=a("../equations/ContactEquation"),m=a("../equations/FrictionEquation"),n=a("../shapes/Circle"),o=a("../shapes/Shape"),p=a("../objects/Body"),q=a("../shapes/Rectangle");b.exports=c;var r=g.fromValues(0,1),s=g.fromValues(0,0),t=g.fromValues(0,0),u=g.fromValues(0,0),v=g.fromValues(0,0),w=g.fromValues(0,0),x=g.fromValues(0,0),y=g.fromValues(0,0),z=g.fromValues(0,0),A=g.fromValues(0,0),B=g.fromValues(0,0),C=g.fromValues(0,0),D=g.fromValues(0,0),E=g.fromValues(0,0),F=g.fromValues(0,0),G=g.fromValues(0,0),H=g.fromValues(0,0),I=g.fromValues(0,0),J=g.fromValues(0,0),K=[];c.prototype.collidedLastStep=function(a,b){var c=a.id,d=b.id;if(c>d){var e=c;c=d,d=e}return!!this.collidingBodiesLastStep[c+" "+d]},c.prototype.reset=function(){d(this.collidingBodiesLastStep);for(var a=0;a!==this.contactEquations.length;a++){var b=this.contactEquations[a],c=b.bi.id,e=b.bj.id;if(c>e){var f=c;c=e,e=f}var g=c+" "+e;this.collidingBodiesLastStep[g]||(this.collidingBodiesLastStep[g]=!0,this.collidingBodiesLastStep.keys.push(g))}if(this.reuseObjects){var h=this.contactEquations,i=this.frictionEquations,j=this.reusableFrictionEquations,l=this.reusableContactEquations;k.appendArray(l,h),k.appendArray(j,i)}this.contactEquations.length=this.frictionEquations.length=0},c.prototype.createContactEquation=function(a,b,c,d){var e=this.reusableContactEquations.length?this.reusableContactEquations.pop():new l(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.restitution=this.restitution,e.firstImpact=!this.collidedLastStep(a,b),e.stiffness=this.stiffness,e.relaxation=this.relaxation,e.enabled=!0,a.allowSleep&&a.motionState==p.DYNAMIC&&b.motionState!=p.STATIC&&b.sleepState!==p.SLEEPY&&a.wakeUp(),b.allowSleep&&b.motionState==p.DYNAMIC&&a.motionState!=p.STATIC&&a.sleepState!==p.SLEEPY&&b.wakeUp(),e},c.prototype.createFrictionEquation=function(a,b,c,d){var e=this.reusableFrictionEquations.length?this.reusableFrictionEquations.pop():new m(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.setSlipForce(this.slipForce),e.frictionCoefficient=this.frictionCoefficient,e.relativeVelocity=this.surfaceVelocity,e.enabled=!0,e.frictionStiffness=this.frictionStiffness,e.frictionRelaxation=this.frictionRelaxation,e},c.prototype.createFrictionFromContact=function(a){var b=this.createFrictionEquation(a.bi,a.bj,a.shapeA,a.shapeB);return g.copy(b.ri,a.ri),g.copy(b.rj,a.rj),g.rotate(b.t,a.ni,-Math.PI/2),b.contactEquation=a,b},c.prototype[o.LINE|o.CONVEX]=c.prototype.convexLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.LINE|o.RECTANGLE]=c.prototype.lineRectangle=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var L=new q(1,1),M=g.create();c.prototype[o.CAPSULE|o.CONVEX]=c.prototype[o.CAPSULE|o.RECTANGLE]=c.prototype.convexCapsule=function(a,b,c,d,f,h,i,j,k){var l=M;g.set(l,h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var m=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);g.set(l,-h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var n=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);if(k&&(m||n))return!0;var o=L;e(o,h);var p=this.convexConvex(a,b,c,d,f,o,i,j,k);return p+m+n},c.prototype[o.CAPSULE|o.LINE]=c.prototype.lineCapsule=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var N=g.create(),O=g.create(),P=new q(1,1);c.prototype[o.CAPSULE|o.CAPSULE]=c.prototype.capsuleCapsule=function(a,b,c,d,f,h,i,j,k){for(var l=N,m=O,n=0,o=0;2>o;o++){g.set(l,(0==o?-1:1)*b.length/2,0),g.rotate(l,l,d),g.add(l,l,c);for(var p=0;2>p;p++){g.set(m,(0==p?-1:1)*h.length/2,0),g.rotate(m,m,j),g.add(m,m,i);var q=this.circleCircle(a,b,l,d,f,h,m,j,k,b.radius,h.radius);if(k&&q)return!0;n+=q}}var r=P;e(r,b);var s=this.convexCapsule(a,r,c,d,f,h,i,j,k);if(k&&s)return!0;n+=s,e(r,h);var t=this.convexCapsule(f,r,i,j,a,b,c,d,k);return k&&t?!0:n+=t},c.prototype[o.LINE|o.LINE]=c.prototype.lineLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.PLANE|o.LINE]=c.prototype.planeLine=function(a,b,c,d,e,f,k,l,m){var n=s,o=t,p=u,q=v,B=w,C=x,D=y,E=z,F=A,G=K;numContacts=0,g.set(n,-f.length/2,0),g.set(o,f.length/2,0),g.rotate(p,n,l),g.rotate(q,o,l),i(p,p,k),i(q,q,k),g.copy(n,p),g.copy(o,q),h(B,o,n),g.normalize(C,B),g.rotate(F,C,-Math.PI/2),g.rotate(E,r,d),G[0]=n,G[1]=o;for(var H=0;HJ){if(m)return!0;var L=this.createContactEquation(a,e,b,f);numContacts++,g.copy(L.ni,E),g.normalize(L.ni,L.ni),g.scale(D,E,J),h(L.ri,I,D),h(L.ri,L.ri,a.position),h(L.rj,I,k),i(L.rj,L.rj,k),h(L.rj,L.rj,e.position),this.contactEquations.push(L),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(L))}}return numContacts},c.prototype[o.PARTICLE|o.CAPSULE]=c.prototype.particleCapsule=function(a,b,c,d,e,f,g,h,i){return this.circleLine(a,b,c,d,e,f,g,h,i,f.radius,0)},c.prototype[o.CIRCLE|o.LINE]=c.prototype.circleLine=function(a,b,c,d,e,f,k,l,m,n,o){var p=f,q=l,r=e,G=k,H=c,I=a,J=b,n=n||0,o="undefined"!=typeof o?o:J.radius,L=s,M=t,N=u,O=v,P=w,Q=x,R=y,S=z,T=A,U=B,V=C,W=D,X=E,Y=F,Z=K;g.set(S,-p.length/2,0),g.set(T,p.length/2,0),g.rotate(U,S,q),g.rotate(V,T,q),i(U,U,G),i(V,V,G),g.copy(S,U),g.copy(T,V),h(Q,T,S),g.normalize(R,Q),g.rotate(P,R,-Math.PI/2),h(W,H,S);var $=j(W,P);if(h(O,S,G),h(X,H,G),Math.abs($)ab&&bb>_){if(m)return!0;var cb=this.createContactEquation(I,r,b,f);return g.scale(cb.ni,L,-1),g.normalize(cb.ni,cb.ni),g.scale(cb.ri,cb.ni,o),i(cb.ri,cb.ri,H),h(cb.ri,cb.ri,I.position),h(cb.rj,N,G),i(cb.rj,cb.rj,G),h(cb.rj,cb.rj,r.position),this.contactEquations.push(cb),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(cb)),1}}Z[0]=S,Z[1]=T;for(var db=0;dbW&&(g.copy(Q,O),S=W,g.scale(N,K,W),g.add(N,N,O),R=!0)}}if(R){if(m)return!0;var X=this.createContactEquation(y,q,b,j);return g.sub(X.ni,Q,x),g.normalize(X.ni,X.ni),g.scale(X.ri,X.ni,n),i(X.ri,X.ri,x),h(X.ri,X.ri,y.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}if(n>0)for(var T=0;TW&&(Q=W,g.scale(N,H,W),g.add(N,N,z),g.copy(P,H),R=!0)}if(R){var X=this.createContactEquation(A,q,b,k);return g.scale(X.ni,P,-1),g.normalize(X.ni,X.ni),g.set(X.ri,0,0),i(X.ri,X.ri,z),h(X.ri,X.ri,A.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}return 0},c.prototype[o.CIRCLE]=c.prototype.circleCircle=function(a,b,c,d,e,f,j,k,l,m,n){var o=a,p=b,q=c,r=e,t=f,u=j,v=s,m=m||p.radius,n=n||t.radius;h(v,c,j);var w=m+n;if(g.squaredLength(v)>w*w)return 0;if(l)return!0;var x=this.createContactEquation(o,r,b,f);return h(x.ni,u,q),g.normalize(x.ni,x.ni),g.scale(x.ri,x.ni,m),g.scale(x.rj,x.ni,-n),i(x.ri,x.ri,q),h(x.ri,x.ri,o.position),i(x.rj,x.rj,u),h(x.rj,x.rj,r.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.PLANE|o.CONVEX]=c.prototype[o.PLANE|o.RECTANGLE]=c.prototype.planeConvex=function(a,b,c,d,e,f,k,l,m){var n=e,o=k,p=f,q=l,v=a,w=b,x=c,y=d,z=s,A=t,B=u,C=0;g.rotate(A,r,y);for(var D=0;D=2)break}}return C},c.prototype.convexPlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.convexPlane is deprecated. Use planeConvex instead!"),this.planeConvex(e,f,g,h,a,b,c,d,i)},c.prototype[o.PARTICLE|o.PLANE]=c.prototype.particlePlane=function(a,b,c,d,e,f,i,k,l){var m=a,n=c,o=e,p=i,q=k,u=s,v=t;q=q||0,h(u,n,p),g.rotate(v,r,q);var w=j(u,v);if(w>0)return 0;if(l)return!0;var x=this.createContactEquation(o,m,f,b);return g.copy(x.ni,v),g.scale(u,x.ni,w),h(x.ri,n,u),h(x.ri,x.ri,o.position),h(x.rj,n,m.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.CIRCLE|o.PARTICLE]=c.prototype.circleParticle=function(a,b,c,d,e,f,j,k,l){var m=a,n=b,o=c,p=e,q=j,r=s;if(h(r,q,o),g.squaredLength(r)>n.radius*n.radius)return 0;if(l)return!0;var t=this.createContactEquation(m,p,b,f);return g.copy(t.ni,r),g.normalize(t.ni,t.ni),g.scale(t.ri,t.ni,n.radius),i(t.ri,t.ri,o),h(t.ri,t.ri,m.position),h(t.rj,q,p.position),this.contactEquations.push(t),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(t)),1};{var U=new n(1),V=g.create(),W=g.create();g.create()}c.prototype[o.PLANE|o.CAPSULE]=c.prototype.planeCapsule=function(a,b,c,d,e,f,h,j,k){var l=V,m=W,n=U;g.set(l,-f.length/2,0),g.rotate(l,l,j),i(l,l,h),g.set(m,f.length/2,0),g.rotate(m,m,j),i(m,m,h),n.radius=f.radius;var o=this.circlePlane(e,n,l,0,a,b,c,d,k),p=this.circlePlane(e,n,m,0,a,b,c,d,k);return k?o||p:o+p},c.prototype.capsulePlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.capsulePlane() is deprecated. Use .planeCapsule() instead!"),this.planeCapsule(e,f,g,h,a,b,c,d,i)},c.prototype[o.CIRCLE|o.PLANE]=c.prototype.circlePlane=function(a,b,c,d,e,f,k,l,m){var n=a,o=b,p=c,q=e,v=k,w=l;w=w||0;var x=s,y=t,z=u;h(x,p,v),g.rotate(y,r,w);var A=j(y,x);if(A>o.radius)return 0;if(m)return!0;var B=this.createContactEquation(q,n,f,b);return g.copy(B.ni,y),g.scale(B.rj,B.ni,-o.radius),i(B.rj,B.rj,p),h(B.rj,B.rj,n.position),g.scale(z,B.ni,A),h(B.ri,x,z),i(B.ri,B.ri,v),h(B.ri,B.ri,q.position),this.contactEquations.push(B),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(B)),1},c.convexPrecision=1e-10,c.prototype[o.CONVEX]=c.prototype[o.CONVEX|o.RECTANGLE]=c.prototype[o.RECTANGLE]=c.prototype.convexConvex=function(a,b,d,e,f,k,l,m,n,o){var p=s,q=t,r=u,x=v,B=w,C=y,D=z,E=A,F=0,o=o||c.convexPrecision,G=c.findSeparatingAxis(b,d,e,k,l,m,p);if(!G)return 0;h(D,l,d),j(p,D)>0&&g.scale(p,p,-1);var H=c.getClosestEdge(b,e,p,!0),I=c.getClosestEdge(k,m,p);if(-1==H||-1==I)return 0;for(var J=0;2>J;J++){var K=H,L=I,M=b,N=k,O=d,P=l,Q=e,R=m,S=a,T=f;if(0==J){var U;U=K,K=L,L=U,U=M,M=N,N=U,U=O,O=P,P=U,U=Q,Q=R,R=U,U=S,S=T,T=U}for(var V=L;L+2>V;V++){var W=N.vertices[(V+N.vertices.length)%N.vertices.length];g.rotate(q,W,R),i(q,q,P);for(var X=0,Y=K-1;K+2>Y;Y++){var Z=M.vertices[(Y+M.vertices.length)%M.vertices.length],$=M.vertices[(Y+1+M.vertices.length)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(E,B,-Math.PI/2),g.normalize(E,E),h(D,q,r);var _=j(E,D);o>=_&&X++}if(3==X){if(n)return!0;var ab=this.createContactEquation(S,T,M,N);F++;var Z=M.vertices[K%M.vertices.length],$=M.vertices[(K+1)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(ab.ni,B,-Math.PI/2),g.normalize(ab.ni,ab.ni),h(D,q,r);var _=j(ab.ni,D);g.scale(C,ab.ni,_),h(ab.ri,q,O),h(ab.ri,ab.ri,C),i(ab.ri,ab.ri,O),h(ab.ri,ab.ri,S.position),h(ab.rj,q,P),i(ab.rj,ab.rj,P),h(ab.rj,ab.rj,T.position),this.contactEquations.push(ab),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(ab))}}}return F};var X=g.fromValues(0,0);c.projectConvexOntoAxis=function(a,b,c,d,e){var f,h,i=null,k=null,l=X;g.rotate(l,d,-c);for(var m=0;mi)&&(i=h),(null===k||k>h)&&(k=h);if(k>i){var n=k;k=i,i=n}var o=j(b,d);g.set(e,k+o,i+o)};var Y=g.fromValues(0,0),Z=g.fromValues(0,0),$=g.fromValues(0,0),_=g.fromValues(0,0),ab=g.fromValues(0,0),bb=g.fromValues(0,0);c.findSeparatingAxis=function(a,b,d,e,f,i,j){for(var k=null,l=!1,m=!1,n=Y,o=Z,p=$,q=_,r=ab,s=bb,t=0;2!==t;t++){var u=a,v=d;1===t&&(u=e,v=i);for(var w=0;w!==u.vertices.length;w++){g.rotate(o,u.vertices[w],v),g.rotate(p,u.vertices[(w+1)%u.vertices.length],v),h(n,p,o),g.rotate(q,n,-Math.PI/2),g.normalize(q,q),c.projectConvexOntoAxis(a,b,d,q,r),c.projectConvexOntoAxis(e,f,i,q,s);var x=r,y=s,z=!1;r[0]>s[0]&&(y=r,x=s,z=!0);var A=y[0]-x[1];l=0>A,(null===k||A>k)&&(g.copy(j,q),k=A,m=l)}}return m};var cb=g.fromValues(0,0),db=g.fromValues(0,0),eb=g.fromValues(0,0);c.getClosestEdge=function(a,b,c,d){var e=cb,f=db,i=eb;g.rotate(e,c,-b),d&&g.scale(e,e,-1);for(var k=-1,l=a.vertices.length,m=Math.PI/2,n=0;n!==l;n++){h(f,a.vertices[(n+1)%l],a.vertices[n%l]),g.rotate(i,f,-m),g.normalize(i,i);var o=j(i,e);(-1==k||o>maxDot)&&(k=n%l,maxDot=o)}return k};var fb=g.create(),gb=g.create(),hb=g.create(),ib=g.create(),jb=g.create(),kb=g.create(),lb=g.create();c.prototype[o.CIRCLE|o.HEIGHTFIELD]=c.prototype.circleHeightfield=function(a,b,c,d,e,f,j,k,l,m){var n=f.data,m=m||b.radius,o=f.elementWidth,p=gb,q=fb,r=jb,s=lb,t=kb,u=hb,v=ib,w=Math.floor((c[0]-m-j[0])/o),x=Math.ceil((c[0]+m-j[0])/o);0>w&&(w=0),x>=n.length&&(x=n.length-1);for(var y=n[w],z=n[x],A=w;x>A;A++)n[A]y&&(y=n[A]);if(c[1]-m>y)return l?!1:0;c[1]+mA;A++){g.set(u,A*o,n[A]),g.set(v,(A+1)*o,n[A+1]),g.add(u,u,j),g.add(v,v,j),g.sub(t,v,u),g.rotate(t,t,Math.PI/2),g.normalize(t,t),g.scale(q,t,-m),g.add(q,q,c),g.sub(p,q,u);var D=g.dot(p,t);if(q[0]>=u[0]&&q[0]=D&&(C===!1||Math.abs(D)0)for(var A=w;x>=A;A++)if(g.set(u,A*o,n[A]),g.add(u,u,j),g.sub(p,c,u),g.squaredLength(p)c;c++)this.root.insert(a[c]);else this.root.insert(a)},c.prototype.clear=function(){this.root.clear()},c.prototype.retrieve=function(a){var b=this.root.retrieve(a).slice(0);return b},c.prototype.getCollisionPairs=function(a){var b=[];this.insert(a.bodies);for(var c=0;c!==a.bodies.length;c++)for(var d=a.bodies[c],e=this.retrieve(d),f=0,h=e.length;f!==h;f++){var i=e[f];if(d!==i){for(var j=!1,k=0,l=b.length;l>k;k+=2){var m=b[k],n=b[k+1];if(m==i&&n==d||n==i&&m==d){j=!0;break}}!j&&g.boundingRadiusCheck(d,i)&&b.push(d,i)}}return this.clear(),b},d.prototype.classConstructor=d,d.prototype.children=null,d.prototype.depth=0,d.prototype.maxChildren=4,d.prototype.maxDepth=4,d.TOP_LEFT=0,d.TOP_RIGHT=1,d.BOTTOM_LEFT=2,d.BOTTOM_RIGHT=3,d.prototype.insert=function(a){if(this.nodes.length){var b=this.findIndex(a);return void this.nodes[b].insert(a)}this.children.push(a);var c=this.children.length;if(!(this.depth>=this.maxDepth)&&c>this.maxChildren){this.subdivide();for(var d=0;c>d;d++)this.insert(this.children[d]);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 void(!(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))}this.children.push(a);var d=this.children.length;if(this.depththis.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":43}],15:[function(a,b){function c(){e.call(this,e.SAP),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;this.axisIndex}for(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;if(e.canCollide(j,k)){var l=j.idb;b++){var k=g[b];if(!c.checkBounds(j,k,1))break;if(e.canCollide(j,k)){var l=j.idc)g.scale(e.ni,i,-1),g.sub(e.ri,j,h.position),g.sub(e.rj,k,o.position),g.scale(n,i,c),g.add(e.ri,e.ri,n),-1==a.indexOf(e)&&a.push(e);else{var u=a.indexOf(e);-1!=u&&a.splice(u,1)}if(this.lowerLimitEnabled&&d>s)g.scale(f.ni,i,1),g.sub(f.ri,j,h.position),g.sub(f.rj,k,o.position),g.scale(n,i,d),g.sub(f.rj,f.rj,n),-1==a.indexOf(f)&&a.push(f);else{var u=a.indexOf(f);-1!=u&&a.splice(u,1)}},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}}},{"../equations/ContactEquation":23,"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../math/vec2":33,"./Constraint":16}],21:[function(a,b){function c(a,b,c,n,o){d.call(this,a,c,d.REVOLUTE),o=this.maxForce="undefined"!=typeof o?o:Number.MAX_VALUE,this.pivotA=b,this.pivotB=n;var p=this.equations=[new e(a,c,-o,o),new e(a,c,-o,o)],q=p[0],r=p[1];q.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,k)},r.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,l)},r.minForce=q.minForce=-o,r.maxForce=q.maxForce=o,this.motorEquation=new f(a,c),this.motorEnabled=!1,this.angle=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=0,this.upperLimitEquation=new g(a,c),this.lowerLimitEquation=new g(a,c),this.upperLimitEquation.minForce=0,this.lowerLimitEquation.maxForce=0}var d=a("./Constraint"),e=a("../equations/Equation"),f=a("../equations/RotationalVelocityEquation"),g=a("../equations/RotationalLockEquation"),h=a("../math/vec2");b.exports=c;var i=h.create(),j=h.create(),k=h.fromValues(1,0),l=h.fromValues(0,1),m=h.create();c.prototype=new d,c.prototype.update=function(){var a=this.bodyA,b=this.bodyB,c=this.pivotA,d=this.pivotB,e=this.equations,f=(e[0],e[1],e[0]),g=e[1],m=this.upperLimit,n=this.lowerLimit,o=this.upperLimitEquation,p=this.lowerLimitEquation,q=this.angle=b.angle-a.angle;if(this.upperLimitEnabled&&q>m)o.angle=m,-1==e.indexOf(o)&&e.push(o);else{var r=e.indexOf(o);-1!=r&&e.splice(r,1)}if(this.lowerLimitEnabled&&n>q)p.angle=n,-1==e.indexOf(p)&&e.push(p);else{var r=e.indexOf(p);-1!=r&&e.splice(r,1)}h.rotate(i,c,a.angle),h.rotate(j,d,b.angle),f.G[0]=-1,f.G[1]=0,f.G[2]=-h.crossLength(i,k),f.G[3]=1,f.G[4]=0,f.G[5]=h.crossLength(j,k),g.G[0]=0,g.G[1]=-1,g.G[2]=-h.crossLength(i,l),g.G[3]=0,g.G[4]=1,g.G[5]=h.crossLength(j,l)},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}},c.prototype.motorIsEnabled=function(){return!!this.motorEnabled},c.prototype.setMotorSpeed=function(a){if(this.motorEnabled){var b=this.equations.indexOf(this.motorEquation);this.equations[b].relativeVelocity=a}},c.prototype.getMotorSpeed=function(){return this.motorEnabled?this.motorEquation.relativeVelocity:!1}},{"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../equations/RotationalVelocityEquation":27,"../math/vec2":33,"./Constraint":16}],22:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0,this.ratio="number"==typeof c.ratio?c.ratio:1,this.setRatio(this.ratio)}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeGq=function(){return this.ratio*this.bi.angle-this.bj.angle+this.angle -},c.prototype.setRatio=function(a){var b=this.G;b[2]=a,b[5]=-1,this.ratio=a}},{"../math/vec2":33,"./Equation":24}],23:[function(a,b){function c(a,b){d.call(this,a,b,0,Number.MAX_VALUE),this.ri=e.create(),this.penetrationVec=e.create(),this.rj=e.create(),this.ni=e.create(),this.restitution=0,this.firstImpact=!1,this.shapeA=null,this.shapeB=null}{var d=a("./Equation"),e=a("../math/vec2");a("../math/mat2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.bi,f=this.bj,g=this.ri,h=this.rj,i=d.position,j=f.position,k=this.penetrationVec,l=this.ni,m=this.G,n=e.crossLength(g,l),o=e.crossLength(h,l);m[0]=-l[0],m[1]=-l[1],m[2]=-n,m[3]=l[0],m[4]=l[1],m[5]=o,e.add(k,j,h),e.sub(k,k,i),e.sub(k,k,g);var p,q;this.firstImpact&&0!==this.restitution?(q=0,p=1/b*(1+this.restitution)*this.computeGW()):(q=e.dot(l,k),p=this.computeGW());var r=this.computeGiMf(),s=-q*a-p*b-c*r;return s}},{"../math/mat2":31,"../math/vec2":33,"./Equation":24}],24:[function(a,b){function c(a,b,c,d){this.minForce="undefined"==typeof c?-1e6:c,this.maxForce="undefined"==typeof d?1e6:d,this.bi=a,this.bj=b,this.stiffness=1e6,this.relaxation=4,this.G=new g.ARRAY_TYPE(6);for(var e=0;6>e;e++)this.G[e]=0;this.offset=0,this.a=0,this.b=0,this.eps=0,this.h=0,this.updateSpookParams(1/60),this.multiplier=0,this.relativeVelocity=0,this.enabled=!0}function d(a,b,c,d,e){return a[0]*b[0]+a[1]*b[1]+a[2]*c+a[3]*d[0]+a[4]*d[1]+a[5]*e}b.exports=c;var e=a("../math/vec2"),f=a("../math/mat2"),g=a("../utils/Utils");c.prototype.constructor=c,c.prototype.updateSpookParams=function(a){var b=this.stiffness,c=this.relaxation,d=a;this.a=4/(d*(1+4*c)),this.b=4*c/(1+4*c),this.eps=4/(d*d*b*(1+4*c)),this.h=a},c.prototype.computeB=function(a,b,c){var d=this.computeGW(),e=this.computeGq(),f=this.computeGiMf();return-e*a-d*b-f*c};var h=e.create(),i=e.create();c.prototype.computeGq=function(){var a=this.G,b=this.bi,c=this.bj,e=(b.position,c.position,b.angle),f=c.angle;return d(a,h,e,i,f)+this.offset};e.create(),e.create();c.prototype.transformedGmult=function(a,b,c,e,f){return d(a,b,c,e,f)},c.prototype.computeGW=function(){var a=this.G,b=this.bi,c=this.bj,d=b.velocity,e=c.velocity,f=b.angularVelocity,g=c.angularVelocity;return this.transformedGmult(a,d,f,e,g)+this.relativeVelocity},c.prototype.computeGWlambda=function(){var a=this.G,b=this.bi,c=this.bj,e=b.vlambda,f=c.vlambda,g=b.wlambda,h=c.wlambda;return d(a,e,g,f,h)};var j=e.create(),k=e.create();c.prototype.computeGiMf=function(){var a=this.bi,b=this.bj,c=a.force,d=a.angularForce,f=b.force,g=b.angularForce,h=a.invMass,i=b.invMass,l=a.invInertia,m=b.invInertia,n=this.G;return e.scale(j,c,h),e.scale(k,f,i),this.transformedGmult(n,j,d*l,k,g*m)},c.prototype.computeGiMGt=function(){var a=this.bi,b=this.bj,c=a.invMass,d=b.invMass,e=a.invInertia,f=b.invInertia,g=this.G;return g[0]*g[0]*c+g[1]*g[1]*c+g[2]*g[2]*e+g[3]*g[3]*d+g[4]*g[4]*d+g[5]*g[5]*f};{var l=e.create(),m=e.create(),n=e.create();e.create(),e.create(),e.create(),f.create(),f.create()}c.prototype.addToWlambda=function(a){var b=this.bi,c=this.bj,d=l,f=m,g=n,h=this.G;f[0]=h[0],f[1]=h[1],g[0]=h[3],g[1]=h[4],e.scale(d,f,b.invMass*a),e.add(b.vlambda,b.vlambda,d),e.scale(d,g,c.invMass*a),e.add(c.vlambda,c.vlambda,d),b.wlambda+=b.invInertia*h[2]*a,c.wlambda+=c.invInertia*h[5]*a},c.prototype.computeInvC=function(a){return 1/(this.computeGiMGt()+a)}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50}],25:[function(a,b){function c(a,b,c){e.call(this,a,b,-c,c),this.ri=d.create(),this.rj=d.create(),this.t=d.create(),this.contactEquation=null,this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}{var d=(a("../math/mat2"),a("../math/vec2")),e=a("./Equation");a("../utils/Utils")}b.exports=c,c.prototype=new e,c.prototype.constructor=c,c.prototype.setSlipForce=function(a){this.maxForce=a,this.minForce=-a},c.prototype.computeB=function(a,b,c){var e=(this.bi,this.bj,this.ri),f=this.rj,g=this.t,h=this.G;h[0]=-g[0],h[1]=-g[1],h[2]=-d.crossLength(e,g),h[3]=g[0],h[4]=g[1],h[5]=d.crossLength(f,g);var i=this.computeGW(),j=this.computeGiMf(),k=-i*b-c*j;return k}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50,"./Equation":24}],26:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0;var e=this.G;e[2]=1,e[5]=-1}var d=a("./Equation"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.constructor=c;var f=e.create(),g=e.create(),h=e.fromValues(1,0),i=e.fromValues(0,1);c.prototype.computeGq=function(){return e.rotate(f,h,this.bi.angle+this.angle),e.rotate(g,i,this.bj.angle),e.dot(f,g)}},{"../math/vec2":33,"./Equation":24}],27:[function(a,b){function c(a,b){d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.G;d[2]=-1,d[5]=this.ratio;var e=this.computeGiMf(),f=this.computeGW(),g=-f*b-c*e;return g}},{"../math/vec2":33,"./Equation":24}],28:[function(a,b){var c=function(){};b.exports=c,c.prototype={constructor:c,on:function(a,b,c){b.context=c||this,void 0===this._listeners&&(this._listeners={});var d=this._listeners;return void 0===d[a]&&(d[a]=[]),-1===d[a].indexOf(b)&&d[a].push(b),this},has:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},off:function(a,b){if(void 0===this._listeners)return this;var c=this._listeners,d=c[a].indexOf(b);return-1!==d&&c[a].splice(d,1),this},emit:function(a){if(void 0===this._listeners)return this;var b=this._listeners,c=b[a.type];if(void 0!==c){a.target=this;for(var d=0,e=c.length;e>d;d++){var f=c[d];f.call(f.context,a)}}return this}}},{}],29:[function(a,b){function c(a,b,e){if(e=e||{},!(a instanceof d&&b instanceof d))throw new Error("First two arguments must be Material instances.");this.id=c.idCounter++,this.materialA=a,this.materialB=b,this.friction="undefined"!=typeof e.friction?Number(e.friction):.3,this.restitution="undefined"!=typeof e.restitution?Number(e.restitution):0,this.stiffness="undefined"!=typeof e.stiffness?Number(e.stiffness):1e7,this.relaxation="undefined"!=typeof e.relaxation?Number(e.relaxation):3,this.frictionStiffness="undefined"!=typeof e.frictionStiffness?Number(e.frictionStiffness):1e7,this.frictionRelaxation="undefined"!=typeof e.frictionRelaxation?Number(e.frictionRelaxation):3,this.surfaceVelocity="undefined"!=typeof e.surfaceVelocity?Number(e.surfaceVelocity):0}var d=a("./Material");b.exports=c,c.idCounter=0},{"./Material":30}],30:[function(a,b){function c(){this.id=c.idCounter++}b.exports=c,c.idCounter=0},{}],31:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/mat2").mat2;b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/mat2":1}],32:[function(a,b){var c={};c.GetArea=function(a){if(a.length<6)return 0;for(var b=a.length-2,c=0,d=0;b>d;d+=2)c+=(a[d+2]-a[d])*(a[d+1]+a[d+3]);return c+=(a[0]-a[b])*(a[b+1]+a[1]),.5*-c},c.Triangulate=function(a){var b=a.length>>1;if(3>b)return[];for(var d=[],e=[],f=0;b>f;f++)e.push(f);for(var f=0,g=b;g>3;){var h=e[(f+0)%g],i=e[(f+1)%g],j=e[(f+2)%g],k=a[2*h],l=a[2*h+1],m=a[2*i],n=a[2*i+1],o=a[2*j],p=a[2*j+1],q=!1;if(c._convex(k,l,m,n,o,p)){q=!0;for(var r=0;g>r;r++){var s=e[r];if(s!=h&&s!=i&&s!=j&&c._PointInTriangle(a[2*s],a[2*s+1],k,l,m,n,o,p)){q=!1;break}}}if(q)d.push(h,i,j),e.splice((f+1)%g,1),g--,f=0;else if(f++>3*g)break}return d.push(e[0],e[1],e[2]),d},c._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},c._convex=function(a,b,c,d,e,f){return(b-d)*(e-c)+(c-a)*(f-d)>=0},b.exports=c},{}],33:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/vec2").vec2;c.getX=function(a){return a[0]},c.getY=function(a){return a[1]},c.crossLength=function(a,b){return a[0]*b[1]-a[1]*b[0]},c.crossVZ=function(a,b,d){return c.rotate(a,b,-Math.PI/2),c.scale(a,a,d),a},c.crossZV=function(a,b,d){return c.rotate(a,d,Math.PI/2),c.scale(a,a,b),a},c.rotate=function(a,b,c){var d=Math.cos(c),e=Math.sin(c),f=b[0],g=b[1];a[0]=d*f-e*g,a[1]=e*f+d*g},c.toLocalFrame=function(a,b,d,e){c.copy(a,b),c.sub(a,a,d),c.rotate(a,a,-e)},c.toGlobalFrame=function(a,b,d,e){c.copy(a,b),c.rotate(a,a,e),c.add(a,a,d)},c.centroid=function(a,b,d,e){return c.add(a,b,d),c.add(a,a,e),c.scale(a,a,1/3),a},b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/vec2":2}],34:[function(a,b){function c(a){a=a||{},h.call(this),this.id=++c._idCounter,this.world=null,this.shapes=[],this.shapeOffsets=[],this.shapeAngles=[],this.mass=a.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.fixedRotation=!!a.fixedRotation||!1,this.position=d.fromValues(0,0),a.position&&d.copy(this.position,a.position),this.interpolatedPosition=d.fromValues(0,0),this.velocity=d.fromValues(0,0),a.velocity&&d.copy(this.velocity,a.velocity),this.vlambda=d.fromValues(0,0),this.wlambda=0,this.angle=a.angle||0,this.angularVelocity=a.angularVelocity||0,this.force=d.create(),a.force&&d.copy(this.force,a.force),this.angularForce=a.angularForce||0,this.damping="number"==typeof a.damping?a.damping:.1,this.angularDamping="number"==typeof a.angularDamping?a.angularDamping:.1,this.motionState=0==this.mass?c.STATIC:c.DYNAMIC,this.boundingRadius=0,this.aabb=new g,this.aabbNeedsUpdate=!0,this.allowSleep=!1,this.sleepState=c.AWAKE,this.sleepSpeedLimit=.1,this.sleepTimeLimit=1,this.gravityScale=1,this.timeLastSleepy=0,this.concavePath=null,this.lastDampingScale=1,this.lastAngularDampingScale=1,this.lastDampingTimeStep=-1,this.updateMassProperties()}var d=a("../math/vec2"),e=a("poly-decomp"),f=a("../shapes/Convex"),g=a("../collision/AABB"),h=a("../events/EventEmitter");b.exports=c,c.prototype=new h,c._idCounter=0,c.prototype.setDensity=function(a){var b=this.getArea();this.mass=b*a,this.updateMassProperties()},c.prototype.getArea=function(){for(var a=0,b=0;be&&(e=h+i)}this.boundingRadius=e},c.prototype.addShape=function(a,b,c){c=c||0,b=b?d.fromValues(b[0],b[1]):d.fromValues(0,0),this.shapes.push(a),this.shapeOffsets.push(b),this.shapeAngles.push(c),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},c.prototype.removeShape=function(a){var b=this.shapes.indexOf(a);return-1!=b?(this.shapes.splice(b,1),this.shapeOffsets.splice(b,1),this.shapeAngles.splice(b,1),this.aabbNeedsUpdate=!0,!0):!1},c.prototype.updateMassProperties=function(){if(this.motionState==c.STATIC||this.motionState==c.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var a=this.shapes,b=a.length,e=this.mass/b,f=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var g=0;b>g;g++){var h=a[g],i=d.squaredLength(this.shapeOffsets[g]),j=h.computeMomentOfInertia(e);f+=j+e*i}this.inertia=f,this.invInertia=f>0?1/f:0}this.invMass=1/this.mass}};var k=d.create();c.prototype.applyForce=function(a,b){var c=k;d.sub(c,b,this.position),d.add(this.force,this.force,a);var e=d.crossLength(c,a);this.angularForce+=e},c.prototype.toLocalFrame=function(a,b){d.toLocalFrame(a,b,this.position,this.angle)},c.prototype.toWorldFrame=function(a,b){d.toGlobalFrame(a,b,this.position,this.angle)},c.prototype.fromPolygon=function(a,b){b=b||{};for(var c=this.shapes.length;c>=0;--c)this.removeShape(this.shapes[c]);var g=new e.Polygon;if(g.vertices=a,g.makeCCW(),"number"==typeof b.removeCollinearPoints&&g.removeCollinearPoints(b.removeCollinearPoints),"undefined"==typeof b.skipSimpleCheck&&!g.isSimple())return!1;this.concavePath=g.vertices.slice(0);for(var c=0;ce?(this.sleepState=c.SLEEPY,this.timeLastSleepy=a,this.emit(c.sleepyEvent)):b===c.SLEEPY&&e>f?this.wakeUp():b===c.SLEEPY&&a-this.timeLastSleepy>this.sleepTimeLimit&&this.sleep()}},c.sleepyEvent={type:"sleepy"},c.sleepEvent={type:"sleep"},c.wakeUpEvent={type:"wakeup"},c.DYNAMIC=1,c.STATIC=2,c.KINEMATIC=4,c.AWAKE=0,c.SLEEPY=1,c.SLEEPING=2},{"../collision/AABB":9,"../events/EventEmitter":28,"../math/vec2":33,"../shapes/Convex":39,"poly-decomp":7}],35:[function(a,b){function c(a,b,c){c=c||{},this.restLength="number"==typeof c.restLength?c.restLength:1,this.stiffness=c.stiffness||100,this.damping=c.damping||1,this.bodyA=a,this.bodyB=b,this.localAnchorA=d.fromValues(0,0),this.localAnchorB=d.fromValues(0,0),c.localAnchorA&&d.copy(this.localAnchorA,c.localAnchorA),c.localAnchorB&&d.copy(this.localAnchorB,c.localAnchorB),c.worldAnchorA&&this.setWorldAnchorA(c.worldAnchorA),c.worldAnchorB&&this.setWorldAnchorB(c.worldAnchorB)}var d=a("../math/vec2");b.exports=c,c.prototype.setWorldAnchorA=function(a){this.bodyA.toLocalFrame(this.localAnchorA,a)},c.prototype.setWorldAnchorB=function(a){this.bodyB.toLocalFrame(this.localAnchorB,a)},c.prototype.getWorldAnchorA=function(a){this.bodyA.toWorldFrame(a,this.localAnchorA)},c.prototype.getWorldAnchorB=function(a){this.bodyB.toWorldFrame(a,this.localAnchorB)};var e=d.create(),f=d.create(),g=d.create(),h=d.create(),i=d.create(),j=d.create(),k=d.create(),l=d.create(),m=d.create();c.prototype.applyForce=function(){var a=this.stiffness,b=this.damping,c=this.restLength,n=this.bodyA,o=this.bodyB,p=e,q=f,r=g,s=h,t=m,u=i,v=j,w=k,x=l;this.getWorldAnchorA(u),this.getWorldAnchorB(v),d.sub(w,u,n.position),d.sub(x,v,o.position),d.sub(p,v,u);var y=d.len(p);d.normalize(q,p),d.sub(r,o.velocity,n.velocity),d.crossZV(t,o.angularVelocity,x),d.add(r,r,t),d.crossZV(t,n.angularVelocity,w),d.sub(r,r,t),d.scale(s,q,-a*(y-c)-b*d.dot(r,q)),d.sub(n.force,n.force,s),d.add(o.force,o.force,s);var z=d.crossLength(w,s),A=d.crossLength(x,s);n.angularForce-=z,o.angularForce+=A}},{"../math/vec2":33}],36:[function(a,b){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"),Island:a("./solver/IslandSolver"),IslandSolver:a("./solver/IslandSolver"),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"),Utils:a("./utils/Utils"),World:a("./world/World"),QuadTree:a("./collision/QuadTree").QuadTree,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/QuadTree":14,"./collision/SAPBroadphase":15,"./constraints/Constraint":16,"./constraints/DistanceConstraint":17,"./constraints/GearConstraint":18,"./constraints/LockConstraint":19,"./constraints/PrismaticConstraint":20,"./constraints/RevoluteConstraint":21,"./equations/AngleLockEquation":22,"./equations/ContactEquation":23,"./equations/Equation":24,"./equations/FrictionEquation":25,"./equations/RotationalVelocityEquation":27,"./events/EventEmitter":28,"./material/ContactMaterial":29,"./material/Material":30,"./math/vec2":33,"./objects/Body":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/IslandSolver":48,"./solver/Solver":49,"./utils/Utils":50,"./world/World":51}],37:[function(a,b){function c(a,b){this.length=a||1,this.radius=b||1,d.call(this,d.CAPSULE)}var d=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,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":45}],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":45}],39:[function(a,b){function c(a){this.vertices=[];for(var b=0;bg;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":45,"poly-decomp":7}],40:[function(a,b){function c(a,b,c){this.data=a,this.maxValue=b,this.elementWidth=c,d.call(this,d.HEIGHTFIELD)}{var d=a("./Shape");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return Number.MAX_VALUE},c.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},c.prototype.updateArea=function(){for(var a=this.data,b=0,c=0;cf)){var D=u?r:z.eps,E=c.iterateEquation(C,z,D,y,x,w,v,a,f,j,this.useNormalForceForFriction);B+=Math.abs(E)}if(k>=B*B)break}for(A=0;A!==o;A++)n[A].addConstraintVelocity()}},c.iterateEquation=function(a,b,c,d,e,f,g,i,j,k,l){var m=d[a],n=e[a],o=f[a],p=b.computeGWlambda();l&&b instanceof h&&j==k&&(b.maxForce=b.contactEquation.multiplier*b.frictionCoefficient*i,b.minForce=-b.contactEquation.multiplier*b.frictionCoefficient*i);var q=b.maxForce,r=b.minForce;g&&(m=0);var s=n*(m-p-c*o),t=o+s;return r*i>t?s=r*i-o:t>q*i&&(s=q*i-o),f[a]+=s,b.multiplier=f[a]/i,b.addToWlambda(s),s}},{"../equations/FrictionEquation":25,"../math/vec2":33,"../utils/Utils":50,"./Solver":49}],47:[function(a,b){function c(){this.equations=[],this.bodies=[]}b.exports=c,c.prototype.reset=function(){this.equations.length=this.bodies.length=0},c.prototype.getBodies=function(){for(var a=[],b=[],c=this.equations,d=0;d!==c.length;d++){var e=c[d];-1===b.indexOf(e.bi.id)&&(a.push(e.bi),b.push(e.bi.id)),-1===b.indexOf(e.bj.id)&&(a.push(e.bj),b.push(e.bj.id))}return a},c.prototype.solve=function(a,b){var c=[];b.removeAllEquations();for(var d=this.equations.length,e=0;e!==d;e++)b.addEquation(this.equations[e]);for(var f=this.getBodies(),g=f.length,e=0;e!==g;e++)c.push(f[e]);b.solve(a,{bodies:c})}},{}],48:[function(a,b){function c(a,b){g.call(this,b,g.ISLAND);this.subsolver=a,this.numIslands=0,this._nodePool=[],this._islandPool=[],this.beforeSolveIslandEvent={type:"beforeSolveIsland",island:null}}function d(a){for(var b=a.length,c=0;c!==b;c++){var d=a[c];if(!d.visited&&d.body.motionState!=j)return d}return!1}function e(a,b,c){b.push(a.body);for(var d=a.eqs.length,e=0;e!==d;e++){var f=a.eqs[e];-1===c.indexOf(f)&&c.push(f)}}function f(a,b,c,e){for(k.length=0,k.push(a),a.visited=!0,b(a,c,e);k.length;)for(var f,g=k.pop();f=d(g.children);)f.visited=!0,b(f,c,e),k.push(f)}var g=a("./Solver"),h=(a("../math/vec2"),a("../solver/Island")),i=a("../objects/Body"),j=i.STATIC;b.exports=c,c.prototype=new g;var k=[],l=[],m=[],n=[],o=[];c.prototype.solve=function(a,b){var c=l,g=b.bodies,i=this.equations,j=i.length,k=g.length,p=(this.subsolver,this._workers,this._workerData,this._workerIslandGroups,this._islandPool);l.length=0;for(var q=0;q!==k;q++)c.push(this._nodePool.length?this._nodePool.pop():{body:g[q],children:[],eqs:[],visited:!1});for(var q=0;q!==k;q++){var r=c[q];r.body=g[q],r.children.length=0,r.eqs.length=0,r.visited=!1}for(var s=0;s!==j;s++){var t=i[s],q=g.indexOf(t.bi),u=g.indexOf(t.bj),v=c[q],w=c[u];v.children.push(w),v.eqs.push(t),w.children.push(v),w.eqs.push(t)}var x,y=0,z=m,A=n;z.length=0,A.length=0;var B=o;for(B.length=0;x=d(c);){var C=p.length?p.pop():new h;z.length=0,A.length=0,f(x,e,A,z);for(var D=z.length,q=0;q!==D;q++){var t=z[q];C.equations.push(t)}y++,B.push(C)}this.numIslands=y;for(var E=this.beforeSolveIslandEvent,q=0;qd;d++)a[d]=a[d+c];a.length=e},c.ARRAY_TYPE=Float32Array||Array},{}],51:[function(a,b){function c(a){n.apply(this),a=a||{},this.springs=[],this.bodies=[],this.solver=a.solver||new d,this.narrowphase=new x(this),this.gravity=a.gravity||f.fromValues(0,-9.78),this.doProfiling=a.doProfiling||!1,this.lastStepTime=0,this.broadphase=a.broadphase||new e,this.broadphase.setWorld(this),this.constraints=[],this.defaultFriction=.3,this.defaultRestitution=0,this.defaultMaterial=new q,this.defaultContactMaterial=new r(this.defaultMaterial,this.defaultMaterial),this.lastTimeStep=1/60,this.applySpringForces=!0,this.applyDamping=!0,this.applyGravity=!0,this.solveConstraints=!0,this.contactMaterials=[],this.time=0,this.fixedStepTime=0,this.emitImpactEvent=!0,this._constraintIdCounter=0,this._bodyIdCounter=0,this.postStepEvent={type:"postStep"},this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.addSpringEvent={type:"addSpring",spring:null},this.impactEvent={type:"impact",bodyA:null,bodyB:null,shapeA:null,shapeB:null,contactEquation:null},this.postBroadphaseEvent={type:"postBroadphase",pairs:null},this.enableBodySleeping=!1,this.beginContactEvent={type:"beginContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null,contactEquations:[]},this.endContactEvent={type:"endContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null},this.preSolveEvent={type:"preSolve",contactEquations:null,frictionEquations:null},this.overlappingShapesLastState={keys:[]},this.overlappingShapesCurrentState={keys:[]},this.overlappingShapeLookup={keys:[]}}var d=a("../solver/GSSolver"),e=a("../collision/NaiveBroadphase"),f=a("../math/vec2"),g=a("../shapes/Circle"),h=a("../shapes/Rectangle"),i=a("../shapes/Convex"),j=a("../shapes/Line"),k=a("../shapes/Plane"),l=a("../shapes/Capsule"),m=a("../shapes/Particle"),n=a("../events/EventEmitter"),o=a("../objects/Body"),p=a("../objects/Spring"),q=a("../material/Material"),r=a("../material/ContactMaterial"),s=a("../constraints/DistanceConstraint"),t=a("../constraints/LockConstraint"),u=a("../constraints/RevoluteConstraint"),v=a("../constraints/PrismaticConstraint"),w=a("../../package.json"),x=(a("../collision/Broadphase"),a("../collision/Narrowphase")),y=a("../utils/Utils");b.exports=c;var z=w.version.split(".").slice(0,2).join(".");if("undefined"==typeof performance&&(performance={}),!performance.now){var A=Date.now();performance.timing&&performance.timing.navigationStart&&(A=performance.timing.navigationStart),performance.now=function(){return Date.now()-A}}c.prototype=new Object(n.prototype),c.prototype.addConstraint=function(a){this.constraints.push(a)},c.prototype.addContactMaterial=function(a){this.contactMaterials.push(a)},c.prototype.removeContactMaterial=function(a){var b=this.contactMaterials.indexOf(a);-1!==b&&y.splice(this.contactMaterials,b,1)},c.prototype.getContactMaterial=function(a,b){for(var c=this.contactMaterials,d=0,e=c.length;d!==e;d++){var f=c[d];if(f.materialA===a&&f.materialB===b||f.materialA===b&&f.materialB===a)return f}return!1},c.prototype.removeConstraint=function(a){var b=this.constraints.indexOf(a);-1!==b&&y.splice(this.constraints,b,1)};{var B=(f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create()),C=f.fromValues(0,0),D=f.fromValues(0,0);f.fromValues(0,0)}c.prototype.step=function(a,b,c){if(c=c||10,b=b||0,0==b)this.internalStep(a),this.time+=a;else{var d=Math.floor((this.time+b)/a)-Math.floor(this.time/a);d=Math.min(d,c);for(var e=0;d>e;e++)this.internalStep(a);this.time+=b,this.fixedStepTime+=d*a;for(var f=this.time-this.fixedStepTime-a,g=0;g!==this.bodies.length;g++){var h=this.bodies[g];h.interpolatedPosition[0]=h.position[0]+h.velocity[0]*f,h.interpolatedPosition[1]=h.position[1]+h.velocity[1]*f}}},c.prototype.internalStep=function(a){{var b,d,e=this,g=this.doProfiling,h=this.springs.length,i=this.springs,j=this.bodies,k=this.gravity,l=this.solver,m=this.bodies.length,n=this.broadphase,p=this.narrowphase,q=this.constraints,r=B,s=(f.scale,f.add);f.rotate}this.lastTimeStep=a,g&&(b=performance.now());var t=f.length(this.gravity);if(this.applyGravity)for(var u=0;u!==m;u++){var v=j[u],w=v.force;v.motionState==o.DYNAMIC&&(f.scale(r,k,v.mass*v.gravityScale),s(w,w,r))}if(this.applySpringForces)for(var u=0;u!==h;u++){var x=i[u];x.applyForce()}if(this.applyDamping)for(var u=0;u!==m;u++){var v=j[u];v.motionState==o.DYNAMIC&&v.applyDamping(a)}var y=n.getCollisionPairs(this);this.postBroadphaseEvent.pairs=y,this.emit(this.postBroadphaseEvent),p.reset(this);for(var u=0,z=y.length;u!==z;u+=2)for(var A=y[u],C=y[u+1],D=0,E=A.shapes.length;D!==E;D++)for(var F=A.shapes[D],G=A.shapeOffsets[D],H=A.shapeAngles[D],I=0,J=C.shapes.length;I!==J;I++){var K=C.shapes[I],L=C.shapeOffsets[I],M=C.shapeAngles[I],N=this.defaultContactMaterial;if(F.material&&K.material){var O=this.getContactMaterial(F.material,K.material);O&&(N=O)}this.runNarrowphase(p,A,F,G,H,C,K,L,M,N,t)}for(var P=this.overlappingShapesLastState,u=0;u!==P.keys.length;u++){var Q=P.keys[u];if(P[Q]===!0&&!this.overlappingShapesCurrentState[Q]){var R=this.endContactEvent;R.shapeA=P[Q+"_shapeA"],R.shapeB=P[Q+"_shapeB"],R.bodyA=P[Q+"_bodyA"],R.bodyB=P[Q+"_bodyB"],this.emit(R)}}for(var u=0;u!==P.keys.length;u++)delete P[P.keys[u]];P.keys.length=0;for(var S=this.overlappingShapesCurrentState,u=0;u!==S.keys.length;u++)P[S.keys[u]]=S[S.keys[u]],P.keys.push(S.keys[u]);for(var u=0;u!==S.keys.length;u++)delete S[S.keys[u]];S.keys.length=0;var T=this.preSolveEvent;T.contactEquations=p.contactEquations,T.frictionEquations=p.frictionEquations,this.emit(T),l.addEquations(p.contactEquations),l.addEquations(p.frictionEquations);var U=q.length;for(u=0;u!==U;u++){var V=q[u];V.update(),l.addEquations(V.equations)}this.solveConstraints&&l.solve(a,this),l.removeAllEquations();for(var u=0;u!==m;u++){var W=j[u];W.sleepState!==o.SLEEPING&&W.motionState!=o.STATIC&&c.integrateBody(W,a)}for(var u=0;u!==m;u++)j[u].setZeroForce();if(g&&(d=performance.now(),e.lastStepTime=d-b),this.emitImpactEvent)for(var X=this.impactEvent,u=0;u!==p.contactEquations.length;u++){var Y=p.contactEquations[u];Y.firstImpact&&(X.bodyA=Y.bi,X.bodyB=Y.bj,X.shapeA=Y.shapeA,X.shapeB=Y.shapeB,X.contactEquation=Y,this.emit(X))}if(this.enableBodySleeping)for(u=0;u!==m;u++)j[u].sleepTick(this.time);this.emit(this.postStepEvent)};var E=f.create(),F=f.create();c.integrateBody=function(a,b){var c=a.invMass,d=a.force,e=a.position,g=a.velocity;a.fixedRotation||(a.angularVelocity+=a.angularForce*a.invInertia*b,a.angle+=a.angularVelocity*b),f.scale(E,d,b*c),f.add(g,E,g),f.scale(F,g,b),f.add(e,e,F),a.aabbNeedsUpdate=!0},c.prototype.runNarrowphase=function(a,b,c,d,e,g,h,i,j,k,l){if(0!==(c.collisionGroup&h.collisionMask)&&0!==(h.collisionGroup&c.collisionMask)){f.rotate(C,d,b.angle),f.rotate(D,i,g.angle),f.add(C,C,b.position),f.add(D,D,g.position);var m=e+b.angle,n=j+g.angle;a.enableFriction=k.friction>0,a.frictionCoefficient=k.friction;var p;p=b.motionState==o.STATIC||b.motionState==o.KINEMATIC?g.mass:g.motionState==o.STATIC||g.motionState==o.KINEMATIC?b.mass:b.mass*g.mass/(b.mass+g.mass),a.slipForce=k.friction*l*p,a.restitution=k.restitution,a.surfaceVelocity=k.surfaceVelocity,a.frictionStiffness=k.frictionStiffness,a.frictionRelaxation=k.frictionRelaxation,a.stiffness=k.stiffness,a.relaxation=k.relaxation;var q=a[c.type|h.type],r=0;if(q){var s=c.sensor||h.sensor;if(r=c.type=0;b--)this.removeConstraint(a[b]);for(var c=this.bodies,b=c.length-1;b>=0;b--)this.removeBody(c[b]);for(var d=this.springs,b=d.length-1;b>=0;b--)this.removeSpring(d[b]);for(var e=this.contactMaterials,b=e.length-1;b>=0;b--)this.removeContactMaterial(e[b])},c.prototype.clone=function(){var a=new c;return a.fromJSON(this.toJSON()),a};var G=f.create(),H=f.fromValues(0,0),I=f.fromValues(0,0);c.prototype.hitTest=function(a,b,c){c=c||0;var d=new o({position:a}),e=new m,h=a,j=0,n=G,p=H,q=I;d.addShape(e);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;f.rotate(n,z,v.angle),f.add(n,n,v.position);var B=A+v.angle;(y instanceof g&&r.circleParticle(v,y,n,B,d,e,h,j,!0)||y instanceof i&&r.particleConvex(d,e,h,j,v,y,n,B,!0)||y instanceof k&&r.particlePlane(d,e,h,j,v,y,n,B,!0)||y instanceof l&&r.particleCapsule(d,e,h,j,v,y,n,B,!0)||y instanceof m&&f.squaredLength(f.sub(q,n,a))0&&this.enable(a[d],b,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c):(this.enableBody(a,b),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,!0))},enableBody:function(a,b){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.P2.Body(this.game,a,a.x,a.y,1),a.body.debug=b,a.anchor.set(.5))},setImpactEvents:function(a){a?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(a,b){this.postBroadphaseCallback=a,this.callbackContext=b,null!==a?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(a){if(this.postBroadphaseCallback)for(var b=a.pairs.length;b-=2;)1===a.pairs[b].id||1===a.pairs[b+1].id||this.postBroadphaseCallback.call(this.callbackContext,a.pairs[b].parent,a.pairs[b+1].parent)||a.pairs.splice(b,2)},impactHandler:function(a){if(a.bodyA.parent&&a.bodyB.parent){var b=a.bodyA.parent,c=a.bodyB.parent;b._bodyCallbacks[a.bodyB.id]&&b._bodyCallbacks[a.bodyB.id].call(b._bodyCallbackContext[a.bodyB.id],b,c,a.shapeA,a.shapeB),c._bodyCallbacks[a.bodyA.id]&&c._bodyCallbacks[a.bodyA.id].call(c._bodyCallbackContext[a.bodyA.id],c,b,a.shapeB,a.shapeA),b._groupCallbacks[a.shapeB.collisionGroup]&&b._groupCallbacks[a.shapeB.collisionGroup].call(b._groupCallbackContext[a.shapeB.collisionGroup],b,c,a.shapeA,a.shapeB),c._groupCallbacks[a.shapeA.collisionGroup]&&c._groupCallbacks[a.shapeA.collisionGroup].call(c._groupCallbackContext[a.shapeA.collisionGroup],c,b,a.shapeB,a.shapeA)}},beginContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onBeginContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB,a.contactEquations),a.bodyA.parent&&a.bodyA.parent.onBeginContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB,a.contactEquations),a.bodyB.parent&&a.bodyB.parent.onBeginContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA,a.contactEquations))},endContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onEndContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB),a.bodyA.parent&&a.bodyA.parent.onEndContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB),a.bodyB.parent&&a.bodyB.parent.onEndContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA))},setBoundsToWorld:function(a,b,c,d,e){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,a,b,c,d,e)},setWorldMaterial:function(a,b,c,d,e){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),b&&this._wallShapes[0]&&(this._wallShapes[0].material=a),c&&this._wallShapes[1]&&(this._wallShapes[1].material=a),d&&this._wallShapes[2]&&(this._wallShapes[2].material=a),e&&this._wallShapes[3]&&(this._wallShapes[3].material=a)},updateBoundsCollisionGroup:function(a){"undefined"==typeof a&&(a=!0);for(var b=0;4>b;b++)this._wallShapes[b]&&(this._wallShapes[b].collisionGroup=a?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask)},setBounds:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=c/2,k=d/2,l=j+a,m=k+b;if(null!==this.bounds){this.bounds.world&&this.world.removeBody(this.bounds);for(var n=this.bounds.shapes.length;n--;){var o=this.bounds.shapes[n];this.bounds.removeShape(o)}this.bounds.position[0]=this.pxmi(l),this.bounds.position[1]=this.pxmi(m)}else this.bounds=new p2.Body({mass:0,position:[this.pxmi(l),this.pxmi(m)]});e&&(this._wallShapes[0]=new p2.Plane,i&&(this._wallShapes[0].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[0],[this.pxmi(-j),0],1.5707963267948966)),f&&(this._wallShapes[1]=new p2.Plane,i&&(this._wallShapes[1].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[1],[this.pxmi(j),0],-1.5707963267948966)),g&&(this._wallShapes[2]=new p2.Plane,i&&(this._wallShapes[2].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[2],[0,this.pxmi(-k)],-3.141592653589793)),h&&(this._wallShapes[3]=new p2.Plane,i&&(this._wallShapes[3].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[3],[0,this.pxmi(k)])),this.world.addBody(this.bounds)},update:function(){this.world.step(this.useElapsedTime?this.game.time.physicsElapsed:this.frameRate)},clear:function(){this.world.clear(),this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this._collisionGroupID=2,this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){return a.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){return a.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){return this.world.addSpring(a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){return this.world.removeSpring(a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.GearConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e){return a=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(new Phaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):void console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){return this.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){return this.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){return this.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){return this.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){return this.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(var c=b.length;c--;)b.setMaterial(a)},createMaterial:function(a,b){a=a||"";var c=new Phaser.Physics.P2.Material(a);return this.materials.push(c),"undefined"!=typeof b&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeof a&&(a=this.createMaterial()),"undefined"==typeof b&&(b=this.createMaterial());var d=new Phaser.Physics.P2.ContactMaterial(a,b,c);return this.addContactMaterial(d)},getBodies:function(){for(var a=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);return a},getBody:function(a){return a instanceof p2.Body?a:a instanceof Phaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(var a=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);return a},getConstraints:function(){for(var a=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);return a},hitTest:function(a,b,c,d){"undefined"==typeof b&&(b=this.world.bodies),"undefined"==typeof c&&(c=5),"undefined"==typeof d&&(d=!1);for(var e=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceof Phaser.Physics.P2.Body&&(!d||b[g].data.motionState!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceof p2.Body&&b[g].parent&&(!d||b[g].motionState!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceof Phaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.motionState!==p2.Body.STATIC)&&f.push(b[g].body.data);return this.world.hitTest(e,f,c)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(a){var b=Math.pow(2,this._collisionGroupID);this._wallShapes[0]&&(this._wallShapes[0].collisionMask=this._wallShapes[0].collisionMask|b),this._wallShapes[1]&&(this._wallShapes[1].collisionMask=this._wallShapes[1].collisionMask|b),this._wallShapes[2]&&(this._wallShapes[2].collisionMask=this._wallShapes[2].collisionMask|b),this._wallShapes[3]&&(this._wallShapes[3].collisionMask=this._wallShapes[3].collisionMask|b),this._collisionGroupID++;var c=new Phaser.Physics.P2.CollisionGroup(b);return this.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(a instanceof Phaser.Group)for(var c=0;ce;e++){var g=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}return d},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c,d){b=a.getLayer(b),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),this.clearTilemapLayerBodies(a,b);for(var e=0,f=0,g=0,h=0,i=a.layers[b].height;i>h;h++){e=0;for(var j=0,k=a.layers[b].width;k>j;j++){var l=a.layers[b].data[h][j];if(l)if(d){var m=a.getTileRight(b,j,h);if(0===e&&(f=l.x*l.width,g=l.y*l.height,e=l.width),m&&m.collides)e+=l.width;else{var n=this.createBody(f,g,0,!1);n.addRectangle(e,l.height,e/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n),e=0}}else{var n=this.createBody(l.x*l.width,l.y*l.height,0,!1);n.addRectangle(l.width,l.height,l.width/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n)}}}return a.layers[b].bodies},mpx:function(a){return a*=20},pxm:function(a){return.05*a},mpxi:function(a){return a*=-20},pxmi:function(a){return a*-.05}},Object.defineProperty(Phaser.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultFriction},set:function(a){this.world.defaultFriction=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"restituion",{get:function(){return this.world.defaultRestitution},set:function(a){this.world.defaultRestitution=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(a){this.world.applySpringForces=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(a){this.world.applyDamping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(a){this.world.applyGravity=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(a){this.world.solveConstraints=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"time",{get:function(){return this.world.time}}),Object.defineProperty(Phaser.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(a){this.world.emitImpactEvent=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"enableBodySleeping",{get:function(){return this.world.enableBodySleeping},set:function(a){this.world.enableBodySleeping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),Phaser.Physics.P2.PointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.PointProxy.prototype.constructor=Phaser.Physics.P2.PointProxy,Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(a)}}),Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(a)}}),Phaser.Physics.P2.InversePointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.InversePointProxy.prototype.constructor=Phaser.Physics.P2.InversePointProxy,Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(-a)}}),Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(-a) -}}),Phaser.Physics.P2.Body=function(a,b,c,d,e){b=b||null,c=c||0,d=d||0,"undefined"==typeof e&&(e=1),this.game=a,this.world=a.physics.p2,this.sprite=b,this.type=Phaser.Physics.P2JS,this.offset=new Phaser.Point,this.data=new p2.Body({position:[this.world.pxmi(c),this.world.pxmi(d)],mass:e}),this.data.parent=this,this.velocity=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new Phaser.Point,this.onImpact=new Phaser.Signal,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,this.collidesWith=[],this.removeNextStep=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody=null,b&&(this.setRectangleFromSprite(b),b.exists&&this.game.physics.p2.addBody(this))},Phaser.Physics.P2.Body.prototype={createBodyCallback:function(a,b,c){var d=-1;a.id?d=a.id:a.body&&(d=a.body.id),d>-1&&(null===b?(delete this._bodyCallbacks[d],delete this._bodyCallbackContext[d]):(this._bodyCallbacks[d]=b,this._bodyCallbackContext[d]=c))},createGroupCallback:function(a,b,c){null===b?(delete this._groupCallbacks[a.mask],delete this._groupCallbacksContext[a.mask]):(this._groupCallbacks[a.mask]=b,this._groupCallbackContext[a.mask]=c)},getCollisionMask:function(){var a=0;this._collideWorldBounds&&(a=this.game.physics.p2.boundsCollisionGroup.mask);for(var b=0;b=0;c--)this.data.shapes[c].collisionMask=b;else a.collisionMask=b},setCollisionGroup:function(a,b){var c=this.getCollisionMask();if("undefined"==typeof b)for(var d=this.data.shapes.length-1;d>=0;d--)this.data.shapes[d].collisionGroup=a.mask,this.data.shapes[d].collisionMask=c;else b.collisionGroup=a.mask,b.collisionMask=c},clearCollision:function(a,b,c){if("undefined"==typeof c)for(var d=this.data.shapes.length-1;d>=0;d--)a&&(this.data.shapes[d].collisionGroup=null),b&&(this.data.shapes[d].collisionMask=null);else a&&(c.collisionGroup=null),b&&(c.collisionMask=null);a&&(this.collidesWith.length=0)},collides:function(a,b,c,d){if(Array.isArray(a))for(var e=0;e=0;e--)this.data.shapes[e].collisionMask=f;else d.collisionMask=f},adjustCenterOfMass:function(){this.data.adjustCenterOfMass()},applyDamping:function(a){this.data.applyDamping(a)},applyForce:function(a,b,c){this.data.applyForce(a,[this.world.pxm(b),this.world.pxm(c)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(a,b){return this.data.toLocalFrame(a,b)},toWorldFrame:function(a,b){return this.data.toWorldFrame(a,b)},rotateLeft:function(a){this.data.angularVelocity=this.world.pxm(-a)},rotateRight:function(a){this.data.angularVelocity=this.world.pxm(a)},moveForward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=b*Math.cos(c),this.data.velocity[1]=b*Math.sin(c)},moveBackward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=-(b*Math.cos(c)),this.data.velocity[1]=-(b*Math.sin(c))},thrust:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]+=b*Math.cos(c),this.data.force[1]+=b*Math.sin(c)},reverse:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]-=b*Math.cos(c),this.data.force[1]-=b*Math.sin(c)},moveLeft:function(a){this.data.velocity[0]=this.world.pxmi(-a)},moveRight:function(a){this.data.velocity[0]=this.world.pxmi(a)},moveUp:function(a){this.data.velocity[1]=this.world.pxmi(-a)},moveDown:function(a){this.data.velocity[1]=this.world.pxmi(a)},preUpdate:function(){this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0]),this.sprite.y=this.world.mpxi(this.data.position[1]),this.fixedRotation||(this.sprite.rotation=this.data.angle)},reset:function(a,b,c,d){"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),c&&this.setZeroDamping(),d&&(this.mass=1),this.x=a,this.y=b},addToWorld:function(){this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(),this.debugBody=null,this.sprite=null},clearShapes:function(){for(var a=this.data.shapes.length;a--;)this.data.removeShape(this.data.shapes[a]);this.shapeChanged()},addShape:function(a,b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.data.addShape(a,[this.world.pxmi(b),this.world.pxmi(c)],d),this.shapeChanged(),a},addCircle:function(a,b,c,d){var e=new p2.Circle(this.world.pxm(a));return this.addShape(e,b,c,d)},addRectangle:function(a,b,c,d,e){var f=new p2.Rectangle(this.world.pxm(a),this.world.pxm(b));return this.addShape(f,c,d,e)},addPlane:function(a,b,c){var d=new p2.Plane;return this.addShape(d,a,b,c)},addParticle:function(a,b,c){var d=new p2.Particle;return this.addShape(d,a,b,c)},addLine:function(a,b,c,d){var e=new p2.Line(this.world.pxm(a));return this.addShape(e,b,c,d)},addCapsule:function(a,b,c,d,e){var f=new p2.Capsule(this.world.pxm(a),b);return this.addShape(f,c,d,e)},addPolygon:function(a,b){a=a||{},b=Array.prototype.slice.call(arguments,1);var c=[];if(1===b.length&&Array.isArray(b[0]))c=b[0].slice(0);else if(Array.isArray(b[0]))c=b[0].slice(0);else if("number"==typeof b[0])for(var d=0,e=b.length;e>d;d+=2)c.push([b[d],b[d+1]]);var f=c.length-1;c[f][0]===c[0][0]&&c[f][1]===c[0][1]&&c.pop();for(var g=0;g=0;c--)this.data.shapes[c].material=a;else b.material=a},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(a,b){for(var c=this.game.cache.getPhysicsData(a,b),d=[],e=0;eg;g+=2)e.push([f.shape[g],f.shape[g+1]]);return this.addPolygon(c,e)}for(var i=p2.vec2.create(),g=0;g=0?o>n:n>o;e=o>=0?++n:--n)k=b.vertices[e],p2.vec2.rotate(m,k,a),l.push([(m[0]+i[0])*this.ppu,-(m[1]+i[1])*this.ppu]);this.drawConvex(j,l,b.triangles,f,c,g,this.settings.debugPolygons,[i[0]*this.ppu,-i[1]*this.ppu])}else b instanceof p2.Plane?this.drawPlane(j,i[0]*this.ppu,-i[1]*this.ppu,c,f,5*g,10*g,10*g,100*this.ppu,a):b instanceof p2.Line?this.drawLine(j,b.length*this.ppu,f,g):b instanceof p2.Rectangle&&this.drawRectangle(j,i[0]*this.ppu,-i[1]*this.ppu,a,b.width*this.ppu,b.height*this.ppu,f,c,g);d++}}},drawRectangle:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof i&&(i=1),"undefined"==typeof g&&(g=0),a.lineStyle(i,g,1),a.beginFill(h),a.drawRect(b-e/2,c-f/2,e,f)},drawCircle:function(a,b,c,d,e,f,g){"undefined"==typeof g&&(g=1),"undefined"==typeof f&&(f=16777215),a.lineStyle(g,0,1),a.beginFill(f,1),a.drawCircle(b,c,-e),a.endFill(),a.moveTo(b,c),a.lineTo(b+e*Math.cos(-d),c+e*Math.sin(-d))},drawLine:function(a,b,c,d){"undefined"==typeof d&&(d=1),"undefined"==typeof c&&(c=0),a.lineStyle(5*d,c,1),a.moveTo(-b/2,0),a.lineTo(b/2,0)},drawConvex:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s;if("undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=0),g){for(i=[16711680,65280,255],j=0;j!==b.length+1;)l=b[j%b.length],m=b[(j+1)%b.length],o=l[0],r=l[1],p=m[0],s=m[1],a.lineStyle(f,i[j%i.length],1),a.moveTo(o,-r),a.lineTo(p,-s),a.drawCircle(o,-r,2*f),j++;return a.lineStyle(f,0,1),a.drawCircle(h[0],h[1],2*f)}for(a.lineStyle(f,d,1),a.beginFill(e),j=0;j!==b.length;)k=b[j],n=k[0],q=k[1],0===j?a.moveTo(n,-q):a.lineTo(n,-q),j++;return a.endFill(),b.length>2?(a.moveTo(b[b.length-1][0],-b[b.length-1][1]),a.lineTo(b[0][0],-b[0][1])):void 0},drawPath:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;for("undefined"==typeof e&&(e=1),"undefined"==typeof c&&(c=0),a.lineStyle(e,c,1),"number"==typeof d&&a.beginFill(d),h=null,i=null,g=0;g2&&"number"==typeof d&&(a.moveTo(b[b.length-1][0],b[b.length-1][1]),a.lineTo(b[0][0],b[0][1]))},drawPlane:function(a,b,c,d,e,f,g,h,i,j){var k,l,m;"undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=16777215),a.lineStyle(f,e,11),a.beginFill(d),k=i,a.moveTo(b,-c),l=b+Math.cos(j)*this.game.width,m=c+Math.sin(j)*this.game.height,a.lineTo(l,-m),a.moveTo(b,-c),l=b+Math.cos(j)*-this.game.width,m=c+Math.sin(j)*-this.game.height,a.lineTo(l,-m)},randomPastelHex:function(){var a,b,c,d;return c=[255,255,255],d=Math.floor(256*Math.random()),b=Math.floor(256*Math.random()),a=Math.floor(256*Math.random()),d=Math.floor((d+3*c[0])/4),b=Math.floor((b+3*c[1])/4),a=Math.floor((a+3*c[2])/4),this.rgbToHex(d,b,a)},rgbToHex:function(a,b,c){return this.componentToHex(a)+this.componentToHex(b)+this.componentToHex(c)},componentToHex:function(a){var b;return b=a.toString(16),2===b.len?b:b+"0"}}),Phaser.Physics.P2.Spring=function(a,b,c,d,e,f,g,h,i,j){this.game=a.game,this.world=a,"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=100),"undefined"==typeof f&&(f=1),d=a.pxm(d);var k={restLength:d,stiffness:e,damping:f};"undefined"!=typeof g&&null!==g&&(k.worldAnchorA=[a.pxm(g[0]),a.pxm(g[1])]),"undefined"!=typeof h&&null!==h&&(k.worldAnchorB=[a.pxm(h[0]),a.pxm(h[1])]),"undefined"!=typeof i&&null!==i&&(k.localAnchorA=[a.pxm(i[0]),a.pxm(i[1])]),"undefined"!=typeof j&&null!==j&&(k.localAnchorB=[a.pxm(j[0]),a.pxm(j[1])]),p2.Spring.call(this,b,c,k)},Phaser.Physics.P2.Spring.prototype=Object.create(p2.Spring.prototype),Phaser.Physics.P2.Spring.prototype.constructor=Phaser.Physics.P2.Spring,Phaser.Physics.P2.Material=function(a){this.name=a,p2.Material.call(this)},Phaser.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),Phaser.Physics.P2.Material.prototype.constructor=Phaser.Physics.P2.Material,Phaser.Physics.P2.ContactMaterial=function(a,b,c){p2.ContactMaterial.call(this,a,b,c)},Phaser.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),Phaser.Physics.P2.ContactMaterial.prototype.constructor=Phaser.Physics.P2.ContactMaterial,Phaser.Physics.P2.CollisionGroup=function(a){this.mask=a},Phaser.Physics.P2.DistanceConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=100),this.game=a.game,this.world=a,d=a.pxm(d),p2.DistanceConstraint.call(this,b,c,d,e)},Phaser.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),Phaser.Physics.P2.DistanceConstraint.prototype.constructor=Phaser.Physics.P2.DistanceConstraint,Phaser.Physics.P2.GearConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1),this.game=a.game,this.world=a;var f={angle:d,ratio:e};p2.GearConstraint.call(this,b,c,f)},Phaser.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),Phaser.Physics.P2.GearConstraint.prototype.constructor=Phaser.Physics.P2.GearConstraint,Phaser.Physics.P2.LockConstraint=function(a,b,c,d,e,f){"undefined"==typeof d&&(d=[0,0]),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,d=[a.pxm(d[0]),a.pxm(d[1])];var g={localOffsetB:d,localAngleB:e,maxForce:f};p2.LockConstraint.call(this,b,c,g)},Phaser.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),Phaser.Physics.P2.LockConstraint.prototype.constructor=Phaser.Physics.P2.LockConstraint,Phaser.Physics.P2.PrismaticConstraint=function(a,b,c,d,e,f,g,h){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=[0,0]),"undefined"==typeof f&&(f=[0,0]),"undefined"==typeof g&&(g=[0,0]),"undefined"==typeof h&&(h=Number.MAX_VALUE),this.game=a.game,this.world=a,e=[a.pxmi(e[0]),a.pxmi(e[1])],f=[a.pxmi(f[0]),a.pxmi(f[1])];var i={localAnchorA:e,localAnchorB:f,localAxisA:g,maxForce:h,disableRotationalLock:!d};p2.PrismaticConstraint.call(this,b,c,i)},Phaser.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),Phaser.Physics.P2.PrismaticConstraint.prototype.constructor=Phaser.Physics.P2.PrismaticConstraint,Phaser.Physics.P2.RevoluteConstraint=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,c=[a.pxmi(c[0]),a.pxmi(c[1])],e=[a.pxmi(e[0]),a.pxmi(e[1])],p2.RevoluteConstraint.call(this,b,c,d,e,f)},Phaser.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),Phaser.Physics.P2.RevoluteConstraint.prototype.constructor=Phaser.Physics.P2.RevoluteConstraint; +if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;if(this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0))return this.kill(),!1;if((this.autoCull||this.checkWorldBounds)&&this._bounds.copyFrom(this.getBounds()),this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this._bounds)),this.checkWorldBounds)if(1===this._cache[5]&&this.game.world.bounds.intersects(this._bounds))this._cache[5]=0,this.events.onEnterBounds.dispatch(this);else if(0===this._cache[5]&&!this.game.world.bounds.intersects(this._bounds)&&(this._cache[5]=1,this.events.onOutOfBounds.dispatch(this),this.outOfBoundsKill))return this.kill(),!1;this.world.setTo(this.game.camera.x+this.worldTransform.tx,this.game.camera.y+this.worldTransform.ty),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++),this.animations.update(),this.body&&this.body.preUpdate();for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Sprite.prototype.update=function(){},b.Sprite.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),this.exists&&this.body&&this.body.postUpdate(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Sprite.prototype.loadTexture=function(a,c){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.Sprite.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Sprite.prototype.revive=function(a){return"undefined"==typeof a&&(a=1),this.alive=!0,this.exists=!0,this.visible=!0,this.health=a,this.events&&this.events.onRevived.dispatch(this),this},b.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Sprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.input&&this.input.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.events&&this.events.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<=0&&this.kill()),this},b.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},b.Sprite.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},b.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},b.Sprite.prototype.overlap=function(a){return b.Rectangle.intersects(this.getBounds(),a.getBounds())},Object.defineProperty(b.Sprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Sprite.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Sprite.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(b.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(b.Sprite.prototype,"renderOrderID",{get:function(){return this._cache[3]}}),Object.defineProperty(b.Sprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.Sprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&this.body.removeFromWorld(),this.visible=!1)}}),Object.defineProperty(b.Sprite.prototype,"fixedToCamera",{get:function(){return!!this._cache[7]},set:function(a){a?(this._cache[7]=1,this.cameraOffset.set(this.x,this.y)):this._cache[7]=0}}),Object.defineProperty(b.Sprite.prototype,"smoothed",{get:function(){return!this.texture.baseTexture.scaleMode},set:function(a){a?this.texture&&(this.texture.baseTexture.scaleMode=0):this.texture&&(this.texture.baseTexture.scaleMode=1)}}),Object.defineProperty(b.Sprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.Sprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Image=function(a,c,d,e,f){c=c||0,d=d||0,e=e||null,f=f||null,this.game=a,this.exists=!0,this.name="",this.type=b.IMAGE,this.z=0,this.events=new b.Events(this),this.key=e,this._frame=0,this._frameName="",PIXI.Sprite.call(this,PIXI.TextureCache.__default),this.loadTexture(e,f),this.position.set(c,d),this.world=new b.Point(c,d),this.autoCull=!1,this.input=null,this.cameraOffset=new b.Point,this._cache=[0,0,0,0,1,0,1,0]},b.Image.prototype=Object.create(PIXI.Sprite.prototype),b.Image.prototype.constructor=b.Image,b.Image.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this._cache[3]=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Image.prototype.update=function(){},b.Image.prototype.postUpdate=function(){this.key instanceof b.BitmapData&&this.key.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,c=this.children.length;c>a;a++)this.children[a].postUpdate()},b.Image.prototype.loadTexture=function(a,c){if(c=c||0,a instanceof b.RenderTexture)return this.key=a.key,void this.setTexture(a);if(a instanceof b.BitmapData)return this.key=a,void this.setTexture(a.texture);if(a instanceof PIXI.Texture)return this.key=a,void this.setTexture(a);if(null===a||"undefined"==typeof a)return this.key="__default",void this.setTexture(PIXI.TextureCache[this.key]);if("string"==typeof a&&!this.game.cache.checkImageKey(a))return this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]);if(this.game.cache.isSpriteSheet(a)){this.key=a;var d=this.game.cache.getFrameData(a);return"string"==typeof c?(this._frame=0,this._frameName=c,void this.setTexture(PIXI.TextureCache[d.getFrameByName(c).uuid])):(this._frame=c,this._frameName="",void this.setTexture(PIXI.TextureCache[d.getFrame(c).uuid]))}return this.key=a,void this.setTexture(PIXI.TextureCache[a])},b.Image.prototype.crop=function(a){if("undefined"==typeof a||null===a)this.texture.hasOwnProperty("sourceWidth")&&this.texture.setFrame(new b.Rectangle(0,0,this.texture.sourceWidth,this.texture.sourceHeight));else if(this.texture instanceof PIXI.Texture){var c={};b.Utils.extend(!0,c,this.texture),c.sourceWidth=c.width,c.sourceHeight=c.height,c.frame=a,c.width=a.width,c.height=a.height,this.texture=c,this.texture.updateFrame=!0,PIXI.Texture.frameUpdates.push(this.texture)}else this.texture.setFrame(a)},b.Image.prototype.revive=function(){return this.alive=!0,this.exists=!0,this.visible=!0,this.events&&this.events.onRevived.dispatch(this),this},b.Image.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},b.Image.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.events&&this.events.destroy(),this.input&&this.input.destroy();var c=this.children.length;if(a)for(;c--;)this.children[c].destroy(a);else for(;c--;)this.removeChild(this.children[c]);this.alive=!1,this.exists=!1,this.visible=!1,this.filters=null,this.mask=null,this.game=null}},b.Image.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this},b.Image.prototype.bringToTop=function(){return this.parent&&this.parent.bringToTop(this),this},Object.defineProperty(b.Image.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.Image.prototype,"deltaX",{get:function(){return this.world.x-this._cache[0]}}),Object.defineProperty(b.Image.prototype,"deltaY",{get:function(){return this.world.y-this._cache[1]}}),Object.defineProperty(b.Image.prototype,"deltaZ",{get:function(){return this.rotation-this._cache[2]}}),Object.defineProperty(b.Image.prototype,"inWorld",{get:function(){return this.game.world.bounds.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"inCamera",{get:function(){return this.game.world.camera.screenView.intersects(this.getBounds())}}),Object.defineProperty(b.Image.prototype,"frame",{get:function(){return this._frame},set:function(a){if(a!==this.frame&&this.game.cache.isSpriteSheet(this.key)){var b=this.game.cache.getFrameData(this.key);b&&aa;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){return c=c||0,a instanceof b.RenderTexture?(this.key=a.key,void this.setTexture(a)):a instanceof b.BitmapData?(this.key=a,void this.setTexture(a.texture)):a instanceof PIXI.Texture?(this.key=a,void this.setTexture(a)):null===a||"undefined"==typeof a?(this.key="__default",void this.setTexture(PIXI.TextureCache[this.key])):"string"!=typeof a||this.game.cache.checkImageKey(a)?this.game.cache.isSpriteSheet(a)?(this.key=a,this.animations.loadFrameData(this.game.cache.getFrameData(a)),"string"==typeof c?this.frameName=c:this.frame=c,void 0):(this.key=a,void this.setTexture(PIXI.TextureCache[a])):(this.key="__missing",void this.setTexture(PIXI.TextureCache[this.key]))},b.TileSprite.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),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.filters=null,this.mask=null,this.game=null}},b.TileSprite.prototype.play=function(a,b,c,d){return this.animations.play(a,b,c,d)},b.TileSprite.prototype.reset=function(a,b){return this.world.setTo(a,b),this.position.x=a,this.position.y=b,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.tilePosition.x=0,this.tilePosition.y=0,this.body&&this.body.reset(a,b,!1,!1),this._cache[4]=1,this},Object.defineProperty(b.TileSprite.prototype,"angle",{get:function(){return b.Math.wrapAngle(b.Math.radToDeg(this.rotation))},set:function(a){this.rotation=b.Math.degToRad(b.Math.wrapAngle(a))}}),Object.defineProperty(b.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){a!==this.animations.frame&&(this.animations.frame=a)}}),Object.defineProperty(b.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){a!==this.animations.frameName&&(this.animations.frameName=a)}}),Object.defineProperty(b.TileSprite.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.TileSprite.prototype,"exists",{get:function(){return!!this._cache[6]},set:function(a){a?(this._cache[6]=1,this.body&&this.body.type===b.Physics.P2JS&&this.body.addToWorld(),this.visible=!0):(this._cache[6]=0,this.body&&this.body.type===b.Physics.P2JS&&(this.body.safeRemove=!0),this.visible=!1)}}),Object.defineProperty(b.TileSprite.prototype,"inputEnabled",{get:function(){return this.input&&this.input.enabled},set:function(a){a?null===this.input&&(this.input=new b.InputHandler(this),this.input.start()):this.input&&this.input.enabled&&this.input.stop()}}),Object.defineProperty(b.TileSprite.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),Object.defineProperty(b.TileSprite.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a,this.body&&this.body.type===b.Physics.ARCADE&&2===this.body.phase&&(this.body._reset=1)}}),b.Text=function(a,c,d,e,f){c=c||0,d=d||0,e=e||" ",f=f||{},e=0===e.length?" ":e.toString(),this.game=a,this.exists=!0,this.name="",this.type=b.TEXT,this.z=0,this.world=new b.Point(c,d),this._text=e,this._font="",this._fontSize=32,this._fontWeight="normal",this._lineSpacing=0,this.events=new b.Events(this),this.input=null,this.cameraOffset=new b.Point,this.setStyle(f),PIXI.Text.call(this,e,this.style),this.position.set(c,d),this._cache=[0,0,0,0,1,0,1,0]},b.Text.prototype=Object.create(PIXI.Text.prototype),b.Text.prototype.constructor=b.Text,b.Text.prototype.preUpdate=function(){if(this._cache[0]=this.world.x,this._cache[1]=this.world.y,this._cache[2]=this.rotation,!this.exists||!this.parent.exists)return this.renderOrderID=-1,!1;this.autoCull&&(this.renderable=this.game.world.camera.screenView.intersects(this.getBounds())),this.world.setTo(this.game.camera.x+this.worldTransform[2],this.game.camera.y+this.worldTransform[5]),this.visible&&(this._cache[3]=this.game.stage.currentRenderOrderID++);for(var a=0,b=this.children.length;b>a;a++)this.children[a].preUpdate();return!0},b.Text.prototype.update=function(){},b.Text.prototype.postUpdate=function(){1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y);for(var a=0,b=this.children.length;b>a;a++)this.children[a].postUpdate()},b.Text.prototype.destroy=function(a){if(null!==this.game){"undefined"==typeof a&&(a=!0),this.parent&&(this.parent instanceof b.Group?this.parent.remove(this):this.parent.removeChild(this)),this.texture.destroy(),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null);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.filters=null,this.mask=null,this.game=null}},b.Text.prototype.setShadow=function(a,b,c,d){this.style.shadowOffsetX=a||0,this.style.shadowOffsetY=b||0,this.style.shadowColor=c||"rgba(0,0,0,0)",this.style.shadowBlur=d||0,this.dirty=!0},b.Text.prototype.setStyle=function(a){a=a||{},a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.shadowOffsetX=a.shadowOffsetX||0,a.shadowOffsetY=a.shadowOffsetY||0,a.shadowColor=a.shadowColor||"rgba(0,0,0,0)",a.shadowBlur=a.shadowBlur||0,this.style=a,this.dirty=!0},b.Text.prototype.updateText=function(){this.context.font=this.style.font;var a=this.text;this.style.wordWrap&&(a=this.runWordWrap(this.text));for(var b=a.split(/(?:\r\n|\r|\n)/),c=[],d=0,e=0;ee?(g>0&&(b+="\n"),b+=f[g]+" ",e=this.style.wordWrapWidth-h):(e-=i,b+=f[g]+" ")}d?@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.RetroFont.TEXT_SET11="ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789",b.RetroFont.prototype.setFixedWidth=function(a,b){"undefined"==typeof b&&(b="left"),this.fixedWidth=a,this.align=b},b.RetroFont.prototype.setText=function(a,b,c,d,e,f){this.multiLine=b||!1,this.customSpacingX=c||0,this.customSpacingY=d||0,this.align=e||"left",this.autoUpperCase=f?!1:!0,a.length>0&&(this.text=a)},b.RetroFont.prototype.resize=function(a,b){if(this.width=a,this.height=b,this.frame.width=this.width,this.frame.height=this.height,this.baseTexture.width=this.width,this.baseTexture.height=this.height,this.renderer.type===PIXI.WEBGL_RENDERER){this.projection.x=this.width/2,this.projection.y=-this.height/2;var c=this.renderer.gl;c.bindTexture(c.TEXTURE_2D,this.baseTexture._glTextures[c.id]),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,this.width,this.height,0,c.RGBA,c.UNSIGNED_BYTE,null)}else this.textureBuffer.resize(this.width,this.height);PIXI.Texture.frameUpdates.push(this)},b.RetroFont.prototype.buildRetroFontText=function(){var a=0,c=0;if(this.multiLine){var d=this._text.split("\n");this.fixedWidth>0?this.resize(this.fixedWidth,d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY):this.resize(this.getLongestLine()*(this.characterWidth+this.customSpacingX),d.length*(this.characterHeight+this.customSpacingY)-this.customSpacingY),this.textureBuffer.clear();for(var e=0;ea&&(a=0),this.pasteLine(d[e],a,c,this.customSpacingX),c+=this.characterHeight+this.customSpacingY}}else{switch(this.fixedWidth>0?this.resize(this.fixedWidth,this.characterHeight):this.resize(this._text.length*(this.characterWidth+this.customSpacingX),this.characterHeight),this.textureBuffer.clear(),this.align){case b.RetroFont.ALIGN_LEFT:a=0;break;case b.RetroFont.ALIGN_RIGHT:a=this.width-this._text.length*(this.characterWidth+this.customSpacingX);break;case b.RetroFont.ALIGN_CENTER:a=this.width/2-this._text.length*(this.characterWidth+this.customSpacingX)/2,a+=this.customSpacingX/2}this.pasteLine(this._text,a,0,this.customSpacingX)}},b.RetroFont.prototype.pasteLine=function(a,c,d,e){for(var f=new b.Point,g=0;g=0&&(this.stamp.frame=this.grabData[a.charCodeAt(g)],f.set(c,d),this.render(this.stamp,f,!1),c+=this.characterWidth+e,c>this.width))break},b.RetroFont.prototype.getLongestLine=function(){var a=0;if(this._text.length>0)for(var b=this._text.split("\n"),c=0;ca&&(a=b[c].length);return a},b.RetroFont.prototype.removeUnsupportedCharacters=function(a){for(var b="",c=0;c=0||!a&&"\n"===d)&&(b=b.concat(d))}return b},Object.defineProperty(b.RetroFont.prototype,"text",{get:function(){return this._text},set:function(a){var b;b=this.autoUpperCase?a.toUpperCase():a,b!==this._text&&(this._text=b,this.removeUnsupportedCharacters(this.multiLine),this.buildRetroFontText())}}),b.Canvas={create:function(a,b,c,d){if("undefined"==typeof d&&(d=!1),a=a||256,b=b||256,d)var e=document.createElement("canvas");else var e=document.createElement(navigator.isCocoonJS?"screencanvas":"canvas");return"string"==typeof c&&""!==c&&(e.id=c),e.width=a,e.height=b,e.style.display="block",e},getOffset:function(a,c){c=c||new b.Point;var d=a.getBoundingClientRect(),e=a.clientTop||document.body.clientTop||0,f=a.clientLeft||document.body.clientLeft||0,g=0,h=0;return"CSS1Compat"===document.compatMode?(g=window.pageYOffset||document.documentElement.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.documentElement.scrollLeft||a.scrollLeft||0):(g=window.pageYOffset||document.body.scrollTop||a.scrollTop||0,h=window.pageXOffset||document.body.scrollLeft||a.scrollLeft||0),c.x=d.left+h-f,c.y=d.top+g-e,c},getAspectRatio:function(a){return a.width/a.height},setBackgroundColor:function(a,b){return b=b||"rgb(0,0,0)",a.style.backgroundColor=b,a},setTouchAction:function(a,b){return b=b||"none",a.style.msTouchAction=b,a.style["ms-touch-action"]=b,a.style["touch-action"]=b,a},setUserSelect:function(a,b){return b=b||"none",a.style["-webkit-touch-callout"]=b,a.style["-webkit-user-select"]=b,a.style["-khtml-user-select"]=b,a.style["-moz-user-select"]=b,a.style["-ms-user-select"]=b,a.style["user-select"]=b,a.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",a},addToDOM:function(a,b,c){var d;return"undefined"==typeof c&&(c=!0),b&&("string"==typeof b?d=document.getElementById(b):"object"==typeof b&&1===b.nodeType&&(d=b)),d||(d=document.body),c&&d.style&&(d.style.overflow="hidden"),d.appendChild(a),a},setTransform:function(a,b,c,d,e,f,g){return a.setTransform(d,f,g,e,b,c),a},setSmoothingEnabled:function(a,b){return a.imageSmoothingEnabled=b,a.mozImageSmoothingEnabled=b,a.oImageSmoothingEnabled=b,a.webkitImageSmoothingEnabled=b,a.msImageSmoothingEnabled=b,a},setImageRenderingCrisp:function(a){return a.style["image-rendering"]="optimizeSpeed",a.style["image-rendering"]="crisp-edges",a.style["image-rendering"]="-moz-crisp-edges",a.style["image-rendering"]="-webkit-optimize-contrast",a.style["image-rendering"]="optimize-contrast",a.style.msInterpolationMode="nearest-neighbor",a},setImageRenderingBicubic:function(a){return a.style["image-rendering"]="auto",a.style.msInterpolationMode="bicubic",a}},b.Device=function(a){this.game=a,this.desktop=!1,this.iOS=!1,this.cocoonJS=!1,this.ejecta=!1,this.android=!1,this.chromeOS=!1,this.linux=!1,this.macOS=!1,this.windows=!1,this.windowsPhone=!1,this.canvas=!1,this.file=!1,this.fileSystem=!1,this.localStorage=!1,this.webGL=!1,this.worker=!1,this.touch=!1,this.mspointer=!1,this.css3D=!1,this.pointerLock=!1,this.typedArray=!1,this.vibration=!1,this.getUserMedia=!1,this.quirksMode=!1,this.arora=!1,this.chrome=!1,this.epiphany=!1,this.firefox=!1,this.ie=!1,this.ieVersion=0,this.trident=!1,this.tridentVersion=0,this.mobileSafari=!1,this.midori=!1,this.opera=!1,this.safari=!1,this.webApp=!1,this.silk=!1,this.audioData=!1,this.webAudio=!1,this.ogg=!1,this.opus=!1,this.mp3=!1,this.wav=!1,this.m4a=!1,this.webm=!1,this.iPhone=!1,this.iPhone4=!1,this.iPad=!1,this.pixelRatio=0,this.littleEndian=!1,this.fullscreen=!1,this.requestFullscreen="",this.cancelFullscreen="",this.fullscreenKeyboard=!1,this._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},b.Device.prototype={_checkOS:function(){var a=navigator.userAgent;/Android/.test(a)?this.android=!0:/CrOS/.test(a)?this.chromeOS=!0:/iP[ao]d|iPhone/i.test(a)?this.iOS=!0:/Linux/.test(a)?this.linux=!0:/Mac OS/.test(a)?this.macOS=!0:/Windows/.test(a)&&(this.windows=!0,/Windows Phone/i.test(a)&&(this.windowsPhone=!0)),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0),(this.windowsPhone||/Windows NT/i.test(a)&&/Touch/i.test(a))&&(this.desktop=!1)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D||this.cocoonJS;try{this.localStorage=!!localStorage.getItem}catch(a){this.localStorage=!1}this.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),this.fileSystem=!!window.requestFileSystem,this.webGL=function(){try{var a=document.createElement("canvas");return!!window.WebGLRenderingContext&&(a.getContext("webgl")||a.getContext("experimental-webgl"))}catch(b){return!1}}(),this.webGL=null===this.webGL||this.webGL===!1?!1:!0,this.worker=!!window.Worker,("ontouchstart"in document.documentElement||window.navigator.maxTouchPoints&&window.navigator.maxTouchPoints>1)&&(this.touch=!0),(window.navigator.msPointerEnabled||window.navigator.pointerEnabled)&&(this.mspointer=!0),this.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,this.quirksMode="CSS1Compat"===document.compatMode?!1:!0,this.getUserMedia=!!(navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia)},checkFullScreenSupport:function(){for(var a=["requestFullscreen","requestFullScreen","webkitRequestFullscreen","webkitRequestFullScreen","msRequestFullscreen","msRequestFullScreen","mozRequestFullScreen","mozRequestFullscreen"],b=0;b0,this.typedArray=!0):(this.littleEndian=!1,this.typedArray=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(this.vibration=!0)},_checkCSS3D:function(){var a,b=document.createElement("p"),c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(b,null);for(var d in c)void 0!==b.style[d]&&(b.style[d]="translate3d(1px,1px,1px)",a=window.getComputedStyle(b).getPropertyValue(c[d]));document.body.removeChild(b),this.css3D=void 0!==a&&a.length>0&&"none"!==a},canPlayAudio:function(a){return"mp3"==a&&this.mp3?!0:"ogg"==a&&(this.ogg||this.opus)?!0:"m4a"==a&&this.m4a?!0:"wav"==a&&this.wav?!0:"webm"==a&&this.webm?!0:!1},isConsoleOpen:function(){return window.console&&window.console.firebug?!0:window.console&&(console.profile(),console.profileEnd(),console.clear&&console.clear(),console.profiles)?console.profiles.length>0:!1}},b.Device.prototype.constructor=b.Device,b.RequestAnimationFrame=function(a,b){"undefined"==typeof b&&(b=!1),this.game=a,this.isRunning=!1,this.forceSetTimeOut=b;for(var c=["ms","moz","webkit","o"],d=0;da},fuzzyGreaterThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),a>b-c},fuzzyCeil:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.ceil(a-b)},fuzzyFloor:function(a,b){return"undefined"==typeof b&&(b=1e-4),Math.floor(a+b)},average:function(){for(var a=[],b=0;b0?Math.floor(a):Math.ceil(a)},shear:function(a){return a%1},snapTo:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.round(a/b),c+a)},snapToFloor:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.floor(a/b),c+a)},snapToCeil:function(a,b,c){return"undefined"==typeof c&&(c=0),0===b?a:(a-=c,a=b*Math.ceil(a/b),c+a)},snapToInArray:function(a,b,c){if("undefined"==typeof c&&(c=!0),c&&b.sort(),a=f-a?f:e},roundTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.round(a*d)/d},floorTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.floor(a*d)/d},ceilTo:function(a,b,c){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=10);var d=Math.pow(c,-b);return Math.ceil(a*d)/d},interpolateFloat:function(a,b,c){return(b-a)*c+a},angleBetween:function(a,b,c,d){return Math.atan2(c-a,d-b)},angleBetweenPoints:function(a,b){return Math.atan2(b.x-a.x,b.y-a.y)},reverseAngle:function(a){return this.normalizeAngle(a+Math.PI,!0)},normalizeAngle:function(a){return a%=2*Math.PI,a>=0?a:a+2*Math.PI},normalizeLatitude:function(a){return Math.max(-90,Math.min(90,a))},normalizeLongitude:function(a){return a%360==180?180:(a%=360,-180>a?a+360:a>180?a-360:a)},nearestAngleBetween:function(a,b,c){"undefined"==typeof c&&(c=!0);var d=c?Math.PI:180;return a=this.normalizeAngle(a,c),b=this.normalizeAngle(b,c),-d/2>a&&b>d/2&&(a+=2*d),-d/2>b&&a>d/2&&(b+=2*d),b-a},interpolateAngles:function(a,b,c,d,e){return"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=null),a=this.normalizeAngle(a,d),b=this.normalizeAngleToAnother(b,a,d),"function"==typeof e?e(c,a,b-a,1):this.interpolateFloat(a,b,c)},chanceRoll:function(a){return"undefined"==typeof a&&(a=50),0>=a?!1:a>=100?!0:100*Math.random()>=a?!1:!0},numberArray:function(a,b){for(var c=[],d=a;b>=d;d++)c.push(d);return c},maxAdd:function(a,b,c){return a+=b,a>c&&(a=c),a},minSub:function(a,b,c){return a-=b,c>a&&(a=c),a},wrap:function(a,b,c){var d=c-b;if(0>=d)return 0;var e=(a-b)%d;return 0>e&&(e+=d),e+b},wrapValue:function(a,b,c){var d;return a=Math.abs(a),b=Math.abs(b),c=Math.abs(c),d=(a+b)%c},randomSign:function(){return Math.random()>.5?1:-1},isOdd:function(a){return 1&a},isEven:function(a){return 1&a?!1:!0},min:function(){if(1===arguments.length&&"object"==typeof arguments[0])var a=arguments[0];else var a=arguments;for(var b=1,c=0,d=a.length;d>b;b++)a[b]b;b++)a[b]>a[c]&&(c=b);return a[c]},minProperty:function(a){if(2===arguments.length&&"object"==typeof arguments[1])var b=arguments[1];else var b=arguments.slice(1);for(var c=1,d=0,e=b.length;e>c;c++)b[c][a]c;c++)b[c][a]>b[d][a]&&(d=c);return b[d][a]},wrapAngle:function(a,b){var c=b?Math.PI/180:1;return this.wrap(a,-180*c,180*c)},angleLimit:function(a,b,c){var d=a;return a>c?d=c:b>a&&(d=b),d},linearInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return 0>b?this.linear(a[0],a[1],d):b>1?this.linear(a[c],a[c-1],c-d):this.linear(a[e],a[e+1>c?c:e+1],d-e)},bezierInterpolation:function(a,b){for(var c=0,d=a.length-1,e=0;d>=e;e++)c+=Math.pow(1-b,d-e)*Math.pow(b,e)*a[e]*this.bernstein(d,e);return c},catmullRomInterpolation:function(a,b){var c=a.length-1,d=c*b,e=Math.floor(d);return a[0]===a[c]?(0>b&&(e=Math.floor(d=c*(1+b))),this.catmullRom(a[(e-1+c)%c],a[e],a[(e+1)%c],a[(e+2)%c],d-e)):0>b?a[0]-(this.catmullRom(a[0],a[0],a[1],a[1],-d)-a[0]):b>1?a[c]-(this.catmullRom(a[c],a[c],a[c-1],a[c-1],d-c)-a[c]):this.catmullRom(a[e?e-1:0],a[e],a[e+1>c?c:e+1],a[e+2>c?c:e+2],d-e)},linear:function(a,b,c){return(b-a)*c+a},bernstein:function(a,b){return this.factorial(a)/this.factorial(b)/this.factorial(a-b)},catmullRom:function(a,b,c,d,e){var f=.5*(c-a),g=.5*(d-b),h=e*e,i=e*h;return(2*b-2*c+f+g)*i+(-3*b+3*c-2*f-g)*h+f*e+b},difference:function(a,b){return Math.abs(a-b)},getRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0)return a[b+Math.floor(Math.random()*d)]}return null},removeRandom:function(a,b,c){if("undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),null!=a){var d=c;if((0===d||d>a.length-b)&&(d=a.length-b),d>0){var e=b+Math.floor(Math.random()*d),f=a.splice(e,1);return f[0]}}return null},floor:function(a){var b=0|a;return a>0?b:b!=a?b-1:b},ceil:function(a){var b=0|a;return a>0?b!=a?b+1:b: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},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.3283064365386963e-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>>0,b-=d,b*=d,d=b>>>0,b-=d,d+=4294967296*b;return 2.3283064365386963e-10*(d>>>0)},integer:function(){return 4294967296*this.rnd.apply(this)},frac:function(){return this.rnd.apply(this)+1.1102230246251565e-16*(2097152*this.rnd.apply(this)|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.round(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|3*a&4?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length-1)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*(a.length-1))]},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.QuadTree=function(a,b,c,d,e,f,g){this.maxObjects=10,this.maxLevels=4,this.level=0,this.bounds={},this.objects=[],this.nodes=[],this.reset(a,b,c,d,e,f,g)},b.QuadTree.prototype={reset:function(a,b,c,d,e,f,g){this.maxObjects=e||10,this.maxLevels=f||4,this.level=g||0,this.bounds={x:Math.round(a),y:Math.round(b),width:c,height:d,subWidth:Math.floor(c/2),subHeight:Math.floor(d/2),right:Math.round(a)+Math.floor(c/2),bottom:Math.round(b)+Math.floor(d/2)},this.objects.length=0,this.nodes.length=0},populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.exists&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new b.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new b.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new b.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new b.QuadTree(this.bounds.right,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level)},insert:function(a){var b,c=0;if(null!=this.nodes[0]&&(b=this.getIndex(a),-1!==b))return void this.nodes[b].insert(a);if(this.objects.push(a),this.objects.length>this.maxObjects&&this.levelthis.bounds.bottom&&(b=2):a.x>this.bounds.right&&(a.ythis.bounds.bottom&&(b=3)),b},retrieve:function(a){var b=this.objects,c=this.getIndex(a.body);return this.nodes[0]&&(-1!==c?b=b.concat(this.nodes[c].retrieve(a)):(b=b.concat(this.nodes[0].retrieve(a)),b=b.concat(this.nodes[1].retrieve(a)),b=b.concat(this.nodes[2].retrieve(a)),b=b.concat(this.nodes[3].retrieve(a)))),b},clear:function(){this.objects.length=0;for(var a=this.nodes.length;a--;)this.nodes[a].clear(),this.nodes.splice(a,1);this.nodes.length=0}},b.QuadTree.prototype.constructor=b.QuadTree,b.Net=function(a){this.game=a},b.Net.prototype={getHostName:function(){return window.location&&window.location.hostname?window.location.hostname:null},checkDomainName:function(a){return-1!==window.location.hostname.indexOf(a)},updateQueryString:function(a,b,c,d){"undefined"==typeof c&&(c=!1),("undefined"==typeof d||""===d)&&(d=window.location.href);var e="",f=new RegExp("([?|&])"+a+"=.*?(&|#|$)(.*)","gi");if(f.test(d))e="undefined"!=typeof b&&null!==b?d.replace(f,"$1"+a+"="+b+"$2$3"):d.replace(f,"$1$3").replace(/(&|\?)$/,"");else if("undefined"!=typeof b&&null!==b){var g=-1!==d.indexOf("?")?"&":"?",h=d.split("#");d=h[0]+g+a+"="+b,h[1]&&(d+="#"+h[1]),e=d}else e=d;return c?void(window.location.href=e):e},getQueryString:function(a){"undefined"==typeof a&&(a="");var b={},c=location.search.substring(1).split("&");for(var d in c){var e=c[d].split("=");if(e.length>1){if(a&&a==this.decodeURI(e[0]))return this.decodeURI(e[1]);b[this.decodeURI(e[0])]=this.decodeURI(e[1])}}return b},decodeURI:function(a){return decodeURIComponent(a.replace(/\+/g," "))}},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;aa;)this._tweens[a].update(this.game.time.now)?a++:(this._tweens.splice(a,1),b--);return this._add.length>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.Linear.None,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;var h;return this._parent?(h=this._manager.create(this._object),this._lastChild.chain(h),this._lastChild=h):(h=this,this._parent=this,this._lastChild=this),h._repeat=f,h._duration=b,h._valuesEnd=a,null!==c&&(h._easingFunction=c),e>0&&(h._delayTime=e),h._yoyo=g,d?this.start():this},start:function(){if(null!==this.game&&null!==this._object){this._manager.add(this),this.isRunning=!0,this._onStartCallbackFired=!1,this._startTime=this.game.time.now+this._delayTime;for(var a in this._valuesEnd){if(Array.isArray(this._valuesEnd[a])){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],Array.isArray(this._valuesStart[a])||(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},generateData:function(a,b){if(null===this.game||null===this._object)return null;this._startTime=0;for(var c in this._valuesEnd){if(Array.isArray(this._valuesEnd[c])){if(0===this._valuesEnd[c].length)continue;this._valuesEnd[c]=[this._object[c]].concat(this._valuesEnd[c])}this._valuesStart[c]=this._object[c],Array.isArray(this._valuesStart[c])||(this._valuesStart[c]*=1),this._valuesStartRepeat[c]=this._valuesStart[c]||0}for(var d=0,e=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}if(this._yoyo){var m=g.slice();m.reverse(),g=g.concat(m)}return"undefined"!=typeof b?b=b.concat(g):g},stop:function(){return this.isRunning=!1,this._onUpdateCallback=null,this._manager.remove(this),this},delay:function(a){return this._delayTime=a,this},repeat:function(a){return this._repeat=a,this},yoyo:function(a){return this._yoyo=a,this},easing:function(a){return this._easingFunction=a,this},interpolation:function(a){return this._interpolationFunction=a,this},chain:function(){return this._chainedTweens=arguments,this},loop:function(){return this._lastChild.chain(this),this},onUpdateCallback:function(a,b){return this._onUpdateCallback=a,this._onUpdateCallbackContext=b,this},pause:function(){this._codePaused=!0,this._paused=!0,this._pausedTime=this.game.time.now},_pause:function(){this._codePaused||(this._paused=!0,this._pausedTime=this.game.time.now)},resume:function(){this._paused&&(this._paused=!1,this._codePaused=!1,this._startTime+=this.game.time.now-this._pausedTime)},_resume:function(){this._codePaused||(this._startTime+=this.game.time.pauseDuration,this._paused=!1)},update:function(a){if(this.pendingDelete)return!1;if(this._paused||a1?1:c;var d=this._easingFunction(c);for(b in this._valuesEnd){var e=this._valuesStart[b]||0,f=this._valuesEnd[b];f instanceof Array?this._object[b]=this._interpolationFunction(f,d):("string"==typeof f&&(f=e+parseFloat(f,10)),"number"==typeof f&&(this._object[b]=e+(f-e)*d))}if(null!==this._onUpdateCallback&&this._onUpdateCallback.call(this._onUpdateCallbackContext,this,d),1==c){if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(b in this._valuesStartRepeat){if("string"==typeof this._valuesEnd[b]&&(this._valuesStartRepeat[b]=this._valuesStartRepeat[b]+parseFloat(this._valuesEnd[b],10)),this._yoyo){var g=this._valuesStartRepeat[b];this._valuesStartRepeat[b]=this._valuesEnd[b],this._valuesEnd[b]=g,this._reversed=!this._reversed}this._valuesStart[b]=this._valuesStartRepeat[b]}return this._startTime=a+this._delayTime,this.onLoop.dispatch(this._object),!0}this.isRunning=!1,this.onComplete.dispatch(this._object);for(var h=0,i=this._chainedTweens.length;i>h;h++)this._chainedTweens[h].start(a);return!1}return!0}},b.Tween.prototype.constructor=b.Tween,b.Easing={Linear:{None:function(a){return a}},Quadratic:{In:function(a){return a*a},Out:function(a){return a*(2-a)},InOut:function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)}},Cubic:{In:function(a){return a*a*a},Out:function(a){return--a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)}},Quartic:{In:function(a){return a*a*a*a},Out:function(a){return 1- --a*a*a*a},InOut:function(a){return(a*=2)<1?.5*a*a*a*a:-.5*((a-=2)*a*a*a-2)}},Quintic:{In:function(a){return a*a*a*a*a},Out:function(a){return--a*a*a*a*a+1},InOut:function(a){return(a*=2)<1?.5*a*a*a*a*a:.5*((a-=2)*a*a*a*a+2)}},Sinusoidal:{In:function(a){return 1-Math.cos(a*Math.PI/2)},Out:function(a){return Math.sin(a*Math.PI/2)},InOut:function(a){return.5*(1-Math.cos(Math.PI*a))}},Exponential:{In:function(a){return 0===a?0:Math.pow(1024,a-1)},Out:function(a){return 1===a?1:1-Math.pow(2,-10*a)},InOut:function(a){return 0===a?0:1===a?1:(a*=2)<1?.5*Math.pow(1024,a-1):.5*(-Math.pow(2,-10*(a-1))+2)}},Circular:{In:function(a){return 1-Math.sqrt(1-a*a)},Out:function(a){return Math.sqrt(1- --a*a)},InOut:function(a){return(a*=2)<1?-.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)}},Elastic:{In:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),-(c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)))},Out:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),c*Math.pow(2,-10*a)*Math.sin(2*(a-b)*Math.PI/d)+1)},InOut:function(a){var b,c=.1,d=.4;return 0===a?0:1===a?1:(!c||1>c?(c=1,b=d/4):b=d*Math.asin(1/c)/(2*Math.PI),(a*=2)<1?-.5*c*Math.pow(2,10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d):c*Math.pow(2,-10*(a-=1))*Math.sin(2*(a-b)*Math.PI/d)*.5+1)}},Back:{In:function(a){var b=1.70158;return a*a*((b+1)*a-b)},Out:function(a){var b=1.70158;return--a*a*((b+1)*a+b)+1},InOut:function(a){var b=2.5949095;return(a*=2)<1?.5*a*a*((b+1)*a-b):.5*((a-=2)*a*((b+1)*a+b)+2)}},Bounce:{In:function(a){return 1-b.Easing.Bounce.Out(1-a)},Out:function(a){return 1/2.75>a?7.5625*a*a:2/2.75>a?7.5625*(a-=1.5/2.75)*a+.75:2.5/2.75>a?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},InOut:function(a){return.5>a?.5*b.Easing.Bounce.In(2*a):.5*b.Easing.Bounce.Out(2*a-1)+.5}}},b.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.advancedTiming=!1,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.deltaCap=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new b.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0},b.Time.prototype={boot:function(){this._started=Date.now(),this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var c=new b.Timer(this.game,a);return this._timers.push(c),c},removeAll:function(){for(var a=0;a0&&this.physicsElapsed>this.deltaCap&&(this.physicsElapsed=this.deltaCap),this.advancedTiming&&(this.msMin=this.game.math.min(this.msMin,this.elapsed),this.msMax=this.game.math.max(this.msMax,this.elapsed),this.frames++,this.now>this._timeLastSecond+1e3&&(this.fps=Math.round(1e3*this.frames/(this.now-this._timeLastSecond)),this.fpsMin=this.game.math.min(this.fpsMin,this.fps),this.fpsMax=this.game.math.max(this.fpsMax,this.fps),this._timeLastSecond=this.now,this.frames=0)),this.time=this.now,this.lastTime=a+this.timeToCall,!this.game.paused)for(this.events.update(this.now),this._i=0,this._len=this._timers.length;this._i0&&(this.events.sort(this.sortHandler),this.nextTick=this.events[0].tick)},sortHandler:function(a,b){return a.tickb.tick?1:0},update:function(a){if(this.paused)return!0;for(this._now=a,this._len=this.events.length,this._i=0;this._i=this.nextTick&&this._len>0){for(this._i=0;this._i=this.events[this._i].tick;){var b=this._now-this.events[this._i].tick,c=this._now+this.events[this._i].delay-b;0>c&&(c=this._now+this.events[this._i].delay),this.events[this._i].loop===!0?(this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):this.events[this._i].repeatCount>0?(this.events[this._i].repeatCount--,this.events[this._i].tick=c,this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args)):(this.events[this._i].callback.apply(this.events[this._i].callbackContext,this.events[this._i].args),this.events.splice(this._i,1),this._len--),this._i++}this.events.length>0?this.order():(this.expired=!0,this.onComplete.dispatch(this))}return this.expired&&this.autoDestroy?!1:!0},pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0,this._codePaused=!0)},_pause:function(){this.running&&!this.expired&&(this._pauseStarted=this.game.time.now,this.paused=!0)},resume:function(){if(this.running&&!this.expired){var a=this.game.time.now-this._pauseStarted;this._pauseTotal+=a;for(var b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(b.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(b.Timer.prototype,"ms",{get:function(){return this._now-this._started-this._pauseTotal}}),Object.defineProperty(b.Timer.prototype,"seconds",{get:function(){return.001*this.ms}}),b.Timer.prototype.constructor=b.Timer,b.TimerEvent=function(a,b,c,d,e,f,g,h){this.timer=a,this.delay=b,this.tick=c,this.repeatCount=d-1,this.loop=e,this.callback=f,this.callbackContext=g,this.args=h,this.pendingDelete=!1},b.TimerEvent.prototype.constructor=b.TimerEvent,b.AnimationManager=function(a){this.sprite=a,this.game=a.game,this.currentFrame=null,this.updateIfVisible=!0,this.isLoaded=!1,this._frameData=null,this._anims={},this._outputFrames=[]},b.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,c,d,e,f){return null==this._frameData?void console.warn("No FrameData available for Phaser.Animation "+a):(c=c||[],d=d||60,"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=c&&"number"==typeof c[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new b.Signal,this.sprite.events.onAnimationComplete=new b.Signal,this.sprite.events.onAnimationLoop=new b.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(c,f,this._outputFrames),this._anims[a]=new b.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,d,e),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1),this._anims[a])},validateFrames:function(a,b){"undefined"==typeof b&&(b=!0);for(var c=0;cthis._frameData.total)return!1}else if(this._frameData.checkFrameName(a[c])===!1)return!1;return!0},play:function(a,b,c,d){if(this._anims[a]){if(this.currentAnim!=this._anims[a])return this.currentAnim=this._anims[a],this.currentAnim.paused=!1,this.currentAnim.play(b,c,d);if(this.currentAnim.isPlaying===!1)return this.currentAnim.paused=!1,this.currentAnim.play(b,c,d)}},stop:function(a,b){"undefined"==typeof b&&(b=!1),"string"==typeof a?this._anims[a]&&(this.currentAnim=this._anims[a],this.currentAnim.stop(b)):this.currentAnim&&this.currentAnim.stop(b)},update:function(){return this.updateIfVisible&&!this.sprite.visible?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},b.AnimationManager.prototype.constructor=b.AnimationManager,Object.defineProperty(b.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(b.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(b.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(b.AnimationManager.prototype,"frame",{get:function(){return this.currentFrame?this._frameIndex:void 0},set:function(a){"number"==typeof a&&this._frameData&&null!==this._frameData.getFrame(a)&&(this.currentFrame=this._frameData.getFrame(a),this.currentFrame&&(this._frameIndex=a,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1)))}}),Object.defineProperty(b.AnimationManager.prototype,"frameName",{get:function(){return this.currentFrame?this.currentFrame.name:void 0},set:function(a){"string"==typeof a&&this._frameData&&null!==this._frameData.getFrameByName(a)?(this.currentFrame=this._frameData.getFrameByName(a),this.currentFrame&&(this._frameIndex=this.currentFrame.index,this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this.sprite.__tilePattern&&(this.__tilePattern=!1,this.tilingTexture=!1))):console.warn("Cannot set frameName: "+a)}}),b.Animation=function(a,c,d,e,f,g,h){this.game=a,this._parent=c,this._frameData=e,this.name=d,this._frames=[],this._frames=this._frames.concat(f),this.delay=1e3/g,this.loop=h,this.loopCount=0,this.killOnComplete=!1,this.isFinished=!1,this.isPlaying=!1,this.isPaused=!1,this._pauseStartTime=0,this._frameIndex=0,this._frameDiff=0,this._frameSkip=1,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart=new b.Signal,this.onComplete=new b.Signal,this.onLoop=new b.Signal,this.game.onPause.add(this.onPause,this),this.game.onResume.add(this.onResume,this)},b.Animation.prototype={play:function(a,b,c){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof b&&(this.loop=b),"undefined"!=typeof c&&(this.killOnComplete=c),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1),this._parent.events.onAnimationStart.dispatch(this._parent,this),this.onStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,this.loopCount=0,this._timeLastFrame=this.game.time.now,this._timeNextFrame=this.game.time.now+this.delay,this._frameIndex=0,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.onStart.dispatch(this._parent,this)},stop:function(a,b){"undefined"==typeof a&&(a=!1),"undefined"==typeof b&&(b=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0])),b&&(this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this))},onPause:function(){this.isPlaying&&(this._frameDiff=this._timeNextFrame-this.game.time.now)},onResume:function(){this.isPlaying&&(this._timeNextFrame=this.game.time.now+this._frameDiff)},update:function(){return this.isPaused?!1:this.isPlaying===!0&&this.game.time.now>=this._timeNextFrame?(this._frameSkip=1,this._frameDiff=this.game.time.now-this._timeNextFrame,this._timeLastFrame=this.game.time.now,this._frameDiff>this.delay&&(this._frameSkip=Math.floor(this._frameDiff/this.delay),this._frameDiff-=this._frameSkip*this.delay),this._timeNextFrame=this.game.time.now+(this.delay-this._frameDiff),this._frameIndex+=this._frameSkip,this._frameIndex>=this._frames.length?this.loop?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1)),this.loopCount++,this._parent.events.onAnimationLoop.dispatch(this._parent,this),this.onLoop.dispatch(this._parent,this)):this.complete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&(this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]),this._parent.__tilePattern&&(this._parent.__tilePattern=!1,this._parent.tilingTexture=!1))),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1,this.onStart.destroy(),this.onLoop.destroy(),this.onComplete.destroy(),this.game.onPause.remove(this.onPause,this),this.game.onResume.remove(this.onResume,this)},complete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.onComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},b.Animation.prototype.constructor=b.Animation,Object.defineProperty(b.Animation.prototype,"paused",{get:function(){return this.isPaused},set:function(a){this.isPaused=a,a?this._pauseStartTime=this.game.time.now:this.isPlaying&&(this._timeNextFrame=this.game.time.now+this.delay)}}),Object.defineProperty(b.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(b.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(this._frames[a]),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(b.Animation.prototype,"speed",{get:function(){return Math.round(1e3/this.delay)},set:function(a){a>=1&&(this.delay=1e3/a)}}),b.Animation.generateFrameNames=function(a,c,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>c)for(var i=c;d>=i;i++)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=c;i>=d;i--)h="number"==typeof f?b.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},b.Frame=function(a,c,d,e,f,g,h){this.index=a,this.x=c,this.y=d,this.width=e,this.height=f,this.name=g,this.uuid=h,this.centerX=Math.floor(e/2),this.centerY=Math.floor(f/2),this.distance=b.Math.distance(0,0,e,f),this.rotated=!1,this.rotationDirection="cw",this.trimmed=!1,this.sourceSizeW=e,this.sourceSizeH=f,this.spriteSourceSizeX=0,this.spriteSourceSizeY=0,this.spriteSourceSizeW=0,this.spriteSourceSizeH=0},b.Frame.prototype={setTrim:function(a,b,c,d,e,f,g){this.trimmed=a,a&&(this.width=b,this.height=c,this.sourceSizeW=b,this.sourceSizeH=c,this.centerX=Math.floor(b/2),this.centerY=Math.floor(c/2),this.spriteSourceSizeX=d,this.spriteSourceSizeY=e,this.spriteSourceSizeW=f,this.spriteSourceSizeH=g)},getRect:function(a){return"undefined"==typeof a?a=new b.Rectangle(this.x,this.y,this.width,this.height):a.setTo(this.x,this.y,this.width,this.height),a}},b.Frame.prototype.constructor=b.Frame,b.FrameData=function(){this._frames=[],this._frameNames=[]},b.FrameData.prototype={addFrame:function(a){return a.index=this._frames.length,this._frames.push(a),""!==a.name&&(this._frameNames[a.name]=a.index),a},getFrame:function(a){return a>this._frames.length&&(a=0),this._frames[a]},getFrameByName:function(a){return"number"==typeof this._frameNames[a]?this._frames[this._frameNames[a]]:null},checkFrameName:function(a){return null==this._frameNames[a]?!1:!0},getFrameRange:function(a,b,c){"undefined"==typeof c&&(c=[]);for(var d=a;b>=d;d++)c.push(this._frames[d]);return c},getFrames:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0;dd;d++)c.push(b?this.getFrame(a[d]):this.getFrameByName(a[d]));return c},getFrameIndexes:function(a,b,c){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=[]),"undefined"==typeof a||0===a.length)for(var d=0,e=this._frames.length;e>d;d++)c.push(this._frames[d].index);else for(var d=0,e=a.length;e>d;d++)b?c.push(a[d]):this.getFrameByName(a[d])&&c.push(this.getFrameByName(a[d]).index);return c}},b.FrameData.prototype.constructor=b.FrameData,Object.defineProperty(b.FrameData.prototype,"total",{get:function(){return this._frames.length}}),b.AnimationParser={spriteSheet:function(a,c,d,e,f,g,h){var i=a.cache.getImage(c);if(null==i)return null;var j=i.width,k=i.height;0>=d&&(d=Math.floor(-j/Math.min(-1,d))),0>=e&&(e=Math.floor(-k/Math.min(-1,e)));var l=Math.floor((j-g)/(d+h)),m=Math.floor((k-g)/(e+h)),n=l*m;if(-1!==f&&(n=f),0===j||0===k||d>j||e>k||0===n)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var o=new b.FrameData,p=g,q=g,r=0;n>r;r++){var s=a.rnd.uuid();o.addFrame(new b.Frame(r,p,q,d,e,"",s)),PIXI.TextureCache[s]=new PIXI.Texture(PIXI.BaseTextureCache[c],{x:p,y:q,width:d,height:e}),p+=d+h,p+d>j&&(p=g,q+=e+h)}return o},JSONData:function(a,c,d){if(!c.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),void console.log(c);for(var e,f=new b.FrameData,g=c.frames,h=0;h 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;s0)for(var c=0;c0)for(var c=0;c0)for(var c=0;c0?(this._fileIndex=0,this._progressChunk=100/this._fileList.length,this.loadFile()):(this.progress=100,this.progressFloat=100,this.hasLoaded=!0,this.onLoadComplete.dispatch()))},loadFile:function(){if(!this._fileList[this._fileIndex])return void console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex);var a=this._fileList[this._fileIndex],c=this;switch(a.type){case"image":case"spritesheet":case"textureatlas":case"bitmapfont":a.data=new Image,a.data.name=a.key,a.data.onload=function(){return c.fileComplete(c._fileIndex)},a.data.onerror=function(){return c.fileError(c._fileIndex)},this.crossOrigin&&(a.data.crossOrigin=this.crossOrigin),a.data.src=this.baseURL+a.url;break;case"audio":a.url=this.getAudioURL(a.url),null!==a.url?this.game.sound.usingWebAudio?(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()):this.game.sound.usingAudioTag&&(this.game.sound.touchLocked?(a.data=new Audio,a.data.name=a.key,a.data.preload="auto",a.data.src=this.baseURL+a.url,this.fileComplete(this._fileIndex)):(a.data=new Audio,a.data.name=a.key,a.data.onerror=function(){return c.fileError(c._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",b.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"json":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)},this._xhr.send();break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===b.Tilemap.TILED_JSON)this._xhr.onload=function(){return c.jsonLoadComplete(c._fileIndex)};else{if(a.format!==b.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return c.csvLoadComplete(c._fileIndex)}}this._xhr.onerror=function(){return c.dataLoadError(c._fileIndex)},this._xhr.send();break;case"text":case"script":case"physics":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send();break;case"binary":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="arraybuffer",this._xhr.onload=function(){return c.fileComplete(c._fileIndex)},this._xhr.onerror=function(){return c.fileError(c._fileIndex)},this._xhr.send()}},getAudioURL:function(a){var b;"string"==typeof a&&(a=[a]);for(var c=0;c100&&(this.progress=100),null!==this.preloadSprite&&(0===this.preloadSprite.direction?(this.preloadSprite.rect.width=Math.floor(this.preloadSprite.width/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect)):(this.preloadSprite.rect.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop(this.preloadSprite.rect))),this.onFileComplete.dispatch(this.progress,this._fileList[a].key,b,this.totalLoadedFiles(),this._fileList.length),this.totalQueuedFiles()>0?(this._fileIndex++,this.loadFile()):(this.hasLoaded=!0,this.isLoading=!1,this.removeAll(),this.onLoadComplete.dispatch())},totalLoadedFiles:function(){for(var a=0,b=0;b=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):(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!==!0||e!==!1||this.override!==!1){if(this.isPlaying&&this.override&&(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 void console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist");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].durationMS,"undefined"!=typeof c&&(this.volume=c),"undefined"!=typeof d&&(this.loop=d),this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=this.loop),this.position=b,this.volume=c,this.loop=d,this.duration=0,this.durationMS=0,this._tempMarker=a,this._tempPosition=b,this._tempVolume=c,this._tempLoop=d;this.usingWebAudio?this.game.cache.isSoundDecoded(this.key)?(null==this._buffer&&(this._buffer=this.game.cache.getSoundData(this.key)),this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.totalDuration=this._sound.buffer.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this.loop&&""===a&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,this.position,this.duration):this._sound.start(0,this.position,this.duration),this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):(this.pendingPlayback=!0,this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).isDecoding===!1&&this.game.sound.decode(this.key,this)):this.game.cache.getSound(this.key)&&this.game.cache.getSound(this.key).locked?(this.game.cache.reloadSound(this.key),this.pendingPlayback=!0):this._sound&&(this.game.device.cocoonJS||4===this._sound.readyState)?(this._sound.play(),this.totalDuration=this._sound.duration,0===this.duration&&(this.duration=this.totalDuration,this.durationMS=1e3*this.totalDuration),this._sound.currentTime=this.position,this._sound.muted=this._muted,this._sound.volume=this._muted?0:this._volume,this.isPlaying=!0,this.startTime=this.game.time.now,this.currentTime=0,this.stopTime=this.startTime+this.durationMS,this.onPlay.dispatch(this)):this.pendingPlayback=!0}},restart:function(a,b,c,d){a=a||"",b=b||0,c=c||1,"undefined"==typeof d&&(d=!1),this.play(a,b,c,d,!0)},pause:function(){this.isPlaying&&this._sound&&(this.stop(),this.isPlaying=!1,this.paused=!0,this.pausedPosition=this.currentTime,this.pausedTime=this.game.time.now,this.onPause.dispatch(this))},resume:function(){if(this.paused&&this._sound){if(this.usingWebAudio){var a=this.position+this.pausedPosition/1e3;this._sound=this.context.createBufferSource(),this._sound.buffer=this._buffer,this._sound.connect(this.externalNode?this.externalNode.input:this.gainNode),this.loop&&(this._sound.loop=!0),"undefined"==typeof this._sound.start?this._sound.noteGrainOn(0,a,this.duration):this._sound.start(0,a,this.duration)}else this._sound.play();this.isPlaying=!0,this.paused=!1,this.startTime+=this.game.time.now-this.pausedTime,this.onResume.dispatch(this)}},stop:function(){this.isPlaying&&this._sound&&(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.isPlaying=!1;var a=this.currentMarker;""!==this.currentMarker&&this.onMarkerComplete.dispatch(this.currentMarker,this),this.currentMarker="",this.onStop.dispatch(this,a)}},b.Sound.prototype.constructor=b.Sound,Object.defineProperty(b.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(b.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(b.Sound.prototype,"mute",{get:function(){return this._muted},set:function(a){a=a||null,a?(this._muted=!0,this.usingWebAudio?(this._muteVolume=this.gainNode.gain.value,this.gainNode.gain.value=0):this.usingAudioTag&&this._sound&&(this._muteVolume=this._sound.volume,this._sound.volume=0)):(this._muted=!1,this.usingWebAudio?this.gainNode.gain.value=this._muteVolume:this.usingAudioTag&&this._sound&&(this._sound.volume=this._muteVolume)),this.onMute.dispatch(this)}}),Object.defineProperty(b.Sound.prototype,"volume",{get:function(){return this._volume},set:function(a){this.usingWebAudio?(this._volume=a,this.gainNode.gain.value=a):this.usingAudioTag&&this._sound&&a>=0&&1>=a&&(this._volume=a,this._sound.volume=a)}}),b.SoundManager=function(a){this.game=a,this.onSoundDecode=new b.Signal,this._codeMuted=!1,this._muted=!1,this._unlockSource=null,this._volume=1,this._sounds=[],this.context=null,this.usingWebAudio=!0,this.usingAudioTag=!1,this.noAudio=!1,this.connectToMaster=!0,this.touchLocked=!1,this.channels=32},b.SoundManager.prototype={boot:function(){if(this.game.device.iOS&&this.game.device.webAudio===!1&&(this.channels=1),this.game.device.iOS||window.PhaserGlobal&&window.PhaserGlobal.fakeiOSTouchLock?(this.game.input.touch.callbackContext=this,this.game.input.touch.touchStartCallback=this.unlock,this.game.input.mouse.callbackContext=this,this.game.input.mouse.mouseDownCallback=this.unlock,this.touchLocked=!0):this.touchLocked=!1,window.PhaserGlobal){if(window.PhaserGlobal.disableAudio===!0)return this.usingWebAudio=!1,void(this.noAudio=!0);if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,void(this.noAudio=!1)}window.AudioContext?this.context=new window.AudioContext:window.webkitAudioContext?this.context=new window.webkitAudioContext:window.Audio?(this.usingWebAudio=!1,this.usingAudioTag=!0):(this.usingWebAudio=!1,this.noAudio=!0),null!==this.context&&(this.masterGain="undefined"==typeof this.context.createGain?this.context.createGainNode():this.context.createGain(),this.masterGain.gain.value=1,this.masterGain.connect(this.context.destination))},unlock:function(){if(this.touchLocked!==!1)if(this.game.device.webAudio===!1||window.PhaserGlobal&&window.PhaserGlobal.disableWebAudio===!0)this.touchLocked=!1,this._unlockSource=null,this.game.input.touch.callbackContext=null,this.game.input.touch.touchStartCallback=null,this.game.input.mouse.callbackContext=null,this.game.input.mouse.mouseDownCallback=null;else{var a=this.context.createBuffer(1,1,22050);this._unlockSource=this.context.createBufferSource(),this._unlockSource.buffer=a,this._unlockSource.connect(this.context.destination),this._unlockSource.noteOn(0)}},stopAll:function(){for(var a=0;a255)return b.Color.getColor(255,255,255);if(a>c)return b.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(c-a)),f=a+Math.round(Math.random()*(c-a)),g=a+Math.round(Math.random()*(c-a));return b.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:a>>16&255,green:a>>8&255,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=a>>16&255,d=a>>8&255,e=255&a;return"rgba("+c.toString()+","+d.toString()+","+e.toString()+","+b.toString()+")"},getAlpha:function(a){return a>>>24},getAlphaFloat:function(a){return(a>>>24)/255},getRed:function(a){return a>>16&255},getGreen:function(a){return a>>8&255},getBlue:function(a){return 255&a}},b.Physics=function(a,b){b=b||{},this.game=a,this.config=b,this.arcade=null,this.p2=null,this.ninja=null,this.box2d=null,this.chipmunk=null,this.parseConfig()},b.Physics.ARCADE=0,b.Physics.P2JS=1,b.Physics.NINJA=2,b.Physics.BOX2D=3,b.Physics.CHIPMUNK=5,b.Physics.prototype={parseConfig:function(){this.config.hasOwnProperty("arcade")&&this.config.arcade!==!0||!b.Physics.hasOwnProperty("Arcade")||(this.arcade=new b.Physics.Arcade(this.game),this.game.time.deltaCap=.2),this.config.hasOwnProperty("ninja")&&this.config.ninja===!0&&b.Physics.hasOwnProperty("Ninja")&&(this.ninja=new b.Physics.Ninja(this.game)),this.config.hasOwnProperty("p2")&&this.config.p2===!0&&b.Physics.hasOwnProperty("P2")&&(this.p2=new b.Physics.P2(this.game,this.config))},startSystem:function(a){if(a===b.Physics.ARCADE?this.arcade=new b.Physics.Arcade(this.game):a===b.Physics.P2JS&&(this.p2=new b.Physics.P2(this.game,this.config)),a===b.Physics.NINJA)this.ninja=new b.Physics.Ninja(this.game);else{if(a===b.Physics.BOX2D&&null===this.box2d)throw new Error("The Box2D physics system has not been implemented yet.");if(a===b.Physics.CHIPMUNK&&null===this.chipmunk)throw new Error("The Chipmunk physics system has not been implemented yet.")}},enable:function(a,c,d){"undefined"==typeof c&&(c=b.Physics.ARCADE),"undefined"==typeof d&&(d=!1),c===b.Physics.ARCADE?this.arcade.enable(a):c===b.Physics.P2JS&&this.p2?this.p2.enable(a,d):c===b.Physics.NINJA&&this.ninja&&this.ninja.enableAABB(a)},preUpdate:function(){this.p2&&this.p2.preUpdate()},update:function(){this.p2&&this.p2.update()},setBoundsToWorld:function(){this.arcade&&this.arcade.setBoundsToWorld(),this.ninja&&this.ninja.setBoundsToWorld(),this.p2&&this.p2.setBoundsToWorld()},clear:function(){this.p2&&this.p2.clear()},destroy:function(){this.p2&&this.p2.destroy(),this.arcade=null,this.ninja=null,this.p2=null}},b.Physics.prototype.constructor=b.Physics,b.Physics.Arcade=function(a){this.game=a,this.gravity=new b.Point,this.bounds=new b.Rectangle(0,0,a.world.width,a.world.height),this.checkCollision={up:!0,down:!0,left:!0,right:!0},this.maxObjects=10,this.maxLevels=4,this.OVERLAP_BIAS=4,this.TILE_BIAS=16,this.forceX=!1,this.quadTree=new b.QuadTree(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this._overlap=0,this._maxOverlap=0,this._velocity1=0,this._velocity2=0,this._newVelocity1=0,this._newVelocity2=0,this._average=0,this._mapData=[],this._result=!1,this._total=0,this._angle=0,this._dx=0,this._dy=0},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(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,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){this.quadTree.clear(),this.quadTree.reset(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,this.maxObjects,this.maxLevels),this.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var g=0,h=this._potentials.length;h>g;g++)this.separate(a.body,this._potentials[g],d,e,f)&&(c&&c.call(e,a,this._potentials[g].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.position.x-a.body.tilePadding.x,a.body.position.y-a.body.tilePadding.y,a.body.width+a.body.tilePadding.x,a.body.height+a.body.tilePadding.y,!1,!1),0!==this._mapData.length)for(var f=0;ff;f++)a.children[f].exists&&this.collideSpriteVsTilemapLayer(a.children[f],b,c,d,e)},separate:function(a,b,c,d,e){return this.intersects(a,b)?c&&c.call(d,a.sprite,b.sprite)===!1?!1:e?!0:(this._result=this.forceX||Math.abs(this.gravity.y+a.gravity.y)=b.right?!1:a.position.y>=b.bottom?!1:!0},separateX:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsX()+b.deltaAbsX()+this.OVERLAP_BIAS,0===a.deltaX()&&0===b.deltaX()?(a.embedded=!0,b.embedded=!0):a.deltaX()>b.deltaX()?(this._overlap=a.right-b.x,this._overlap>this._maxOverlap||a.checkCollision.right===!1||b.checkCollision.left===!1?this._overlap=0:(a.touching.none=!1,a.touching.right=!0,b.touching.none=!1,b.touching.left=!0)):a.deltaX()this._maxOverlap||a.checkCollision.left===!1||b.checkCollision.right===!1?this._overlap=0:(a.touching.none=!1,a.touching.left=!0,b.touching.none=!1,b.touching.right=!0)),0!==this._overlap)?(a.overlapX=this._overlap,b.overlapX=this._overlap,c||a.customSeparateX||b.customSeparateX?!0:(this._velocity1=a.velocity.x,this._velocity2=b.velocity.x,a.immovable||b.immovable?a.immovable?b.immovable||(b.x+=this._overlap,b.velocity.x=this._velocity1-this._velocity2*b.bounce.x):(a.x=a.x-this._overlap,a.velocity.x=this._velocity2-this._velocity1*a.bounce.x):(this._overlap*=.5,a.x=a.x-this._overlap,b.x+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.x=this._average+this._newVelocity1*a.bounce.x,b.velocity.x=this._average+this._newVelocity2*b.bounce.x),!0)):!1)},separateY:function(a,b,c){return a.immovable&&b.immovable?!1:(this._overlap=0,this.intersects(a,b)&&(this._maxOverlap=a.deltaAbsY()+b.deltaAbsY()+this.OVERLAP_BIAS,0===a.deltaY()&&0===b.deltaY()?(a.embedded=!0,b.embedded=!0):a.deltaY()>b.deltaY()?(this._overlap=a.bottom-b.y,this._overlap>this._maxOverlap||a.checkCollision.down===!1||b.checkCollision.up===!1?this._overlap=0:(a.touching.none=!1,a.touching.down=!0,b.touching.none=!1,b.touching.up=!0)):a.deltaY()this._maxOverlap||a.checkCollision.up===!1||b.checkCollision.down===!1?this._overlap=0:(a.touching.none=!1,a.touching.up=!0,b.touching.none=!1,b.touching.down=!0)),0!==this._overlap)?(a.overlapY=this._overlap,b.overlapY=this._overlap,c||a.customSeparateY||b.customSeparateY?!0:(this._velocity1=a.velocity.y,this._velocity2=b.velocity.y,a.immovable||b.immovable?a.immovable?b.immovable||(b.y+=this._overlap,b.velocity.y=this._velocity1-this._velocity2*b.bounce.y,a.moves&&(b.x+=a.x-a.prev.x)):(a.y=a.y-this._overlap,a.velocity.y=this._velocity2-this._velocity1*a.bounce.y,b.moves&&(a.x+=b.x-b.prev.x)):(this._overlap*=.5,a.y=a.y-this._overlap,b.y+=this._overlap,this._newVelocity1=Math.sqrt(this._velocity2*this._velocity2*b.mass/a.mass)*(this._velocity2>0?1:-1),this._newVelocity2=Math.sqrt(this._velocity1*this._velocity1*a.mass/b.mass)*(this._velocity1>0?1:-1),this._average=.5*(this._newVelocity1+this._newVelocity2),this._newVelocity1-=this._average,this._newVelocity2-=this._average,a.velocity.y=this._average+this._newVelocity1*a.bounce.y,b.velocity.y=this._average+this._newVelocity2*b.bounce.y),!0)):!1)},separateTile:function(a,b,c){if(!c.intersects(b.position.x,b.position.y,b.right,b.bottom))return!1;if(c.collisionCallback&&!c.collisionCallback.call(c.collisionCallbackContext,b.sprite,c))return!1;if(c.layer.callbacks[c.index]&&!c.layer.callbacks[c.index].callback.call(c.layer.callbacks[c.index].callbackContext,b.sprite,c))return!1;if(!(c.faceLeft||c.faceRight||c.faceTop||c.faceBottom))return!1;var d=0,e=0,f=0,g=1;if(b.deltaAbsX()>b.deltaAbsY()?f=-1:b.deltaAbsX()f){if((c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c),0!==d&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c))}else{if((c.faceTop||c.faceBottom)&&(e=this.tileCheckY(b,c),0!==e&&!c.intersects(b.position.x,b.position.y,b.right,b.bottom)))return!0;(c.faceLeft||c.faceRight)&&(d=this.tileCheckX(b,c))}return 0!==d||0!==e},tileCheckX:function(a,b){var c=0;return a.deltaX()<0&&!a.blocked.left&&b.collideRight&&a.checkCollision.left?b.faceRight&&a.x0&&!a.blocked.right&&b.collideLeft&&a.checkCollision.right&&b.faceLeft&&a.right>b.left&&(c=a.right-b.left,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationX(a,c),c},tileCheckY:function(a,b){var c=0;return a.deltaY()<0&&!a.blocked.up&&b.collideDown&&a.checkCollision.up?b.faceBottom&&a.y0&&!a.blocked.down&&b.collideUp&&a.checkCollision.down&&b.faceTop&&a.bottom>b.top&&(c=a.bottom-b.top,c>this.TILE_BIAS&&(c=0)),0!==c&&this.processTileSeparationY(a,c),c},processTileSeparationX:function(a,b){0>b?a.blocked.left=!0:b>0&&(a.blocked.right=!0),a.position.x-=b,a.velocity.x=0===a.bounce.x?0:-a.velocity.x*a.bounce.x},processTileSeparationY:function(a,b){0>b?a.blocked.up=!0:b>0&&(a.blocked.down=!0),a.position.y-=b,a.velocity.y=0===a.bounce.y?0:-a.velocity.y*a.bounce.y},moveToObject:function(a,b,c,d){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=0),this._angle=Math.atan2(b.y-a.y,b.x-a.x),d>0&&(c=this.distanceBetween(a,b)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*c,a.body.velocity.y=Math.sin(this._angle)*c,this._angle},moveToPointer:function(a,b,c,d){return"undefined"==typeof b&&(b=60),c=c||this.game.input.activePointer,"undefined"==typeof d&&(d=0),this._angle=this.angleToPointer(a,c),d>0&&(b=this.distanceToPointer(a,c)/(d/1e3)),a.body.velocity.x=Math.cos(this._angle)*b,a.body.velocity.y=Math.sin(this._angle)*b,this._angle},moveToXY:function(a,b,c,d,e){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=0),this._angle=Math.atan2(c-a.y,b-a.x),e>0&&(d=this.distanceToXY(a,b,c)/(e/1e3)),a.body.velocity.x=Math.cos(this._angle)*d,a.body.velocity.y=Math.sin(this._angle)*d,this._angle},velocityFromAngle:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*c,Math.sin(this.game.math.degToRad(a))*c)},velocityFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerationFromRotation:function(a,c,d){return"undefined"==typeof c&&(c=60),d=d||new b.Point,d.setTo(Math.cos(a)*c,Math.sin(a)*c)},accelerateToObject:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleBetween(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToPointer:function(a,b,c,d,e){return"undefined"==typeof c&&(c=60),"undefined"==typeof b&&(b=this.game.input.activePointer),"undefined"==typeof d&&(d=1e3),"undefined"==typeof e&&(e=1e3),this._angle=this.angleToPointer(a,b),a.body.acceleration.setTo(Math.cos(this._angle)*c,Math.sin(this._angle)*c),a.body.maxVelocity.setTo(d,e),this._angle},accelerateToXY:function(a,b,c,d,e,f){return"undefined"==typeof d&&(d=60),"undefined"==typeof e&&(e=1e3),"undefined"==typeof f&&(f=1e3),this._angle=this.angleToXY(a,b,c),a.body.acceleration.setTo(Math.cos(this._angle)*d,Math.sin(this._angle)*d),a.body.maxVelocity.setTo(e,f),this._angle},distanceBetween:function(a,b){return this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToXY:function(a,b,c){return this._dx=a.x-b,this._dy=a.y-c,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},distanceToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=a.x-b.x,this._dy=a.y-b.y,Math.sqrt(this._dx*this._dx+this._dy*this._dy)},angleBetween:function(a,b){return this._dx=b.x-a.x,this._dy=b.y-a.y,Math.atan2(this._dy,this._dx)},angleToXY:function(a,b,c){return this._dx=b-a.x,this._dy=c-a.y,Math.atan2(this._dy,this._dx)},angleToPointer:function(a,b){return b=b||this.game.input.activePointer,this._dx=b.worldX-a.x,this._dy=b.worldY-a.y,Math.atan2(this._dy,this._dx)}},b.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.type=b.Physics.ARCADE,this.offset=new b.Point,this.position=new b.Point(a.x,a.y),this.prev=new b.Point(this.position.x,this.position.y),this.allowRotation=!0,this.rotation=a.rotation,this.preRotation=a.rotation,this.sourceWidth=a.texture.frame.width,this.sourceHeight=a.texture.frame.height,this.width=a.width,this.height=a.height,this.halfWidth=Math.abs(a.width/2),this.halfHeight=Math.abs(a.height/2),this.center=new b.Point(a.x+this.halfWidth,a.y+this.halfHeight),this.velocity=new b.Point,this.newVelocity=new b.Point(0,0),this.deltaMax=new b.Point(0,0),this.acceleration=new b.Point,this.drag=new b.Point,this.allowGravity=!0,this.gravity=new b.Point(0,0),this.bounce=new b.Point,this.maxVelocity=new b.Point(1e4,1e4),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=b.NONE,this.immovable=!1,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={up:!1,down:!1,left:!1,right:!1},this.tilePadding=new b.Point,this.phase=0,this._reset=!0,this._sx=a.scale.x,this._sy=a.scale.y,this._dx=0,this._dy=0},b.Physics.Arcade.Body.prototype={updateBounds:function(){var a=Math.abs(this.sprite.scale.x),b=Math.abs(this.sprite.scale.y);(a!==this._sx||b!==this._sy)&&(this.width=this.sourceWidth*a,this.height=this.sourceHeight*b,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this._sx=a,this._sy=b,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this._reset=!0)},preUpdate:function(){this.phase=1,this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.blocked.up=!1,this.blocked.down=!1,this.blocked.left=!1,this.blocked.right=!1,this.embedded=!1,this.updateBounds(),this.position.x=this.sprite.world.x-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=this.sprite.world.y-this.sprite.anchor.y*this.height+this.offset.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,(this._reset||1===this.sprite._cache[4])&&(this.prev.x=this.position.x,this.prev.y=this.position.y),this.moves&&(this.game.physics.arcade.updateMotion(this),this.newVelocity.set(this.velocity.x*this.game.time.physicsElapsed,this.velocity.y*this.game.time.physicsElapsed),this.position.x+=this.newVelocity.x,this.position.y+=this.newVelocity.y,(this.position.x!==this.prev.x||this.position.y!==this.prev.y)&&(this.speed=Math.sqrt(this.velocity.x*this.velocity.x+this.velocity.y*this.velocity.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x)),this.collideWorldBounds&&this.checkWorldBounds()),this._dx=this.deltaX(),this._dy=this.deltaY(),this._reset=!1},postUpdate:function(){this.phase=2,this.deltaX()<0?this.facing=b.LEFT:this.deltaX()>0&&(this.facing=b.RIGHT),this.deltaY()<0?this.facing=b.UP:this.deltaY()>0&&(this.facing=b.DOWN),this.moves&&(this._dx=this.deltaX(),this._dy=this.deltaY(),0!==this.deltaMax.x&&0!==this._dx&&(this._dx<0&&this._dx<-this.deltaMax.x?this._dx=-this.deltaMax.x:this._dx>0&&this._dx>this.deltaMax.x&&(this._dx=this.deltaMax.x)),0!==this.deltaMax.y&&0!==this._dy&&(this._dy<0&&this._dy<-this.deltaMax.y?this._dy=-this.deltaMax.y:this._dy>0&&this._dy>this.deltaMax.y&&(this._dy=this.deltaMax.y)),this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.allowRotation&&(this.sprite.angle+=this.deltaZ()),this.prev.x=this.position.x,this.prev.y=this.position.y},destroy:function(){this.sprite=null},checkWorldBounds:function(){this.position.xthis.game.physics.arcade.bounds.right&&this.game.physics.arcade.checkCollision.right&&(this.position.x=this.game.physics.arcade.bounds.right-this.width,this.velocity.x*=-this.bounce.x,this.blocked.right=!0),this.position.ythis.game.physics.arcade.bounds.bottom&&this.game.physics.arcade.checkCollision.down&&(this.position.y=this.game.physics.arcade.bounds.bottom-this.height,this.velocity.y*=-this.bounce.y,this.blocked.down=!0) +},setSize:function(a,b,c,d){c=c||this.offset.x,d=d||this.offset.y,this.sourceWidth=a,this.sourceHeight=b,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.setTo(c,d),this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(a,b){this.velocity.set(0),this.acceleration.set(0),this.angularVelocity=0,this.angularAcceleration=0,this.position.x=a-this.sprite.anchor.x*this.width+this.offset.x,this.position.y=b-this.sprite.anchor.y*this.height+this.offset.y,this.prev.x=this.position.x,this.prev.y=this.position.y,this.rotation=this.sprite.angle,this.preRotation=this.rotation,this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y,this.center.setTo(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},onFloor:function(){return this.blocked.down},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.position.x-this.prev.x},deltaY:function(){return this.position.y-this.prev.y},deltaZ:function(){return this.rotation-this.preRotation}},Object.defineProperty(b.Physics.Arcade.Body.prototype,"bottom",{get:function(){return this.position.y+this.height}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"right",{get:function(){return this.position.x+this.width}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(b.Physics.Arcade.Body.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),b.Physics.Arcade.Body.render=function(a,b,c,d){"undefined"==typeof c&&(c=!0),d=d||"rgba(0,255,0,0.4)",c?(a.fillStyle=d,a.fillRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height)):(a.strokeStyle=d,a.strokeRect(b.position.x-b.game.camera.x,b.position.y-b.game.camera.y,b.width,b.height))},b.Physics.Arcade.Body.renderBodyInfo=function(a,b){a.line("x: "+b.x.toFixed(2),"y: "+b.y.toFixed(2),"width: "+b.width,"height: "+b.height),a.line("velocity x: "+b.velocity.x.toFixed(2),"y: "+b.velocity.y.toFixed(2),"deltaX: "+b._dx.toFixed(2),"deltaY: "+b._dy.toFixed(2)),a.line("acceleration x: "+b.acceleration.x.toFixed(2),"y: "+b.acceleration.y.toFixed(2),"speed: "+b.speed.toFixed(2),"angle: "+b.angle.toFixed(2)),a.line("gravity x: "+b.gravity.x,"y: "+b.gravity.y,"bounce x: "+b.bounce.x.toFixed(2),"y: "+b.bounce.y.toFixed(2)),a.line("touching left: "+b.touching.left,"right: "+b.touching.right,"up: "+b.touching.up,"down: "+b.touching.down),a.line("blocked left: "+b.blocked.left,"right: "+b.blocked.right,"up: "+b.blocked.up,"down: "+b.blocked.down)},b.Physics.Arcade.Body.prototype.constructor=b.Physics.Arcade.Body,b.Particles=function(a){this.game=a,this.emitters={},this.ID=0},b.Particles.prototype={add:function(a){return this.emitters[a.name]=a,a},remove:function(a){delete this.emitters[a.name]},update:function(){for(var a in this.emitters)this.emitters[a].exists&&this.emitters[a].update()}},b.Particles.prototype.constructor=b.Particles,b.Particles.Arcade={},b.Particles.Arcade.Emitter=function(a,c,d,e){this.maxParticles=e||50,b.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=b.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new b.Point(-100,-100),this.maxParticleSpeed=new b.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=b.Sprite,this.particleDrag=new b.Point,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new b.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this._frames=null,this.on=!1,this.exists=!0,this.emitX=c,this.emitY=d},b.Particles.Arcade.Emitter.prototype=Object.create(b.Group.prototype),b.Particles.Arcade.Emitter.prototype.constructor=b.Particles.Arcade.Emitter,b.Particles.Arcade.Emitter.prototype.update=function(){if(this.on)if(this._explode){this._counter=0;do this.emitParticle(),this._counter++;while(this._counter=this._timer&&(this.emitParticle(),this._counter++,this._quantity>0&&this._counter>=this._quantity&&(this.on=!1),this._timer=this.game.time.now+this.frequency)},b.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,c,d,e){"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=this.maxParticles),"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=!1);var f,g=0,h=a,i=b;for(this._frames=b;c>g;)"object"==typeof a&&(h=this.game.rnd.pick(a)),"object"==typeof b&&(i=this.game.rnd.pick(b)),f=new this.particleClass(this.game,0,0,h,i),this.game.physics.arcade.enable(f,!1),d?(f.body.checkCollision.any=!0,f.body.checkCollision.none=!1):f.body.checkCollision.none=!0,f.body.collideWorldBounds=e,f.exists=!1,f.visible=!1,f.anchor.set(.5),this.add(f),g++;return this},b.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},b.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},b.Particles.Arcade.Emitter.prototype.start=function(a,b,c,d){"undefined"==typeof a&&(a=!0),"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=250),"undefined"==typeof d&&(d=0),this.revive(),this.visible=!0,this.on=!0,this._explode=a,this.lifespan=b,this.frequency=c,a?this._quantity=d:this._quantity+=d,this._counter=0,this._timer=this.game.time.now+c},b.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);null!=a&&(a.angle=0,a.bringToTop(),(1!==this.minParticleScale||1!==this.maxParticleScale)&&a.scale.set(this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale)),this.width>1||this.height>1?a.reset(this.game.rnd.integerInRange(this.left,this.right),this.game.rnd.integerInRange(this.top,this.bottom)):a.reset(this.emitX,this.emitY),a.lifespan=this.lifespan,a.body.bounce.setTo(this.bounce.x,this.bounce.y),a.body.velocity.x=this.minParticleSpeed.x!==this.maxParticleSpeed.x?this.game.rnd.integerInRange(this.minParticleSpeed.x,this.maxParticleSpeed.x):this.minParticleSpeed.x,a.body.velocity.y=this.minParticleSpeed.y!==this.maxParticleSpeed.y?this.game.rnd.integerInRange(this.minParticleSpeed.y,this.maxParticleSpeed.y):this.minParticleSpeed.y,this.minRotation!==this.maxRotation?a.body.angularVelocity=this.game.rnd.integerInRange(this.minRotation,this.maxRotation):0!==this.minRotation&&(a.body.angularVelocity=this.minRotation),a.frame="object"==typeof this._frames?this.game.rnd.pick(this._frames):this._frames,a.body.gravity.y=this.gravity,a.body.drag.x=this.particleDrag.x,a.body.drag.y=this.particleDrag.y,a.body.angularDrag=this.angularDrag)},b.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},b.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},b.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},b.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},b.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(b.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),b.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.worldX=c*e,this.worldY=d*f,this.width=e,this.height=f,this.centerX=Math.abs(e/2),this.centerY=Math.abs(f/2),this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.collisionCallback=null,this.collisionCallbackContext=this},b.Tile.prototype={containsPoint:function(a,b){return!(athis.right||b>this.bottom)},intersects:function(a,b,c,d){return c<=this.worldX?!1:d<=this.worldY?!1:a>=this.worldX+this.width?!1:b>=this.worldY+this.height?!1:!0},setCollisionCallback:function(a,b){this.collisionCallback=a,this.collisionCallbackContext=b},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d},resetCollision:function(){this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1},isInteresting:function(a,b){return a&&b?this.collideLeft||this.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.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.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;c=a}if("string"==typeof a&&(a=this.getTilesetIndex(a)),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;pl;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].properties)h.set(k,n,this.objects[a][l].properties[n],!1,!1,0)}},createLayer:function(a,c,d,e){"undefined"==typeof c&&(c=this.game.width),"undefined"==typeof d&&(d=this.game.height),"undefined"==typeof e&&(e=this.game.world);var f=a;return"string"==typeof a&&(f=this.getLayerIndex(a)),null===f||f>this.layers.length?void console.warn("Tilemap.createLayer: Invalid layer ID given: "+f):e.add(new b.TilemapLayer(this.game,this,f,c,d))},createBlankLayer:function(a,c,d,e,f,g){if("undefined"==typeof g&&(g=this.game.world),null!==this.getLayerIndex(a))return void console.warn("Tilemap.createBlankLayer: Layer with matching name already exists");for(var h,i=[],j=0;d>j;j++){h=[];for(var k=0;c>k;k++)h.push(null);i.push(h)}var l={name:a,x:0,y:0,width:c,height:d,widthInPixels:c*e,heightInPixels:d*f,alpha:1,visible:!0,properties:{},indexes:[],callbacks:[],bodies:[],data:i};this.layers.push(l),this.currentLayer=this.layers.length-1;var m=l.widthInPixels,n=l.heightInPixels;m>this.game.width&&(m=this.game.width),n>this.game.height&&(n=this.game.height);var i=new b.TilemapLayer(this.game,this,this.layers.length-1,m,n);return i.name=a,g.add(i)},getIndex:function(a,b){for(var c=0;ce;e++)this.layers[d].callbacks[a[e]]={callback:b,callbackContext:c}},setTileLocationCallback:function(a,b,c,d,e,f,g){if(g=this.getLayer(g),this.copy(a,b,c,d,g),!(this._results.length<2))for(var h=1;hd;d++)this.setCollisionByIndex(a[d],b,c,!1);this.calculateFaces(c)},setCollisionBetween:function(a,b,c,d){if("undefined"==typeof c&&(c=!0),d=this.getLayer(d),!(a>b)){for(var e=a;b>=e;e++)this.setCollisionByIndex(e,c,d,!1);this.calculateFaces(d)}},setCollisionByExclusion:function(a,b,c){"undefined"==typeof b&&(b=!0),c=this.getLayer(c);for(var d=0,e=this.tiles.length;e>d;d++)-1===a.indexOf(d)&&this.setCollisionByIndex(d,b,c,!1);this.calculateFaces(c)},setCollisionByIndex:function(a,b,c,d){if("undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0),b)this.collideIndexes.push(a);else{var e=this.collideIndexes.indexOf(a);e>-1&&this.collideIndexes.splice(e,1)}for(var f=0;ff;f++)for(var h=0,i=this.layers[a].width;i>h;h++){var j=this.layers[a].data[f][h];j&&(b=this.getTileAbove(a,h,f),c=this.getTileBelow(a,h,f),d=this.getTileLeft(a,h,f),e=this.getTileRight(a,h,f),j.collides&&(j.faceTop=!0,j.faceBottom=!0,j.faceLeft=!0,j.faceRight=!0),b&&b.collides&&(j.faceTop=!1),c&&c.collides&&(j.faceBottom=!1),d&&d.collides&&(j.faceLeft=!1),e&&e.collides&&(j.faceRight=!1))}},getTileAbove:function(a,b,c){return c>0?this.layers[a].data[c-1][b]:null},getTileBelow:function(a,b,c){return c0?this.layers[a].data[c][b-1]:null},getTileRight:function(a,b,c){return b=0&&c=0&&d-1?this.layers[e].data[d][c].setCollision(!0,!0,!0,!0):this.layers[e].data[d][c].resetCollision(),this.layers[e].dirty=!0,this.calculateFaces(e),this.layers[e].data[d][c]}return null},putTileWorldXY:function(a,b,c,d,e,f){f=this.getLayer(f),b=this.game.math.snapToFloor(b,d)/d,c=this.game.math.snapToFloor(c,e)/e,this.putTile(a,b,c,f)},getTile:function(a,b,c){return c=this.getLayer(c),a>=0&&a=0&&ba&&(a=0),0>b&&(b=0),c>this.layers[e].width&&(c=this.layers[e].width),d>this.layers[e].height&&(d=this.layers[e].height),this._results.length=0,this._results.push({x:a,y:b,width:c,height:d,layer:e});for(var f=b;b+d>f;f++)for(var g=a;a+c>g;g++)this._results.push(this.layers[e].data[f][g]);return this._results},paste:function(a,b,c,d){if("undefined"==typeof a&&(a=0),"undefined"==typeof b&&(b=0),d=this.getLayer(d),c&&!(c.length<2)){for(var e=c[1].x-a,f=c[1].y-b,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?"background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]:"background: #ffffff":"background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},b.Tilemap.prototype.constructor=b.Tilemap,b.TilemapLayer=function(a,c,d,e,f){this.game=a,this.map=c,this.index=d,this.layer=c.layers[d],this.canvas=b.Canvas.create(e,f,"",!0),this.context=this.canvas.getContext("2d"),this.baseTexture=new PIXI.BaseTexture(this.canvas),this.texture=new PIXI.Texture(this.baseTexture),this.textureFrame=new b.Frame(0,0,0,e,f,"tilemapLayer",a.rnd.uuid()),b.Image.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=b.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new b.Point(0,0),this.tileColor="rgb(255, 255, 255)",this.debug=!1,this.debugAlpha=.5,this.debugColor="rgba(0, 255, 0, 1)",this.debugFill=!1,this.debugFillColor="rgba(0, 255, 0, 0.2)",this.debugCallbackColor="rgba(255, 0, 0, 1)",this.scrollFactorX=1,this.scrollFactorY=1,this.dirty=!0,this.rayStepRate=4,this._mc={cw:c.tileWidth,ch:c.tileHeight,ga:1,dx:0,dy:0,dw:0,dh:0,tx:0,ty:0,tw:0,th:0,tl:0,maxX:0,maxY:0,startX:0,startY:0,x:0,y:0,prevX:0,prevY:0},this._results=[],this.updateMax()},b.TilemapLayer.prototype=Object.create(b.Image.prototype),b.TilemapLayer.prototype.constructor=b.TilemapLayer,b.TilemapLayer.prototype.postUpdate=function(){b.Image.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render(),1===this._cache[7]&&(this.position.x=(this.game.camera.view.x+this.cameraOffset.x)/this.game.camera.scale.x,this.position.y=(this.game.camera.view.y+this.cameraOffset.y)/this.game.camera.scale.y)},b.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},b.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._mc.x+(a-this._mc.x/this.scrollFactorX)},b.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._mc.x/this.scrollFactorX+(a-this._mc.x)},b.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._mc.y+(a-this._mc.y/this.scrollFactorY)},b.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._mc.y/this.scrollFactorY+(a-this._mc.y)},b.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},b.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},b.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},b.TilemapLayer.prototype.getRayCastTiles=function(a,b,c,d){("undefined"==typeof b||null===b)&&(b=this.rayStepRate),"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1);var e=this.getTiles(a.x,a.y,a.width,a.height,c,d);if(0===e.length)return[];for(var f=a.coordinatesOnLine(b),g=f.length,h=[],i=0;ij;j++)if(e[i].containsPoint(f[j][0],f[j][1])){h.push(e[i]);break}return h},b.TilemapLayer.prototype.getTiles=function(a,b,c,d,e,f){"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1),a=this._fixX(a),b=this._fixY(b),c>this.layer.widthInPixels&&(c=this.layer.widthInPixels),d>this.layer.heightInPixels&&(d=this.layer.heightInPixels),this._mc.tx=this.game.math.snapToFloor(a,this._mc.cw)/this._mc.cw,this._mc.ty=this.game.math.snapToFloor(b,this._mc.ch)/this._mc.ch,this._mc.tw=(this.game.math.snapToCeil(c,this._mc.cw)+this._mc.cw)/this._mc.cw,this._mc.th=(this.game.math.snapToCeil(d,this._mc.ch)+this._mc.ch)/this._mc.ch,this._results.length=0;for(var g=this._mc.ty;gthis.layer.width&&(this._mc.maxX=this.layer.width),this._mc.maxY>this.layer.height&&(this._mc.maxY=this.layer.height)),this.dirty=!0},b.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._mc.prevX=this._mc.dx,this._mc.prevY=this._mc.dy,this._mc.dx=-(this._mc.x-this._mc.startX*this.map.tileWidth),this._mc.dy=-(this._mc.y-this._mc.startY*this.map.tileHeight),this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,c;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var d=this._mc.startY,e=this._mc.startY+this._mc.maxY;e>d;d++){this._column=this.layer.data[d];for(var f=this._mc.startX,g=this._mc.startX+this._mc.maxX;g>f;f++)this._column[f]&&(a=this._column[f],c=this.map.tilesets[this.map.tiles[a.index][2]],this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),c.draw(this.context,Math.floor(this._mc.tx),Math.floor(this._mc.ty),a.index),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._mc.tx),Math.floor(this._mc.ty),this.map.tileWidth,this.map.tileHeight))),this._mc.tx+=this.map.tileWidth;this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===b.WEBGL&&PIXI.updateWebGLTexture(this.baseTexture,this.game.renderer.gl),this.dirty=!1,this.layer.dirty=!1,!0}},b.TilemapLayer.prototype.renderDebug=function(){this._mc.tx=this._mc.dx,this._mc.ty=this._mc.dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._mc.startY,b=this._mc.startY+this._mc.maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._mc.startX,d=this._mc.startX+this._mc.maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._mc.tx=Math.floor(this._mc.tx),this.debugFill&&this.context.fillRect(this._mc.tx,this._mc.ty,this._mc.cw,this._mc.ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty)),e.faceBottom&&(this.context.moveTo(this._mc.tx,this._mc.ty+this._mc.ch),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),e.faceLeft&&(this.context.moveTo(this._mc.tx,this._mc.ty),this.context.lineTo(this._mc.tx,this._mc.ty+this._mc.ch)),e.faceRight&&(this.context.moveTo(this._mc.tx+this._mc.cw,this._mc.ty),this.context.lineTo(this._mc.tx+this._mc.cw,this._mc.ty+this._mc.ch)),this.context.stroke()),this._mc.tx+=this.map.tileWidth}this._mc.tx=this._mc.dx,this._mc.ty+=this.map.tileHeight}},Object.defineProperty(b.TilemapLayer.prototype,"scrollX",{get:function(){return this._mc.x},set:function(a){a!==this._mc.x&&a>=0&&this.layer.widthInPixels>this.width&&(this._mc.x=a,this._mc.x>this.layer.widthInPixels-this.width&&(this._mc.x=this.layer.widthInPixels-this.width),this._mc.startX=this.game.math.floor(this._mc.x/this.map.tileWidth),this._mc.startX<0&&(this._mc.startX=0),this._mc.startX+this._mc.maxX>this.layer.width&&(this._mc.startX=this.layer.width-this._mc.maxX),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"scrollY",{get:function(){return this._mc.y},set:function(a){a!==this._mc.y&&a>=0&&this.layer.heightInPixels>this.height&&(this._mc.y=a,this._mc.y>this.layer.heightInPixels-this.height&&(this._mc.y=this.layer.heightInPixels-this.height),this._mc.startY=this.game.math.floor(this._mc.y/this.map.tileHeight),this._mc.startY<0&&(this._mc.startY=0),this._mc.startY+this._mc.maxY>this.layer.height&&(this._mc.startY=this.layer.height-this._mc.maxY),this.dirty=!0)}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._mc.cw},set:function(a){this._mc.cw=a,this.dirty=!0}}),Object.defineProperty(b.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._mc.ch},set:function(a){this._mc.ch=a,this.dirty=!0}}),b.TilemapParser={parse:function(a,c,d,e,f,g){if("undefined"==typeof d&&(d=32),"undefined"==typeof e&&(e=32),"undefined"==typeof f&&(f=10),"undefined"==typeof g&&(g=10),"undefined"==typeof c)return this.getEmptyData();if(null===c)return this.getEmptyData(d,e,f,g);var h=a.cache.getTilemapData(c);if(h){if(h.format===b.Tilemap.CSV)return this.parseCSV(c,h.data,d,e);if(!h.format||h.format===b.Tilemap.TILED_JSON)return this.parseTiledJSON(h.data)}else console.warn("Phaser.TilemapParser.parse - No map data found for key "+c)},parseCSV:function(a,c,d,e){var f=this.getEmptyData();c=c.trim();for(var g=[],h=c.split("\n"),i=h.length,j=0,k=0;kj;j++)h.push(a.layers[e].data[j]>0?new b.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight):null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}c.layers=d;for(var l=[],e=0;es;s++)if(a.layers[e].objects[s].gid){var t={gid:a.layers[e].objects[s].gid,name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};q[a.layers[e].name].push(t)}else if(a.layers[e].objects[s].polyline){var t={name:a.layers[e].objects[s].name,x:a.layers[e].objects[s].x,y:a.layers[e].objects[s].y,width:a.layers[e].objects[s].width,height:a.layers[e].objects[s].height,visible:a.layers[e].objects[s].visible,properties:a.layers[e].objects[s].properties};t.polyline=[];for(var u=0;u=c)&&(c=32),("undefined"==typeof d||0>=d)&&(d=32),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=0),this.name=a,this.firstgid=b,this.tileWidth=c,this.tileHeight=d,this.tileMargin=e,this.tileSpacing=f,this.properties=g,this.image=null,this.rows=0,this.columns=0,this.total=0,this.drawCoords=[]},b.Tileset.prototype={draw:function(a,b,c,d){this.image&&this.drawCoords[d]&&a.drawImage(this.image,this.drawCoords[d][0],this.drawCoords[d][1],this.tileWidth,this.tileHeight,b,c,this.tileWidth,this.tileHeight)},setImage:function(a){this.image=a,this.rows=Math.round((a.height-this.tileMargin)/(this.tileHeight+this.tileSpacing)),this.columns=Math.round((a.width-this.tileMargin)/(this.tileWidth+this.tileSpacing)),this.total=this.rows*this.columns,this.drawCoords.length=0;for(var b=this.tileMargin,c=this.tileMargin,d=this.firstgid,e=0;e0&&this.enable(a[f],b,c,d,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c,d,e):(this.enableBody(a,b,c,d),e&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,c,d,!0))},enableBody:function(a,b,c,d){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.Ninja.Body(this,a,b,c,d),a.anchor.set(.5))},setBounds:function(a,b,c,d){this.bounds.setTo(a,b,c,d)},setBoundsToWorld:function(){this.bounds.setTo(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height)},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c){b=a.getLayer(b),this.clearTilemapLayerBodies(a,b);for(var d=0,e=a.layers[b].height;e>d;d++)for(var f=0,g=a.layers[b].width;g>f;f++){var h=a.layers[b].data[d][f];if(h&&c.hasOwnProperty(h.index)){var i=new Phaser.Physics.Ninja.Body(this,null,3,c[h.index],0,h.worldX+h.centerX,h.worldY+h.centerY,h.width,h.height);a.layers[b].bodies.push(i)}}return a.layers[b].bodies},overlap:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!0);else this.collideHandler(a,b,c,d,e,!0);return this._total>0},collide:function(a,b,c,d,e){if(c=c||null,d=d||null,e=e||c,this._result=!1,this._total=0,Array.isArray(b))for(var f=0,g=b.length;g>f;f++)this.collideHandler(a,b[f],c,d,e,!1);else this.collideHandler(a,b,c,d,e,!1);return this._total>0},collideHandler:function(a,b,c,d,e,f){return"undefined"!=typeof b||a.type!==Phaser.GROUP&&a.type!==Phaser.EMITTER?void(a&&b&&a.exists&&b.exists&&(a.type==Phaser.SPRITE||a.type==Phaser.TILESPRITE?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsSprite(a,b,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideSpriteVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,c,d,e):a.type==Phaser.GROUP?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e):a.type==Phaser.TILEMAPLAYER?b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,c,d,e):(b.type==Phaser.GROUP||b.type==Phaser.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,c,d,e):a.type==Phaser.EMITTER&&(b.type==Phaser.SPRITE||b.type==Phaser.TILESPRITE?this.collideSpriteVsGroup(b,a,c,d,e,f):b.type==Phaser.GROUP||b.type==Phaser.EMITTER?this.collideGroupVsGroup(a,b,c,d,e,f):b.type==Phaser.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,c,d,e)))):void this.collideGroupVsSelf(a,c,d,e,f)},collideSpriteVsSprite:function(a,b,c,d,e,f){this.separate(a.body,b.body,d,e,f)&&(c&&c.call(e,a,b),this._total++)},collideSpriteVsGroup:function(a,b,c,d,e,f){if(0!==b.length)for(var g=0,h=b.children.length;h>g;g++)b.children[g].exists&&b.children[g].body&&this.separate(a.body,b.children[g].body,d,e,f)&&(c&&c.call(e,a,b.children[g]),this._total++)},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a.children[g]&&a.children[h]&&a.children[g].exists&&a.children[h].exists&&this.collideSpriteVsSprite(a.children[g],a.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length)for(var g=0,h=a.children.length;h>g;g++)a.children[g].exists&&this.collideSpriteVsGroup(a.children[g],b,c,d,e,f)},separate:function(a,b){return a.type!==Phaser.Physics.NINJA||b.type!==Phaser.Physics.NINJA?!1:a.aabb&&b.aabb?a.aabb.collideAABBVsAABB(b.aabb):a.aabb&&b.tile?a.aabb.collideAABBVsTile(b.tile):a.tile&&b.aabb?b.aabb.collideAABBVsTile(a.tile):a.circle&&b.tile?a.circle.collideCircleVsTile(b.tile):a.tile&&b.circle?b.circle.collideCircleVsTile(a.tile):void 0}},Phaser.Physics.Ninja.Body=function(a,b,c,d,e,f,g,h,i){b=b||null,"undefined"==typeof c&&(c=1),"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=16),this.sprite=b,this.game=a.game,this.type=Phaser.Physics.NINJA,this.system=a,this.aabb=null,this.tile=null,this.circle=null,this.shape=null,this.drag=1,this.friction=.05,this.gravityScale=1,this.bounce=.3,this.velocity=new Phaser.Point,this.facing=Phaser.NONE,this.immovable=!1,this.collideWorldBounds=!0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.maxSpeed=8,b&&(f=b.x,g=b.y,h=b.width,i=b.height,0===b.anchor.x&&(f+=.5*b.width),0===b.anchor.y&&(g+=.5*b.height)),1===c?(this.aabb=new Phaser.Physics.Ninja.AABB(this,f,g,h,i),this.shape=this.aabb):2===c?(this.circle=new Phaser.Physics.Ninja.Circle(this,f,g,e),this.shape=this.circle):3===c&&(this.tile=new Phaser.Physics.Ninja.Tile(this,f,g,h,i,d),this.shape=this.tile)},Phaser.Physics.Ninja.Body.prototype={preUpdate:function(){this.wasTouching.none=this.touching.none,this.wasTouching.up=this.touching.up,this.wasTouching.down=this.touching.down,this.wasTouching.left=this.touching.left,this.wasTouching.right=this.touching.right,this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.shape.integrate(),this.collideWorldBounds&&this.shape.collideWorldBounds()},postUpdate:function(){this.sprite&&(this.sprite.type===Phaser.TILESPRITE?(this.sprite.x=this.shape.pos.x-this.shape.xw,this.sprite.y=this.shape.pos.y-this.shape.yw):(this.sprite.x=this.shape.pos.x,this.sprite.y=this.shape.pos.y)),this.velocity.x<0?this.facing=Phaser.LEFT:this.velocity.x>0&&(this.facing=Phaser.RIGHT),this.velocity.y<0?this.facing=Phaser.UP:this.velocity.y>0&&(this.facing=Phaser.DOWN)},setZeroVelocity:function(){this.shape.oldpos.x=this.shape.pos.x,this.shape.oldpos.y=this.shape.pos.y},moveTo:function(a,b){var c=a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveFrom:function(a,b){var c=-a*this.game.time.physicsElapsed,b=this.game.math.degToRad(b);this.shape.pos.x=this.shape.oldpos.x+c*Math.cos(b),this.shape.pos.y=this.shape.oldpos.y+c*Math.sin(b)},moveLeft:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveRight:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.x=this.shape.oldpos.x+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.x-this.shape.oldpos.x+b))},moveUp:function(a){var b=-a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},moveDown:function(a){var b=a*this.game.time.physicsElapsed;this.shape.pos.y=this.shape.oldpos.y+Math.min(this.maxSpeed,Math.max(-this.maxSpeed,this.shape.pos.y-this.shape.oldpos.y+b))},reset:function(){this.velocity.set(0),this.shape.pos.x=this.sprite.x,this.shape.pos.y=this.sprite.y,this.shape.oldpos.copyFrom(this.shape.pos)},deltaAbsX:function(){return this.deltaX()>0?this.deltaX():-this.deltaX()},deltaAbsY:function(){return this.deltaY()>0?this.deltaY():-this.deltaY()},deltaX:function(){return this.shape.pos.x-this.shape.oldpos.x},deltaY:function(){return this.shape.pos.y-this.shape.oldpos.y},destroy:function(){this.sprite=null,this.system=null,this.aabb=null,this.tile=null,this.circle=null,this.shape.destroy(),this.shape=null}},Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"x",{get:function(){return this.shape.pos.x},set:function(a){this.shape.pos.x=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"y",{get:function(){return this.shape.pos.y},set:function(a){this.shape.pos.y=a}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"width",{get:function(){return this.shape.width}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"height",{get:function(){return this.shape.height}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"bottom",{get:function(){return this.shape.pos.y+this.shape.yw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"right",{get:function(){return this.shape.pos.x+this.shape.xw}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"speed",{get:function(){return Math.sqrt(this.shape.velocity.x*this.shape.velocity.x+this.shape.velocity.y*this.shape.velocity.y)}}),Object.defineProperty(Phaser.Physics.Ninja.Body.prototype,"angle",{get:function(){return Math.atan2(this.shape.velocity.y,this.shape.velocity.x)}}),Phaser.Physics.Ninja.AABB=function(a,b,c,d,e){this.body=a,this.system=a.system,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.oH=0,this.oV=0,this.velocity=new Phaser.Point,this.aabbTileProjections={},this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_FULL]=this.projAABB_Full,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_45DEG]=this.projAABB_45Deg,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONCAVE]=this.projAABB_Concave,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_CONVEX]=this.projAABB_Convex,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGs]=this.projAABB_22DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_22DEGb]=this.projAABB_22DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGs]=this.projAABB_67DegS,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb]=this.projAABB_67DegB,this.aabbTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF]=this.projAABB_Half},Phaser.Physics.Ninja.AABB.prototype.constructor=Phaser.Physics.Ninja.AABB,Phaser.Physics.Ninja.AABB.COL_NONE=0,Phaser.Physics.Ninja.AABB.COL_AXIS=1,Phaser.Physics.Ninja.AABB.COL_OTHER=2,Phaser.Physics.Ninja.AABB.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},reverse:function(){var a=this.pos.x-this.oldpos.x,b=this.pos.y-this.oldpos.y;this.oldpos.xthis.pos.x&&(this.oldpos.x=this.pos.x-a),this.oldpos.ythis.pos.y&&(this.oldpos.y=this.pos.y-b)},reportCollisionVsBody:function(a,b,c,d,e){var f=this.pos.x-this.oldpos.x,g=this.pos.y-this.oldpos.y,h=f*c+g*d;return this.body.immovable&&e.body.immovable?(a*=.5,b*=.5,this.pos.add(a,b),this.oldpos.set(this.pos.x,this.pos.y),e.pos.subtract(a,b),void e.oldpos.set(e.pos.x,e.pos.y)):void(this.body.immovable||e.body.immovable?this.body.immovable?e.body.immovable||(e.pos.subtract(a,b),0>h&&e.reverse()):(this.pos.subtract(a,b),0>h&&this.reverse()):(a*=.5,b*=.5,this.pos.add(a,b),e.pos.subtract(a,b),0>h&&(this.reverse(),e.reverse())))},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideAABBVsAABB:function(a){var b=this.pos,c=a,d=c.pos.x,e=c.pos.y,f=c.xw,g=c.yw,h=b.x-d,i=f+this.xw-Math.abs(h);if(i>0){var j=b.y-e,k=g+this.yw-Math.abs(j);if(k>0){k>i?0>h?(i*=-1,k=0):k=0:0>j?(i=0,k*=-1):i=0;var l=Math.sqrt(i*i+k*k);return this.reportCollisionVsBody(i,k,i/l,k/l,c),Phaser.Physics.Ninja.AABB.COL_AXIS}}return!1},collideAABBVsTile:function(a){var b=this.pos.x-a.pos.x,c=a.xw+this.xw-Math.abs(b);if(c>0){var d=this.pos.y-a.pos.y,e=a.yw+this.yw-Math.abs(d);if(e>0)return e>c?0>b?(c*=-1,e=0):e=0:0>d?(c=0,e*=-1):c=0,this.resolveTile(c,e,this,a)}return!1},resolveTile:function(a,b,c,d){return 0i){e*=-i,f*=-i;var j=Math.sqrt(e*e+f*f),k=Math.sqrt(a*a+b*b);return j>k?(c.reportCollisionVsWorld(a,b,a/k,b/k,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(e,f,d.signx,d.signy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_45Deg:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-d.pos.x,h=c.pos.y-f*c.yw-d.pos.y,i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.y-f*c.yw,h=d.pos.y-g;if(h*f>0){var i=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(0,h,0,h/p,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_22DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegS:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw,h=d.pos.x-g;if(h*e>0){var i=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),j=c.pos.y-f*c.yw-(d.pos.y+f*d.yw),k=d.sx,l=d.sy,m=i*k+j*l;if(0>m){k*=-m,l*=-m;var n=Math.sqrt(k*k+l*l),o=Math.sqrt(a*a+b*b),p=Math.abs(h);return n>o?o>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(a,b,a/o,b/o,d),Phaser.Physics.Ninja.AABB.COL_AXIS):n>p?(c.reportCollisionVsWorld(h,0,h/p,0,d),Phaser.Physics.Ninja.AABB.COL_OTHER):(c.reportCollisionVsWorld(k,l,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_67DegB:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x+e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=d.sx,j=d.sy,k=g*i+h*j;if(0>k){i*=-k,j*=-k;var l=Math.sqrt(i*i+j*j),m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(c.reportCollisionVsWorld(i,j,d.sx,d.sy,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Convex:function(a,b,c,d){var e=d.signx,f=d.signy,g=c.pos.x-e*c.xw-(d.pos.x-e*d.xw),h=c.pos.y-f*c.yw-(d.pos.y-f*d.yw),i=Math.sqrt(g*g+h*h),j=2*d.xw,k=Math.sqrt(j*j+0),l=k-i;if(0>e*g||0>f*h){var m=Math.sqrt(a*a+b*b);return c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS}return l>0?(g/=i,h/=i,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER):Phaser.Physics.Ninja.AABB.COL_NONE},projAABB_Concave:function(a,b,c,d){var e=d.signx,f=d.signy,g=d.pos.x+e*d.xw-(c.pos.x-e*c.xw),h=d.pos.y+f*d.yw-(c.pos.y-f*c.yw),i=2*d.xw,j=Math.sqrt(i*i+0),k=Math.sqrt(g*g+h*h),l=k-j;if(l>0){var m=Math.sqrt(a*a+b*b);return l>m?(c.reportCollisionVsWorld(a,b,a/m,b/m,d),Phaser.Physics.Ninja.AABB.COL_AXIS):(g/=k,h/=k,c.reportCollisionVsWorld(g*l,h*l,g,h,d),Phaser.Physics.Ninja.AABB.COL_OTHER)}return Phaser.Physics.Ninja.AABB.COL_NONE},destroy:function(){this.body=null,this.system=null}},Phaser.Physics.Ninja.Tile=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Phaser.Physics.Ninja.Tile.EMPTY),this.body=a,this.system=a.system,this.id=f,this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.pos=new Phaser.Point(b,c),this.oldpos=new Phaser.Point(b,c),this.id>1&&this.id<30&&(e=d),this.xw=Math.abs(d/2),this.yw=Math.abs(e/2),this.width=d,this.height=e,this.velocity=new Phaser.Point,this.signx=0,this.signy=0,this.sx=0,this.sy=0,this.body.gravityScale=0,this.body.collideWorldBounds=!1,this.id>0&&this.setType(this.id)},Phaser.Physics.Ninja.Tile.prototype.constructor=Phaser.Physics.Ninja.Tile,Phaser.Physics.Ninja.Tile.prototype={integrate:function(){var a=this.pos.x,b=this.pos.y;this.pos.x+=this.body.drag*this.pos.x-this.body.drag*this.oldpos.x,this.pos.y+=this.body.drag*this.pos.y-this.body.drag*this.oldpos.y+this.system.gravity*this.body.gravityScale,this.velocity.set(this.pos.x-a,this.pos.y-b),this.oldpos.set(a,b)},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.xw);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.xw-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.yw);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.yw-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},reportCollisionVsWorld:function(a,b,c,d){var e,f,g,h,i,j=this.pos,k=this.oldpos,l=j.x-k.x,m=j.y-k.y,n=l*c+m*d,o=n*c,p=n*d,q=l-o,r=m-p;0>n?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},setType:function(a){return a===Phaser.Physics.Ninja.Tile.EMPTY?this.clear():(this.id=a,this.updateType()),this},clear:function(){this.id=Phaser.Physics.Ninja.Tile.EMPTY,this.updateType()},destroy:function(){this.body=null,this.system=null},updateType:function(){if(0===this.id)return this.type=Phaser.Physics.Ninja.Tile.TYPE_EMPTY,this.signx=0,this.signy=0,this.sx=0,this.sy=0,!0;if(this.idn?(h=q*this.body.friction,i=r*this.body.friction,e=1+this.body.bounce,f=o*e,g=p*e,1===c?this.body.touching.left=!0:-1===c&&(this.body.touching.right=!0),1===d?this.body.touching.up=!0:-1===d&&(this.body.touching.down=!0)):f=g=h=i=0,j.x+=a,j.y+=b,k.x+=a+f+h,k.y+=b+g+i},collideWorldBounds:function(){var a=this.system.bounds.x-(this.pos.x-this.radius);a>0?this.reportCollisionVsWorld(a,0,1,0,null):(a=this.pos.x+this.radius-this.system.bounds.right,a>0&&this.reportCollisionVsWorld(-a,0,-1,0,null));var b=this.system.bounds.y-(this.pos.y-this.radius);b>0?this.reportCollisionVsWorld(0,b,0,1,null):(b=this.pos.y+this.radius-this.system.bounds.bottom,b>0&&this.reportCollisionVsWorld(0,-b,0,-1,null))},collideCircleVsTile:function(a){var b=this.pos,c=this.radius,d=a,e=d.pos.x,f=d.pos.y,g=d.xw,h=d.yw,i=b.x-e,j=g+c-Math.abs(i);if(j>0){var k=b.y-f,l=h+c-Math.abs(k);if(l>0)return this.oH=0,this.oV=0,-g>i?this.oH=-1:i>g&&(this.oH=1),-h>k?this.oV=-1:k>h&&(this.oV=1),this.resolveCircleTile(j,l,this.oH,this.oV,this,d)}},resolveCircleTile:function(a,b,c,d,e,f){return 0a){var g=e.pos.x-f.pos.x;return 0>g?(e.reportCollisionVsWorld(-a,0,-1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(a,0,1,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}var h=e.pos.y-f.pos.y;return 0>h?(e.reportCollisionVsWorld(0,-b,0,-1,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(0,b,0,1,f),Phaser.Physics.Ninja.Circle.COL_AXIS)}return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS}if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var i=f.pos.x+c*f.xw,j=f.pos.y+d*f.yw,g=e.pos.x-i,h=e.pos.y-j,k=Math.sqrt(g*g+h*h),l=e.radius-k;return l>0?(0===k?(g=c/Math.SQRT2,h=d/Math.SQRT2):(g/=k,h/=k),e.reportCollisionVsWorld(g*l,h*l,g,h,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_45Deg:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.pos.x-j*e.radius-f.pos.x,m=e.pos.y-k*e.radius-f.pos.y,n=l*j+m*k;if(0>n){j*=-n,k*=-n,b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1));var o=Math.sqrt(j*j+k*k);return o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x-h*f.xw),m=e.pos.y-(f.pos.y+d*f.yw),p=l*-k+m*j;if(p*h*i>0){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.pos.x-(f.pos.x+c*f.xw),m=e.pos.y-(f.pos.y-i*f.yw),p=l*-k+m*j;if(0>p*h*i){var q=Math.sqrt(l*l+m*m),r=e.radius-q;if(r>0)return l/=q,m/=q,e.reportCollisionVsWorld(l*r,m*r,l,m,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var n=l*j+m*k,r=e.radius-Math.abs(n);if(r>0)return e.reportCollisionVsWorld(j*r,k*r,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var s=f.pos.x+c*f.xw,t=f.pos.y+d*f.yw,u=e.pos.x-s,v=e.pos.y-t,q=Math.sqrt(u*u+v*v),r=e.radius-q;if(r>0)return 0===q?(u=c/Math.SQRT2,v=d/Math.SQRT2):(u/=q,v/=q),e.reportCollisionVsWorld(u*r,v*r,u,v,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Concave:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c){if(0===d){var j=f.pos.x+h*f.xw-e.pos.x,k=f.pos.y+i*f.yw-e.pos.y,l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=n+e.radius-m;return o>0?(b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)):Phaser.Physics.Ninja.Circle.COL_NONE}if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x-h*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=0,s=d):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=f.pos.x+c*f.xw,q=f.pos.y-i*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c,s=0):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{if(h*c+i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Convex:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),o>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(h*c+i*d>0){var j=e.pos.x-(f.pos.x-h*f.xw),k=e.pos.y-(f.pos.y-i*f.yw),l=2*f.xw,m=Math.sqrt(l*l+0),n=Math.sqrt(j*j+k*k),o=m+e.radius-n;if(o>0)return j/=n,k/=n,e.reportCollisionVsWorld(j*o,k*o,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var p=f.pos.x+c*f.xw,q=f.pos.y+d*f.yw,r=e.pos.x-p,s=e.pos.y-q,n=Math.sqrt(r*r+s*s),o=e.radius-n;if(o>0)return 0===n?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=n,s/=n),e.reportCollisionVsWorld(r*o,s*o,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_Half:function(a,b,c,d,e,f){var g=f.signx,h=f.signy,i=c*g+d*h;if(i>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var j=e.radius,k=e.pos.x-g*j-f.pos.x,l=e.pos.y-h*j-f.pos.y,m=g,n=h,o=k*m+l*n;if(0>o){m*=-o,n*=-o;var p=Math.sqrt(m*m+n*n),q=Math.sqrt(a*a+b*b);return p>q?(e.reportCollisionVsWorld(a,b,a/q,b/q,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(m,n,f.signx,f.signy),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0!==i)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-f.pos.x;if(0>r*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-(f.pos.y+d*f.yw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else if(0===d){if(0!==i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var s=e.pos.y-f.pos.y;if(0>s*h)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var r=e.pos.x-(f.pos.x+c*f.xw),t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=g/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var v=f.pos.x+c*f.xw,w=f.pos.y+d*f.yw,r=e.pos.x-v,s=e.pos.y-w,t=Math.sqrt(r*r+s*s),u=e.radius-t;if(u>0)return 0===t?(r=c/Math.SQRT2,s=d/Math.SQRT2):(r/=t,s/=t),e.reportCollisionVsWorld(r*u,s*u,r,s,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegS:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(i*d>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c){if(0!==d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-f.pos.y,o=m*-k+n*j;if(o*h*i>0){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0===d)if(0>h*c){var t=f.pos.x-h*f.xw,u=f.pos.y,v=e.pos.x-t,w=e.pos.y-u;if(0>w*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x+c*f.xw),n=e.pos.y-(f.pos.y-i*f.yw),o=m*-k+n*j;if(0>o*h*i){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_22DegB:function(a,b,c,d,e,f){var g,h=f.signx,i=f.signy;if(0===c)if(0===d){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(g=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(g=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>g?(e.reportCollisionVsWorld(a,b,a/g,b/g,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>i*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-h*f.xw),n=e.pos.y-(f.pos.y+i*f.yw),q=m*-k+n*j;if(q*h*i>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>h*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-(f.pos.x+h*f.xw),n=e.pos.y-f.pos.y;if(0>n*i)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(0>q*h*i){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(h*c+i*d>0){var t=Math.sqrt(5),j=1*h/t,k=2*i/t,l=e.radius,m=e.pos.x-j*l-(f.pos.x-h*f.xw),n=e.pos.y-k*l-(f.pos.y+i*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegS:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(g*c>0)return Phaser.Physics.Ninja.Circle.COL_NONE;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y-h*f.yw),o=m*-k+n*j;if(0>o*g*h){var p=Math.sqrt(m*m+n*n),q=l-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{m-=l*j,n-=l*k;var r=m*j+n*k;if(0>r){j*=-r,k*=-r;var s=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),s>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}}else if(0>h*d){var t=f.pos.x,u=f.pos.y-h*f.yw,v=e.pos.x-t,w=e.pos.y-u;if(0>v*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var j=f.sx,k=f.sy,m=e.pos.x-(f.pos.x-g*f.xw),n=e.pos.y-(f.pos.y+d*f.yw),o=m*-k+n*j;if(o*g*h>0){var p=Math.sqrt(m*m+n*n),q=e.radius-p;if(q>0)return m/=p,n/=p,e.reportCollisionVsWorld(m*q,n*q,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var r=m*j+n*k,q=e.radius-Math.abs(r);if(q>0)return e.reportCollisionVsWorld(j*q,k*q,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(0===d)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=f.pos.x+c*f.xw,u=f.pos.y+d*f.yw,v=e.pos.x-t,w=e.pos.y-u,p=Math.sqrt(v*v+w*w),q=e.radius-p;if(q>0)return 0===p?(v=c/Math.SQRT2,w=d/Math.SQRT2):(v/=p,w/=p),e.reportCollisionVsWorld(v*q,w*q,v,w,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},projCircle_67DegB:function(a,b,c,d,e,f){var g=f.signx,h=f.signy;if(0===c)if(0===d){var i,j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;if(0>o){j*=-o,k*=-o;var p=Math.sqrt(j*j+k*k);return b>a?(i=a,b=0,e.pos.x-f.pos.x<0&&(a*=-1)):(i=b,a=0,e.pos.y-f.pos.y<0&&(b*=-1)),p>i?(e.reportCollisionVsWorld(a,b,a/i,b/i,f),Phaser.Physics.Ninja.Circle.COL_AXIS):(e.reportCollisionVsWorld(j,k,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER)}}else{if(0>h*d)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var m=e.pos.x-f.pos.x,n=e.pos.y-(f.pos.y+h*f.yw);if(0>m*g)return e.reportCollisionVsWorld(0,b*d,0,d,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var j=f.sx,k=f.sy,q=m*-k+n*j;if(q*g*h>0){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,j,k,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else if(0===d){if(0>g*c)return e.reportCollisionVsWorld(a*c,0,c,0,f),Phaser.Physics.Ninja.Circle.COL_AXIS;var t=Math.sqrt(5),j=2*g/t,k=1*h/t,m=e.pos.x-(f.pos.x+g*f.xw),n=e.pos.y-(f.pos.y-h*f.yw),q=m*-k+n*j;if(0>q*g*h){var r=Math.sqrt(m*m+n*n),s=e.radius-r;if(s>0)return m/=r,n/=r,e.reportCollisionVsWorld(m*s,n*s,m,n,f),Phaser.Physics.Ninja.Circle.COL_OTHER}else{var o=m*j+n*k,s=e.radius-Math.abs(o);if(s>0)return e.reportCollisionVsWorld(j*s,k*s,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER}}else{if(g*c+h*d>0){var j=f.sx,k=f.sy,l=e.radius,m=e.pos.x-j*l-(f.pos.x+g*f.xw),n=e.pos.y-k*l-(f.pos.y-h*f.yw),o=m*j+n*k;return 0>o?(e.reportCollisionVsWorld(-j*o,-k*o,f.sx,f.sy,f),Phaser.Physics.Ninja.Circle.COL_OTHER):Phaser.Physics.Ninja.Circle.COL_NONE}var u=f.pos.x+c*f.xw,v=f.pos.y+d*f.yw,w=e.pos.x-u,x=e.pos.y-v,r=Math.sqrt(w*w+x*x),s=e.radius-r;if(s>0)return 0===r?(w=c/Math.SQRT2,x=d/Math.SQRT2):(w/=r,x/=r),e.reportCollisionVsWorld(w*s,x*s,w,x,f),Phaser.Physics.Ninja.Circle.COL_OTHER}return Phaser.Physics.Ninja.Circle.COL_NONE},destroy:function(){this.body=null,this.system=null}},!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define("p2",function(){return this.p2=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;g0&&(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=d)},{}],3:[function(a,b){function c(){}var d=a("./Scalar");b.exports=c,c.lineInt=function(a,b,c){c=c||0;var e,f,g,h,i,j,k,l=[0,0];return e=a[1][1]-a[0][1],f=a[0][0]-a[1][0],g=e*a[0][0]+f*a[0][1],h=b[1][1]-b[0][1],i=b[0][0]-b[1][0],j=h*b[0][0]+i*b[0][1],k=e*i-h*f,d.eq(k,0,c)||(l[0]=(i*g-f*j)/k,l[1]=(e*j-h*g)/k),l},c.segmentsIntersect=function(a,b,c,d){var e=b[0]-a[0],f=b[1]-a[1],g=d[0]-c[0],h=d[1]-c[1];if(g*f-h*e==0)return!1;var i=(e*(c[1]-a[1])+f*(a[0]-c[0]))/(g*f-h*e),j=(g*(a[1]-c[1])+h*(c[0]-a[0]))/(h*e-g*f);return i>=0&&1>=i&&j>=0&&1>=j}},{"./Scalar":6}],4:[function(a,b){function c(){}b.exports=c,c.area=function(a,b,c){return(b[0]-a[0])*(c[1]-a[1])-(c[0]-a[0])*(b[1]-a[1])},c.left=function(a,b,d){return c.area(a,b,d)>0},c.leftOn=function(a,b,d){return c.area(a,b,d)>=0},c.right=function(a,b,d){return c.area(a,b,d)<0},c.rightOn=function(a,b,d){return c.area(a,b,d)<=0};var d=[],e=[];c.collinear=function(a,b,f,g){if(g){var h=d,i=e;h[0]=b[0]-a[0],h[1]=b[1]-a[1],i[0]=f[0]-b[0],i[1]=f[1]-b[1];var j=h[0]*i[0]+h[1]*i[1],k=Math.sqrt(h[0]*h[0]+h[1]*h[1]),l=Math.sqrt(i[0]*i[0]+i[1]*i[1]),m=Math.acos(j/(k*l));return g>m}return 0==c.area(a,b,f)},c.sqdist=function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return c*c+d*d}},{}],5:[function(a,b){function c(){this.vertices=[]}function d(a,b,c,d,e){e=e||0;var f=b[1]-a[1],h=a[0]-b[0],i=f*a[0]+h*a[1],j=d[1]-c[1],k=c[0]-d[0],l=j*c[0]+k*c[1],m=f*k-j*h;return g.eq(m,0,e)?[0,0]:[(k*i-h*l)/m,(f*l-j*i)/m]}var e=a("./Line"),f=a("./Point"),g=a("./Scalar");b.exports=c,c.prototype.at=function(a){var b=this.vertices,c=b.length;return b[0>a?a%c+c:a%c]},c.prototype.first=function(){return this.vertices[0]},c.prototype.last=function(){return this.vertices[this.vertices.length-1]},c.prototype.clear=function(){this.vertices.length=0},c.prototype.append=function(a,b,c){if("undefined"==typeof b)throw new Error("From is not given!");if("undefined"==typeof c)throw new Error("To is not given!");if(b>c-1)throw new Error("lol1");if(c>a.vertices.length)throw new Error("lol2");if(0>b)throw new Error("lol3");for(var d=b;c>d;d++)this.vertices.push(a.vertices[d])},c.prototype.makeCCW=function(){for(var a=0,b=this.vertices,c=1;cb[a][0])&&(a=c);f.left(this.at(a-1),this.at(a),this.at(a+1))||this.reverse()},c.prototype.reverse=function(){for(var a=[],b=0,c=this.vertices.length;b!==c;b++)a.push(this.vertices.pop());this.vertices=a},c.prototype.isReflex=function(a){return f.right(this.at(a-1),this.at(a),this.at(a+1))};var h=[],i=[];c.prototype.canSee=function(a,b){var c,d,g=h,j=i;if(f.leftOn(this.at(a+1),this.at(a),this.at(b))&&f.rightOn(this.at(a-1),this.at(a),this.at(b)))return!1;d=f.sqdist(this.at(a),this.at(b));for(var k=0;k!==this.vertices.length;++k)if((k+1)%this.vertices.length!==a&&k!==a&&f.leftOn(this.at(a),this.at(b),this.at(k+1))&&f.rightOn(this.at(a),this.at(b),this.at(k))&&(g[0]=this.at(a),g[1]=this.at(b),j[0]=this.at(k),j[1]=this.at(k+1),c=e.lineInt(g,j),f.sqdist(this.at(a),c)a)for(var f=a;b>=f;f++)e.vertices.push(this.vertices[f]);else{for(var f=0;b>=f;f++)e.vertices.push(this.vertices[f]);for(var f=a;f0?this.slice(a):[this]},c.prototype.slice=function(a){if(0==a.length)return[this];if(a instanceof Array&&a.length&&a[0]instanceof Array&&2==a[0].length&&a[0][0]instanceof Array){for(var b=[this],c=0;cc;c++)if(e.segmentsIntersect(a[b],a[b+1],a[c],a[c+1]))return!1;for(var b=1;bh)return console.warn("quickDecomp: max level ("+h+") reached."),a;for(var x=0;xo&&(n=o,k=l,r=y))),f.left(v.at(x+1),v.at(x),v.at(y+1))&&f.rightOn(v.at(x+1),v.at(x),v.at(y))&&(l=d(v.at(x+1),v.at(x),v.at(y),v.at(y+1)),f.left(v.at(x-1),v.at(x),l)&&(o=f.sqdist(v.vertices[x],l),m>o&&(m=o,j=l,q=y)));if(r==(q+1)%this.vertices.length)l[0]=(k[0]+j[0])/2,l[1]=(k[1]+j[1])/2,e.push(l),q>x?(t.append(v,x,q+1),t.vertices.push(l),u.vertices.push(l),0!=r&&u.append(v,r,v.vertices.length),u.append(v,0,x+1)):(0!=x&&t.append(v,x,v.vertices.length),t.append(v,0,q+1),t.vertices.push(l),u.vertices.push(l),u.append(v,r,x+1));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.length3&&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}],6:[function(a,b){function c(){}b.exports=c,c.eq=function(a,b,c){return c=c||0,Math.abs(a-b) (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:{jshint:"latest",nodeunit:"latest",grunt:"~0.4.0","grunt-contrib-jshint":"~0.1.1","grunt-contrib-nodeunit":"~0.1.2","grunt-contrib-concat":"~0.1.3","grunt-contrib-uglify":"*","grunt-browserify":"*",browserify:"*"},dependencies:{underscore:"*","poly-decomp":"git://github.com/schteppe/poly-decomp.js","gl-matrix":"2.0.0",jsonschema:"*"}}},{}],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("../math/vec2");a("../utils/Utils")}b.exports=c;var e=d.create();c.prototype.setFromPoints=function(a,b,c){var f=this.lowerBound,g=this.upperBound;d.set(f,Number.MAX_VALUE,Number.MAX_VALUE),d.set(g,-Number.MAX_VALUE,-Number.MAX_VALUE);for(var h=0;hj;j++)i[j]>g[j]&&(g[j]=i[j]),i[j]b;b++)a.lowerBound[b]this.upperBound[b]&&(this.upperBound[b]=a.upperBound[b])},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":33,"../utils/Utils":50}],10:[function(a,b){function c(a){this.type=a,this.result=[],this.world=null}var d=a("../math/vec2"),e=a("../objects/Body");b.exports=c,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.aabbNeedsUpdate&&a.updateAABB(),b.aabbNeedsUpdate&&b.updateAABB(),a.aabb.overlaps(b.aabb)},c.canCollide=function(a,b){return a.motionState==e.STATIC&&b.motionState==e.STATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.STATIC||a.motionState==e.STATIC&&b.motionState==e.KINEMATIC?!1:a.motionState==e.KINEMATIC&&b.motionState==e.KINEMATIC?!1:a.sleepState==e.SLEEPING&&b.sleepState==e.SLEEPING?!1:!0},c.NAIVE=1,c.SAP=2},{"../math/vec2":33,"../objects/Body":34}],11:[function(a,b){function d(a,b,c,d,e,f){h.apply(this),e=e||10,f=f||10,this.binsizeX=(b-a)/e,this.binsizeY=(d-c)/f,this.nx=e,this.ny=f,this.xmin=a,this.ymin=c,this.xmax=b,this.ymax=d}{var e=a("../shapes/Circle"),f=a("../shapes/Plane"),g=a("../shapes/Particle"),h=a("../collision/Broadphase");a("../math/vec2")}b.exports=d,d.prototype=new h,d.prototype.getBinIndex=function(a,b){var c=this.nx,d=this.ny,e=this.xmin,f=this.ymin,g=this.xmax,h=this.ymax,i=Math.floor(c*(a-e)/(g-e)),j=Math.floor(d*(b-f)/(h-f));return i*d+j},d.prototype.getCollisionPairs=function(a){for(var b=[],d=a.bodies,i=i=d.length,j=this.binsizeX,k=this.binsizeY,l=[],m=nx*ny,n=0;m>n;n++)l.push([]);for(var o=nx/(xmax-xmin),p=ny/(ymax-ymin),n=0;n!==i;n++){var q=d[n],r=q.shape;if(void 0!==r)if(r instanceof e)for(var s=q.position[0],t=q.position[1],u=r.radius,v=Math.floor(o*(s-u-xmin)),w=Math.floor(p*(t-u-ymin)),x=Math.floor(o*(s+u-xmin)),y=Math.floor(p*(t+u-ymin)),z=v;x>=z;z++)for(var A=w;y>=A;A++){var B=z,C=A;B*(ny-1)+C>=0&&m>B*(ny-1)+C&&l[B*(ny-1)+C].push(q)}else{if(!(r instanceof f))throw new Error("Shape not supported in GridBroadphase!");if(0==q.angle)for(var t=q.position[1],z=0;z!==m&&t>ymin+k*(z-1);z++)for(var A=0;nx>A;A++){var B=A,C=Math.floor(p*(k*z-ymin));l[B*(ny-1)+C].push(q)}else if(q.angle==.5*Math.PI)for(var s=q.position[0],z=0;z!==m&&s>xmin+j*(z-1);z++)for(var A=0;ny>A;A++){var C=A,B=Math.floor(o*(j*z-xmin));l[B*(ny-1)+C].push(q)}else for(var z=0;z!==m;z++)l[z].push(q)}}for(var n=0;n!==m;n++)for(var D=l[n],z=0,E=D.length;z!==E;z++)for(var q=D[z],r=q.shape,A=0;A!==z;A++){var F=D[A],G=F.shape; +r instanceof e?G instanceof e?c=h.circleCircle(q,F):G instanceof g?c=h.circleParticle(q,F):G instanceof f&&(c=h.circlePlane(q,F)):r instanceof g?G instanceof e&&(c=h.circleParticle(F,q)):r instanceof f&&G instanceof e&&(c=h.circlePlane(F,q))}return b}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43}],12:[function(a,b){function c(){d.call(this,d.NAIVE),this.useBoundingBoxes=!1}{var d=(a("../shapes/Circle"),a("../shapes/Plane"),a("../shapes/Shape"),a("../shapes/Particle"),a("../collision/Broadphase"));a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.getCollisionPairs=function(a){var b,c,e,f,g=a.bodies,h=this.result,i=this.useBoundingBoxes?d.aabbCheck:d.boundingRadiusCheck;for(h.length=0,b=0,Ncolliding=g.length;b!==Ncolliding;b++)for(e=g[b],c=0;b>c;c++)f=g[c],d.canCollide(e,f)&&i(e,f)&&h.push(e,f);return h}},{"../collision/Broadphase":10,"../math/vec2":33,"../shapes/Circle":38,"../shapes/Particle":42,"../shapes/Plane":43,"../shapes/Shape":45}],13:[function(a,b){function c(){this.contactEquations=[],this.frictionEquations=[],this.enableFriction=!0,this.slipForce=10,this.frictionCoefficient=.3,this.surfaceVelocity=0,this.reuseObjects=!0,this.reusableContactEquations=[],this.reusableFrictionEquations=[],this.restitution=0,this.stiffness=1e7,this.relaxation=3,this.frictionStiffness=1e7,this.frictionRelaxation=3,this.collidingBodiesLastStep={keys:[]}}function d(a){for(var b=0,c=a.keys.length;c>b;b++)delete a[a.keys[b]];a.keys.length=0}function e(a,b){g.set(a.vertices[0],.5*-b.length,-b.radius),g.set(a.vertices[1],.5*b.length,-b.radius),g.set(a.vertices[2],.5*b.length,b.radius),g.set(a.vertices[3],.5*-b.length,b.radius)}function f(a,b,c,d){for(var e=Q,f=R,j=S,k=T,l=a,m=b.vertices,n=null,o=0;o!==m.length+1;o++){var p=m[o%m.length],q=m[(o+1)%m.length];g.rotate(e,p,d),g.rotate(f,q,d),i(e,e,c),i(f,f,c),h(j,e,l),h(k,f,l);var r=g.crossLength(j,k);if(null===n&&(n=r),0>=r*n)return!1;n=r}return!0}var g=a("../math/vec2"),h=g.sub,i=g.add,j=g.dot,k=a("../utils/Utils"),l=a("../equations/ContactEquation"),m=a("../equations/FrictionEquation"),n=a("../shapes/Circle"),o=a("../shapes/Shape"),p=a("../objects/Body"),q=a("../shapes/Rectangle");b.exports=c;var r=g.fromValues(0,1),s=g.fromValues(0,0),t=g.fromValues(0,0),u=g.fromValues(0,0),v=g.fromValues(0,0),w=g.fromValues(0,0),x=g.fromValues(0,0),y=g.fromValues(0,0),z=g.fromValues(0,0),A=g.fromValues(0,0),B=g.fromValues(0,0),C=g.fromValues(0,0),D=g.fromValues(0,0),E=g.fromValues(0,0),F=g.fromValues(0,0),G=g.fromValues(0,0),H=g.fromValues(0,0),I=g.fromValues(0,0),J=g.fromValues(0,0),K=[];c.prototype.collidedLastStep=function(a,b){var c=a.id,d=b.id;if(c>d){var e=c;c=d,d=e}return!!this.collidingBodiesLastStep[c+" "+d]},c.prototype.reset=function(){d(this.collidingBodiesLastStep);for(var a=0;a!==this.contactEquations.length;a++){var b=this.contactEquations[a],c=b.bi.id,e=b.bj.id;if(c>e){var f=c;c=e,e=f}var g=c+" "+e;this.collidingBodiesLastStep[g]||(this.collidingBodiesLastStep[g]=!0,this.collidingBodiesLastStep.keys.push(g))}if(this.reuseObjects){var h=this.contactEquations,i=this.frictionEquations,j=this.reusableFrictionEquations,l=this.reusableContactEquations;k.appendArray(l,h),k.appendArray(j,i)}this.contactEquations.length=this.frictionEquations.length=0},c.prototype.createContactEquation=function(a,b,c,d){var e=this.reusableContactEquations.length?this.reusableContactEquations.pop():new l(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.restitution=this.restitution,e.firstImpact=!this.collidedLastStep(a,b),e.stiffness=this.stiffness,e.relaxation=this.relaxation,e.enabled=!0,a.allowSleep&&a.motionState==p.DYNAMIC&&b.motionState!=p.STATIC&&b.sleepState!==p.SLEEPY&&a.wakeUp(),b.allowSleep&&b.motionState==p.DYNAMIC&&a.motionState!=p.STATIC&&a.sleepState!==p.SLEEPY&&b.wakeUp(),e},c.prototype.createFrictionEquation=function(a,b,c,d){var e=this.reusableFrictionEquations.length?this.reusableFrictionEquations.pop():new m(a,b);return e.bi=a,e.bj=b,e.shapeA=c,e.shapeB=d,e.setSlipForce(this.slipForce),e.frictionCoefficient=this.frictionCoefficient,e.relativeVelocity=this.surfaceVelocity,e.enabled=!0,e.frictionStiffness=this.frictionStiffness,e.frictionRelaxation=this.frictionRelaxation,e},c.prototype.createFrictionFromContact=function(a){var b=this.createFrictionEquation(a.bi,a.bj,a.shapeA,a.shapeB);return g.copy(b.ri,a.ri),g.copy(b.rj,a.rj),g.rotate(b.t,a.ni,-Math.PI/2),b.contactEquation=a,b},c.prototype[o.LINE|o.CONVEX]=c.prototype.convexLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.LINE|o.RECTANGLE]=c.prototype.lineRectangle=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var L=new q(1,1),M=g.create();c.prototype[o.CAPSULE|o.CONVEX]=c.prototype[o.CAPSULE|o.RECTANGLE]=c.prototype.convexCapsule=function(a,b,c,d,f,h,i,j,k){var l=M;g.set(l,h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var m=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);g.set(l,-h.length/2,0),g.rotate(l,l,j),g.add(l,l,i);var n=this.circleConvex(f,h,l,j,a,b,c,d,k,h.radius);if(k&&(m||n))return!0;var o=L;e(o,h);var p=this.convexConvex(a,b,c,d,f,o,i,j,k);return p+m+n},c.prototype[o.CAPSULE|o.LINE]=c.prototype.lineCapsule=function(a,b,c,d,e,f,g,h,i){return i?!1:0};var N=g.create(),O=g.create(),P=new q(1,1);c.prototype[o.CAPSULE|o.CAPSULE]=c.prototype.capsuleCapsule=function(a,b,c,d,f,h,i,j,k){for(var l=N,m=O,n=0,o=0;2>o;o++){g.set(l,(0==o?-1:1)*b.length/2,0),g.rotate(l,l,d),g.add(l,l,c);for(var p=0;2>p;p++){g.set(m,(0==p?-1:1)*h.length/2,0),g.rotate(m,m,j),g.add(m,m,i);var q=this.circleCircle(a,b,l,d,f,h,m,j,k,b.radius,h.radius);if(k&&q)return!0;n+=q}}var r=P;e(r,b);var s=this.convexCapsule(a,r,c,d,f,h,i,j,k);if(k&&s)return!0;n+=s,e(r,h);var t=this.convexCapsule(f,r,i,j,a,b,c,d,k);return k&&t?!0:n+=t},c.prototype[o.LINE|o.LINE]=c.prototype.lineLine=function(a,b,c,d,e,f,g,h,i){return i?!1:0},c.prototype[o.PLANE|o.LINE]=c.prototype.planeLine=function(a,b,c,d,e,f,k,l,m){var n=s,o=t,p=u,q=v,B=w,C=x,D=y,E=z,F=A,G=K;numContacts=0,g.set(n,-f.length/2,0),g.set(o,f.length/2,0),g.rotate(p,n,l),g.rotate(q,o,l),i(p,p,k),i(q,q,k),g.copy(n,p),g.copy(o,q),h(B,o,n),g.normalize(C,B),g.rotate(F,C,-Math.PI/2),g.rotate(E,r,d),G[0]=n,G[1]=o;for(var H=0;HJ){if(m)return!0;var L=this.createContactEquation(a,e,b,f);numContacts++,g.copy(L.ni,E),g.normalize(L.ni,L.ni),g.scale(D,E,J),h(L.ri,I,D),h(L.ri,L.ri,a.position),h(L.rj,I,k),i(L.rj,L.rj,k),h(L.rj,L.rj,e.position),this.contactEquations.push(L),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(L))}}return numContacts},c.prototype[o.PARTICLE|o.CAPSULE]=c.prototype.particleCapsule=function(a,b,c,d,e,f,g,h,i){return this.circleLine(a,b,c,d,e,f,g,h,i,f.radius,0)},c.prototype[o.CIRCLE|o.LINE]=c.prototype.circleLine=function(a,b,c,d,e,f,k,l,m,n,o){var p=f,q=l,r=e,G=k,H=c,I=a,J=b,n=n||0,o="undefined"!=typeof o?o:J.radius,L=s,M=t,N=u,O=v,P=w,Q=x,R=y,S=z,T=A,U=B,V=C,W=D,X=E,Y=F,Z=K;g.set(S,-p.length/2,0),g.set(T,p.length/2,0),g.rotate(U,S,q),g.rotate(V,T,q),i(U,U,G),i(V,V,G),g.copy(S,U),g.copy(T,V),h(Q,T,S),g.normalize(R,Q),g.rotate(P,R,-Math.PI/2),h(W,H,S);var $=j(W,P);if(h(O,S,G),h(X,H,G),Math.abs($)ab&&bb>_){if(m)return!0;var cb=this.createContactEquation(I,r,b,f);return g.scale(cb.ni,L,-1),g.normalize(cb.ni,cb.ni),g.scale(cb.ri,cb.ni,o),i(cb.ri,cb.ri,H),h(cb.ri,cb.ri,I.position),h(cb.rj,N,G),i(cb.rj,cb.rj,G),h(cb.rj,cb.rj,r.position),this.contactEquations.push(cb),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(cb)),1}}Z[0]=S,Z[1]=T;for(var db=0;dbW&&(g.copy(Q,O),S=W,g.scale(N,K,W),g.add(N,N,O),R=!0)}}if(R){if(m)return!0;var X=this.createContactEquation(y,q,b,j);return g.sub(X.ni,Q,x),g.normalize(X.ni,X.ni),g.scale(X.ri,X.ni,n),i(X.ri,X.ri,x),h(X.ri,X.ri,y.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}if(n>0)for(var T=0;TW&&(Q=W,g.scale(N,H,W),g.add(N,N,z),g.copy(P,H),R=!0)}if(R){var X=this.createContactEquation(A,q,b,k);return g.scale(X.ni,P,-1),g.normalize(X.ni,X.ni),g.set(X.ri,0,0),i(X.ri,X.ri,z),h(X.ri,X.ri,A.position),h(X.rj,N,r),i(X.rj,X.rj,r),h(X.rj,X.rj,q.position),this.contactEquations.push(X),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(X)),1}return 0},c.prototype[o.CIRCLE]=c.prototype.circleCircle=function(a,b,c,d,e,f,j,k,l,m,n){var o=a,p=b,q=c,r=e,t=f,u=j,v=s,m=m||p.radius,n=n||t.radius;h(v,c,j);var w=m+n;if(g.squaredLength(v)>w*w)return 0;if(l)return!0;var x=this.createContactEquation(o,r,b,f);return h(x.ni,u,q),g.normalize(x.ni,x.ni),g.scale(x.ri,x.ni,m),g.scale(x.rj,x.ni,-n),i(x.ri,x.ri,q),h(x.ri,x.ri,o.position),i(x.rj,x.rj,u),h(x.rj,x.rj,r.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.PLANE|o.CONVEX]=c.prototype[o.PLANE|o.RECTANGLE]=c.prototype.planeConvex=function(a,b,c,d,e,f,k,l,m){var n=e,o=k,p=f,q=l,v=a,w=b,x=c,y=d,z=s,A=t,B=u,C=0;g.rotate(A,r,y);for(var D=0;D=2)break}}return C},c.prototype.convexPlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.convexPlane is deprecated. Use planeConvex instead!"),this.planeConvex(e,f,g,h,a,b,c,d,i)},c.prototype[o.PARTICLE|o.PLANE]=c.prototype.particlePlane=function(a,b,c,d,e,f,i,k,l){var m=a,n=c,o=e,p=i,q=k,u=s,v=t;q=q||0,h(u,n,p),g.rotate(v,r,q);var w=j(u,v);if(w>0)return 0;if(l)return!0;var x=this.createContactEquation(o,m,f,b);return g.copy(x.ni,v),g.scale(u,x.ni,w),h(x.ri,n,u),h(x.ri,x.ri,o.position),h(x.rj,n,m.position),this.contactEquations.push(x),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(x)),1},c.prototype[o.CIRCLE|o.PARTICLE]=c.prototype.circleParticle=function(a,b,c,d,e,f,j,k,l){var m=a,n=b,o=c,p=e,q=j,r=s;if(h(r,q,o),g.squaredLength(r)>n.radius*n.radius)return 0;if(l)return!0;var t=this.createContactEquation(m,p,b,f);return g.copy(t.ni,r),g.normalize(t.ni,t.ni),g.scale(t.ri,t.ni,n.radius),i(t.ri,t.ri,o),h(t.ri,t.ri,m.position),h(t.rj,q,p.position),this.contactEquations.push(t),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(t)),1};{var U=new n(1),V=g.create(),W=g.create();g.create()}c.prototype[o.PLANE|o.CAPSULE]=c.prototype.planeCapsule=function(a,b,c,d,e,f,h,j,k){var l=V,m=W,n=U;g.set(l,-f.length/2,0),g.rotate(l,l,j),i(l,l,h),g.set(m,f.length/2,0),g.rotate(m,m,j),i(m,m,h),n.radius=f.radius;var o=this.circlePlane(e,n,l,0,a,b,c,d,k),p=this.circlePlane(e,n,m,0,a,b,c,d,k);return k?o||p:o+p},c.prototype.capsulePlane=function(a,b,c,d,e,f,g,h,i){return console.warn("Narrowphase.prototype.capsulePlane() is deprecated. Use .planeCapsule() instead!"),this.planeCapsule(e,f,g,h,a,b,c,d,i)},c.prototype[o.CIRCLE|o.PLANE]=c.prototype.circlePlane=function(a,b,c,d,e,f,k,l,m){var n=a,o=b,p=c,q=e,v=k,w=l;w=w||0;var x=s,y=t,z=u;h(x,p,v),g.rotate(y,r,w);var A=j(y,x);if(A>o.radius)return 0;if(m)return!0;var B=this.createContactEquation(q,n,f,b);return g.copy(B.ni,y),g.scale(B.rj,B.ni,-o.radius),i(B.rj,B.rj,p),h(B.rj,B.rj,n.position),g.scale(z,B.ni,A),h(B.ri,x,z),i(B.ri,B.ri,v),h(B.ri,B.ri,q.position),this.contactEquations.push(B),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(B)),1},c.convexPrecision=1e-10,c.prototype[o.CONVEX]=c.prototype[o.CONVEX|o.RECTANGLE]=c.prototype[o.RECTANGLE]=c.prototype.convexConvex=function(a,b,d,e,f,k,l,m,n,o){var p=s,q=t,r=u,x=v,B=w,C=y,D=z,E=A,F=0,o=o||c.convexPrecision,G=c.findSeparatingAxis(b,d,e,k,l,m,p);if(!G)return 0;h(D,l,d),j(p,D)>0&&g.scale(p,p,-1);var H=c.getClosestEdge(b,e,p,!0),I=c.getClosestEdge(k,m,p);if(-1==H||-1==I)return 0;for(var J=0;2>J;J++){var K=H,L=I,M=b,N=k,O=d,P=l,Q=e,R=m,S=a,T=f;if(0==J){var U;U=K,K=L,L=U,U=M,M=N,N=U,U=O,O=P,P=U,U=Q,Q=R,R=U,U=S,S=T,T=U}for(var V=L;L+2>V;V++){var W=N.vertices[(V+N.vertices.length)%N.vertices.length];g.rotate(q,W,R),i(q,q,P);for(var X=0,Y=K-1;K+2>Y;Y++){var Z=M.vertices[(Y+M.vertices.length)%M.vertices.length],$=M.vertices[(Y+1+M.vertices.length)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(E,B,-Math.PI/2),g.normalize(E,E),h(D,q,r);var _=j(E,D);o>=_&&X++}if(3==X){if(n)return!0;var ab=this.createContactEquation(S,T,M,N);F++;var Z=M.vertices[K%M.vertices.length],$=M.vertices[(K+1)%M.vertices.length];g.rotate(r,Z,Q),g.rotate(x,$,Q),i(r,r,O),i(x,x,O),h(B,x,r),g.rotate(ab.ni,B,-Math.PI/2),g.normalize(ab.ni,ab.ni),h(D,q,r);var _=j(ab.ni,D);g.scale(C,ab.ni,_),h(ab.ri,q,O),h(ab.ri,ab.ri,C),i(ab.ri,ab.ri,O),h(ab.ri,ab.ri,S.position),h(ab.rj,q,P),i(ab.rj,ab.rj,P),h(ab.rj,ab.rj,T.position),this.contactEquations.push(ab),this.enableFriction&&this.frictionEquations.push(this.createFrictionFromContact(ab))}}}return F};var X=g.fromValues(0,0);c.projectConvexOntoAxis=function(a,b,c,d,e){var f,h,i=null,k=null,l=X;g.rotate(l,d,-c);for(var m=0;mi)&&(i=h),(null===k||k>h)&&(k=h);if(k>i){var n=k;k=i,i=n}var o=j(b,d);g.set(e,k+o,i+o)};var Y=g.fromValues(0,0),Z=g.fromValues(0,0),$=g.fromValues(0,0),_=g.fromValues(0,0),ab=g.fromValues(0,0),bb=g.fromValues(0,0);c.findSeparatingAxis=function(a,b,d,e,f,i,j){for(var k=null,l=!1,m=!1,n=Y,o=Z,p=$,q=_,r=ab,s=bb,t=0;2!==t;t++){var u=a,v=d;1===t&&(u=e,v=i);for(var w=0;w!==u.vertices.length;w++){g.rotate(o,u.vertices[w],v),g.rotate(p,u.vertices[(w+1)%u.vertices.length],v),h(n,p,o),g.rotate(q,n,-Math.PI/2),g.normalize(q,q),c.projectConvexOntoAxis(a,b,d,q,r),c.projectConvexOntoAxis(e,f,i,q,s);var x=r,y=s,z=!1;r[0]>s[0]&&(y=r,x=s,z=!0);var A=y[0]-x[1];l=0>A,(null===k||A>k)&&(g.copy(j,q),k=A,m=l)}}return m};var cb=g.fromValues(0,0),db=g.fromValues(0,0),eb=g.fromValues(0,0);c.getClosestEdge=function(a,b,c,d){var e=cb,f=db,i=eb;g.rotate(e,c,-b),d&&g.scale(e,e,-1);for(var k=-1,l=a.vertices.length,m=Math.PI/2,n=0;n!==l;n++){h(f,a.vertices[(n+1)%l],a.vertices[n%l]),g.rotate(i,f,-m),g.normalize(i,i);var o=j(i,e);(-1==k||o>maxDot)&&(k=n%l,maxDot=o)}return k};var fb=g.create(),gb=g.create(),hb=g.create(),ib=g.create(),jb=g.create(),kb=g.create(),lb=g.create();c.prototype[o.CIRCLE|o.HEIGHTFIELD]=c.prototype.circleHeightfield=function(a,b,c,d,e,f,j,k,l,m){var n=f.data,m=m||b.radius,o=f.elementWidth,p=gb,q=fb,r=jb,s=lb,t=kb,u=hb,v=ib,w=Math.floor((c[0]-m-j[0])/o),x=Math.ceil((c[0]+m-j[0])/o);0>w&&(w=0),x>=n.length&&(x=n.length-1);for(var y=n[w],z=n[x],A=w;x>A;A++)n[A]y&&(y=n[A]);if(c[1]-m>y)return l?!1:0;c[1]+mA;A++){g.set(u,A*o,n[A]),g.set(v,(A+1)*o,n[A+1]),g.add(u,u,j),g.add(v,v,j),g.sub(t,v,u),g.rotate(t,t,Math.PI/2),g.normalize(t,t),g.scale(q,t,-m),g.add(q,q,c),g.sub(p,q,u);var D=g.dot(p,t);if(q[0]>=u[0]&&q[0]=D&&(C===!1||Math.abs(D)0)for(var A=w;x>=A;A++)if(g.set(u,A*o,n[A]),g.add(u,u,j),g.sub(p,c,u),g.squaredLength(p)c;c++)this.root.insert(a[c]);else this.root.insert(a)},c.prototype.clear=function(){this.root.clear()},c.prototype.retrieve=function(a){var b=this.root.retrieve(a).slice(0);return b},c.prototype.getCollisionPairs=function(a){var b=[];this.insert(a.bodies);for(var c=0;c!==a.bodies.length;c++)for(var d=a.bodies[c],e=this.retrieve(d),f=0,h=e.length;f!==h;f++){var i=e[f];if(d!==i){for(var j=!1,k=0,l=b.length;l>k;k+=2){var m=b[k],n=b[k+1];if(m==i&&n==d||n==i&&m==d){j=!0;break}}!j&&g.boundingRadiusCheck(d,i)&&b.push(d,i)}}return this.clear(),b},d.prototype.classConstructor=d,d.prototype.children=null,d.prototype.depth=0,d.prototype.maxChildren=4,d.prototype.maxDepth=4,d.TOP_LEFT=0,d.TOP_RIGHT=1,d.BOTTOM_LEFT=2,d.BOTTOM_RIGHT=3,d.prototype.insert=function(a){if(this.nodes.length){var b=this.findIndex(a);return void this.nodes[b].insert(a)}this.children.push(a);var c=this.children.length;if(!(this.depth>=this.maxDepth)&&c>this.maxChildren){this.subdivide();for(var d=0;c>d;d++)this.insert(this.children[d]);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 void(!(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))}this.children.push(a);var d=this.children.length;if(this.depththis.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":43}],15:[function(a,b){function c(){e.call(this,e.SAP),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;this.axisIndex}for(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;if(e.canCollide(j,k)){var l=j.idb;b++){var k=g[b];if(!c.checkBounds(j,k,1))break;if(e.canCollide(j,k)){var l=j.idc)g.scale(e.ni,i,-1),g.sub(e.ri,j,h.position),g.sub(e.rj,k,o.position),g.scale(n,i,c),g.add(e.ri,e.ri,n),-1==a.indexOf(e)&&a.push(e);else{var u=a.indexOf(e);-1!=u&&a.splice(u,1)}if(this.lowerLimitEnabled&&d>s)g.scale(f.ni,i,1),g.sub(f.ri,j,h.position),g.sub(f.rj,k,o.position),g.scale(n,i,d),g.sub(f.rj,f.rj,n),-1==a.indexOf(f)&&a.push(f);else{var u=a.indexOf(f);-1!=u&&a.splice(u,1)}},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}}},{"../equations/ContactEquation":23,"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../math/vec2":33,"./Constraint":16}],21:[function(a,b){function c(a,b,c,n,o){d.call(this,a,c,d.REVOLUTE),o=this.maxForce="undefined"!=typeof o?o:Number.MAX_VALUE,this.pivotA=b,this.pivotB=n;var p=this.equations=[new e(a,c,-o,o),new e(a,c,-o,o)],q=p[0],r=p[1];q.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,k)},r.computeGq=function(){return h.rotate(i,b,a.angle),h.rotate(j,n,c.angle),h.add(m,c.position,j),h.sub(m,m,a.position),h.sub(m,m,i),h.dot(m,l)},r.minForce=q.minForce=-o,r.maxForce=q.maxForce=o,this.motorEquation=new f(a,c),this.motorEnabled=!1,this.angle=0,this.lowerLimitEnabled=!1,this.upperLimitEnabled=!1,this.lowerLimit=0,this.upperLimit=0,this.upperLimitEquation=new g(a,c),this.lowerLimitEquation=new g(a,c),this.upperLimitEquation.minForce=0,this.lowerLimitEquation.maxForce=0}var d=a("./Constraint"),e=a("../equations/Equation"),f=a("../equations/RotationalVelocityEquation"),g=a("../equations/RotationalLockEquation"),h=a("../math/vec2");b.exports=c;var i=h.create(),j=h.create(),k=h.fromValues(1,0),l=h.fromValues(0,1),m=h.create();c.prototype=new d,c.prototype.update=function(){var a=this.bodyA,b=this.bodyB,c=this.pivotA,d=this.pivotB,e=this.equations,f=(e[0],e[1],e[0]),g=e[1],m=this.upperLimit,n=this.lowerLimit,o=this.upperLimitEquation,p=this.lowerLimitEquation,q=this.angle=b.angle-a.angle;if(this.upperLimitEnabled&&q>m)o.angle=m,-1==e.indexOf(o)&&e.push(o); +else{var r=e.indexOf(o);-1!=r&&e.splice(r,1)}if(this.lowerLimitEnabled&&n>q)p.angle=n,-1==e.indexOf(p)&&e.push(p);else{var r=e.indexOf(p);-1!=r&&e.splice(r,1)}h.rotate(i,c,a.angle),h.rotate(j,d,b.angle),f.G[0]=-1,f.G[1]=0,f.G[2]=-h.crossLength(i,k),f.G[3]=1,f.G[4]=0,f.G[5]=h.crossLength(j,k),g.G[0]=0,g.G[1]=-1,g.G[2]=-h.crossLength(i,l),g.G[3]=0,g.G[4]=1,g.G[5]=h.crossLength(j,l)},c.prototype.enableMotor=function(){this.motorEnabled||(this.equations.push(this.motorEquation),this.motorEnabled=!0)},c.prototype.disableMotor=function(){if(this.motorEnabled){var a=this.equations.indexOf(this.motorEquation);this.equations.splice(a,1),this.motorEnabled=!1}},c.prototype.motorIsEnabled=function(){return!!this.motorEnabled},c.prototype.setMotorSpeed=function(a){if(this.motorEnabled){var b=this.equations.indexOf(this.motorEquation);this.equations[b].relativeVelocity=a}},c.prototype.getMotorSpeed=function(){return this.motorEnabled?this.motorEquation.relativeVelocity:!1}},{"../equations/Equation":24,"../equations/RotationalLockEquation":26,"../equations/RotationalVelocityEquation":27,"../math/vec2":33,"./Constraint":16}],22:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0,this.ratio="number"==typeof c.ratio?c.ratio:1,this.setRatio(this.ratio)}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeGq=function(){return this.ratio*this.bi.angle-this.bj.angle+this.angle},c.prototype.setRatio=function(a){var b=this.G;b[2]=a,b[5]=-1,this.ratio=a}},{"../math/vec2":33,"./Equation":24}],23:[function(a,b){function c(a,b){d.call(this,a,b,0,Number.MAX_VALUE),this.ri=e.create(),this.penetrationVec=e.create(),this.rj=e.create(),this.ni=e.create(),this.restitution=0,this.firstImpact=!1,this.shapeA=null,this.shapeB=null}{var d=a("./Equation"),e=a("../math/vec2");a("../math/mat2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.bi,f=this.bj,g=this.ri,h=this.rj,i=d.position,j=f.position,k=this.penetrationVec,l=this.ni,m=this.G,n=e.crossLength(g,l),o=e.crossLength(h,l);m[0]=-l[0],m[1]=-l[1],m[2]=-n,m[3]=l[0],m[4]=l[1],m[5]=o,e.add(k,j,h),e.sub(k,k,i),e.sub(k,k,g);var p,q;this.firstImpact&&0!==this.restitution?(q=0,p=1/b*(1+this.restitution)*this.computeGW()):(q=e.dot(l,k),p=this.computeGW());var r=this.computeGiMf(),s=-q*a-p*b-c*r;return s}},{"../math/mat2":31,"../math/vec2":33,"./Equation":24}],24:[function(a,b){function c(a,b,c,d){this.minForce="undefined"==typeof c?-1e6:c,this.maxForce="undefined"==typeof d?1e6:d,this.bi=a,this.bj=b,this.stiffness=1e6,this.relaxation=4,this.G=new g.ARRAY_TYPE(6);for(var e=0;6>e;e++)this.G[e]=0;this.offset=0,this.a=0,this.b=0,this.eps=0,this.h=0,this.updateSpookParams(1/60),this.multiplier=0,this.relativeVelocity=0,this.enabled=!0}function d(a,b,c,d,e){return a[0]*b[0]+a[1]*b[1]+a[2]*c+a[3]*d[0]+a[4]*d[1]+a[5]*e}b.exports=c;var e=a("../math/vec2"),f=a("../math/mat2"),g=a("../utils/Utils");c.prototype.constructor=c,c.prototype.updateSpookParams=function(a){var b=this.stiffness,c=this.relaxation,d=a;this.a=4/(d*(1+4*c)),this.b=4*c/(1+4*c),this.eps=4/(d*d*b*(1+4*c)),this.h=a},c.prototype.computeB=function(a,b,c){var d=this.computeGW(),e=this.computeGq(),f=this.computeGiMf();return-e*a-d*b-f*c};var h=e.create(),i=e.create();c.prototype.computeGq=function(){var a=this.G,b=this.bi,c=this.bj,e=(b.position,c.position,b.angle),f=c.angle;return d(a,h,e,i,f)+this.offset};e.create(),e.create();c.prototype.transformedGmult=function(a,b,c,e,f){return d(a,b,c,e,f)},c.prototype.computeGW=function(){var a=this.G,b=this.bi,c=this.bj,d=b.velocity,e=c.velocity,f=b.angularVelocity,g=c.angularVelocity;return this.transformedGmult(a,d,f,e,g)+this.relativeVelocity},c.prototype.computeGWlambda=function(){var a=this.G,b=this.bi,c=this.bj,e=b.vlambda,f=c.vlambda,g=b.wlambda,h=c.wlambda;return d(a,e,g,f,h)};var j=e.create(),k=e.create();c.prototype.computeGiMf=function(){var a=this.bi,b=this.bj,c=a.force,d=a.angularForce,f=b.force,g=b.angularForce,h=a.invMass,i=b.invMass,l=a.invInertia,m=b.invInertia,n=this.G;return e.scale(j,c,h),e.scale(k,f,i),this.transformedGmult(n,j,d*l,k,g*m)},c.prototype.computeGiMGt=function(){var a=this.bi,b=this.bj,c=a.invMass,d=b.invMass,e=a.invInertia,f=b.invInertia,g=this.G;return g[0]*g[0]*c+g[1]*g[1]*c+g[2]*g[2]*e+g[3]*g[3]*d+g[4]*g[4]*d+g[5]*g[5]*f};{var l=e.create(),m=e.create(),n=e.create();e.create(),e.create(),e.create(),f.create(),f.create()}c.prototype.addToWlambda=function(a){var b=this.bi,c=this.bj,d=l,f=m,g=n,h=this.G;f[0]=h[0],f[1]=h[1],g[0]=h[3],g[1]=h[4],e.scale(d,f,b.invMass*a),e.add(b.vlambda,b.vlambda,d),e.scale(d,g,c.invMass*a),e.add(c.vlambda,c.vlambda,d),b.wlambda+=b.invInertia*h[2]*a,c.wlambda+=c.invInertia*h[5]*a},c.prototype.computeInvC=function(a){return 1/(this.computeGiMGt()+a)}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50}],25:[function(a,b){function c(a,b,c){e.call(this,a,b,-c,c),this.ri=d.create(),this.rj=d.create(),this.t=d.create(),this.contactEquation=null,this.shapeA=null,this.shapeB=null,this.frictionCoefficient=.3}{var d=(a("../math/mat2"),a("../math/vec2")),e=a("./Equation");a("../utils/Utils")}b.exports=c,c.prototype=new e,c.prototype.constructor=c,c.prototype.setSlipForce=function(a){this.maxForce=a,this.minForce=-a},c.prototype.computeB=function(a,b,c){var e=(this.bi,this.bj,this.ri),f=this.rj,g=this.t,h=this.G;h[0]=-g[0],h[1]=-g[1],h[2]=-d.crossLength(e,g),h[3]=g[0],h[4]=g[1],h[5]=d.crossLength(f,g);var i=this.computeGW(),j=this.computeGiMf(),k=-i*b-c*j;return k}},{"../math/mat2":31,"../math/vec2":33,"../utils/Utils":50,"./Equation":24}],26:[function(a,b){function c(a,b,c){c=c||{},d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.angle=c.angle||0;var e=this.G;e[2]=1,e[5]=-1}var d=a("./Equation"),e=a("../math/vec2");b.exports=c,c.prototype=new d,c.prototype.constructor=c;var f=e.create(),g=e.create(),h=e.fromValues(1,0),i=e.fromValues(0,1);c.prototype.computeGq=function(){return e.rotate(f,h,this.bi.angle+this.angle),e.rotate(g,i,this.bj.angle),e.dot(f,g)}},{"../math/vec2":33,"./Equation":24}],27:[function(a,b){function c(a,b){d.call(this,a,b,-Number.MAX_VALUE,Number.MAX_VALUE),this.relativeVelocity=1,this.ratio=1}{var d=a("./Equation");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.constructor=c,c.prototype.computeB=function(a,b,c){var d=this.G;d[2]=-1,d[5]=this.ratio;var e=this.computeGiMf(),f=this.computeGW(),g=-f*b-c*e;return g}},{"../math/vec2":33,"./Equation":24}],28:[function(a,b){var c=function(){};b.exports=c,c.prototype={constructor:c,on:function(a,b,c){b.context=c||this,void 0===this._listeners&&(this._listeners={});var d=this._listeners;return void 0===d[a]&&(d[a]=[]),-1===d[a].indexOf(b)&&d[a].push(b),this},has:function(a,b){if(void 0===this._listeners)return!1;var c=this._listeners;return void 0!==c[a]&&-1!==c[a].indexOf(b)?!0:!1},off:function(a,b){if(void 0===this._listeners)return this;var c=this._listeners,d=c[a].indexOf(b);return-1!==d&&c[a].splice(d,1),this},emit:function(a){if(void 0===this._listeners)return this;var b=this._listeners,c=b[a.type];if(void 0!==c){a.target=this;for(var d=0,e=c.length;e>d;d++){var f=c[d];f.call(f.context,a)}}return this}}},{}],29:[function(a,b){function c(a,b,e){if(e=e||{},!(a instanceof d&&b instanceof d))throw new Error("First two arguments must be Material instances.");this.id=c.idCounter++,this.materialA=a,this.materialB=b,this.friction="undefined"!=typeof e.friction?Number(e.friction):.3,this.restitution="undefined"!=typeof e.restitution?Number(e.restitution):0,this.stiffness="undefined"!=typeof e.stiffness?Number(e.stiffness):1e7,this.relaxation="undefined"!=typeof e.relaxation?Number(e.relaxation):3,this.frictionStiffness="undefined"!=typeof e.frictionStiffness?Number(e.frictionStiffness):1e7,this.frictionRelaxation="undefined"!=typeof e.frictionRelaxation?Number(e.frictionRelaxation):3,this.surfaceVelocity="undefined"!=typeof e.surfaceVelocity?Number(e.surfaceVelocity):0}var d=a("./Material");b.exports=c,c.idCounter=0},{"./Material":30}],30:[function(a,b){function c(){this.id=c.idCounter++}b.exports=c,c.idCounter=0},{}],31:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/mat2").mat2;b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/mat2":1}],32:[function(a,b){var c={};c.GetArea=function(a){if(a.length<6)return 0;for(var b=a.length-2,c=0,d=0;b>d;d+=2)c+=(a[d+2]-a[d])*(a[d+1]+a[d+3]);return c+=(a[0]-a[b])*(a[b+1]+a[1]),.5*-c},c.Triangulate=function(a){var b=a.length>>1;if(3>b)return[];for(var d=[],e=[],f=0;b>f;f++)e.push(f);for(var f=0,g=b;g>3;){var h=e[(f+0)%g],i=e[(f+1)%g],j=e[(f+2)%g],k=a[2*h],l=a[2*h+1],m=a[2*i],n=a[2*i+1],o=a[2*j],p=a[2*j+1],q=!1;if(c._convex(k,l,m,n,o,p)){q=!0;for(var r=0;g>r;r++){var s=e[r];if(s!=h&&s!=i&&s!=j&&c._PointInTriangle(a[2*s],a[2*s+1],k,l,m,n,o,p)){q=!1;break}}}if(q)d.push(h,i,j),e.splice((f+1)%g,1),g--,f=0;else if(f++>3*g)break}return d.push(e[0],e[1],e[2]),d},c._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},c._convex=function(a,b,c,d,e,f){return(b-d)*(e-c)+(c-a)*(f-d)>=0},b.exports=c},{}],33:[function(a,b){var c=a("../../node_modules/gl-matrix/src/gl-matrix/vec2").vec2;c.getX=function(a){return a[0]},c.getY=function(a){return a[1]},c.crossLength=function(a,b){return a[0]*b[1]-a[1]*b[0]},c.crossVZ=function(a,b,d){return c.rotate(a,b,-Math.PI/2),c.scale(a,a,d),a},c.crossZV=function(a,b,d){return c.rotate(a,d,Math.PI/2),c.scale(a,a,b),a},c.rotate=function(a,b,c){var d=Math.cos(c),e=Math.sin(c),f=b[0],g=b[1];a[0]=d*f-e*g,a[1]=e*f+d*g},c.toLocalFrame=function(a,b,d,e){c.copy(a,b),c.sub(a,a,d),c.rotate(a,a,-e)},c.toGlobalFrame=function(a,b,d,e){c.copy(a,b),c.rotate(a,a,e),c.add(a,a,d)},c.centroid=function(a,b,d,e){return c.add(a,b,d),c.add(a,a,e),c.scale(a,a,1/3),a},b.exports=c},{"../../node_modules/gl-matrix/src/gl-matrix/vec2":2}],34:[function(a,b){function c(a){a=a||{},h.call(this),this.id=++c._idCounter,this.world=null,this.shapes=[],this.shapeOffsets=[],this.shapeAngles=[],this.mass=a.mass||0,this.invMass=0,this.inertia=0,this.invInertia=0,this.fixedRotation=!!a.fixedRotation||!1,this.position=d.fromValues(0,0),a.position&&d.copy(this.position,a.position),this.interpolatedPosition=d.fromValues(0,0),this.velocity=d.fromValues(0,0),a.velocity&&d.copy(this.velocity,a.velocity),this.vlambda=d.fromValues(0,0),this.wlambda=0,this.angle=a.angle||0,this.angularVelocity=a.angularVelocity||0,this.force=d.create(),a.force&&d.copy(this.force,a.force),this.angularForce=a.angularForce||0,this.damping="number"==typeof a.damping?a.damping:.1,this.angularDamping="number"==typeof a.angularDamping?a.angularDamping:.1,this.motionState=0==this.mass?c.STATIC:c.DYNAMIC,this.boundingRadius=0,this.aabb=new g,this.aabbNeedsUpdate=!0,this.allowSleep=!1,this.sleepState=c.AWAKE,this.sleepSpeedLimit=.1,this.sleepTimeLimit=1,this.gravityScale=1,this.timeLastSleepy=0,this.concavePath=null,this.lastDampingScale=1,this.lastAngularDampingScale=1,this.lastDampingTimeStep=-1,this.updateMassProperties()}var d=a("../math/vec2"),e=a("poly-decomp"),f=a("../shapes/Convex"),g=a("../collision/AABB"),h=a("../events/EventEmitter");b.exports=c,c.prototype=new h,c._idCounter=0,c.prototype.setDensity=function(a){var b=this.getArea();this.mass=b*a,this.updateMassProperties()},c.prototype.getArea=function(){for(var a=0,b=0;be&&(e=h+i)}this.boundingRadius=e},c.prototype.addShape=function(a,b,c){c=c||0,b=b?d.fromValues(b[0],b[1]):d.fromValues(0,0),this.shapes.push(a),this.shapeOffsets.push(b),this.shapeAngles.push(c),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0},c.prototype.removeShape=function(a){var b=this.shapes.indexOf(a);return-1!=b?(this.shapes.splice(b,1),this.shapeOffsets.splice(b,1),this.shapeAngles.splice(b,1),this.aabbNeedsUpdate=!0,!0):!1},c.prototype.updateMassProperties=function(){if(this.motionState==c.STATIC||this.motionState==c.KINEMATIC)this.mass=Number.MAX_VALUE,this.invMass=0,this.inertia=Number.MAX_VALUE,this.invInertia=0;else{var a=this.shapes,b=a.length,e=this.mass/b,f=0;if(this.fixedRotation)this.inertia=Number.MAX_VALUE,this.invInertia=0;else{for(var g=0;b>g;g++){var h=a[g],i=d.squaredLength(this.shapeOffsets[g]),j=h.computeMomentOfInertia(e);f+=j+e*i}this.inertia=f,this.invInertia=f>0?1/f:0}this.invMass=1/this.mass}};var k=d.create();c.prototype.applyForce=function(a,b){var c=k;d.sub(c,b,this.position),d.add(this.force,this.force,a);var e=d.crossLength(c,a);this.angularForce+=e},c.prototype.toLocalFrame=function(a,b){d.toLocalFrame(a,b,this.position,this.angle)},c.prototype.toWorldFrame=function(a,b){d.toGlobalFrame(a,b,this.position,this.angle)},c.prototype.fromPolygon=function(a,b){b=b||{};for(var c=this.shapes.length;c>=0;--c)this.removeShape(this.shapes[c]);var g=new e.Polygon;if(g.vertices=a,g.makeCCW(),"number"==typeof b.removeCollinearPoints&&g.removeCollinearPoints(b.removeCollinearPoints),"undefined"==typeof b.skipSimpleCheck&&!g.isSimple())return!1;this.concavePath=g.vertices.slice(0);for(var c=0;ce?(this.sleepState=c.SLEEPY,this.timeLastSleepy=a,this.emit(c.sleepyEvent)):b===c.SLEEPY&&e>f?this.wakeUp():b===c.SLEEPY&&a-this.timeLastSleepy>this.sleepTimeLimit&&this.sleep()}},c.sleepyEvent={type:"sleepy"},c.sleepEvent={type:"sleep"},c.wakeUpEvent={type:"wakeup"},c.DYNAMIC=1,c.STATIC=2,c.KINEMATIC=4,c.AWAKE=0,c.SLEEPY=1,c.SLEEPING=2},{"../collision/AABB":9,"../events/EventEmitter":28,"../math/vec2":33,"../shapes/Convex":39,"poly-decomp":7}],35:[function(a,b){function c(a,b,c){c=c||{},this.restLength="number"==typeof c.restLength?c.restLength:1,this.stiffness=c.stiffness||100,this.damping=c.damping||1,this.bodyA=a,this.bodyB=b,this.localAnchorA=d.fromValues(0,0),this.localAnchorB=d.fromValues(0,0),c.localAnchorA&&d.copy(this.localAnchorA,c.localAnchorA),c.localAnchorB&&d.copy(this.localAnchorB,c.localAnchorB),c.worldAnchorA&&this.setWorldAnchorA(c.worldAnchorA),c.worldAnchorB&&this.setWorldAnchorB(c.worldAnchorB)}var d=a("../math/vec2");b.exports=c,c.prototype.setWorldAnchorA=function(a){this.bodyA.toLocalFrame(this.localAnchorA,a)},c.prototype.setWorldAnchorB=function(a){this.bodyB.toLocalFrame(this.localAnchorB,a)},c.prototype.getWorldAnchorA=function(a){this.bodyA.toWorldFrame(a,this.localAnchorA)},c.prototype.getWorldAnchorB=function(a){this.bodyB.toWorldFrame(a,this.localAnchorB)};var e=d.create(),f=d.create(),g=d.create(),h=d.create(),i=d.create(),j=d.create(),k=d.create(),l=d.create(),m=d.create();c.prototype.applyForce=function(){var a=this.stiffness,b=this.damping,c=this.restLength,n=this.bodyA,o=this.bodyB,p=e,q=f,r=g,s=h,t=m,u=i,v=j,w=k,x=l;this.getWorldAnchorA(u),this.getWorldAnchorB(v),d.sub(w,u,n.position),d.sub(x,v,o.position),d.sub(p,v,u);var y=d.len(p);d.normalize(q,p),d.sub(r,o.velocity,n.velocity),d.crossZV(t,o.angularVelocity,x),d.add(r,r,t),d.crossZV(t,n.angularVelocity,w),d.sub(r,r,t),d.scale(s,q,-a*(y-c)-b*d.dot(r,q)),d.sub(n.force,n.force,s),d.add(o.force,o.force,s);var z=d.crossLength(w,s),A=d.crossLength(x,s);n.angularForce-=z,o.angularForce+=A}},{"../math/vec2":33}],36:[function(a,b){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"),Island:a("./solver/IslandSolver"),IslandSolver:a("./solver/IslandSolver"),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"),Utils:a("./utils/Utils"),World:a("./world/World"),QuadTree:a("./collision/QuadTree").QuadTree,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/QuadTree":14,"./collision/SAPBroadphase":15,"./constraints/Constraint":16,"./constraints/DistanceConstraint":17,"./constraints/GearConstraint":18,"./constraints/LockConstraint":19,"./constraints/PrismaticConstraint":20,"./constraints/RevoluteConstraint":21,"./equations/AngleLockEquation":22,"./equations/ContactEquation":23,"./equations/Equation":24,"./equations/FrictionEquation":25,"./equations/RotationalVelocityEquation":27,"./events/EventEmitter":28,"./material/ContactMaterial":29,"./material/Material":30,"./math/vec2":33,"./objects/Body":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/IslandSolver":48,"./solver/Solver":49,"./utils/Utils":50,"./world/World":51}],37:[function(a,b){function c(a,b){this.length=a||1,this.radius=b||1,d.call(this,d.CAPSULE)}var d=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,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":45}],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":45}],39:[function(a,b){function c(a){this.vertices=[];for(var b=0;bg;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":45,"poly-decomp":7}],40:[function(a,b){function c(a,b,c){this.data=a,this.maxValue=b,this.elementWidth=c,d.call(this,d.HEIGHTFIELD)}{var d=a("./Shape");a("../math/vec2")}b.exports=c,c.prototype=new d,c.prototype.computeMomentOfInertia=function(){return Number.MAX_VALUE},c.prototype.updateBoundingRadius=function(){this.boundingRadius=Number.MAX_VALUE},c.prototype.updateArea=function(){for(var a=this.data,b=0,c=0;cf)){var D=u?r:z.eps,E=c.iterateEquation(C,z,D,y,x,w,v,a,f,j,this.useNormalForceForFriction);B+=Math.abs(E)}if(k>=B*B)break}for(A=0;A!==o;A++)n[A].addConstraintVelocity()}},c.iterateEquation=function(a,b,c,d,e,f,g,i,j,k,l){var m=d[a],n=e[a],o=f[a],p=b.computeGWlambda();l&&b instanceof h&&j==k&&(b.maxForce=b.contactEquation.multiplier*b.frictionCoefficient*i,b.minForce=-b.contactEquation.multiplier*b.frictionCoefficient*i);var q=b.maxForce,r=b.minForce;g&&(m=0);var s=n*(m-p-c*o),t=o+s;return r*i>t?s=r*i-o:t>q*i&&(s=q*i-o),f[a]+=s,b.multiplier=f[a]/i,b.addToWlambda(s),s}},{"../equations/FrictionEquation":25,"../math/vec2":33,"../utils/Utils":50,"./Solver":49}],47:[function(a,b){function c(){this.equations=[],this.bodies=[]}b.exports=c,c.prototype.reset=function(){this.equations.length=this.bodies.length=0},c.prototype.getBodies=function(){for(var a=[],b=[],c=this.equations,d=0;d!==c.length;d++){var e=c[d];-1===b.indexOf(e.bi.id)&&(a.push(e.bi),b.push(e.bi.id)),-1===b.indexOf(e.bj.id)&&(a.push(e.bj),b.push(e.bj.id))}return a},c.prototype.solve=function(a,b){var c=[];b.removeAllEquations();for(var d=this.equations.length,e=0;e!==d;e++)b.addEquation(this.equations[e]);for(var f=this.getBodies(),g=f.length,e=0;e!==g;e++)c.push(f[e]);b.solve(a,{bodies:c})}},{}],48:[function(a,b){function c(a,b){g.call(this,b,g.ISLAND);this.subsolver=a,this.numIslands=0,this._nodePool=[],this._islandPool=[],this.beforeSolveIslandEvent={type:"beforeSolveIsland",island:null}}function d(a){for(var b=a.length,c=0;c!==b;c++){var d=a[c];if(!d.visited&&d.body.motionState!=j)return d}return!1}function e(a,b,c){b.push(a.body);for(var d=a.eqs.length,e=0;e!==d;e++){var f=a.eqs[e];-1===c.indexOf(f)&&c.push(f)}}function f(a,b,c,e){for(k.length=0,k.push(a),a.visited=!0,b(a,c,e);k.length;)for(var f,g=k.pop();f=d(g.children);)f.visited=!0,b(f,c,e),k.push(f)}var g=a("./Solver"),h=(a("../math/vec2"),a("../solver/Island")),i=a("../objects/Body"),j=i.STATIC;b.exports=c,c.prototype=new g;var k=[],l=[],m=[],n=[],o=[];c.prototype.solve=function(a,b){var c=l,g=b.bodies,i=this.equations,j=i.length,k=g.length,p=(this.subsolver,this._workers,this._workerData,this._workerIslandGroups,this._islandPool);l.length=0;for(var q=0;q!==k;q++)c.push(this._nodePool.length?this._nodePool.pop():{body:g[q],children:[],eqs:[],visited:!1});for(var q=0;q!==k;q++){var r=c[q];r.body=g[q],r.children.length=0,r.eqs.length=0,r.visited=!1}for(var s=0;s!==j;s++){var t=i[s],q=g.indexOf(t.bi),u=g.indexOf(t.bj),v=c[q],w=c[u]; +v.children.push(w),v.eqs.push(t),w.children.push(v),w.eqs.push(t)}var x,y=0,z=m,A=n;z.length=0,A.length=0;var B=o;for(B.length=0;x=d(c);){var C=p.length?p.pop():new h;z.length=0,A.length=0,f(x,e,A,z);for(var D=z.length,q=0;q!==D;q++){var t=z[q];C.equations.push(t)}y++,B.push(C)}this.numIslands=y;for(var E=this.beforeSolveIslandEvent,q=0;qd;d++)a[d]=a[d+c];a.length=e},c.ARRAY_TYPE=Float32Array||Array},{}],51:[function(a,b){function c(a){n.apply(this),a=a||{},this.springs=[],this.bodies=[],this.solver=a.solver||new d,this.narrowphase=new x(this),this.gravity=a.gravity||f.fromValues(0,-9.78),this.doProfiling=a.doProfiling||!1,this.lastStepTime=0,this.broadphase=a.broadphase||new e,this.broadphase.setWorld(this),this.constraints=[],this.defaultFriction=.3,this.defaultRestitution=0,this.defaultMaterial=new q,this.defaultContactMaterial=new r(this.defaultMaterial,this.defaultMaterial),this.lastTimeStep=1/60,this.applySpringForces=!0,this.applyDamping=!0,this.applyGravity=!0,this.solveConstraints=!0,this.contactMaterials=[],this.time=0,this.fixedStepTime=0,this.emitImpactEvent=!0,this._constraintIdCounter=0,this._bodyIdCounter=0,this.postStepEvent={type:"postStep"},this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.addSpringEvent={type:"addSpring",spring:null},this.impactEvent={type:"impact",bodyA:null,bodyB:null,shapeA:null,shapeB:null,contactEquation:null},this.postBroadphaseEvent={type:"postBroadphase",pairs:null},this.enableBodySleeping=!1,this.beginContactEvent={type:"beginContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null,contactEquations:[]},this.endContactEvent={type:"endContact",shapeA:null,shapeB:null,bodyA:null,bodyB:null},this.preSolveEvent={type:"preSolve",contactEquations:null,frictionEquations:null},this.overlappingShapesLastState={keys:[]},this.overlappingShapesCurrentState={keys:[]},this.overlappingShapeLookup={keys:[]}}var d=a("../solver/GSSolver"),e=a("../collision/NaiveBroadphase"),f=a("../math/vec2"),g=a("../shapes/Circle"),h=a("../shapes/Rectangle"),i=a("../shapes/Convex"),j=a("../shapes/Line"),k=a("../shapes/Plane"),l=a("../shapes/Capsule"),m=a("../shapes/Particle"),n=a("../events/EventEmitter"),o=a("../objects/Body"),p=a("../objects/Spring"),q=a("../material/Material"),r=a("../material/ContactMaterial"),s=a("../constraints/DistanceConstraint"),t=a("../constraints/LockConstraint"),u=a("../constraints/RevoluteConstraint"),v=a("../constraints/PrismaticConstraint"),w=a("../../package.json"),x=(a("../collision/Broadphase"),a("../collision/Narrowphase")),y=a("../utils/Utils");b.exports=c;var z=w.version.split(".").slice(0,2).join(".");if("undefined"==typeof performance&&(performance={}),!performance.now){var A=Date.now();performance.timing&&performance.timing.navigationStart&&(A=performance.timing.navigationStart),performance.now=function(){return Date.now()-A}}c.prototype=new Object(n.prototype),c.prototype.addConstraint=function(a){this.constraints.push(a)},c.prototype.addContactMaterial=function(a){this.contactMaterials.push(a)},c.prototype.removeContactMaterial=function(a){var b=this.contactMaterials.indexOf(a);-1!==b&&y.splice(this.contactMaterials,b,1)},c.prototype.getContactMaterial=function(a,b){for(var c=this.contactMaterials,d=0,e=c.length;d!==e;d++){var f=c[d];if(f.materialA===a&&f.materialB===b||f.materialA===b&&f.materialB===a)return f}return!1},c.prototype.removeConstraint=function(a){var b=this.constraints.indexOf(a);-1!==b&&y.splice(this.constraints,b,1)};{var B=(f.create(),f.create(),f.create(),f.create(),f.create(),f.create(),f.create()),C=f.fromValues(0,0),D=f.fromValues(0,0);f.fromValues(0,0)}c.prototype.step=function(a,b,c){if(c=c||10,b=b||0,0==b)this.internalStep(a),this.time+=a;else{var d=Math.floor((this.time+b)/a)-Math.floor(this.time/a);d=Math.min(d,c);for(var e=0;d>e;e++)this.internalStep(a);this.time+=b,this.fixedStepTime+=d*a;for(var f=this.time-this.fixedStepTime-a,g=0;g!==this.bodies.length;g++){var h=this.bodies[g];h.interpolatedPosition[0]=h.position[0]+h.velocity[0]*f,h.interpolatedPosition[1]=h.position[1]+h.velocity[1]*f}}},c.prototype.internalStep=function(a){{var b,d,e=this,g=this.doProfiling,h=this.springs.length,i=this.springs,j=this.bodies,k=this.gravity,l=this.solver,m=this.bodies.length,n=this.broadphase,p=this.narrowphase,q=this.constraints,r=B,s=(f.scale,f.add);f.rotate}this.lastTimeStep=a,g&&(b=performance.now());var t=f.length(this.gravity);if(this.applyGravity)for(var u=0;u!==m;u++){var v=j[u],w=v.force;v.motionState==o.DYNAMIC&&(f.scale(r,k,v.mass*v.gravityScale),s(w,w,r))}if(this.applySpringForces)for(var u=0;u!==h;u++){var x=i[u];x.applyForce()}if(this.applyDamping)for(var u=0;u!==m;u++){var v=j[u];v.motionState==o.DYNAMIC&&v.applyDamping(a)}var y=n.getCollisionPairs(this);this.postBroadphaseEvent.pairs=y,this.emit(this.postBroadphaseEvent),p.reset(this);for(var u=0,z=y.length;u!==z;u+=2)for(var A=y[u],C=y[u+1],D=0,E=A.shapes.length;D!==E;D++)for(var F=A.shapes[D],G=A.shapeOffsets[D],H=A.shapeAngles[D],I=0,J=C.shapes.length;I!==J;I++){var K=C.shapes[I],L=C.shapeOffsets[I],M=C.shapeAngles[I],N=this.defaultContactMaterial;if(F.material&&K.material){var O=this.getContactMaterial(F.material,K.material);O&&(N=O)}this.runNarrowphase(p,A,F,G,H,C,K,L,M,N,t)}for(var P=this.overlappingShapesLastState,u=0;u!==P.keys.length;u++){var Q=P.keys[u];if(P[Q]===!0&&!this.overlappingShapesCurrentState[Q]){var R=this.endContactEvent;R.shapeA=P[Q+"_shapeA"],R.shapeB=P[Q+"_shapeB"],R.bodyA=P[Q+"_bodyA"],R.bodyB=P[Q+"_bodyB"],this.emit(R)}}for(var u=0;u!==P.keys.length;u++)delete P[P.keys[u]];P.keys.length=0;for(var S=this.overlappingShapesCurrentState,u=0;u!==S.keys.length;u++)P[S.keys[u]]=S[S.keys[u]],P.keys.push(S.keys[u]);for(var u=0;u!==S.keys.length;u++)delete S[S.keys[u]];S.keys.length=0;var T=this.preSolveEvent;T.contactEquations=p.contactEquations,T.frictionEquations=p.frictionEquations,this.emit(T),l.addEquations(p.contactEquations),l.addEquations(p.frictionEquations);var U=q.length;for(u=0;u!==U;u++){var V=q[u];V.update(),l.addEquations(V.equations)}this.solveConstraints&&l.solve(a,this),l.removeAllEquations();for(var u=0;u!==m;u++){var W=j[u];W.sleepState!==o.SLEEPING&&W.motionState!=o.STATIC&&c.integrateBody(W,a)}for(var u=0;u!==m;u++)j[u].setZeroForce();if(g&&(d=performance.now(),e.lastStepTime=d-b),this.emitImpactEvent)for(var X=this.impactEvent,u=0;u!==p.contactEquations.length;u++){var Y=p.contactEquations[u];Y.firstImpact&&(X.bodyA=Y.bi,X.bodyB=Y.bj,X.shapeA=Y.shapeA,X.shapeB=Y.shapeB,X.contactEquation=Y,this.emit(X))}if(this.enableBodySleeping)for(u=0;u!==m;u++)j[u].sleepTick(this.time);this.emit(this.postStepEvent)};var E=f.create(),F=f.create();c.integrateBody=function(a,b){var c=a.invMass,d=a.force,e=a.position,g=a.velocity;a.fixedRotation||(a.angularVelocity+=a.angularForce*a.invInertia*b,a.angle+=a.angularVelocity*b),f.scale(E,d,b*c),f.add(g,E,g),f.scale(F,g,b),f.add(e,e,F),a.aabbNeedsUpdate=!0},c.prototype.runNarrowphase=function(a,b,c,d,e,g,h,i,j,k,l){if(0!==(c.collisionGroup&h.collisionMask)&&0!==(h.collisionGroup&c.collisionMask)){f.rotate(C,d,b.angle),f.rotate(D,i,g.angle),f.add(C,C,b.position),f.add(D,D,g.position);var m=e+b.angle,n=j+g.angle;a.enableFriction=k.friction>0,a.frictionCoefficient=k.friction;var p;p=b.motionState==o.STATIC||b.motionState==o.KINEMATIC?g.mass:g.motionState==o.STATIC||g.motionState==o.KINEMATIC?b.mass:b.mass*g.mass/(b.mass+g.mass),a.slipForce=k.friction*l*p,a.restitution=k.restitution,a.surfaceVelocity=k.surfaceVelocity,a.frictionStiffness=k.frictionStiffness,a.frictionRelaxation=k.frictionRelaxation,a.stiffness=k.stiffness,a.relaxation=k.relaxation;var q=a[c.type|h.type],r=0;if(q){var s=c.sensor||h.sensor;if(r=c.type=0;b--)this.removeConstraint(a[b]);for(var c=this.bodies,b=c.length-1;b>=0;b--)this.removeBody(c[b]);for(var d=this.springs,b=d.length-1;b>=0;b--)this.removeSpring(d[b]);for(var e=this.contactMaterials,b=e.length-1;b>=0;b--)this.removeContactMaterial(e[b])},c.prototype.clone=function(){var a=new c;return a.fromJSON(this.toJSON()),a};var G=f.create(),H=f.fromValues(0,0),I=f.fromValues(0,0);c.prototype.hitTest=function(a,b,c){c=c||0;var d=new o({position:a}),e=new m,h=a,j=0,n=G,p=H,q=I;d.addShape(e);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;f.rotate(n,z,v.angle),f.add(n,n,v.position);var B=A+v.angle;(y instanceof g&&r.circleParticle(v,y,n,B,d,e,h,j,!0)||y instanceof i&&r.particleConvex(d,e,h,j,v,y,n,B,!0)||y instanceof k&&r.particlePlane(d,e,h,j,v,y,n,B,!0)||y instanceof l&&r.particleCapsule(d,e,h,j,v,y,n,B,!0)||y instanceof m&&f.squaredLength(f.sub(q,n,a))0&&this.enable(a[d],b,!0));else a instanceof Phaser.Group?this.enable(a.children,b,c):(this.enableBody(a,b),c&&a.hasOwnProperty("children")&&a.children.length>0&&this.enable(a.children,b,!0))},enableBody:function(a,b){a.hasOwnProperty("body")&&null===a.body&&(a.body=new Phaser.Physics.P2.Body(this.game,a,a.x,a.y,1),a.body.debug=b,a.anchor.set(.5))},setImpactEvents:function(a){a?this.world.on("impact",this.impactHandler,this):this.world.off("impact",this.impactHandler,this)},setPostBroadphaseCallback:function(a,b){this.postBroadphaseCallback=a,this.callbackContext=b,null!==a?this.world.on("postBroadphase",this.postBroadphaseHandler,this):this.world.off("postBroadphase",this.postBroadphaseHandler,this)},postBroadphaseHandler:function(a){if(this.postBroadphaseCallback)for(var b=a.pairs.length;b-=2;)1===a.pairs[b].id||1===a.pairs[b+1].id||this.postBroadphaseCallback.call(this.callbackContext,a.pairs[b].parent,a.pairs[b+1].parent)||a.pairs.splice(b,2)},impactHandler:function(a){if(a.bodyA.parent&&a.bodyB.parent){var b=a.bodyA.parent,c=a.bodyB.parent;b._bodyCallbacks[a.bodyB.id]&&b._bodyCallbacks[a.bodyB.id].call(b._bodyCallbackContext[a.bodyB.id],b,c,a.shapeA,a.shapeB),c._bodyCallbacks[a.bodyA.id]&&c._bodyCallbacks[a.bodyA.id].call(c._bodyCallbackContext[a.bodyA.id],c,b,a.shapeB,a.shapeA),b._groupCallbacks[a.shapeB.collisionGroup]&&b._groupCallbacks[a.shapeB.collisionGroup].call(b._groupCallbackContext[a.shapeB.collisionGroup],b,c,a.shapeA,a.shapeB),c._groupCallbacks[a.shapeA.collisionGroup]&&c._groupCallbacks[a.shapeA.collisionGroup].call(c._groupCallbackContext[a.shapeA.collisionGroup],c,b,a.shapeB,a.shapeA)}},beginContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onBeginContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB,a.contactEquations),a.bodyA.parent&&a.bodyA.parent.onBeginContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB,a.contactEquations),a.bodyB.parent&&a.bodyB.parent.onBeginContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA,a.contactEquations))},endContactHandler:function(a){a.bodyA.id>1&&a.bodyB.id>1&&(this.onEndContact.dispatch(a.bodyA,a.bodyB,a.shapeA,a.shapeB),a.bodyA.parent&&a.bodyA.parent.onEndContact.dispatch(a.bodyB.parent,a.shapeA,a.shapeB),a.bodyB.parent&&a.bodyB.parent.onEndContact.dispatch(a.bodyA.parent,a.shapeB,a.shapeA))},setBoundsToWorld:function(a,b,c,d,e){this.setBounds(this.game.world.bounds.x,this.game.world.bounds.y,this.game.world.bounds.width,this.game.world.bounds.height,a,b,c,d,e)},setWorldMaterial:function(a,b,c,d,e){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=!0),b&&this._wallShapes[0]&&(this._wallShapes[0].material=a),c&&this._wallShapes[1]&&(this._wallShapes[1].material=a),d&&this._wallShapes[2]&&(this._wallShapes[2].material=a),e&&this._wallShapes[3]&&(this._wallShapes[3].material=a)},updateBoundsCollisionGroup:function(a){"undefined"==typeof a&&(a=!0);for(var b=0;4>b;b++)this._wallShapes[b]&&(this._wallShapes[b].collisionGroup=a?this.boundsCollisionGroup.mask:this.everythingCollisionGroup.mask)},setBounds:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=c/2,k=d/2,l=j+a,m=k+b;if(null!==this.bounds){this.bounds.world&&this.world.removeBody(this.bounds);for(var n=this.bounds.shapes.length;n--;){var o=this.bounds.shapes[n];this.bounds.removeShape(o)}this.bounds.position[0]=this.pxmi(l),this.bounds.position[1]=this.pxmi(m)}else this.bounds=new p2.Body({mass:0,position:[this.pxmi(l),this.pxmi(m)]});e&&(this._wallShapes[0]=new p2.Plane,i&&(this._wallShapes[0].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[0],[this.pxmi(-j),0],1.5707963267948966)),f&&(this._wallShapes[1]=new p2.Plane,i&&(this._wallShapes[1].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[1],[this.pxmi(j),0],-1.5707963267948966)),g&&(this._wallShapes[2]=new p2.Plane,i&&(this._wallShapes[2].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[2],[0,this.pxmi(-k)],-3.141592653589793)),h&&(this._wallShapes[3]=new p2.Plane,i&&(this._wallShapes[3].collisionGroup=this.boundsCollisionGroup.mask),this.bounds.addShape(this._wallShapes[3],[0,this.pxmi(k)])),this.world.addBody(this.bounds)},update:function(){this.world.step(this.useElapsedTime?this.game.time.physicsElapsed:this.frameRate)},clear:function(){this.world.clear(),this.world.off("beginContact",this.beginContactHandler,this),this.world.off("endContact",this.endContactHandler,this),this.postBroadphaseCallback=null,this.callbackContext=null,this.impactCallback=null,this.collisionGroups=[],this._toRemove=[],this._collisionGroupID=2,this.boundsCollidesWith=[]},destroy:function(){this.clear(),this.game=null},addBody:function(a){return a.data.world?!1:(this.world.addBody(a.data),this.onBodyAdded.dispatch(a),!0)},removeBody:function(a){return a.data.world==this.world&&(this.world.removeBody(a.data),this.onBodyRemoved.dispatch(a)),a},addSpring:function(a){return this.world.addSpring(a),this.onSpringAdded.dispatch(a),a},removeSpring:function(a){return this.world.removeSpring(a),this.onSpringRemoved.dispatch(a),a},createDistanceConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.DistanceConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createGearConstraint:function(a,b,c,d){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.GearConstraint(this,a,b,c,d)):void console.warn("Cannot create Constraint, invalid body objects given")},createRevoluteConstraint:function(a,b,c,d,e){return a=this.getBody(a),c=this.getBody(c),a&&c?this.addConstraint(new Phaser.Physics.P2.RevoluteConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createLockConstraint:function(a,b,c,d,e){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.LockConstraint(this,a,b,c,d,e)):void console.warn("Cannot create Constraint, invalid body objects given")},createPrismaticConstraint:function(a,b,c,d,e,f,g){return a=this.getBody(a),b=this.getBody(b),a&&b?this.addConstraint(new Phaser.Physics.P2.PrismaticConstraint(this,a,b,c,d,e,f,g)):void console.warn("Cannot create Constraint, invalid body objects given")},addConstraint:function(a){return this.world.addConstraint(a),this.onConstraintAdded.dispatch(a),a},removeConstraint:function(a){return this.world.removeConstraint(a),this.onConstraintRemoved.dispatch(a),a},addContactMaterial:function(a){return this.world.addContactMaterial(a),this.onContactMaterialAdded.dispatch(a),a},removeContactMaterial:function(a){return this.world.removeContactMaterial(a),this.onContactMaterialRemoved.dispatch(a),a},getContactMaterial:function(a,b){return this.world.getContactMaterial(a,b)},setMaterial:function(a,b){for(var c=b.length;c--;)b.setMaterial(a)},createMaterial:function(a,b){a=a||"";var c=new Phaser.Physics.P2.Material(a);return this.materials.push(c),"undefined"!=typeof b&&b.setMaterial(c),c},createContactMaterial:function(a,b,c){"undefined"==typeof a&&(a=this.createMaterial()),"undefined"==typeof b&&(b=this.createMaterial());var d=new Phaser.Physics.P2.ContactMaterial(a,b,c);return this.addContactMaterial(d)},getBodies:function(){for(var a=[],b=this.world.bodies.length;b--;)a.push(this.world.bodies[b].parent);return a},getBody:function(a){return a instanceof p2.Body?a:a instanceof Phaser.Physics.P2.Body?a.data:a.body&&a.body.type===Phaser.Physics.P2JS?a.body.data:null},getSprings:function(){for(var a=[],b=this.world.springs.length;b--;)a.push(this.world.springs[b].parent);return a},getConstraints:function(){for(var a=[],b=this.world.constraints.length;b--;)a.push(this.world.constraints[b].parent);return a},hitTest:function(a,b,c,d){"undefined"==typeof b&&(b=this.world.bodies),"undefined"==typeof c&&(c=5),"undefined"==typeof d&&(d=!1);for(var e=[this.pxmi(a.x),this.pxmi(a.y)],f=[],g=b.length;g--;)b[g]instanceof Phaser.Physics.P2.Body&&(!d||b[g].data.motionState!==p2.Body.STATIC)?f.push(b[g].data):b[g]instanceof p2.Body&&b[g].parent&&(!d||b[g].motionState!==p2.Body.STATIC)?f.push(b[g]):b[g]instanceof Phaser.Sprite&&b[g].hasOwnProperty("body")&&(!d||b[g].body.data.motionState!==p2.Body.STATIC)&&f.push(b[g].body.data);return this.world.hitTest(e,f,c)},toJSON:function(){return this.world.toJSON()},createCollisionGroup:function(a){var b=Math.pow(2,this._collisionGroupID);this._wallShapes[0]&&(this._wallShapes[0].collisionMask=this._wallShapes[0].collisionMask|b),this._wallShapes[1]&&(this._wallShapes[1].collisionMask=this._wallShapes[1].collisionMask|b),this._wallShapes[2]&&(this._wallShapes[2].collisionMask=this._wallShapes[2].collisionMask|b),this._wallShapes[3]&&(this._wallShapes[3].collisionMask=this._wallShapes[3].collisionMask|b),this._collisionGroupID++;var c=new Phaser.Physics.P2.CollisionGroup(b);return this.collisionGroups.push(c),a&&this.setCollisionGroup(a,c),c},setCollisionGroup:function(a,b){if(a instanceof Phaser.Group)for(var c=0;ce;e++){var g=a.collision[b][e],h=this.createBody(g.x,g.y,0,c,{},g.polyline);h&&d.push(h)}return d},clearTilemapLayerBodies:function(a,b){b=a.getLayer(b);for(var c=a.layers[b].bodies.length;c--;)a.layers[b].bodies[c].destroy();a.layers[b].bodies.length=[]},convertTilemap:function(a,b,c,d){b=a.getLayer(b),"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!0),this.clearTilemapLayerBodies(a,b);for(var e=0,f=0,g=0,h=0,i=a.layers[b].height;i>h;h++){e=0;for(var j=0,k=a.layers[b].width;k>j;j++){var l=a.layers[b].data[h][j];if(l)if(d){var m=a.getTileRight(b,j,h);if(0===e&&(f=l.x*l.width,g=l.y*l.height,e=l.width),m&&m.collides)e+=l.width;else{var n=this.createBody(f,g,0,!1);n.addRectangle(e,l.height,e/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n),e=0}}else{var n=this.createBody(l.x*l.width,l.y*l.height,0,!1);n.addRectangle(l.width,l.height,l.width/2,l.height/2,0),c&&this.addBody(n),a.layers[b].bodies.push(n)}}}return a.layers[b].bodies},mpx:function(a){return a*=20},pxm:function(a){return.05*a},mpxi:function(a){return a*=-20},pxmi:function(a){return a*-.05}},Object.defineProperty(Phaser.Physics.P2.prototype,"friction",{get:function(){return this.world.defaultFriction},set:function(a){this.world.defaultFriction=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"restituion",{get:function(){return this.world.defaultRestitution},set:function(a){this.world.defaultRestitution=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applySpringForces",{get:function(){return this.world.applySpringForces},set:function(a){this.world.applySpringForces=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyDamping",{get:function(){return this.world.applyDamping},set:function(a){this.world.applyDamping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"applyGravity",{get:function(){return this.world.applyGravity},set:function(a){this.world.applyGravity=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"solveConstraints",{get:function(){return this.world.solveConstraints},set:function(a){this.world.solveConstraints=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"time",{get:function(){return this.world.time +}}),Object.defineProperty(Phaser.Physics.P2.prototype,"emitImpactEvent",{get:function(){return this.world.emitImpactEvent},set:function(a){this.world.emitImpactEvent=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"enableBodySleeping",{get:function(){return this.world.enableBodySleeping},set:function(a){this.world.enableBodySleeping=a}}),Object.defineProperty(Phaser.Physics.P2.prototype,"total",{get:function(){return this.world.bodies.length}}),Phaser.Physics.P2.PointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.PointProxy.prototype.constructor=Phaser.Physics.P2.PointProxy,Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(a)}}),Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(a)}}),Phaser.Physics.P2.InversePointProxy=function(a,b){this.world=a,this.destination=b},Phaser.Physics.P2.InversePointProxy.prototype.constructor=Phaser.Physics.P2.InversePointProxy,Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"x",{get:function(){return this.destination[0]},set:function(a){this.destination[0]=this.world.pxm(-a)}}),Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype,"y",{get:function(){return this.destination[1]},set:function(a){this.destination[1]=this.world.pxm(-a)}}),Phaser.Physics.P2.Body=function(a,b,c,d,e){b=b||null,c=c||0,d=d||0,"undefined"==typeof e&&(e=1),this.game=a,this.world=a.physics.p2,this.sprite=b,this.type=Phaser.Physics.P2JS,this.offset=new Phaser.Point,this.data=new p2.Body({position:[this.world.pxmi(c),this.world.pxmi(d)],mass:e}),this.data.parent=this,this.velocity=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.velocity),this.force=new Phaser.Physics.P2.InversePointProxy(this.world,this.data.force),this.gravity=new Phaser.Point,this.onImpact=new Phaser.Signal,this.onBeginContact=new Phaser.Signal,this.onEndContact=new Phaser.Signal,this.collidesWith=[],this.removeNextStep=!1,this._collideWorldBounds=!0,this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody=null,b&&(this.setRectangleFromSprite(b),b.exists&&this.game.physics.p2.addBody(this))},Phaser.Physics.P2.Body.prototype={createBodyCallback:function(a,b,c){var d=-1;a.id?d=a.id:a.body&&(d=a.body.id),d>-1&&(null===b?(delete this._bodyCallbacks[d],delete this._bodyCallbackContext[d]):(this._bodyCallbacks[d]=b,this._bodyCallbackContext[d]=c))},createGroupCallback:function(a,b,c){null===b?(delete this._groupCallbacks[a.mask],delete this._groupCallbacksContext[a.mask]):(this._groupCallbacks[a.mask]=b,this._groupCallbackContext[a.mask]=c)},getCollisionMask:function(){var a=0;this._collideWorldBounds&&(a=this.game.physics.p2.boundsCollisionGroup.mask);for(var b=0;b=0;c--)this.data.shapes[c].collisionMask=b;else a.collisionMask=b},setCollisionGroup:function(a,b){var c=this.getCollisionMask();if("undefined"==typeof b)for(var d=this.data.shapes.length-1;d>=0;d--)this.data.shapes[d].collisionGroup=a.mask,this.data.shapes[d].collisionMask=c;else b.collisionGroup=a.mask,b.collisionMask=c},clearCollision:function(a,b,c){if("undefined"==typeof c)for(var d=this.data.shapes.length-1;d>=0;d--)a&&(this.data.shapes[d].collisionGroup=null),b&&(this.data.shapes[d].collisionMask=null);else a&&(c.collisionGroup=null),b&&(c.collisionMask=null);a&&(this.collidesWith.length=0)},collides:function(a,b,c,d){if(Array.isArray(a))for(var e=0;e=0;e--)this.data.shapes[e].collisionMask=f;else d.collisionMask=f},adjustCenterOfMass:function(){this.data.adjustCenterOfMass()},applyDamping:function(a){this.data.applyDamping(a)},applyForce:function(a,b,c){this.data.applyForce(a,[this.world.pxm(b),this.world.pxm(c)])},setZeroForce:function(){this.data.setZeroForce()},setZeroRotation:function(){this.data.angularVelocity=0},setZeroVelocity:function(){this.data.velocity[0]=0,this.data.velocity[1]=0},setZeroDamping:function(){this.data.damping=0,this.data.angularDamping=0},toLocalFrame:function(a,b){return this.data.toLocalFrame(a,b)},toWorldFrame:function(a,b){return this.data.toWorldFrame(a,b)},rotateLeft:function(a){this.data.angularVelocity=this.world.pxm(-a)},rotateRight:function(a){this.data.angularVelocity=this.world.pxm(a)},moveForward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=b*Math.cos(c),this.data.velocity[1]=b*Math.sin(c)},moveBackward:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.velocity[0]=-(b*Math.cos(c)),this.data.velocity[1]=-(b*Math.sin(c))},thrust:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]+=b*Math.cos(c),this.data.force[1]+=b*Math.sin(c)},reverse:function(a){var b=this.world.pxmi(-a),c=this.data.angle+Math.PI/2;this.data.force[0]-=b*Math.cos(c),this.data.force[1]-=b*Math.sin(c)},moveLeft:function(a){this.data.velocity[0]=this.world.pxmi(-a)},moveRight:function(a){this.data.velocity[0]=this.world.pxmi(a)},moveUp:function(a){this.data.velocity[1]=this.world.pxmi(-a)},moveDown:function(a){this.data.velocity[1]=this.world.pxmi(a)},preUpdate:function(){this.removeNextStep&&(this.removeFromWorld(),this.removeNextStep=!1)},postUpdate:function(){this.sprite.x=this.world.mpxi(this.data.position[0]),this.sprite.y=this.world.mpxi(this.data.position[1]),this.fixedRotation||(this.sprite.rotation=this.data.angle)},reset:function(a,b,c,d){"undefined"==typeof c&&(c=!1),"undefined"==typeof d&&(d=!1),this.setZeroForce(),this.setZeroVelocity(),this.setZeroRotation(),c&&this.setZeroDamping(),d&&(this.mass=1),this.x=a,this.y=b},addToWorld:function(){this.data.world!==this.game.physics.p2.world&&this.game.physics.p2.addBody(this)},removeFromWorld:function(){this.data.world===this.game.physics.p2.world&&this.game.physics.p2.removeBodyNextStep(this)},destroy:function(){this.removeFromWorld(),this.clearShapes(),this._bodyCallbacks={},this._bodyCallbackContext={},this._groupCallbacks={},this._groupCallbackContext={},this.debugBody&&this.debugBody.destroy(),this.debugBody=null,this.sprite=null},clearShapes:function(){for(var a=this.data.shapes.length;a--;)this.data.removeShape(this.data.shapes[a]);this.shapeChanged()},addShape:function(a,b,c,d){return"undefined"==typeof b&&(b=0),"undefined"==typeof c&&(c=0),"undefined"==typeof d&&(d=0),this.data.addShape(a,[this.world.pxmi(b),this.world.pxmi(c)],d),this.shapeChanged(),a},addCircle:function(a,b,c,d){var e=new p2.Circle(this.world.pxm(a));return this.addShape(e,b,c,d)},addRectangle:function(a,b,c,d,e){var f=new p2.Rectangle(this.world.pxm(a),this.world.pxm(b));return this.addShape(f,c,d,e)},addPlane:function(a,b,c){var d=new p2.Plane;return this.addShape(d,a,b,c)},addParticle:function(a,b,c){var d=new p2.Particle;return this.addShape(d,a,b,c)},addLine:function(a,b,c,d){var e=new p2.Line(this.world.pxm(a));return this.addShape(e,b,c,d)},addCapsule:function(a,b,c,d,e){var f=new p2.Capsule(this.world.pxm(a),b);return this.addShape(f,c,d,e)},addPolygon:function(a,b){a=a||{},b=Array.prototype.slice.call(arguments,1);var c=[];if(1===b.length&&Array.isArray(b[0]))c=b[0].slice(0);else if(Array.isArray(b[0]))c=b[0].slice(0);else if("number"==typeof b[0])for(var d=0,e=b.length;e>d;d+=2)c.push([b[d],b[d+1]]);var f=c.length-1;c[f][0]===c[0][0]&&c[f][1]===c[0][1]&&c.pop();for(var g=0;g=0;c--)this.data.shapes[c].material=a;else b.material=a},shapeChanged:function(){this.debugBody&&this.debugBody.draw()},addPhaserPolygon:function(a,b){for(var c=this.game.cache.getPhysicsData(a,b),d=[],e=0;eg;g+=2)e.push([f.shape[g],f.shape[g+1]]);return this.addPolygon(c,e)}for(var i=p2.vec2.create(),g=0;g=0?o>n:n>o;e=o>=0?++n:--n)k=b.vertices[e],p2.vec2.rotate(m,k,a),l.push([(m[0]+i[0])*this.ppu,-(m[1]+i[1])*this.ppu]);this.drawConvex(j,l,b.triangles,f,c,g,this.settings.debugPolygons,[i[0]*this.ppu,-i[1]*this.ppu])}else b instanceof p2.Plane?this.drawPlane(j,i[0]*this.ppu,-i[1]*this.ppu,c,f,5*g,10*g,10*g,100*this.ppu,a):b instanceof p2.Line?this.drawLine(j,b.length*this.ppu,f,g):b instanceof p2.Rectangle&&this.drawRectangle(j,i[0]*this.ppu,-i[1]*this.ppu,a,b.width*this.ppu,b.height*this.ppu,f,c,g);d++}}},drawRectangle:function(a,b,c,d,e,f,g,h,i){"undefined"==typeof i&&(i=1),"undefined"==typeof g&&(g=0),a.lineStyle(i,g,1),a.beginFill(h),a.drawRect(b-e/2,c-f/2,e,f)},drawCircle:function(a,b,c,d,e,f,g){"undefined"==typeof g&&(g=1),"undefined"==typeof f&&(f=16777215),a.lineStyle(g,0,1),a.beginFill(f,1),a.drawCircle(b,c,-e),a.endFill(),a.moveTo(b,c),a.lineTo(b+e*Math.cos(-d),c+e*Math.sin(-d))},drawLine:function(a,b,c,d){"undefined"==typeof d&&(d=1),"undefined"==typeof c&&(c=0),a.lineStyle(5*d,c,1),a.moveTo(-b/2,0),a.lineTo(b/2,0)},drawConvex:function(a,b,c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q,r,s;if("undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=0),g){for(i=[16711680,65280,255],j=0;j!==b.length+1;)l=b[j%b.length],m=b[(j+1)%b.length],o=l[0],r=l[1],p=m[0],s=m[1],a.lineStyle(f,i[j%i.length],1),a.moveTo(o,-r),a.lineTo(p,-s),a.drawCircle(o,-r,2*f),j++;return a.lineStyle(f,0,1),a.drawCircle(h[0],h[1],2*f)}for(a.lineStyle(f,d,1),a.beginFill(e),j=0;j!==b.length;)k=b[j],n=k[0],q=k[1],0===j?a.moveTo(n,-q):a.lineTo(n,-q),j++;return a.endFill(),b.length>2?(a.moveTo(b[b.length-1][0],-b[b.length-1][1]),a.lineTo(b[0][0],-b[0][1])):void 0},drawPath:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r;for("undefined"==typeof e&&(e=1),"undefined"==typeof c&&(c=0),a.lineStyle(e,c,1),"number"==typeof d&&a.beginFill(d),h=null,i=null,g=0;g2&&"number"==typeof d&&(a.moveTo(b[b.length-1][0],b[b.length-1][1]),a.lineTo(b[0][0],b[0][1]))},drawPlane:function(a,b,c,d,e,f,g,h,i,j){var k,l,m;"undefined"==typeof f&&(f=1),"undefined"==typeof d&&(d=16777215),a.lineStyle(f,e,11),a.beginFill(d),k=i,a.moveTo(b,-c),l=b+Math.cos(j)*this.game.width,m=c+Math.sin(j)*this.game.height,a.lineTo(l,-m),a.moveTo(b,-c),l=b+Math.cos(j)*-this.game.width,m=c+Math.sin(j)*-this.game.height,a.lineTo(l,-m)},randomPastelHex:function(){var a,b,c,d;return c=[255,255,255],d=Math.floor(256*Math.random()),b=Math.floor(256*Math.random()),a=Math.floor(256*Math.random()),d=Math.floor((d+3*c[0])/4),b=Math.floor((b+3*c[1])/4),a=Math.floor((a+3*c[2])/4),this.rgbToHex(d,b,a)},rgbToHex:function(a,b,c){return this.componentToHex(a)+this.componentToHex(b)+this.componentToHex(c)},componentToHex:function(a){var b;return b=a.toString(16),2===b.len?b:b+"0"}}),Phaser.Physics.P2.Spring=function(a,b,c,d,e,f,g,h,i,j){this.game=a.game,this.world=a,"undefined"==typeof d&&(d=1),"undefined"==typeof e&&(e=100),"undefined"==typeof f&&(f=1),d=a.pxm(d);var k={restLength:d,stiffness:e,damping:f};"undefined"!=typeof g&&null!==g&&(k.worldAnchorA=[a.pxm(g[0]),a.pxm(g[1])]),"undefined"!=typeof h&&null!==h&&(k.worldAnchorB=[a.pxm(h[0]),a.pxm(h[1])]),"undefined"!=typeof i&&null!==i&&(k.localAnchorA=[a.pxm(i[0]),a.pxm(i[1])]),"undefined"!=typeof j&&null!==j&&(k.localAnchorB=[a.pxm(j[0]),a.pxm(j[1])]),p2.Spring.call(this,b,c,k)},Phaser.Physics.P2.Spring.prototype=Object.create(p2.Spring.prototype),Phaser.Physics.P2.Spring.prototype.constructor=Phaser.Physics.P2.Spring,Phaser.Physics.P2.Material=function(a){this.name=a,p2.Material.call(this)},Phaser.Physics.P2.Material.prototype=Object.create(p2.Material.prototype),Phaser.Physics.P2.Material.prototype.constructor=Phaser.Physics.P2.Material,Phaser.Physics.P2.ContactMaterial=function(a,b,c){p2.ContactMaterial.call(this,a,b,c)},Phaser.Physics.P2.ContactMaterial.prototype=Object.create(p2.ContactMaterial.prototype),Phaser.Physics.P2.ContactMaterial.prototype.constructor=Phaser.Physics.P2.ContactMaterial,Phaser.Physics.P2.CollisionGroup=function(a){this.mask=a},Phaser.Physics.P2.DistanceConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=100),this.game=a.game,this.world=a,d=a.pxm(d),p2.DistanceConstraint.call(this,b,c,d,e)},Phaser.Physics.P2.DistanceConstraint.prototype=Object.create(p2.DistanceConstraint.prototype),Phaser.Physics.P2.DistanceConstraint.prototype.constructor=Phaser.Physics.P2.DistanceConstraint,Phaser.Physics.P2.GearConstraint=function(a,b,c,d,e){"undefined"==typeof d&&(d=0),"undefined"==typeof e&&(e=1),this.game=a.game,this.world=a;var f={angle:d,ratio:e};p2.GearConstraint.call(this,b,c,f)},Phaser.Physics.P2.GearConstraint.prototype=Object.create(p2.GearConstraint.prototype),Phaser.Physics.P2.GearConstraint.prototype.constructor=Phaser.Physics.P2.GearConstraint,Phaser.Physics.P2.LockConstraint=function(a,b,c,d,e,f){"undefined"==typeof d&&(d=[0,0]),"undefined"==typeof e&&(e=0),"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,d=[a.pxm(d[0]),a.pxm(d[1])];var g={localOffsetB:d,localAngleB:e,maxForce:f};p2.LockConstraint.call(this,b,c,g)},Phaser.Physics.P2.LockConstraint.prototype=Object.create(p2.LockConstraint.prototype),Phaser.Physics.P2.LockConstraint.prototype.constructor=Phaser.Physics.P2.LockConstraint,Phaser.Physics.P2.PrismaticConstraint=function(a,b,c,d,e,f,g,h){"undefined"==typeof d&&(d=!0),"undefined"==typeof e&&(e=[0,0]),"undefined"==typeof f&&(f=[0,0]),"undefined"==typeof g&&(g=[0,0]),"undefined"==typeof h&&(h=Number.MAX_VALUE),this.game=a.game,this.world=a,e=[a.pxmi(e[0]),a.pxmi(e[1])],f=[a.pxmi(f[0]),a.pxmi(f[1])];var i={localAnchorA:e,localAnchorB:f,localAxisA:g,maxForce:h,disableRotationalLock:!d};p2.PrismaticConstraint.call(this,b,c,i)},Phaser.Physics.P2.PrismaticConstraint.prototype=Object.create(p2.PrismaticConstraint.prototype),Phaser.Physics.P2.PrismaticConstraint.prototype.constructor=Phaser.Physics.P2.PrismaticConstraint,Phaser.Physics.P2.RevoluteConstraint=function(a,b,c,d,e,f){"undefined"==typeof f&&(f=Number.MAX_VALUE),this.game=a.game,this.world=a,c=[a.pxmi(c[0]),a.pxmi(c[1])],e=[a.pxmi(e[0]),a.pxmi(e[1])],p2.RevoluteConstraint.call(this,b,c,d,e,f)},Phaser.Physics.P2.RevoluteConstraint.prototype=Object.create(p2.RevoluteConstraint.prototype),Phaser.Physics.P2.RevoluteConstraint.prototype.constructor=Phaser.Physics.P2.RevoluteConstraint; //# sourceMappingURL=phaser.map \ No newline at end of file diff --git a/changelog.md b/changelog.md index af0c111d93..474969953d 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,35 @@ Change Log There is an extensive [Migration Guide](https://github.com/photonstorm/phaser/blob/master/resources/Migration%20Guide.md) available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system. +Version 2.0.2 - "Ghealdan" - 28th March 2014 +-------------------------------------------- + +Bug Fixes + +* Sprite would glitch if it had an ArcadePhysics Body that was re-positioned out of loop. +* Sprite would "fly off" if it had an ArcadePhysics Body that was re-positioned during an input handler. +* Tween.generateData would enter an eternal loop if the total resulted in a float. Now wrapped in Math.floor. +* ArcadePhysics.Body preUpdate has been modified to stop Sprites with non-1 scaling from gaining delta and moving off the screen (fix #644). +* ArcadePhysics.Body deltaMaxY wasn't being correctly applied. +* P2.World - Removing tilemap layer retrieval for object layers in convertCollisionObjects() (thanks bmceldowney, fix #653) +* Calling Keyboard.stop() wouldn't let you call Keyboard.start() later on in the same game + + +Updated + +* The "Build your First Phaser Game" Tutorial has been updated for Phaser 2 +* Line.fromSprite now sets "fromCenter" to false by default as Sprite.center is deprecated in 2.x. Documentation and Examples updated to reflect this. +* All the documentation has been re-published for 2.0.2. +* Lots of ArcadePhysics.World methods have been marked as private where they shouldn't be called directly (separateX, etc) +* xtian jshint fixed nearly every single file in the repository! + + +New Features + +* Sprite.overlap lets you quickly check to see if the bounds of two display objects are intersecting or not, without having to use a physics system. +* Keyboard.destroy will now clear all event listeners and any custom set callbacks or Keys. + + Version 2.0.1 - "Lyrelle" - 24th March 2014 ------------------------------------------- diff --git a/docs/AABB.js.html b/docs/AABB.js.html index 2d51e10f24..e6ff2e2b63 100644 --- a/docs/AABB.js.html +++ b/docs/AABB.js.html @@ -507,7 +507,8 @@

Source: physics/ninja/AABB.js

-
/**
+            
/* jshint camelcase: false */
+/**
 * @author       Richard Davey <rich@photonstorm.com>
 * @copyright    2014 Photon Storm Ltd.
 * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
@@ -527,7 +528,7 @@ 

Source: physics/ninja/AABB.js

* @param {number} height - The height of this AABB. */ Phaser.Physics.Ninja.AABB = function (body, x, y, width, height) { - + /** * @property {Phaser.Physics.Ninja.Body} system - A reference to the body that owns this shape. */ @@ -644,7 +645,7 @@

Source: physics/ninja/AABB.js

* @param {number} dy - Collision normal * @param {number} obj - Object this AABB collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -753,16 +754,6 @@

Source: physics/ninja/AABB.js

var vx1 = this.pos.x - this.oldpos.x; // Calc velocity of this object var vy1 = this.pos.y - this.oldpos.y; var dp1 = (vx1 * dx + vy1 * dy); // Find component of velocity parallel to collision normal - var nx1 = dp1 * dx; // Project velocity onto collision normal - var ny1 = dp1 * dy; // nx, ny is normal velocity - - var dx2 = dx * -1; - var dy2 = dy * -1; - var vx2 = obj.pos.x - obj.oldpos.x; // Calc velocity of colliding object - var vy2 = obj.pos.y - obj.oldpos.y; - var dp2 = (vx2 * dx2 + vy2 * dy2); // Find component of velocity parallel to collision normal - var nx2 = dp2 * dx2; // Project velocity onto collision normal - var ny2 = dp2 * dy2; // nx, ny is normal velocity // We only want to apply collision response forces if the object is travelling into, and not out of, the collision if (this.body.immovable && obj.body.immovable) @@ -1043,16 +1034,16 @@

Source: physics/ninja/AABB.js

projAABB_Half: function (x, y, obj, t) { //signx or signy must be 0; the other must be -1 or 1 - //calculate the projection vector for the half-edge, and then + //calculate the projection vector for the half-edge, and then //(if collision is occuring) pick the minimum - + var sx = t.signx; var sy = t.signy; - + var ox = (obj.pos.x - (sx*obj.xw)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*obj.yw)) - t.pos.y;//point on the AABB, relative to the tile center - //we perform operations analogous to the 45deg tile, except we're using + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope @@ -1063,11 +1054,11 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { //project along axis; note that we're assuming that this tile is horizontal OR vertical @@ -1077,14 +1068,14 @@

Source: physics/ninja/AABB.js

return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { //note that we could use -= instead of -dp obj.reportCollisionVsWorld(sx,sy,t.signx, t.signy, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1109,7 +1100,7 @@

Source: physics/ninja/AABB.js

var sx = t.sx; var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1118,8 +1109,8 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1138,7 +1129,7 @@

Source: physics/ninja/AABB.js

return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1153,7 +1144,7 @@

Source: physics/ninja/AABB.js

* @return {number} The result of the collision. */ projAABB_22DegS: function (x, y, obj, t) { - + var signx = t.signx; var signy = t.signy; @@ -1166,10 +1157,10 @@

Source: physics/ninja/AABB.js

{ var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1178,11 +1169,11 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + var aY = Math.abs(penY); if (lenP < lenN) @@ -1190,13 +1181,13 @@

Source: physics/ninja/AABB.js

if (aY < lenP) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -1205,7 +1196,7 @@

Source: physics/ninja/AABB.js

if (aY < lenN) { obj.reportCollisionVsWorld(0, penY, 0, penY/aY, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else @@ -1217,7 +1208,7 @@

Source: physics/ninja/AABB.js

} } } - + //if we've reached this point, no collision has occured return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1239,10 +1230,10 @@

Source: physics/ninja/AABB.js

var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1251,7 +1242,7 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1259,18 +1250,18 @@

Source: physics/ninja/AABB.js

if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } - + } - + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1300,7 +1291,7 @@

Source: physics/ninja/AABB.js

var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need to project it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1309,7 +1300,7 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; + sy *= -dp; var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); @@ -1321,13 +1312,13 @@

Source: physics/ninja/AABB.js

if (aX < lenP) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.AABB.COL_AXIS; } } @@ -1336,11 +1327,11 @@

Source: physics/ninja/AABB.js

if (aX < lenN) { obj.reportCollisionVsWorld(penX, 0, penX/aX, 0, t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.AABB.COL_OTHER; @@ -1348,9 +1339,9 @@

Source: physics/ninja/AABB.js

} } } - + //if we've reached this point, no collision has occured - return Phaser.Physics.Ninja.AABB.COL_NONE; + return Phaser.Physics.Ninja.AABB.COL_NONE; }, @@ -1368,13 +1359,13 @@

Source: physics/ninja/AABB.js

var signx = t.signx; var signy = t.signy; - + var ox = (obj.pos.x - (signx*obj.xw)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*obj.yw)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + var sx = t.sx;//get slope unit normal var sy = t.sy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); @@ -1383,11 +1374,11 @@

Source: physics/ninja/AABB.js

{ //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); @@ -1395,14 +1386,14 @@

Source: physics/ninja/AABB.js

return Phaser.Physics.Ninja.AABB.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.AABB.COL_OTHER; } } - - return Phaser.Physics.Ninja.AABB.COL_NONE; + + return Phaser.Physics.Ninja.AABB.COL_NONE; }, /** @@ -1439,7 +1430,7 @@

Source: physics/ninja/AABB.js

var lenP = Math.sqrt(x * x + y * y); obj.reportCollisionVsWorld(x, y, x / lenP, y / lenP, t); - return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report + return Phaser.Physics.Ninja.AABB.COL_AXIS;//we need to report } else if (0 < pen) { @@ -1510,7 +1501,7 @@

Source: physics/ninja/AABB.js

} return Phaser.Physics.Ninja.AABB.COL_NONE; - + }, /** @@ -1523,7 +1514,7 @@

Source: physics/ninja/AABB.js

this.system = null; } -} +};
@@ -1545,7 +1536,7 @@

Source: physics/ninja/AABB.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Animation.js.html b/docs/Animation.js.html index c972e36a64..9ce98c7a6e 100644 --- a/docs/Animation.js.html +++ b/docs/Animation.js.html @@ -648,7 +648,7 @@

Source: animation/Animation.js

// Set-up some event listeners this.game.onPause.add(this.onPause, this); this.game.onResume.add(this.onResume, this); - + }; Phaser.Animation.prototype = { @@ -847,7 +847,7 @@

Source: animation/Animation.js

this._parent.tilingTexture = false; } } - + this.loopCount++; this._parent.events.onAnimationLoop.dispatch(this._parent, this); this.onLoop.dispatch(this._parent, this); @@ -1095,7 +1095,7 @@

Source: animation/Animation.js

return output; -} +}; @@ -1117,7 +1117,7 @@

Source: animation/Animation.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/AnimationManager.js.html b/docs/AnimationManager.js.html index 45df060130..d222c66334 100644 --- a/docs/AnimationManager.js.html +++ b/docs/AnimationManager.js.html @@ -538,7 +538,7 @@

Source: animation/AnimationManager.js

* @default */ this.currentFrame = null; - + /** * @property {boolean} updateIfVisible - Should the animation data continue to update even if the Sprite.visible is set to false. * @default @@ -692,7 +692,7 @@

Source: animation/AnimationManager.js

/** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. - * + * * @method Phaser.AnimationManager#play * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". * @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used. @@ -754,7 +754,7 @@

Source: animation/AnimationManager.js

/** * The main update function is called by the Sprites update loop. It's responsible for updating animation frames and firing related events. - * + * * @method Phaser.AnimationManager#update * @protected * @return {boolean} True if a new animation frame has been set, otherwise false. @@ -852,7 +852,7 @@

Source: animation/AnimationManager.js

* @readonly */ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameTotal', { - + get: function () { if (this._frameData) @@ -899,7 +899,7 @@

Source: animation/AnimationManager.js

{ return this._frameIndex; } - + }, set: function (value) { @@ -907,12 +907,12 @@

Source: animation/AnimationManager.js

if (typeof value === 'number' && this._frameData && this._frameData.getFrame(value) !== null) { this.currentFrame = this._frameData.getFrame(value); - + if (this.currentFrame) { this._frameIndex = value; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -950,7 +950,7 @@

Source: animation/AnimationManager.js

{ this._frameIndex = this.currentFrame.index; this.sprite.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); - + if (this.sprite.__tilePattern) { this.__tilePattern = false; @@ -986,7 +986,7 @@

Source: animation/AnimationManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/AnimationParser.js.html b/docs/AnimationParser.js.html index 7b43bccd37..7324083de5 100644 --- a/docs/AnimationParser.js.html +++ b/docs/AnimationParser.js.html @@ -559,7 +559,7 @@

Source: animation/AnimationParser.js

var row = Math.floor((width - margin) / (frameWidth + spacing)); var column = Math.floor((height - margin) / (frameHeight + spacing)); var total = row * column; - + if (frameMax !== -1) { total = frameMax; @@ -624,11 +624,11 @@

Source: animation/AnimationParser.js

// Let's create some frames then var data = new Phaser.FrameData(); - + // By this stage frames is a fully parsed array var frames = json['frames']; var newFrame; - + for (var i = 0; i < frames.length; i++) { var uuid = game.rnd.uuid(); @@ -689,7 +689,7 @@

Source: animation/AnimationParser.js

console.log(json); return; } - + // Let's create some frames then var data = new Phaser.FrameData(); @@ -697,7 +697,7 @@

Source: animation/AnimationParser.js

var frames = json['frames']; var newFrame; var i = 0; - + for (var key in frames) { var uuid = game.rnd.uuid(); @@ -775,7 +775,7 @@

Source: animation/AnimationParser.js

var frameY; var frameWidth; var frameHeight; - + for (var i = 0; i < frames.length; i++) { uuid = game.rnd.uuid(); @@ -843,7 +843,7 @@

Source: animation/AnimationParser.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BitmapData.js.html b/docs/BitmapData.js.html index a11f419efa..c02ee4bfe8 100644 --- a/docs/BitmapData.js.html +++ b/docs/BitmapData.js.html @@ -533,7 +533,7 @@

Source: gameobjects/BitmapData.js

if (typeof height === 'undefined') { height = 100; } /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -546,7 +546,7 @@

Source: gameobjects/BitmapData.js

* @property {number} width - The width of the BitmapData in pixels. */ this.width = width; - + /** * @property {number} height - The height of the BitmapData in pixels. */ @@ -557,7 +557,7 @@

Source: gameobjects/BitmapData.js

* @default */ this.canvas = Phaser.Canvas.create(width, height, '', true); - + /** * @property {CanvasRenderingContext2D} context - The 2d context of the canvas. * @default @@ -591,13 +591,13 @@

Source: gameobjects/BitmapData.js

* @default */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - The PIXI.Texture. * @default */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - The Frame this BitmapData uses for rendering. * @default @@ -615,13 +615,13 @@

Source: gameobjects/BitmapData.js

*/ this.dirty = false; -} +}; Phaser.BitmapData.prototype = { /** * Updates the given objects so that they use this BitmapData as their texture. This will replace any texture they will currently have set. - * + * * @method Phaser.BitmapData#add * @param {Phaser.Sprite|Phaser.Sprite[]|Phaser.Image|Phaser.Image[]} object - Either a single Sprite/Image or an Array of Sprites/Images. */ @@ -651,7 +651,7 @@

Source: gameobjects/BitmapData.js

clear: function () { this.context.clearRect(0, 0, this.width, this.height); - + this.dirty = true; }, @@ -672,7 +672,7 @@

Source: gameobjects/BitmapData.js

this.textureFrame.height = height; this.imageData = this.context.getImageData(0, 0, width, height); } - + this.dirty = true; }, @@ -908,7 +908,7 @@

Source: gameobjects/BitmapData.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BitmapText.js.html b/docs/BitmapText.js.html index a6b6699008..387bb45318 100644 --- a/docs/BitmapText.js.html +++ b/docs/BitmapText.js.html @@ -545,7 +545,7 @@

Source: gameobjects/BitmapText.js

*/ this.game = game; - /** + /** * @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all. * @default */ @@ -686,7 +686,7 @@

Source: gameobjects/BitmapText.js

return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -695,7 +695,7 @@

Source: gameobjects/BitmapText.js

*/ Phaser.BitmapText.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -710,7 +710,7 @@

Source: gameobjects/BitmapText.js

this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this BitmapText instance. This will remove any filters and un-parent any children. @@ -766,7 +766,7 @@

Source: gameobjects/BitmapText.js

this.mask = null; this.game = null; -} +}; /** * @name Phaser.BitmapText#align @@ -910,7 +910,7 @@

Source: gameobjects/BitmapText.js

* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.BitmapText.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -947,7 +947,7 @@

Source: gameobjects/BitmapText.js

* @property {boolean} fixedToCamera - Set to true to fix this BitmapText to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.BitmapText.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -989,7 +989,7 @@

Source: gameobjects/BitmapText.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Body.js.html b/docs/Body.js.html index 05264ee07d..bb348f6b13 100644 --- a/docs/Body.js.html +++ b/docs/Body.js.html @@ -700,12 +700,6 @@

Source: physics/arcade/Body.js

*/ this.speed = 0; - /** - * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to any QuadTrees. - * @default - this.skipQuadTree = false; - */ - /** * @property {number} facing - A const reference to the direction the Body is traveling or facing. * @default @@ -801,6 +795,17 @@

Source: physics/arcade/Body.js

*/ this.tilePadding = new Phaser.Point(); + /** + * @property {number} phaser - Is this Body in a preUpdate or postUpdate state? + */ + this.phase = 0; + + /** + * @property {boolean} _reset - Internal cache var. + * @private + */ + this._reset = true; + /** * @property {number} _sx - Internal cache var. * @private @@ -850,11 +855,9 @@

Source: physics/arcade/Body.js

this._sy = asy; this.center.setTo(this.position.x + this.halfWidth, this.position.y + this.halfHeight); - return true; + this._reset = true; } - return false; - }, /** @@ -865,6 +868,8 @@

Source: physics/arcade/Body.js

*/ preUpdate: function () { + this.phase = 1; + // Store and reset collision flags this.wasTouching.none = this.touching.none; this.wasTouching.up = this.touching.up; @@ -885,13 +890,15 @@

Source: physics/arcade/Body.js

this.embedded = false; + this.updateBounds(); + this.position.x = (this.sprite.world.x - (this.sprite.anchor.x * this.width)) + this.offset.x; this.position.y = (this.sprite.world.y - (this.sprite.anchor.y * this.height)) + this.offset.y; this.rotation = this.sprite.angle; this.preRotation = this.rotation; - if (this.updateBounds() || this.sprite._cache[4] === 1) + if (this._reset || this.sprite._cache[4] === 1) { this.prev.x = this.position.x; this.prev.y = this.position.y; @@ -921,6 +928,11 @@

Source: physics/arcade/Body.js

} } + this._dx = this.deltaX(); + this._dy = this.deltaY(); + + this._reset = false; + }, /** @@ -931,6 +943,8 @@

Source: physics/arcade/Body.js

*/ postUpdate: function () { + this.phase = 2; + if (this.deltaX() < 0) { this.facing = Phaser.LEFT; @@ -968,7 +982,7 @@

Source: physics/arcade/Body.js

if (this.deltaMax.y !== 0 && this._dy !== 0) { - if (this._dy < 0 && this._dx < -this.deltaMax.y) + if (this._dy < 0 && this._dy < -this.deltaMax.y) { this._dy = -this.deltaMax.y; } @@ -1178,7 +1192,7 @@

Source: physics/arcade/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "bottom", { - + get: function () { return this.position.y + this.height; } @@ -1191,7 +1205,7 @@

Source: physics/arcade/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "right", { - + get: function () { return this.position.x + this.width; } @@ -1203,12 +1217,13 @@

Source: physics/arcade/Body.js

* @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { - + get: function () { return this.position.x; }, set: function (value) { + this.position.x = value; } @@ -1219,13 +1234,15 @@

Source: physics/arcade/Body.js

* @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", { - + get: function () { return this.position.y; }, set: function (value) { + this.position.y = value; + } }); @@ -1256,7 +1273,7 @@

Source: physics/arcade/Body.js

context.strokeRect(body.position.x - body.game.camera.x, body.position.y - body.game.camera.y, body.width, body.height); } -} +}; /** * Render Sprite Body Physics Data as text. @@ -1270,14 +1287,13 @@

Source: physics/arcade/Body.js

Phaser.Physics.Arcade.Body.renderBodyInfo = function (debug, body) { debug.line('x: ' + body.x.toFixed(2), 'y: ' + body.y.toFixed(2), 'width: ' + body.width, 'height: ' + body.height); - // debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body.deltaX().toFixed(2), 'deltaY: ' + body.deltaY().toFixed(2)); - debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'new velocity x: ' + body.newVelocity.x.toFixed(2), 'y: ' + body.newVelocity.y.toFixed(2)); + debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body._dx.toFixed(2), 'deltaY: ' + body._dy.toFixed(2)); debug.line('acceleration x: ' + body.acceleration.x.toFixed(2), 'y: ' + body.acceleration.y.toFixed(2), 'speed: ' + body.speed.toFixed(2), 'angle: ' + body.angle.toFixed(2)); debug.line('gravity x: ' + body.gravity.x, 'y: ' + body.gravity.y, 'bounce x: ' + body.bounce.x.toFixed(2), 'y: ' + body.bounce.y.toFixed(2)); debug.line('touching left: ' + body.touching.left, 'right: ' + body.touching.right, 'up: ' + body.touching.up, 'down: ' + body.touching.down); debug.line('blocked left: ' + body.blocked.left, 'right: ' + body.blocked.right, 'up: ' + body.blocked.up, 'down: ' + body.blocked.down); -} +}; Phaser.Physics.Arcade.Body.prototype.constructor = Phaser.Physics.Arcade.Body; @@ -1301,7 +1317,7 @@

Source: physics/arcade/Body.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Body.js_.html b/docs/Body.js_.html index eb79c4a2ff..0732676733 100644 --- a/docs/Body.js_.html +++ b/docs/Body.js_.html @@ -950,7 +950,7 @@

Source: physics/ninja/Body.js

* @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "x", { - + get: function () { return this.shape.pos.x; }, @@ -966,7 +966,7 @@

Source: physics/ninja/Body.js

* @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "y", { - + get: function () { return this.shape.pos.y; }, @@ -983,7 +983,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "width", { - + get: function () { return this.shape.width; } @@ -996,7 +996,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "height", { - + get: function () { return this.shape.height; } @@ -1009,7 +1009,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "bottom", { - + get: function () { return this.shape.pos.y + this.shape.yw; } @@ -1022,7 +1022,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "right", { - + get: function () { return this.shape.pos.x + this.shape.xw; } @@ -1035,7 +1035,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "speed", { - + get: function () { return Math.sqrt(this.shape.velocity.x * this.shape.velocity.x + this.shape.velocity.y * this.shape.velocity.y); } @@ -1048,7 +1048,7 @@

Source: physics/ninja/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Body.prototype, "angle", { - + get: function () { return Math.atan2(this.shape.velocity.y, this.shape.velocity.x); } @@ -1076,7 +1076,7 @@

Source: physics/ninja/Body.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Body.js__.html b/docs/Body.js__.html index 5630bb4284..87d85f0c6a 100644 --- a/docs/Body.js__.html +++ b/docs/Body.js__.html @@ -643,7 +643,7 @@

Source: physics/p2/Body.js

/** * @property {Phaser.Physics.P2.BodyDebug} debugBody - Reference to the debug body. */ - this.debugBody = null + this.debugBody = null; // Set-up the default shape if (sprite) @@ -1272,7 +1272,7 @@

Source: physics/p2/Body.js

this.debugBody.destroy(); } - this.debugBody = null + this.debugBody = null; this.sprite = null; @@ -1436,12 +1436,12 @@

Source: physics/p2/Body.js

* This function expects the x.y values to be given in pixels. If you want to provide them at p2 world scales then call Body.data.fromPolygon directly. * * @method Phaser.Physics.P2.Body#addPolygon - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {boolean} True on success, else false. */ @@ -1474,7 +1474,7 @@

Source: physics/p2/Body.js

// top and tail var idx = path.length - 1; - if ( path[idx][0] === path[0][0] && path[idx][1] === path[0][1] ) + if (path[idx][0] === path[0][0] && path[idx][1] === path[0][1]) { path.pop(); } @@ -1589,7 +1589,7 @@

Source: physics/p2/Body.js

} }, - + /** * Updates the debug draw if any body shapes change. * @@ -1632,7 +1632,7 @@

Source: physics/p2/Body.js

return createdFixtures; }, - + /** * Add a polygon fixture. This is used during #loadPhaserPolygon. * @@ -1645,28 +1645,26 @@

Source: physics/p2/Body.js

if (fixtureData.circle) { - var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)) - shape.collisionGroup = fixtureData.filter.categoryBits - shape.collisionMask = fixtureData.filter.maskBits - shape.sensor = fixtureData.isSensor + var shape = new p2.Circle(this.world.pxm(fixtureData.circle.radius)); + shape.collisionGroup = fixtureData.filter.categoryBits; + shape.collisionMask = fixtureData.filter.maskBits; + shape.sensor = fixtureData.isSensor; var offset = p2.vec2.create(); - offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2) - offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2) - + offset[0] = this.world.pxmi(fixtureData.circle.position[0] - this.sprite.width/2); + offset[1] = this.world.pxmi(fixtureData.circle.position[1] - this.sprite.height/2); + this.data.addShape(shape, offset); - generatedShapes.push(shape) + generatedShapes.push(shape); } else { - polygons = fixtureData.polygons; - + var polygons = fixtureData.polygons; var cm = p2.vec2.create(); for (var i = 0; i < polygons.length; i++) { - shapes = polygons[i]; - + var shapes = polygons[i]; var vertices = []; for (var s = 0; s < shapes.length; s += 2) @@ -1788,7 +1786,7 @@

Source: physics/p2/Body.js

* @method Phaser.Physics.P2.Body#loadPolygon * @param {string} key - The key of the Physics Data file as stored in Game.Cache. * @param {string} object - The key of the object within the Physics data file that you wish to load the shape data from. - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. @@ -1840,7 +1838,7 @@

Source: physics/p2/Body.js

* @property {boolean} static - Returns true if the Body is static. Setting Body.static to 'false' will make it dynamic. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "static", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.STATIC); @@ -1873,7 +1871,7 @@

Source: physics/p2/Body.js

* @property {boolean} dynamic - Returns true if the Body is dynamic. Setting Body.dynamic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "dynamic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.DYNAMIC); @@ -1906,7 +1904,7 @@

Source: physics/p2/Body.js

* @property {boolean} kinematic - Returns true if the Body is kinematic. Setting Body.kinematic to 'false' will make it static. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "kinematic", { - + get: function () { return (this.data.motionState === Phaser.Physics.P2.Body.KINEMATIC); @@ -1932,10 +1930,10 @@

Source: physics/p2/Body.js

/** * @name Phaser.Physics.P2.Body#allowSleep -* @property {boolean} allowSleep - +* @property {boolean} allowSleep - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "allowSleep", { - + get: function () { return this.data.allowSleep; @@ -1957,7 +1955,7 @@

Source: physics/p2/Body.js

* The angle of the Body in degrees from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement Body.angle = 450 is the same as Body.angle = 90. * If you wish to work in radians instead of degrees use the property Body.rotation instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#angle * @property {number} angle - The angle of this Body in degrees. */ @@ -1983,7 +1981,7 @@

Source: physics/p2/Body.js

* @property {number} angularDamping - The angular damping acting acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularDamping", { - + get: function () { return this.data.angularDamping; @@ -2003,7 +2001,7 @@

Source: physics/p2/Body.js

* @property {number} angularForce - The angular force acting on the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularForce", { - + get: function () { return this.data.angularForce; @@ -2023,7 +2021,7 @@

Source: physics/p2/Body.js

* @property {number} angularVelocity - The angular velocity of the body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "angularVelocity", { - + get: function () { return this.data.angularVelocity; @@ -2044,7 +2042,7 @@

Source: physics/p2/Body.js

* @property {number} damping - The linear damping acting on the body in the velocity direction. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "damping", { - + get: function () { return this.data.damping; @@ -2061,10 +2059,10 @@

Source: physics/p2/Body.js

/** * @name Phaser.Physics.P2.Body#fixedRotation -* @property {boolean} fixedRotation - +* @property {boolean} fixedRotation - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "fixedRotation", { - + get: function () { return this.data.fixedRotation; @@ -2087,7 +2085,7 @@

Source: physics/p2/Body.js

* @property {number} inertia - The inertia of the body around the Z axis.. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "inertia", { - + get: function () { return this.data.inertia; @@ -2104,10 +2102,10 @@

Source: physics/p2/Body.js

/** * @name Phaser.Physics.P2.Body#mass -* @property {number} mass - +* @property {number} mass - */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "mass", { - + get: function () { return this.data.mass; @@ -2131,7 +2129,7 @@

Source: physics/p2/Body.js

* @property {number} motionState - The type of motion this body has. Should be one of: Body.STATIC (the body does not move), Body.DYNAMIC (body can move and respond to collisions) and Body.KINEMATIC (only moves according to its .velocity). */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "motionState", { - + get: function () { return this.data.motionState; @@ -2152,7 +2150,7 @@

Source: physics/p2/Body.js

/** * The angle of the Body in radians. * If you wish to work in degrees instead of radians use the Body.angle property instead. Working in radians is faster as it doesn't have to convert values. -* +* * @name Phaser.Physics.P2.Body#rotation * @property {number} rotation - The angle of this Body in radians. */ @@ -2177,7 +2175,7 @@

Source: physics/p2/Body.js

* @property {number} sleepSpeedLimit - . */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "sleepSpeedLimit", { - + get: function () { return this.data.sleepSpeedLimit; @@ -2197,7 +2195,7 @@

Source: physics/p2/Body.js

* @property {number} x - The x coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "x", { - + get: function () { return this.world.mpxi(this.data.position[0]); @@ -2217,7 +2215,7 @@

Source: physics/p2/Body.js

* @property {number} y - The y coordinate of this Body. */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "y", { - + get: function () { return this.world.mpxi(this.data.position[1]); @@ -2238,7 +2236,7 @@

Source: physics/p2/Body.js

* @readonly */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "id", { - + get: function () { return this.data.id; @@ -2252,7 +2250,7 @@

Source: physics/p2/Body.js

* @property {boolean} debug - Enable or disable debug drawing of this body */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "debug", { - + get: function () { return (!this.debugBody); @@ -2264,7 +2262,7 @@

Source: physics/p2/Body.js

if (value && !this.debugBody) { // This will be added to the global space - this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data) + this.debugBody = new Phaser.Physics.P2.BodyDebug(this.game, this.data); } else if (!value && this.debugBody) { @@ -2283,7 +2281,7 @@

Source: physics/p2/Body.js

* @property {boolean} collideWorldBounds - Should the Body collide with the World bounds? */ Object.defineProperty(Phaser.Physics.P2.Body.prototype, "collideWorldBounds", { - + get: function () { return this._collideWorldBounds; @@ -2327,7 +2325,7 @@

Source: physics/p2/Body.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/BodyDebug.js.html b/docs/BodyDebug.js.html index 84e4d00d4e..dffa1b871c 100644 --- a/docs/BodyDebug.js.html +++ b/docs/BodyDebug.js.html @@ -540,7 +540,7 @@

Source: physics/p2/BodyDebug.js

debugPolygons: false, lineWidth: 1, alpha: 0.5 - } + }; this.settings = Phaser.Utils.extend(defaultSettings, settings); @@ -560,16 +560,16 @@

Source: physics/p2/BodyDebug.js

*/ this.canvas = new Phaser.Graphics(game); - this.canvas.alpha = this.settings.alpha + this.canvas.alpha = this.settings.alpha; this.add(this.canvas); this.draw(); -} +}; -Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype) -Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug +Phaser.Physics.P2.BodyDebug.prototype = Object.create(Phaser.Group.prototype); +Phaser.Physics.P2.BodyDebug.prototype.constructor = Phaser.Physics.P2.BodyDebug; Phaser.Utils.extend(Phaser.Physics.P2.BodyDebug.prototype, { @@ -604,7 +604,7 @@

Source: physics/p2/BodyDebug.js

* @method Phaser.Physics.P2.BodyDebug#draw */ draw: function() { - + var angle, child, color, i, j, lineColor, lw, obj, offset, sprite, v, verts, vrot, _j, _ref1; obj = this.body; sprite = this.canvas; @@ -615,10 +615,10 @@

Source: physics/p2/BodyDebug.js

if (obj instanceof p2.Body && obj.shapes.length) { - var l = obj.shapes.length + var l = obj.shapes.length; i = 0; - + while (i !== l) { child = obj.shapes[i]; @@ -626,7 +626,7 @@

Source: physics/p2/BodyDebug.js

angle = obj.shapeAngles[i]; offset = offset || 0; angle = angle || 0; - + if (child instanceof p2.Circle) { this.drawCircle(sprite, offset[0] * this.ppu, offset[1] * this.ppu, angle, child.radius * this.ppu, color, lw); @@ -658,7 +658,7 @@

Source: physics/p2/BodyDebug.js

this.drawRectangle(sprite, offset[0] * this.ppu, -offset[1] * this.ppu, angle, child.width * this.ppu, child.height * this.ppu, lineColor, color, lw); } - i++ + i++; } } @@ -762,7 +762,7 @@

Source: physics/p2/BodyDebug.js

{ colors = [0xff0000, 0x00ff00, 0x0000ff]; i = 0; - + while (i !== verts.length + 1) { v0 = verts[i % verts.length]; @@ -933,7 +933,8 @@

Source: physics/p2/BodyDebug.js

} -}) +}); + @@ -954,7 +955,7 @@

Source: physics/p2/BodyDebug.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Button.js.html b/docs/Button.js.html index 166e6b7b32..67c263c06b 100644 --- a/docs/Button.js.html +++ b/docs/Button.js.html @@ -549,136 +549,136 @@

Source: gameobjects/Button.js

Phaser.Image.call(this, game, x, y, key, outFrame); - /** + /** * @property {number} type - The Phaser Object Type. */ this.type = Phaser.BUTTON; - /** + /** * @property {string} _onOverFrameName - Internal variable. * @private * @default */ this._onOverFrameName = null; - - /** + + /** * @property {string} _onOutFrameName - Internal variable. * @private * @default */ this._onOutFrameName = null; - - /** + + /** * @property {string} _onDownFrameName - Internal variable. * @private * @default */ this._onDownFrameName = null; - /** + /** * @property {string} _onUpFrameName - Internal variable. * @private * @default */ this._onUpFrameName = null; - - /** + + /** * @property {number} _onOverFrameID - Internal variable. * @private * @default */ this._onOverFrameID = null; - - /** + + /** * @property {number} _onOutFrameID - Internal variable. * @private * @default */ this._onOutFrameID = null; - - /** + + /** * @property {number} _onDownFrameID - Internal variable. * @private * @default */ this._onDownFrameID = null; - /** + /** * @property {number} _onUpFrameID - Internal variable. * @private * @default */ this._onUpFrameID = null; - /** + /** * @property {Phaser.Sound} onOverSound - The Sound to be played when this Buttons Over state is activated. * @default */ this.onOverSound = null; - /** + /** * @property {Phaser.Sound} onOutSound - The Sound to be played when this Buttons Out state is activated. * @default */ this.onOutSound = null; - /** + /** * @property {Phaser.Sound} onDownSound - The Sound to be played when this Buttons Down state is activated. * @default */ this.onDownSound = null; - /** + /** * @property {Phaser.Sound} onUpSound - The Sound to be played when this Buttons Up state is activated. * @default */ this.onUpSound = null; - /** + /** * @property {string} onOverSoundMarker - The Sound Marker used in conjunction with the onOverSound. * @default */ this.onOverSoundMarker = ''; - /** + /** * @property {string} onOutSoundMarker - The Sound Marker used in conjunction with the onOutSound. * @default */ this.onOutSoundMarker = ''; - /** + /** * @property {string} onDownSoundMarker - The Sound Marker used in conjunction with the onDownSound. * @default */ this.onDownSoundMarker = ''; - /** + /** * @property {string} onUpSoundMarker - The Sound Marker used in conjunction with the onUpSound. * @default */ this.onUpSoundMarker = ''; - /** + /** * @property {Phaser.Signal} onInputOver - The Signal (or event) dispatched when this Button is in an Over state. */ this.onInputOver = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputOut - The Signal (or event) dispatched when this Button is in an Out state. */ this.onInputOut = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputDown - The Signal (or event) dispatched when this Button is in an Down state. */ this.onInputDown = new Phaser.Signal(); - - /** + + /** * @property {Phaser.Signal} onInputUp - The Signal (or event) dispatched when this Button is in an Up state. */ this.onInputUp = new Phaser.Signal(); - /** + /** * @property {boolean} freezeFrames - When true the Button will cease to change texture frame on all events (over, out, up, down). */ this.freezeFrames = false; @@ -731,7 +731,7 @@

Source: gameobjects/Button.js

this._onUpFrameName = null; this._onUpFrameID = null; -} +}; /** * Used to manually set the frames that will be used for the different states of the Button. @@ -751,7 +751,7 @@

Source: gameobjects/Button.js

if (typeof overFrame === 'string') { this._onOverFrameName = overFrame; - + if (this.input.pointerOver()) { this.frameName = overFrame; @@ -858,7 +858,7 @@

Source: gameobjects/Button.js

this.setDownSound(downSound, downMarker); this.setUpSound(upSound, upMarker); -} +}; /** * The Sound to be played when a Pointer moves over this Button. @@ -882,7 +882,7 @@

Source: gameobjects/Button.js

this.onOverSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer moves out of this Button. @@ -906,7 +906,7 @@

Source: gameobjects/Button.js

this.onOutSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer presses down on this Button. @@ -930,7 +930,7 @@

Source: gameobjects/Button.js

this.onDownSoundMarker = marker; } -} +}; /** * The Sound to be played when a Pointer has pressed down and is released from this Button. @@ -954,7 +954,7 @@

Source: gameobjects/Button.js

this.onUpSoundMarker = marker; } -} +}; /** * Internal function that handles input events. @@ -1165,7 +1165,7 @@

Source: gameobjects/Button.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Cache.js.html b/docs/Cache.js.html index 50b2c9672d..551f4a1c4e 100644 --- a/docs/Cache.js.html +++ b/docs/Cache.js.html @@ -880,7 +880,7 @@

Source: loader/Cache.js

* Add a new text data. * * @method Phaser.Cache#addText - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -894,7 +894,7 @@

Source: loader/Cache.js

* Add a new json object into the cache. * * @method Phaser.Cache#addJSON - * @param {string} key - Asset key for the text data. + * @param {string} key - Asset key for the text data. * @param {string} url - URL of this text data file. * @param {object} data - Extra text data. */ @@ -994,7 +994,7 @@

Source: loader/Cache.js

* @param {string} key - Asset key for the sound. */ updateSound: function (key, property, value) { - + if (this._sounds[key]) { this._sounds[key][property] = value; @@ -1110,7 +1110,7 @@

Source: loader/Cache.js

console.warn('Phaser.Cache.getPhysicsData: Invalid key/object: "' + key + ' / ' + object + '"'); } } - + return null; }, @@ -1399,7 +1399,7 @@

Source: loader/Cache.js

{ console.warn('Phaser.Cache.getText: Invalid key: "' + key + '"'); } - + }, /** @@ -1419,7 +1419,7 @@

Source: loader/Cache.js

{ console.warn('Phaser.Cache.getJSON: Invalid key: "' + key + '"'); } - + }, /** @@ -1439,7 +1439,7 @@

Source: loader/Cache.js

{ console.warn('Phaser.Cache.getBinary: Invalid key: "' + key + '"'); } - + }, /** @@ -1710,7 +1710,7 @@

Source: loader/Cache.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Camera.js.html b/docs/Camera.js.html index 185acb3f2d..4b02d573dd 100644 --- a/docs/Camera.js.html +++ b/docs/Camera.js.html @@ -527,7 +527,7 @@

Source: core/Camera.js

* @param {number} height - The height of the view rectangle */ Phaser.Camera = function (game, id, x, y, width, height) { - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -545,7 +545,7 @@

Source: core/Camera.js

this.id = 0; /** - * Camera view. + * Camera view. * The view into the world we wish to render (by default the game dimensions). * The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render. * Objects outside of this view are not rendered if set to camera cull. @@ -604,7 +604,7 @@

Source: core/Camera.js

* @property {Phaser.Point} scale - The scale of the display object to which all game objects are added. Set by World.boot */ this.scale = null; - + }; /** @@ -815,7 +815,7 @@

Source: core/Camera.js

/** * A helper function to set both the X and Y properties of the camera at once * without having to use game.camera.x and game.camera.y. - * + * * @method Phaser.Camera#setPosition * @param {number} x - X position. * @param {number} y - Y position. @@ -834,7 +834,7 @@

Source: core/Camera.js

/** * Sets the size of the view rectangle given the width and height in parameters. - * + * * @method Phaser.Camera#setSize * @param {number} width - The desired width. * @param {number} height - The desired height. @@ -848,7 +848,7 @@

Source: core/Camera.js

/** * Resets the camera back to 0,0 and un-follows any object it may have been tracking. - * + * * @method Phaser.Camera#reset */ reset: function () { @@ -873,7 +873,7 @@

Source: core/Camera.js

get: function () { return this.view.x; }, - + set: function (value) { this.view.x = value; @@ -892,7 +892,7 @@

Source: core/Camera.js

* @property {number} y - Gets or sets the cameras y position. */ Object.defineProperty(Phaser.Camera.prototype, "y", { - + get: function () { return this.view.y; }, @@ -963,7 +963,7 @@

Source: core/Camera.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Canvas.js.html b/docs/Canvas.js.html index 84d9f73847..6618b29a9f 100644 --- a/docs/Canvas.js.html +++ b/docs/Canvas.js.html @@ -623,7 +623,7 @@

Source: system/Canvas.js

color = color || 'rgb(0,0,0)'; canvas.style.backgroundColor = color; - + return canvas; }, @@ -824,7 +824,7 @@

Source: system/Canvas.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Circle.js.html b/docs/Circle.js.html index 154959a71e..0e6c4fbfe7 100644 --- a/docs/Circle.js.html +++ b/docs/Circle.js.html @@ -628,7 +628,7 @@

Source: geom/Circle.js

*/ distance: function (dest, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -756,7 +756,7 @@

Source: geom/Circle.js

* @property {number} radius - Gets or sets the radius of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "radius", { - + get: function () { return this._radius; }, @@ -779,7 +779,7 @@

Source: geom/Circle.js

* @propety {number} left - Gets or sets the value of the leftmost point of the circle. */ Object.defineProperty(Phaser.Circle.prototype, "left", { - + get: function () { return this.x - this._radius; }, @@ -837,7 +837,7 @@

Source: geom/Circle.js

get: function () { return this.y - this._radius; }, - + set: function (value) { if (value > this.y) @@ -1064,7 +1064,7 @@

Source: geom/Circle.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Circle.js_.html b/docs/Circle.js_.html index 6ce9edcb9e..737042ff64 100644 --- a/docs/Circle.js_.html +++ b/docs/Circle.js_.html @@ -507,7 +507,8 @@

Source: physics/ninja/Circle.js

-
/**
+            
/* jshint camelcase: false */
+/**
 * @author       Richard Davey <rich@photonstorm.com>
 * @copyright    2014 Photon Storm Ltd.
 * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
@@ -608,7 +609,7 @@ 

Source: physics/ninja/Circle.js

this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_67DEGb] = this.projCircle_67DegB; this.circleTileProjections[Phaser.Physics.Ninja.Tile.TYPE_HALF] = this.projCircle_Half; -} +}; Phaser.Physics.Ninja.Circle.prototype.constructor = Phaser.Physics.Ninja.Circle; @@ -648,7 +649,7 @@

Source: physics/ninja/Circle.js

* @param {number} dy - Collision normal * @param {number} obj - Object this Circle collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -861,9 +862,9 @@

Source: physics/ninja/Circle.js

//if we're colliding vs. horiz. or vert. neighb, we simply project horiz/vert //if we're colliding diagonally, we need to collide vs. tile corner - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //collision with current cell if (x < y) @@ -871,7 +872,7 @@

Source: physics/ninja/Circle.js

//penetration in x is smaller; project in x var dx = obj.pos.x - t.pos.x;//get sign for projection along x-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dx < 0) { obj.reportCollisionVsWorld(-x, 0, -1, 0, t); @@ -885,10 +886,10 @@

Source: physics/ninja/Circle.js

} else { - //penetration in y is smaller; project in y + //penetration in y is smaller; project in y var dy = obj.pos.y - t.pos.y;//get sign for projection along y-axis - //NOTE: should we handle the delta == 0 case?! and how? (project towards oldpos?) + //NOTE: should we handle the delta === 0 case?! and how? (project towards oldpos?) if (dy < 0) { obj.reportCollisionVsWorld(0, -y, 0, -1, t); @@ -909,7 +910,7 @@

Source: physics/ninja/Circle.js

return Phaser.Physics.Ninja.Circle.COL_AXIS; } } - else if (oV == 0) + else if (oV === 0) { //collision with horizontal neighbor obj.reportCollisionVsWorld(x * oH, 0, oH, 0, t); @@ -923,7 +924,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -932,7 +933,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -979,9 +980,9 @@

Source: physics/ninja/Circle.js

var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile @@ -989,7 +990,7 @@

Source: physics/ninja/Circle.js

var sy = t.sy; var ox = (obj.pos.x - (sx * obj.radius)) - t.pos.x;//this gives is the coordinates of the innermost - var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center + var oy = (obj.pos.y - (sy * obj.radius)) - t.pos.y;//point on the circle, relative to the tile center //if the dotprod of (ox,oy) and (sx,sy) is negative, the innermost point is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) @@ -1008,7 +1009,7 @@

Source: physics/ninja/Circle.js

lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -1020,7 +1021,7 @@

Source: physics/ninja/Circle.js

lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -1063,13 +1064,13 @@

Source: physics/ninja/Circle.js

var sy = t.sy; var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (oV * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronoi region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronoi region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if (0 < (perp * signx * signy)) { @@ -1108,7 +1109,7 @@

Source: physics/ninja/Circle.js

} } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -1127,7 +1128,7 @@

Source: physics/ninja/Circle.js

var sy = t.sy; var ox = obj.pos.x - (t.pos.x + (oH * t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) @@ -1137,8 +1138,8 @@

Source: physics/ninja/Circle.js

// for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox * -sy) + (oy * sx); if ((perp * signx * signy) < 0) { @@ -1193,7 +1194,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -1201,7 +1202,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -1249,13 +1250,13 @@

Source: physics/ninja/Circle.js

var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to + var ox = (t.pos.x + (signx * t.xw)) - obj.pos.x;//(ox,oy) is the vector from the circle to var oy = (t.pos.y + (signy * t.yw)) - obj.pos.y;//tile-circle's center var twid = t.xw * 2; @@ -1274,7 +1275,7 @@

Source: physics/ninja/Circle.js

lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -1286,7 +1287,7 @@

Source: physics/ninja/Circle.js

lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -1337,7 +1338,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x - (signx * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -1345,7 +1346,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out vertically dx = 0; @@ -1364,7 +1365,7 @@

Source: physics/ninja/Circle.js

} } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -1382,7 +1383,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y - (signy * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -1390,7 +1391,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out horizontally dx = oH; @@ -1425,7 +1426,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -1433,7 +1434,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -1483,14 +1484,14 @@

Source: physics/ninja/Circle.js

var signy = t.signy; var lenP; - if (oH == 0) + if (oH === 0) { - if (oV == 0) + if (oV === 0) { //colliding with current tile - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -1509,7 +1510,7 @@

Source: physics/ninja/Circle.js

lenP = x; y = 0; - //get sign for projection along x-axis + //get sign for projection along x-axis if ((obj.pos.x - t.pos.x) < 0) { x *= -1; @@ -1521,7 +1522,7 @@

Source: physics/ninja/Circle.js

lenP = y; x = 0; - //get sign for projection along y-axis + //get sign for projection along y-axis if ((obj.pos.y - t.pos.y) < 0) { y *= -1; @@ -1537,7 +1538,7 @@

Source: physics/ninja/Circle.js

} else { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //projeciton by an axis shoudl always be shorter, and we should //never arrive here ox /= len; @@ -1565,7 +1566,7 @@

Source: physics/ninja/Circle.js

//obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -1578,7 +1579,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -1590,7 +1591,7 @@

Source: physics/ninja/Circle.js

} } } - else if (oV == 0) + else if (oV === 0) { //colliding horizontally if ((signx * oH) < 0) @@ -1605,7 +1606,7 @@

Source: physics/ninja/Circle.js

//obj in neighboring cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -1618,7 +1619,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -1637,7 +1638,7 @@

Source: physics/ninja/Circle.js

//obj in diag neighb cell pointed at by tile normal; //we could only be colliding vs the tile-circle surface - var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to + var ox = obj.pos.x - (t.pos.x - (signx * t.xw));//(ox,oy) is the vector from the tile-circle to var oy = obj.pos.y - (t.pos.y - (signy * t.yw));//the circle's center var twid = t.xw * 2; @@ -1650,7 +1651,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { - //note: len should NEVER be == 0, because if it is, + //note: len should NEVER be === 0, because if it is, //obj is not in a neighboring cell! ox /= len; oy /= len; @@ -1667,7 +1668,7 @@

Source: physics/ninja/Circle.js

var vx = t.pos.x + (oH * t.xw); var vy = t.pos.y + (oV * t.yw); - var dx = obj.pos.x - vx;//calc vert->circle vector + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; var len = Math.sqrt(dx * dx + dy * dy); @@ -1675,7 +1676,7 @@

Source: physics/ninja/Circle.js

if (0 < pen) { //vertex is in the circle; project outward - if (len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -1730,85 +1731,84 @@

Source: physics/ninja/Circle.js

var signy = t.signy; var celldp = (oH*signx + oV*signy);//this tells us about the configuration of cell-offset relative to tile normal - if(0 < celldp) + if (0 < celldp) { //obj is in "far" (pointed-at-by-normal) neighbor of halffull tile, and will never hit return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile var r = obj.radius; var ox = (obj.pos.x - (signx*r)) - t.pos.x;//this gives is the coordinates of the innermost var oy = (obj.pos.y - (signy*r)) - t.pos.y;//point on the circle, relative to the tile center - - - //we perform operations analogous to the 45deg tile, except we're using + + + //we perform operations analogous to the 45deg tile, except we're using //an axis-aligned slope instead of an angled one.. var sx = signx; var sy = signy; - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the corner is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - if(dp < 0) + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - - + sy *= -dp; + + var lenN = Math.sqrt(sx*sx + sy*sy); var lenP = Math.sqrt(x*x + y*y); - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP,t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.signx,t.signy); return Phaser.Physics.Ninja.Circle.COL_OTHER; } return true; - } - + } + } else { //colliding vertically - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dx = obj.pos.x - t.pos.x; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dx*signx) < 0) + if ((dx*signx) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dy = obj.pos.y - (t.pos.y + oV*t.yw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -1819,12 +1819,12 @@

Source: physics/ninja/Circle.js

dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else @@ -1833,41 +1833,40 @@

Source: physics/ninja/Circle.js

//we can only collide with the cell edge //collision with vertical neighbor obj.reportCollisionVsWorld(0,y*oV,0,oV,t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } - + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if(celldp == 0) + if (celldp === 0) { - - var r = obj.radius; + var dy = obj.pos.y - t.pos.y; - + //we're in a cell perpendicular to the normal, and can collide vs. halfedge vertex //or halfedge side - if((dy*signy) < 0) + if ((dy*signy) < 0) { //collision with halfedge side obj.reportCollisionVsWorld(x*oH,0,oH,0,t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //collision with halfedge vertex var dx = obj.pos.x - (t.pos.x + oH*t.xw);//(dx,dy) is now the vector from the appropriate halfedge vertex to the circle - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = signx / Math.SQRT2; @@ -1878,25 +1877,25 @@

Source: physics/ninja/Circle.js

dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } } else - { + { //due to the first conditional (celldp >0), we know w're in the cell "opposite" the normal, and so //we can only collide with the cell edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } else - { + { //colliding diagonally; we know, due to the initial (celldp >0) test which has failed //if we've reached this point, that we're in a diagonal neighbor on the non-normal side, so //we could only be colliding with the cell vertex, if at all. @@ -1904,16 +1903,16 @@

Source: physics/ninja/Circle.js

//get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -1926,14 +1925,14 @@

Source: physics/ninja/Circle.js

} obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - + } + } - + return Phaser.Physics.Ninja.Circle.COL_NONE; - + }, /** @@ -1949,7 +1948,7 @@

Source: physics/ninja/Circle.js

* @return {number} The result of the collision. */ projCircle_22DegS: function (x,y,oH,oV,obj,t) { - + //if the object is in a cell pointed at by signy, no collision will ever occur //otherwise, // @@ -1958,115 +1957,116 @@

Source: physics/ninja/Circle.js

//if obj is in this tile: collide vs slope or vertex //if obj is horiz neighb in direction of slope: collide vs. slope or vertex //if obj is horiz neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is vert neighb against direction of slope: collide vs. face + var lenP; var signx = t.signx; var signy = t.signy; - if(0 < (signy*oV)) + if (0 < (signy*oV)) { //object will never collide vs tile, it can't reach that far - + return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner - + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal or axially. - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronio region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); return Phaser.Physics.Ninja.Circle.COL_OTHER; } - + } } - + } else { @@ -2074,42 +2074,42 @@

Source: physics/ninja/Circle.js

//due to the first conditional far above obj.reportCollisionVsWorld(0,y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - if((signx*oH) < 0) + if ((signx*oH) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x - (signx*t.xw); var vy = t.pos.y; - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dy*signy) < 0) + + if ((dy*signy) < 0) { //colliding vs face obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -2122,7 +2122,7 @@

Source: physics/ninja/Circle.js

} obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -2131,13 +2131,13 @@

Source: physics/ninja/Circle.js

{ //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x + (oH*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal, otherwise by the vertex. @@ -2146,41 +2146,41 @@

Source: physics/ninja/Circle.js

// for horizontal, if the perp prod and the slope's slope agree, circle is inside. // ..but this is only a property of flahs' coord system (i.e the rules might swap // in righthanded systems)) - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -2196,16 +2196,16 @@

Source: physics/ninja/Circle.js

//get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -2218,7 +2218,7 @@

Source: physics/ninja/Circle.js

} obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -2253,81 +2253,82 @@

Source: physics/ninja/Circle.js

// //if obj is vert neighb in direction of slope: collide vs. slope or vertex + var lenP; var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x, y, x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } - } + } + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -2337,77 +2338,77 @@

Source: physics/ninja/Circle.js

var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen,sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert - - if((oy*signy) < 0) + var oy = obj.pos.y - t.pos.y;//point on the circle, relative to the closest tile vert + + if ((oy*signy) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -2415,79 +2416,79 @@

Source: physics/ninja/Circle.js

var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope //we should really precalc this at compile time, but for now, fuck it var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*1) / slen;//get slope _unit_ normal; var sy = (signy*2) / slen;//raw RH normal is (1,-2) - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y + (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } return Phaser.Physics.Ninja.Circle.COL_NONE; @@ -2497,16 +2498,16 @@

Source: physics/ninja/Circle.js

//collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -2522,10 +2523,10 @@

Source: physics/ninja/Circle.js

return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -2551,47 +2552,48 @@

Source: physics/ninja/Circle.js

//if obj is in this tile: collide vs slope or vertex or axis //if obj is vert neighb in direction of slope: collide vs. slope or vertex //if obj is vert neighb against the slope: - // if(distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) + // if (distance in y from circle to 90deg corner of tile < 1/2 tileheight, collide vs. face) // else(collide vs. corner of slope) (vert collision with a non-grid-aligned vert) //if obj is horiz neighb against direction of slope: collide vs. face var signx = t.signx; var signy = t.signy; - if(0 < (signx*oH)) + if (0 < (signx*oH)) { //object will never collide vs tile, it can't reach that far return Phaser.Physics.Ninja.Circle.COL_NONE; } - else if(oH == 0) + else if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current tile //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner - + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the tile corner + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the normal or axis, otherwise by the corner/vertex - //note that this is simply a VERY tricky/weird method of determining + //note that this is simply a VERY tricky/weird method of determining //if the circle is in side the slope/face's voronoi region, or that of the vertex. - + var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = r - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; @@ -2599,99 +2601,99 @@

Source: physics/ninja/Circle.js

obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope or vs axis - ox -= r*sx;//this gives us the vector from + ox -= r*sx;//this gives us the vector from oy -= r*sy;//a point on the slope to the innermost point on the circle - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - if(lenP < lenN) + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { obj.reportCollisionVsWorld(sx,sy,t.sx,t.sy,t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } } - + } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge OR with corner of wedge, depending on our position vertically - + //collide vs. vertex //get diag vertex position var vx = t.pos.x; var vy = t.pos.y - (signy*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - - if((dx*signx) < 0) - { + + if ((dx*signx) < 0) + { //colliding vs face obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { //colliding vs. vertex - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -2702,9 +2704,9 @@

Source: physics/ninja/Circle.js

dx /= len; dy /= len; } - + obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -2713,68 +2715,68 @@

Source: physics/ninja/Circle.js

{ //we could only be colliding vs the slope OR a vertex //look at the vector form the closest vert to the circle to decide - + var sx = t.sx; var sy = t.sy; - + var ox = obj.pos.x - (t.pos.x - (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert - + var oy = obj.pos.y - (t.pos.y + (oV*t.yw));//point on the circle, relative to the closest tile vert + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the normal. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); - var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. + var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } } - } + } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally; we can assume that (signy*oV) < 0 //due to the first conditional far above - obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - - return Phaser.Physics.Ninja.Circle.COL_AXIS; + obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); + + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else - { + { //colliding diagonally; due to the first conditional above, //obj is vertically offset against slope, and offset in either direction horizontally @@ -2782,16 +2784,16 @@

Source: physics/ninja/Circle.js

//get diag vertex position var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -2804,7 +2806,7 @@

Source: physics/ninja/Circle.js

} obj.reportCollisionVsWorld(dx*pen, dy*pen, dx, dy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -2842,75 +2844,76 @@

Source: physics/ninja/Circle.js

var signx = t.signx; var signy = t.signy; - if(oH == 0) + if (oH === 0) { - if(oV == 0) + if (oV === 0) { //colliding with current cell + var lenP; var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the AABB, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { //collision; project delta onto slope and use this to displace the object sx *= -dp;//(sx,sy) is now the projection vector - sy *= -dp; - + sy *= -dp; + var lenN = Math.sqrt(sx*sx + sy*sy); - + //find the smallest axial projection vector - if(x < y) - { + if (x < y) + { //penetration in x is smaller lenP = x; - y = 0; - //get sign for projection along x-axis - if((obj.pos.x - t.pos.x) < 0) + y = 0; + //get sign for projection along x-axis + if ((obj.pos.x - t.pos.x) < 0) { x *= -1; } } else - { + { //penetration in y is smaller lenP = y; - x = 0; - //get sign for projection along y-axis - if((obj.pos.y - t.pos.y)< 0) + x = 0; + //get sign for projection along y-axis + if ((obj.pos.y - t.pos.y)< 0) { y *= -1; - } + } } - - if(lenP < lenN) + + if (lenP < lenN) { obj.reportCollisionVsWorld(x,y,x/lenP, y/lenP, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { obj.reportCollisionVsWorld(sx, sy, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } else { //colliding vertically - - if((signy*oV) < 0) + + if ((signy*oV) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); @@ -2920,16 +2923,16 @@

Source: physics/ninja/Circle.js

else { //colliding with edge, slope, or vertex - + var ox = obj.pos.x - t.pos.x;//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert - - if((ox*signx) < 0) + var oy = obj.pos.y - (t.pos.y + (signy*t.yw));//point on the circle, relative to the closest tile vert + + if ((ox*signx) < 0) { //we're colliding with the halfface obj.reportCollisionVsWorld(0, y*oV, 0, oV, t); - return Phaser.Physics.Ninja.Circle.COL_AXIS; + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else { @@ -2937,60 +2940,60 @@

Source: physics/ninja/Circle.js

var sx = t.sx; var sy = t.sy; - + //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the vertex, otherwise by the slope. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if(0 < (perp*signx*signy)) + if (0 < (perp*signx*signy)) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; - + obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, sx, sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } - } + } } } } } - else if(oV == 0) + else if (oV === 0) { //colliding horizontally - - if((signx*oH) < 0) + + if ((signx*oH) < 0) { //colliding with face/edge obj.reportCollisionVsWorld(x*oH, 0, oH, 0, t); - + return Phaser.Physics.Ninja.Circle.COL_AXIS; } else @@ -3001,47 +3004,47 @@

Source: physics/ninja/Circle.js

var slen = Math.sqrt(2*2 + 1*1);//the raw slope is (-2,-1) var sx = (signx*2) / slen;//get slope _unit_ normal; var sy = (signy*1) / slen;//raw RH normal is (1,-2) - + var ox = obj.pos.x - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost - var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert + var oy = obj.pos.y - (t.pos.y - (signy*t.yw));//point on the circle, relative to the closest tile vert //if the component of (ox,oy) parallel to the normal's righthand normal //has the same sign as the slope of the slope (the sign of the slope's slope is signx*signy) //then we project by the slope, otherwise by the vertex. - //note that this is simply a VERY tricky/weird method of determining - //if the circle is in side the slope/face's voronio region, or that of the vertex. + //note that this is simply a VERY tricky/weird method of determining + //if the circle is in side the slope/face's voronio region, or that of the vertex. var perp = (ox*-sy) + (oy*sx); - if((perp*signx*signy) < 0) + if ((perp*signx*signy) < 0) { //collide vs. vertex var len = Math.sqrt(ox*ox + oy*oy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //note: if len=0, then perp=0 and we'll never reach here, so don't worry about div-by-0 ox /= len; oy /= len; obj.reportCollisionVsWorld(ox*pen, oy*pen, ox, oy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; - } + } } else { //collide vs. slope - + //if the component of (ox,oy) parallel to the normal is less than the circle radius, we're //penetrating the slope. note that this method of penetration calculation doesn't hold //in general (i.e it won't work if the circle is in the slope), but works in this case //because we know the circle is in a neighboring cell var dp = (ox*sx) + (oy*sy); var pen = obj.radius - Math.abs(dp);//note: we don't need the abs because we know the dp will be positive, but just in case.. - if(0 < pen) + if (0 < pen) { //collision; circle out along normal by penetration amount obj.reportCollisionVsWorld(sx*pen, sy*pen, t.sx, t.sy, t); - + return Phaser.Physics.Ninja.Circle.COL_OTHER; } } @@ -3050,27 +3053,27 @@

Source: physics/ninja/Circle.js

else { //colliding diagonally - if( 0 < ((signx*oH) + (signy*oV)) ) + if ( 0 < ((signx*oH) + (signy*oV)) ) { //the dotprod of slope normal and cell offset is strictly positive, //therefore obj is in the diagonal neighb pointed at by the normal. - + //collide vs slope var sx = t.sx; var sy = t.sy; - + var r = obj.radius; var ox = (obj.pos.x - (sx*r)) - (t.pos.x + (signx*t.xw));//this gives is the coordinates of the innermost var oy = (obj.pos.y - (sy*r)) - (t.pos.y - (signy*t.yw));//point on the circle, relative to a point on the slope - + //if the dotprod of (ox,oy) and (sx,sy) is negative, the point on the circle is in the slope //and we need toproject it out by the magnitude of the projection of (ox,oy) onto (sx,sy) var dp = (ox*sx) + (oy*sy); - - if(dp < 0) + + if (dp < 0) { - //collision; project delta onto slope and use this to displace the object + //collision; project delta onto slope and use this to displace the object //(sx,sy)*-dp is the projection vector obj.reportCollisionVsWorld(-sx*dp, -sy*dp, t.sx, t.sy, t); @@ -3081,20 +3084,20 @@

Source: physics/ninja/Circle.js

} else { - + //collide vs the appropriate vertex var vx = t.pos.x + (oH*t.xw); var vy = t.pos.y + (oV*t.yw); - - var dx = obj.pos.x - vx;//calc vert->circle vector + + var dx = obj.pos.x - vx;//calc vert->circle vector var dy = obj.pos.y - vy; - + var len = Math.sqrt(dx*dx + dy*dy); var pen = obj.radius - len; - if(0 < pen) + if (0 < pen) { //vertex is in the circle; project outward - if(len == 0) + if (len === 0) { //project out by 45deg dx = oH / Math.SQRT2; @@ -3110,10 +3113,10 @@

Source: physics/ninja/Circle.js

return Phaser.Physics.Ninja.Circle.COL_OTHER; } - - } + + } } - + return Phaser.Physics.Ninja.Circle.COL_NONE; }, @@ -3127,7 +3130,7 @@

Source: physics/ninja/Circle.js

this.system = null; } -} +};
@@ -3149,7 +3152,7 @@

Source: physics/ninja/Circle.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/CollisionGroup.js.html b/docs/CollisionGroup.js.html index abe7de4111..31ce08c52e 100644 --- a/docs/CollisionGroup.js.html +++ b/docs/CollisionGroup.js.html @@ -527,7 +527,7 @@

Source: physics/p2/CollisionGroup.js

*/ this.mask = bitmask; -} +}; @@ -549,7 +549,7 @@

Source: physics/p2/CollisionGroup.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Color.js.html b/docs/Color.js.html index 23fd869e03..aed513ab03 100644 --- a/docs/Color.js.html +++ b/docs/Color.js.html @@ -561,7 +561,7 @@

Source: utils/Color.js

var hex16 = (h.charAt(0) == "#") ? h.substring(1, 7) : h; - if (hex16.length==3) + if (hex16.length == 3) { hex16 = hex16.charAt(0) + hex16.charAt(0) + hex16.charAt(1) + hex16.charAt(1) + hex16.charAt(2) + hex16.charAt(2); } @@ -571,7 +571,7 @@

Source: utils/Color.js

var blue = parseInt(hex16.substring(4, 6), 16); return red << 16 | green << 8 | blue; - + }, /** @@ -587,13 +587,13 @@

Source: utils/Color.js

var argb = Phaser.Color.getRGB(color); var hsl = Phaser.Color.RGBtoHSV(color); - + // Hex format var result = Phaser.Color.RGBtoHexstring(color) + "\n"; - + // RGB format result = result.concat("Alpha: " + argb.alpha + " Red: " + argb.red + " Green: " + argb.green + " Blue: " + argb.blue) + "\n"; - + // HSL info result = result.concat("Hue: " + hsl.hue + " Saturation: " + hsl.saturation + " Lightnes: " + hsl.lightness); @@ -794,7 +794,7 @@

Source: utils/Color.js

var blue = color & 0xFF; return 'rgba(' + red.toString() + ',' + green.toString() + ',' + blue.toString() + ',' + alpha.toString() + ')'; - + }, /** @@ -856,7 +856,7 @@

Source: utils/Color.js

getBlue: function (color) { return color & 0xFF; } - + }; @@ -879,7 +879,7 @@

Source: utils/Color.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/ContactMaterial.js.html b/docs/ContactMaterial.js.html index 862e6d71d6..10355b94e7 100644 --- a/docs/ContactMaterial.js.html +++ b/docs/ContactMaterial.js.html @@ -567,7 +567,7 @@

Source: physics/p2/ContactMaterial.js

p2.ContactMaterial.call(this, materialA, materialB, options); -} +}; Phaser.Physics.P2.ContactMaterial.prototype = Object.create(p2.ContactMaterial.prototype); Phaser.Physics.P2.ContactMaterial.prototype.constructor = Phaser.Physics.P2.ContactMaterial; @@ -592,7 +592,7 @@

Source: physics/p2/ContactMaterial.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Debug.js.html b/docs/Debug.js.html index c0eff91701..9dcdca8f98 100644 --- a/docs/Debug.js.html +++ b/docs/Debug.js.html @@ -529,7 +529,7 @@

Source: utils/Debug.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {PIXI.Sprite} sprite - If debugging in WebGL mode we need this. */ @@ -544,7 +544,7 @@

Source: utils/Debug.js

* @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = null; - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ @@ -565,7 +565,7 @@

Source: utils/Debug.js

* @default '14px Courier' */ this.font = '14px Courier'; - + /** * @property {number} columnWidth - The spacing between columns. */ @@ -575,24 +575,24 @@

Source: utils/Debug.js

* @property {number} lineHeight - The line height between the debug text. */ this.lineHeight = 16; - + /** * @property {boolean} renderShadow - Should the text be rendered with a slight shadow? Makes it easier to read on different types of background. */ this.renderShadow = true; - + /** * @property {Context} currentX - The current X position the debug information will be rendered at. * @default */ this.currentX = 0; - + /** * @property {number} currentY - The current Y position the debug information will be rendered at. * @default */ this.currentY = 0; - + /** * @property {number} currentAlpha - The current alpha the debug information will be rendered at. * @default @@ -779,7 +779,7 @@

Source: utils/Debug.js

this.line('Bounds x: ' + camera.bounds.x + ' Y: ' + camera.bounds.y + ' w: ' + camera.bounds.width + ' h: ' + camera.bounds.height); this.line('View x: ' + camera.view.x + ' Y: ' + camera.view.y + ' w: ' + camera.view.width + ' h: ' + camera.view.height); this.stop(); - + }, /** @@ -1072,7 +1072,7 @@

Source: utils/Debug.js

} this.stop(); - + }, /** @@ -1247,7 +1247,7 @@

Source: utils/Debug.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Device.js.html b/docs/Device.js.html index 8986a6fabd..2ddc23ff5c 100644 --- a/docs/Device.js.html +++ b/docs/Device.js.html @@ -645,7 +645,7 @@

Source: system/Device.js

*/ this.css3D = false; - /** + /** * @property {boolean} pointerLock - Is Pointer Lock available? * @default */ @@ -826,7 +826,7 @@

Source: system/Device.js

*/ this.iPhone4 = false; - /** + /** * @property {boolean} iPad - Is running on iPad? * @default */ @@ -875,7 +875,7 @@

Source: system/Device.js

this._checkDevice(); this._checkFeatures(); this._checkOS(); - + }; Phaser.Device.prototype = { @@ -961,7 +961,7 @@

Source: system/Device.js

} this.worker = !!window['Worker']; - + if ('ontouchstart' in document.documentElement || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 1)) { this.touch = true; @@ -971,7 +971,7 @@

Source: system/Device.js

{ this.mspointer = true; } - + this.pointerLock = 'pointerLockElement' in document || 'mozPointerLockElement' in document || 'webkitPointerLockElement' in document; this.quirksMode = (document.compatMode === 'CSS1Compat') ? false : true; @@ -1127,7 +1127,7 @@

Source: system/Device.js

try { if (result = !!audioElement.canPlayType) { - + if (audioElement.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, '')) { this.ogg = true; } @@ -1184,7 +1184,7 @@

Source: system/Device.js

} navigator.vibrate = navigator.vibrate || navigator.webkitVibrate || navigator.mozVibrate || navigator.msVibrate; - + if (navigator.vibrate) { this.vibration = true; @@ -1220,7 +1220,7 @@

Source: system/Device.js

has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]); } } - + document.body.removeChild(el); this.css3D = (has3d !== undefined && has3d.length > 0 && has3d !== "none"); @@ -1318,7 +1318,7 @@

Source: system/Device.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/DistanceConstraint.js.html b/docs/DistanceConstraint.js.html index 2976647298..f55fa47fe9 100644 --- a/docs/DistanceConstraint.js.html +++ b/docs/DistanceConstraint.js.html @@ -543,7 +543,7 @@

Source: physics/p2/DistanceConstraint.js

p2.DistanceConstraint.call(this, bodyA, bodyB, distance, maxForce); -} +}; Phaser.Physics.P2.DistanceConstraint.prototype = Object.create(p2.DistanceConstraint.prototype); Phaser.Physics.P2.DistanceConstraint.prototype.constructor = Phaser.Physics.P2.DistanceConstraint; @@ -568,7 +568,7 @@

Source: physics/p2/DistanceConstraint.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Easing.js.html b/docs/Easing.js.html index 4f1979fa8b..b5e6f113b0 100644 --- a/docs/Easing.js.html +++ b/docs/Easing.js.html @@ -532,7 +532,7 @@

Source: tween/Easing.js

/** * Ease-in. * - * @method Phaser.Easing.Linear#In + * @method Phaser.Easing.Linear#In * @param {number} k - The value to be tweened. * @returns {number} k^2. */ @@ -554,8 +554,8 @@

Source: tween/Easing.js

/** * Ease-in. * - * @method Phaser.Easing.Quadratic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#In + * @param {number} k - The value to be tweened. * @returns {number} k^2. */ In: function ( k ) { @@ -567,8 +567,8 @@

Source: tween/Easing.js

/** * Ease-out. * - * @method Phaser.Easing.Quadratic#Out - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quadratic#Out + * @param {number} k - The value to be tweened. * @returns {number} k* (2-k). */ Out: function ( k ) { @@ -581,7 +581,7 @@

Source: tween/Easing.js

* Ease-in/out. * * @method Phaser.Easing.Quadratic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -603,8 +603,8 @@

Source: tween/Easing.js

/** * Cubic ease-in. * - * @method Phaser.Easing.Cubic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Cubic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -617,7 +617,7 @@

Source: tween/Easing.js

* Cubic ease-out. * * @method Phaser.Easing.Cubic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -630,7 +630,7 @@

Source: tween/Easing.js

* Cubic ease-in/out. * * @method Phaser.Easing.Cubic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -652,8 +652,8 @@

Source: tween/Easing.js

/** * Quartic ease-in. * - * @method Phaser.Easing.Quartic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quartic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -666,7 +666,7 @@

Source: tween/Easing.js

* Quartic ease-out. * * @method Phaser.Easing.Quartic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -679,7 +679,7 @@

Source: tween/Easing.js

* Quartic ease-in/out. * * @method Phaser.Easing.Quartic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -701,8 +701,8 @@

Source: tween/Easing.js

/** * Quintic ease-in. * - * @method Phaser.Easing.Quintic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Quintic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -715,7 +715,7 @@

Source: tween/Easing.js

* Quintic ease-out. * * @method Phaser.Easing.Quintic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -728,7 +728,7 @@

Source: tween/Easing.js

* Quintic ease-in/out. * * @method Phaser.Easing.Quintic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -750,8 +750,8 @@

Source: tween/Easing.js

/** * Sinusoidal ease-in. * - * @method Phaser.Easing.Sinusoidal#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Sinusoidal#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -764,7 +764,7 @@

Source: tween/Easing.js

* Sinusoidal ease-out. * * @method Phaser.Easing.Sinusoidal#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -777,7 +777,7 @@

Source: tween/Easing.js

* Sinusoidal ease-in/out. * * @method Phaser.Easing.Sinusoidal#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -798,8 +798,8 @@

Source: tween/Easing.js

/** * Exponential ease-in. * - * @method Phaser.Easing.Exponential#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Exponential#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -812,7 +812,7 @@

Source: tween/Easing.js

* Exponential ease-out. * * @method Phaser.Easing.Exponential#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -825,7 +825,7 @@

Source: tween/Easing.js

* Exponential ease-in/out. * * @method Phaser.Easing.Exponential#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -849,8 +849,8 @@

Source: tween/Easing.js

/** * Circular ease-in. * - * @method Phaser.Easing.Circular#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Circular#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -863,7 +863,7 @@

Source: tween/Easing.js

* Circular ease-out. * * @method Phaser.Easing.Circular#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -876,7 +876,7 @@

Source: tween/Easing.js

* Circular ease-in/out. * * @method Phaser.Easing.Circular#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -898,8 +898,8 @@

Source: tween/Easing.js

/** * Elastic ease-in. * - * @method Phaser.Easing.Elastic#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Elastic#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -917,7 +917,7 @@

Source: tween/Easing.js

* Elastic ease-out. * * @method Phaser.Easing.Elastic#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -935,7 +935,7 @@

Source: tween/Easing.js

* Elastic ease-in/out. * * @method Phaser.Easing.Elastic#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -962,8 +962,8 @@

Source: tween/Easing.js

/** * Back ease-in. * - * @method Phaser.Easing.Back#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Back#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -977,7 +977,7 @@

Source: tween/Easing.js

* Back ease-out. * * @method Phaser.Easing.Back#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -991,7 +991,7 @@

Source: tween/Easing.js

* Back ease-in/out. * * @method Phaser.Easing.Back#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -1014,8 +1014,8 @@

Source: tween/Easing.js

/** * Bounce ease-in. * - * @method Phaser.Easing.Bounce#In - * @param {number} k - The value to be tweened. + * @method Phaser.Easing.Bounce#In + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ In: function ( k ) { @@ -1028,7 +1028,7 @@

Source: tween/Easing.js

* Bounce ease-out. * * @method Phaser.Easing.Bounce#Out - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ Out: function ( k ) { @@ -1057,7 +1057,7 @@

Source: tween/Easing.js

* Bounce ease-in/out. * * @method Phaser.Easing.Bounce#InOut - * @param {number} k - The value to be tweened. + * @param {number} k - The value to be tweened. * @returns {number} The tweened value. */ InOut: function ( k ) { @@ -1091,7 +1091,7 @@

Source: tween/Easing.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Ellipse.js.html b/docs/Ellipse.js.html index d5d79d80ae..76c1933610 100644 --- a/docs/Ellipse.js.html +++ b/docs/Ellipse.js.html @@ -660,7 +660,7 @@

Source: geom/Ellipse.js

* @propety {number} left - Gets or sets the value of the leftmost point of the ellipse. */ Object.defineProperty(Phaser.Ellipse.prototype, "left", { - + get: function () { return this.x; }, @@ -708,7 +708,7 @@

Source: geom/Ellipse.js

get: function () { return this.y; }, - + set: function (value) { this.y = value; } @@ -824,7 +824,7 @@

Source: geom/Ellipse.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Emitter.js.html b/docs/Emitter.js.html index a97eb470c0..f04bab44ae 100644 --- a/docs/Emitter.js.html +++ b/docs/Emitter.js.html @@ -698,7 +698,7 @@

Source: particles/arcade/Emitter.js

* @property {boolean} emitX */ this.emitX = x; - + /** * The point the particles are emitted from. * Emitter.x and Emitter.y control the containers location, which updates all current particles @@ -738,7 +738,7 @@

Source: particles/arcade/Emitter.js

if (this.game.time.now >= this._timer) { this.emitParticle(); - + this._counter++; if (this._quantity > 0) @@ -754,7 +754,7 @@

Source: particles/arcade/Emitter.js

} } -} +}; /** * This function generates a new array of particle sprites to attach to the emitter. @@ -821,7 +821,7 @@

Source: particles/arcade/Emitter.js

return this; -} +}; /** * Call this function to turn off all the particles and the emitter. @@ -833,7 +833,7 @@

Source: particles/arcade/Emitter.js

this.alive = false; this.exists = false; -} +}; /** * Handy for bringing game objects "back to life". Just sets alive and exists back to true. @@ -844,7 +844,7 @@

Source: particles/arcade/Emitter.js

this.alive = true; this.exists = true; -} +}; /** * Call this function to start emitting particles. @@ -882,7 +882,7 @@

Source: particles/arcade/Emitter.js

this._counter = 0; this._timer = this.game.time.now + frequency; -} +}; /** * This function can be used both internally and externally to emit the next particle. @@ -959,7 +959,7 @@

Source: particles/arcade/Emitter.js

particle.body.drag.y = this.particleDrag.y; particle.body.angularDrag = this.angularDrag; -} +}; /** * A more compact way of setting the width and height of the emitter. @@ -972,7 +972,7 @@

Source: particles/arcade/Emitter.js

this.width = width; this.height = height; -} +}; /** * A more compact way of setting the X velocity range of the emitter. @@ -988,7 +988,7 @@

Source: particles/arcade/Emitter.js

this.minParticleSpeed.x = min; this.maxParticleSpeed.x = max; -} +}; /** * A more compact way of setting the Y velocity range of the emitter. @@ -1004,7 +1004,7 @@

Source: particles/arcade/Emitter.js

this.minParticleSpeed.y = min; this.maxParticleSpeed.y = max; -} +}; /** * A more compact way of setting the angular velocity constraints of the emitter. @@ -1020,7 +1020,7 @@

Source: particles/arcade/Emitter.js

this.minRotation = min; this.maxRotation = max; -} +}; /** * Change the emitters center to match the center of any object with a `center` property, such as a Sprite. @@ -1035,7 +1035,7 @@

Source: particles/arcade/Emitter.js

this.emitY = object.center.y; } -} +}; /** * @name Phaser.Particles.Arcade.Emitter#x @@ -1075,7 +1075,7 @@

Source: particles/arcade/Emitter.js

* @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "left", { - + get: function () { return Math.floor(this.x - (this.width / 2)); } @@ -1088,7 +1088,7 @@

Source: particles/arcade/Emitter.js

* @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "right", { - + get: function () { return Math.floor(this.x + (this.width / 2)); } @@ -1101,7 +1101,7 @@

Source: particles/arcade/Emitter.js

* @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "top", { - + get: function () { return Math.floor(this.y - (this.height / 2)); } @@ -1114,7 +1114,7 @@

Source: particles/arcade/Emitter.js

* @readonly */ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", { - + get: function () { return Math.floor(this.y + (this.height / 2)); } @@ -1141,7 +1141,7 @@

Source: particles/arcade/Emitter.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Events.js.html b/docs/Events.js.html index 2255e2fd83..9cca50326c 100644 --- a/docs/Events.js.html +++ b/docs/Events.js.html @@ -531,7 +531,7 @@

Source: gameobjects/Events.js

* @param {Phaser.Sprite} sprite - A reference to Description. */ Phaser.Events = function (sprite) { - + this.parent = sprite; this.onAddedToGroup = new Phaser.Signal(); @@ -608,7 +608,7 @@

Source: gameobjects/Events.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Filter.js.html b/docs/Filter.js.html index c0d27615a3..8aac73c7c4 100644 --- a/docs/Filter.js.html +++ b/docs/Filter.js.html @@ -513,9 +513,9 @@

Source: core/Filter.js

* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Filter template to use for any Phaser filter development. -* +* * @class Phaser.Filter * @classdesc Phaser - Filter * @constructor @@ -534,8 +534,8 @@

Source: core/Filter.js

* @property {number} type - The const type of this object, either Phaser.WEBGL_FILTER or Phaser.CANVAS_FILTER. * @default */ - this.type = Phaser.WEBGL_FILTER; - + this.type = Phaser.WEBGL_FILTER; + /** * An array of passes - some filters contain a few steps this array simply stores the steps in a linear fashion. * For example the blur filter has two passes blurX and blurY. @@ -543,7 +543,7 @@

Source: core/Filter.js

* @private */ this.passes = [this]; - + /** * @property {array} shaders - Array an array of shaders. * @private @@ -572,7 +572,7 @@

Source: core/Filter.js

mouse: { type: '2f', value: { x: 0.0, y: 0.0 }} }; - + /** * @property {array} fragmentSrc - The fragment shader code. */ @@ -634,7 +634,7 @@

Source: core/Filter.js

destroy: function () { this.game = null; - + } }; @@ -693,7 +693,7 @@

Source: core/Filter.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Frame.js.html b/docs/Frame.js.html index fc59e08b2a..f636820fc9 100644 --- a/docs/Frame.js.html +++ b/docs/Frame.js.html @@ -532,7 +532,7 @@

Source: animation/Frame.js

* @property {number} index - The index of this Frame within the FrameData set it is being added to. */ this.index = index; - + /** * @property {number} x - X position within the image to cut from. */ @@ -712,7 +712,7 @@

Source: animation/Frame.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/FrameData.js.html b/docs/FrameData.js.html index 7d671f8594..fc6b008eec 100644 --- a/docs/FrameData.js.html +++ b/docs/FrameData.js.html @@ -611,7 +611,7 @@

Source: animation/FrameData.js

} return true; - + }, /** @@ -624,7 +624,7 @@

Source: animation/FrameData.js

* @return {Array} An array of Frames between the start and end index values, or an empty array if none were found. */ getFrameRange: function (start, end, output) { - + if (typeof output === "undefined") { output = []; } for (var i = start; i <= end; i++) @@ -767,7 +767,7 @@

Source: animation/FrameData.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Game.js.html b/docs/Game.js.html index 1caf2ec695..900c50d121 100644 --- a/docs/Game.js.html +++ b/docs/Game.js.html @@ -822,7 +822,7 @@

Source: core/Game.js

this._onBoot = function () { return _this.boot(); - } + }; if (document.readyState === 'complete' || document.readyState === 'interactive') { @@ -1355,7 +1355,7 @@

Source: core/Game.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GameObjectCreator.js.html b/docs/GameObjectCreator.js.html index 224b1931ec..1ccbbb2197 100644 --- a/docs/GameObjectCreator.js.html +++ b/docs/GameObjectCreator.js.html @@ -527,7 +527,7 @@

Source: gameobjects/GameObjectCreator.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -630,7 +630,7 @@

Source: gameobjects/GameObjectCreator.js

audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -646,7 +646,7 @@

Source: gameobjects/GameObjectCreator.js

sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -740,7 +740,7 @@

Source: gameobjects/GameObjectCreator.js

* A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectCreator#retroFont @@ -894,7 +894,7 @@

Source: gameobjects/GameObjectCreator.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GameObjectFactory.js.html b/docs/GameObjectFactory.js.html index a6c03159e2..e10cedc87e 100644 --- a/docs/GameObjectFactory.js.html +++ b/docs/GameObjectFactory.js.html @@ -526,7 +526,7 @@

Source: gameobjects/GameObjectFactory.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {Phaser.World} world - A reference to the game world. */ @@ -666,7 +666,7 @@

Source: gameobjects/GameObjectFactory.js

audio: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -682,7 +682,7 @@

Source: gameobjects/GameObjectFactory.js

sound: function (key, volume, loop, connect) { return this.game.sound.add(key, volume, loop, connect); - + }, /** @@ -788,7 +788,7 @@

Source: gameobjects/GameObjectFactory.js

* A RetroFont uses a bitmap which contains fixed with characters for the font set. You use character spacing to define the set. * If you need variable width character support then use a BitmapText object instead. The main difference between a RetroFont and a BitmapText * is that a RetroFont creates a single texture that you can apply to a game object, where-as a BitmapText creates one Sprite object per letter of text. - * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, + * The texture can be asssigned or one or multiple images/sprites, but note that the text the RetroFont uses will be shared across them all, * i.e. if you need each Image to have different text in it, then you need to create multiple RetroFont objects. * * @method Phaser.GameObjectFactory#retroFont @@ -946,7 +946,7 @@

Source: gameobjects/GameObjectFactory.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Gamepad.js.html b/docs/Gamepad.js.html index ac53a1a0ca..52301a95f1 100644 --- a/docs/Gamepad.js.html +++ b/docs/Gamepad.js.html @@ -808,7 +808,7 @@

Source: input/Gamepad.js

} var rawPad = this._rawPads[m]; - + if (rawPad) { if (validConnections.rawIndices[rawPad.index]) @@ -1113,7 +1113,7 @@

Source: input/Gamepad.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GamepadButton.js.html b/docs/GamepadButton.js.html index 7eee570136..f7ea1b6bf6 100644 --- a/docs/GamepadButton.js.html +++ b/docs/GamepadButton.js.html @@ -703,7 +703,7 @@

Source: input/GamepadButton.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/GearConstraint.js.html b/docs/GearConstraint.js.html index ce39684874..7436fd58a4 100644 --- a/docs/GearConstraint.js.html +++ b/docs/GearConstraint.js.html @@ -544,7 +544,7 @@

Source: physics/p2/GearConstraint.js

p2.GearConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.GearConstraint.prototype = Object.create(p2.GearConstraint.prototype); Phaser.Physics.P2.GearConstraint.prototype.constructor = Phaser.Physics.P2.GearConstraint; @@ -569,7 +569,7 @@

Source: physics/p2/GearConstraint.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Graphics.js.html b/docs/Graphics.js.html index e6054444c0..0084d97ba5 100644 --- a/docs/Graphics.js.html +++ b/docs/Graphics.js.html @@ -515,7 +515,7 @@

Source: gameobjects/Graphics.js

/** * Creates a new `Graphics` object. -* +* * @class Phaser.Graphics * @constructor * @@ -532,7 +532,7 @@

Source: gameobjects/Graphics.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -621,7 +621,7 @@

Source: gameobjects/Graphics.js

return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -631,7 +631,7 @@

Source: gameobjects/Graphics.js

*/ Phaser.Graphics.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -646,11 +646,11 @@

Source: gameobjects/Graphics.js

this.position.y = (this.game.camera.view.y + this.cameraOffset.y) / this.game.camera.scale.y; } -} +}; /** * Destroy this Graphics instance. -* +* * @method Phaser.Graphics.prototype.destroy * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? */ @@ -694,11 +694,11 @@

Source: gameobjects/Graphics.js

this.game = null; -} +}; /* * Draws a {Phaser.Polygon} or a {PIXI.Polygon} filled -* +* * @method Phaser.Graphics.prototype.drawPolygon */ Phaser.Graphics.prototype.drawPolygon = function (poly) { @@ -711,8 +711,8 @@

Source: gameobjects/Graphics.js

} this.lineTo(poly.points[0].x, poly.points[0].y); - -} + +}; /** * Indicates the rotation of the Graphics, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -742,7 +742,7 @@

Source: gameobjects/Graphics.js

* @property {boolean} fixedToCamera - Set to true to fix this Graphics to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Graphics.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -784,7 +784,7 @@

Source: gameobjects/Graphics.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Group.js.html b/docs/Group.js.html index 1e92e63618..e79a793100 100644 --- a/docs/Group.js.html +++ b/docs/Group.js.html @@ -719,7 +719,7 @@

Source: core/Group.js

return child; -} +}; /** * Adds an existing object to this Group. The object can be an instance of Phaser.Sprite, Phaser.Button or any other display object. @@ -756,7 +756,7 @@

Source: core/Group.js

return child; -} +}; /** * Returns the child found at the given index within this Group. @@ -776,7 +776,7 @@

Source: core/Group.js

return this.getChildAt(index); } -} +}; /** * Automatically creates a new Phaser.Sprite object and adds it to the top of this Group. @@ -806,9 +806,9 @@

Source: core/Group.js

child.alive = exists; this.addChild(child); - + child.z = this.children.length; - + if (child.events) { child.events.onAddedToGroup.dispatch(child, this); @@ -821,7 +821,7 @@

Source: core/Group.js

return child; -} +}; /** * Automatically creates multiple Phaser.Sprite objects and adds them to the top of this Group. @@ -843,7 +843,7 @@

Source: core/Group.js

this.create(0, 0, key, frame, exists); } -} +}; /** * Internal method that re-applies all of the childrens Z values. @@ -860,7 +860,7 @@

Source: core/Group.js

this.children[i].z = i; } -} +}; /** * Advances the Group cursor to the next object in the Group. If it's at the end of the Group it wraps around to the first object. @@ -884,7 +884,7 @@

Source: core/Group.js

this.cursor = this.children[this._cache[8]]; } -} +}; /** * Moves the Group cursor to the previous object in the Group. If it's at the start of the Group it wraps around to the last object. @@ -908,7 +908,7 @@

Source: core/Group.js

this.cursor = this.children[this._cache[8]]; } -} +}; /** * Swaps the position of two children in this Group. Both children must be in this Group. @@ -928,8 +928,8 @@

Source: core/Group.js

} return result; - -} + +}; /** * Brings the given child to the top of this Group so it renders above all other children. @@ -948,7 +948,7 @@

Source: core/Group.js

return child; -} +}; /** * Sends the given child to the bottom of this Group so it renders below all other children. @@ -967,7 +967,7 @@

Source: core/Group.js

return child; -} +}; /** * Moves the given child up one place in this Group unless it's already at the top. @@ -991,7 +991,7 @@

Source: core/Group.js

return child; -} +}; /** * Moves the given child down one place in this Group unless it's already at the top. @@ -1015,7 +1015,7 @@

Source: core/Group.js

return child; -} +}; /** * Positions the child found at the given index within this Group to the given x and y coordinates. @@ -1037,7 +1037,7 @@

Source: core/Group.js

this.getChildAt(index).y = y; } -} +}; /** * Reverses all children in this Group. Note that this does not propagate, only direct children are re-ordered. @@ -1049,7 +1049,7 @@

Source: core/Group.js

this.children.reverse(); this.updateZ(); -} +}; /** * Get the index position of the given child in this Group. This should always match the childs z property. @@ -1062,7 +1062,7 @@

Source: core/Group.js

return this.children.indexOf(child); -} +}; /** * Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group. @@ -1075,7 +1075,7 @@

Source: core/Group.js

Phaser.Group.prototype.replace = function (oldChild, newChild) { var index = this.getIndex(oldChild); - + if (index !== -1) { if (newChild.parent !== undefined) @@ -1098,7 +1098,7 @@

Source: core/Group.js

return temp; } -} +}; /** * Sets the given property to the given value on the child. The operation controls the assignment of the value. @@ -1158,7 +1158,7 @@

Source: core/Group.js

else if (operation == 4) { child[key[0]][key[1]][key[2]][key[3]] /= value; } } -} +}; /** * This function allows you to quickly set a property on a single child of this Group to a new value. @@ -1184,7 +1184,7 @@

Source: core/Group.js

this.setProperty(child, key, value, operation); } -} +}; /** * This function allows you to quickly set the same property across all children of this Group to a new value. @@ -1217,7 +1217,7 @@

Source: core/Group.js

} } -} +}; /** * This function allows you to quickly set the same property across all children of this Group, and any child Groups, to a new value. @@ -1256,7 +1256,7 @@

Source: core/Group.js

} } -} +}; /** * Adds the amount to the given property on all children in this Group. @@ -1272,7 +1272,7 @@

Source: core/Group.js

this.setAll(property, amount, checkAlive, checkVisible, 1); -} +}; /** * Subtracts the amount from the given property on all children in this Group. @@ -1288,7 +1288,7 @@

Source: core/Group.js

this.setAll(property, amount, checkAlive, checkVisible, 2); -} +}; /** * Multiplies the given property by the amount on all children in this Group. @@ -1304,7 +1304,7 @@

Source: core/Group.js

this.setAll(property, amount, checkAlive, checkVisible, 3); -} +}; /** * Divides the given property by the amount on all children in this Group. @@ -1320,12 +1320,12 @@

Source: core/Group.js

this.setAll(property, amount, checkAlive, checkVisible, 4); -} +}; /** * Calls a function on all of the children that have exists=true in this Group. * After the existsValue parameter you can add as many parameters as you like, which will all be passed to the child callback. -* +* * @method Phaser.Group#callAllExists * @param {function} callback - The function that exists on the children that will be called. * @param {boolean} existsValue - Only children with exists=existsValue will be called. @@ -1343,11 +1343,11 @@

Source: core/Group.js

} } -} +}; /** * Returns a reference to a function that exists on a child of the Group based on the given callback array. -* +* * @method Phaser.Group#callbackFromArray * @param {object} child - The object to inspect. * @param {array} callback - The array of function names. @@ -1396,12 +1396,12 @@

Source: core/Group.js

return false; -} +}; /** * Calls a function on all of the children regardless if they are dead or alive (see callAllExists if you need control over that) * After the method parameter and context you can add as many extra parameters as you like, which will all be passed to the child. -* +* * @method Phaser.Group#callAll * @param {string} method - A string containing the name of the function that will be called. The function must exist on the child. * @param {string} [context=null] - A string containing the context under which the method will be executed. Set to null to default to the child. @@ -1456,7 +1456,7 @@

Source: core/Group.js

} } -} +}; /** * The core preUpdate - as called by World. @@ -1480,7 +1480,7 @@

Source: core/Group.js

return true; -} +}; /** * The core update - as called by World. @@ -1496,7 +1496,7 @@

Source: core/Group.js

this.children[i].update(); } -} +}; /** * The core postUpdate - as called by World. @@ -1519,25 +1519,22 @@

Source: core/Group.js

this.children[i].postUpdate(); } -} +}; /** * Allows you to call your own function on each member of this Group. You must pass the callback and context in which it will run. * After the checkExists parameter you can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEach(awardBonusGold, this, true, 100, 500) * Note: Currently this will skip any children which are Groups themselves. -* +* * @method Phaser.Group#forEach * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). -* @param {boolean} checkExists - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. +* @param {boolean} [checkExists=false] - If set only children with exists=true will be passed to the callback, otherwise all children will be passed. */ Phaser.Group.prototype.forEach = function (callback, callbackContext, checkExists) { - if (typeof checkExists === 'undefined') - { - checkExists = false; - } + if (typeof checkExists === 'undefined') { checkExists = false; } var args = Array.prototype.splice.call(arguments, 3); args.unshift(null); @@ -1551,13 +1548,13 @@

Source: core/Group.js

} } -} +}; /** * Allows you to call your own function on each member of this Group where child.exists=true. You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachExists(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachExists * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -1569,13 +1566,13 @@

Source: core/Group.js

this.iterate('exists', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each alive member of this Group (where child.alive=true). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachAlive(causeDamage, this, 500) -* +* * @method Phaser.Group#forEachAlive * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -1587,13 +1584,13 @@

Source: core/Group.js

this.iterate('alive', true, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Allows you to call your own function on each dead member of this Group (where alive=false). You must pass the callback and context in which it will run. * You can add as many parameters as you like, which will all be passed to the callback along with the child. * For example: Group.forEachDead(bringToLife, this) -* +* * @method Phaser.Group#forEachDead * @param {function} callback - The function that will be called. Each child of the Group will be passed to it as its first parameter. * @param {Object} callbackContext - The context in which the function should be called (usually 'this'). @@ -1605,7 +1602,7 @@

Source: core/Group.js

this.iterate('alive', false, Phaser.Group.RETURN_TOTAL, callback, callbackContext, args); -} +}; /** * Call this function to sort the group according to a particular value and order. @@ -1639,7 +1636,7 @@

Source: core/Group.js

this.updateZ(); -} +}; /** * An internal helper function for the sort process. @@ -1670,7 +1667,7 @@

Source: core/Group.js

} } -} +}; /** * An internal helper function for the sort process. @@ -1694,13 +1691,13 @@

Source: core/Group.js

return 0; } -} +}; /** * Iterates over the children of the Group. When a child has a property matching key that equals the given value, it is considered as a match. * Matched children can be sent to the optional callback, or simply returned or counted. * You can add as many callback parameters as you like, which will all be passed to the callback along with the child, after the callbackContext parameter. -* +* * @method Phaser.Group#iterate * @param {string} key - The child property to check, i.e. 'exists', 'alive', 'health' * @param {any} value - If child.key === this value it will be considered a match. Note that a strict comparison is used. @@ -1751,7 +1748,7 @@

Source: core/Group.js

return null; } -} +}; /** * Call this function to retrieve the first object with exists == (the given state) in the Group. @@ -1769,7 +1766,7 @@

Source: core/Group.js

return this.iterate('exists', state, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === true in the group. @@ -1782,7 +1779,7 @@

Source: core/Group.js

return this.iterate('alive', true, Phaser.Group.RETURN_CHILD); -} +}; /** * Call this function to retrieve the first object with alive === false in the group. @@ -1795,7 +1792,7 @@

Source: core/Group.js

return this.iterate('alive', false, Phaser.Group.RETURN_CHILD); -} +}; /** * Returns the child at the top of this Group. The top is the one being displayed (rendered) above every other child. @@ -1810,7 +1807,7 @@

Source: core/Group.js

return this.children[this.children.length - 1]; } -} +}; /** * Returns the child at the bottom of this Group. The bottom is the one being displayed (rendered) below every other child. @@ -1825,7 +1822,7 @@

Source: core/Group.js

return this.children[0]; } -} +}; /** * Call this function to find out how many members of the group are alive. @@ -1837,7 +1834,7 @@

Source: core/Group.js

return this.iterate('alive', true, Phaser.Group.RETURN_TOTAL); -} +}; /** * Call this function to find out how many members of the group are dead. @@ -1849,7 +1846,7 @@

Source: core/Group.js

return this.iterate('alive', false, Phaser.Group.RETURN_TOTAL); -} +}; /** * Returns a member at random from the group. @@ -1871,7 +1868,7 @@

Source: core/Group.js

return this.game.math.getRandom(this.children, startIndex, length); -} +}; /** * Removes the given child from this Group and sets its group property to null. @@ -1903,7 +1900,7 @@

Source: core/Group.js

return true; -} +}; /** * Removes all children from this Group, setting all group properties to null. @@ -1931,7 +1928,7 @@

Source: core/Group.js

this.cursor = null; -} +}; /** * Removes all children from this Group whos index falls beteen the given startIndex and endIndex values. @@ -1969,7 +1966,7 @@

Source: core/Group.js

this.updateZ(); -} +}; /** * Destroys this Group. Removes all children, then removes the container from the display list and nulls references. @@ -2015,7 +2012,7 @@

Source: core/Group.js

this.exists = false; } -} +}; /** * @name Phaser.Group#total @@ -2074,7 +2071,7 @@

Source: core/Group.js

* @property {boolean} fixedToCamera - Set to true to fix this Group to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Group.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -2149,7 +2146,7 @@

Source: core/Group.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Image.js.html b/docs/Image.js.html index b2bd933e1e..d1855b9395 100644 --- a/docs/Image.js.html +++ b/docs/Image.js.html @@ -532,12 +532,12 @@

Source: gameobjects/Image.js

y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Image isn't updated by the core game loop. * @default @@ -673,7 +673,7 @@

Source: gameobjects/Image.js

return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -683,7 +683,7 @@

Source: gameobjects/Image.js

*/ Phaser.Image.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -711,7 +711,7 @@

Source: gameobjects/Image.js

this.children[i].postUpdate(); } -} +}; /** * Changes the Texture the Image is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -788,7 +788,7 @@

Source: gameobjects/Image.js

} } -} +}; /** * Crop allows you to crop the texture used to display this Image. @@ -835,13 +835,13 @@

Source: gameobjects/Image.js

} } -} +}; /** * Brings a 'dead' Image back to life, optionally giving it the health value specified. * A resurrected Image has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Image.events.onRevived for the signal. -* +* * @method Phaser.Image#revive * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -859,14 +859,14 @@

Source: gameobjects/Image.js

return this; -} +}; /** * Kills a Image. A killed Image has its alive, exists and visible properties all set to false. * It will dispatch the onKilled event, you can listen to Image.events.onKilled for the signal. * Note that killing a Image is a way for you to quickly recycle it in a Image pool, it doesn't free it up from memory. * If you don't need this Image any more you should call Image.destroy instead. -* +* * @method Phaser.Image#kill * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -884,12 +884,12 @@

Source: gameobjects/Image.js

return this; -} +}; /** * Destroys the Image. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Image#destroy * @memberof Phaser.Image * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -947,11 +947,11 @@

Source: gameobjects/Image.js

this.mask = null; this.game = null; -} +}; /** * Resets the Image. This places the Image at the given x/y world coordinates and then sets alive, exists, visible and renderable all to true. -* +* * @method Phaser.Image#reset * @memberof Phaser.Image * @param {number} x - The x coordinate (in world space) to position the Image at. @@ -969,13 +969,13 @@

Source: gameobjects/Image.js

this.renderable = true; return this; - -} + +}; /** * Brings the Image to the top of the display list it is a child of. Images that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Image#bringToTop * @memberof Phaser.Image * @return {Phaser.Image} This instance. @@ -989,13 +989,13 @@

Source: gameobjects/Image.js

return this; -} +}; /** * Indicates the rotation of the Image, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Image.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Image#angle * @property {number} angle - The angle of this Image in degrees. */ @@ -1042,7 +1042,7 @@

Source: gameobjects/Image.js

Object.defineProperty(Phaser.Image.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -1059,7 +1059,7 @@

Source: gameobjects/Image.js

Object.defineProperty(Phaser.Image.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -1093,7 +1093,7 @@

Source: gameobjects/Image.js

Object.defineProperty(Phaser.Image.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -1107,7 +1107,7 @@

Source: gameobjects/Image.js

Object.defineProperty(Phaser.Image.prototype, "frame", { get: function() { - + return this._frame; }, @@ -1136,7 +1136,7 @@

Source: gameobjects/Image.js

Object.defineProperty(Phaser.Image.prototype, "frameName", { get: function() { - + return this._frameName; }, @@ -1181,7 +1181,7 @@

Source: gameobjects/Image.js

* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Image.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -1218,7 +1218,7 @@

Source: gameobjects/Image.js

* @property {boolean} fixedToCamera - Set to true to fix this Image to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Image.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -1247,7 +1247,7 @@

Source: gameobjects/Image.js

* @property {boolean} smoothed - Set to true to smooth the texture of this Image, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Image.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -1294,7 +1294,7 @@

Source: gameobjects/Image.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Input.js.html b/docs/Input.js.html index 5dcf1652b8..b3666bfded 100644 --- a/docs/Input.js.html +++ b/docs/Input.js.html @@ -524,7 +524,7 @@

Source: input/Input.js

Phaser.Input = function (game) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -533,7 +533,7 @@

Source: input/Input.js

* @default */ this.hitCanvas = null; - + /** * @property {CanvasRenderingContext2D} hitContext - The context of the pixel perfect hit canvas. * @default @@ -566,13 +566,13 @@

Source: input/Input.js

/** * @property {number} multiInputOverride - Controls the expected behaviour when using a mouse and touch together on a multi-input device. - * @default + * @default */ this.multiInputOverride = Phaser.Input.MOUSE_TOUCH_COMBINE; /** * @property {Phaser.Point} position - A point object representing the current position of the Pointer. - * @default + * @default */ this.position = null; @@ -719,22 +719,22 @@

Source: input/Input.js

* @property {Pointer} mousePointer - The mouse has its own unique Phaser.Pointer object which you can use if making a desktop specific game. */ this.mousePointer = null; - + /** * @property {Phaser.Mouse} mouse - The Mouse Input manager. */ this.mouse = null; - + /** * @property {Phaser.Keyboard} keyboard - The Keyboard Input manager. */ this.keyboard = null; - + /** * @property {Phaser.Touch} touch - the Touch Input manager. */ this.touch = null; - + /** * @property {Phaser.MSPointer} mspointer - The MSPointer Input manager. */ @@ -754,17 +754,17 @@

Source: input/Input.js

* @property {Phaser.Signal} onDown - A Signal that is dispatched each time a pointer is pressed down. */ this.onDown = null; - + /** * @property {Phaser.Signal} onUp - A Signal that is dispatched each time a pointer is released. */ this.onUp = null; - + /** * @property {Phaser.Signal} onTap - A Signal that is dispatched each time a pointer is tapped. */ this.onTap = null; - + /** * @property {Phaser.Signal} onHold - A Signal that is dispatched each time a pointer is held down. */ @@ -781,7 +781,7 @@

Source: input/Input.js

* @private */ this._localPoint = new Phaser.Point(); - + /** * @property {number} _pollCounter - Internal var holding the current poll counter. * @private @@ -1222,7 +1222,7 @@

Source: input/Input.js

wt.d * id * pointer.x + -wt.b * id * pointer.y + (wt.ty * wt.b - wt.tx * wt.d) * id, wt.a * id * pointer.y + -wt.c * id * pointer.x + (-wt.ty * wt.a + wt.tx * wt.c) * id ); - + }, /** @@ -1324,7 +1324,7 @@

Source: input/Input.js

* @property {number} y - The Y coordinate of the most recently active pointer. */ Object.defineProperty(Phaser.Input.prototype, "y", { - + get: function () { return this._y; }, @@ -1369,7 +1369,7 @@

Source: input/Input.js

* @readonly */ Object.defineProperty(Phaser.Input.prototype, "totalActivePointers", { - + get: function () { this.currentPointers = 0; @@ -1434,7 +1434,7 @@

Source: input/Input.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/InputHandler.js.html b/docs/InputHandler.js.html index 4a11c5a2cb..0baba9a424 100644 --- a/docs/InputHandler.js.html +++ b/docs/InputHandler.js.html @@ -527,7 +527,7 @@

Source: input/InputHandler.js

this.sprite = sprite; /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = sprite.game; @@ -542,13 +542,13 @@

Source: input/InputHandler.js

* @default */ this.priorityID = 0; - + /** * @property {boolean} useHandCursor - On a desktop browser you can set the 'hand' cursor to appear when moving over the Sprite. * @default */ this.useHandCursor = false; - + /** * @property {boolean} _setHandCursor - Did this Sprite trigger the hand cursor? * @private @@ -560,19 +560,19 @@

Source: input/InputHandler.js

* @default */ this.isDragged = false; - + /** * @property {boolean} allowHorizontalDrag - Controls if the Sprite is allowed to be dragged horizontally. * @default */ this.allowHorizontalDrag = true; - + /** * @property {boolean} allowVerticalDrag - Controls if the Sprite is allowed to be dragged vertically. * @default */ this.allowVerticalDrag = true; - + /** * @property {boolean} bringToTop - If true when this Sprite is clicked or dragged it will automatically be bought to the top of the Group it is within. * @default @@ -584,25 +584,25 @@

Source: input/InputHandler.js

* @default */ this.snapOffset = null; - + /** * @property {boolean} snapOnDrag - When the Sprite is dragged this controls if the center of the Sprite will snap to the pointer on drag or not. * @default */ this.snapOnDrag = false; - + /** * @property {boolean} snapOnRelease - When the Sprite is dragged this controls if the Sprite will be snapped on release. * @default */ this.snapOnRelease = false; - + /** * @property {number} snapX - When a Sprite has snapping enabled this holds the width of the snap grid. * @default */ this.snapX = 0; - + /** * @property {number} snapY - When a Sprite has snapping enabled this holds the height of the snap grid. * @default @@ -614,7 +614,7 @@

Source: input/InputHandler.js

* @default */ this.snapOffsetX = 0; - + /** * @property {number} snapOffsetY - This defines the top-left Y coordinate of the snap grid.. * @default @@ -647,13 +647,13 @@

Source: input/InputHandler.js

/** * @property {boolean} draggable - Is this sprite allowed to be dragged by the mouse? true = yes, false = no - * @default + * @default */ this.draggable = false; /** * @property {Phaser.Rectangle} boundsRect - A region of the game world within which the sprite is restricted during drag. - * @default + * @default */ this.boundsRect = null; @@ -1153,7 +1153,7 @@

Source: input/InputHandler.js

y += this.sprite.texture.frame.y; this.game.input.hitContext.drawImage(this.sprite.texture.baseTexture.source, x, y, 1, 1, 0, 0, 1, 1); - + var rgb = this.game.input.hitContext.getImageData(0, 0, 1, 1); if (rgb.data[3] >= this.pixelPerfectAlpha) @@ -1639,7 +1639,7 @@

Source: input/InputHandler.js

} this.updateDrag(pointer); - + if (this.bringToTop) { this.sprite.bringToTop(); @@ -1659,7 +1659,7 @@

Source: input/InputHandler.js

this.isDragged = false; this._draggedPointerID = -1; this._pointerData[pointer.id].isDragged = false; - + if (this.snapOnRelease) { if (this.sprite.fixedToCamera) @@ -1859,7 +1859,7 @@

Source: input/InputHandler.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/InversePointProxy.js.html b/docs/InversePointProxy.js.html index 0b2a95a9f4..2efbb9a005 100644 --- a/docs/InversePointProxy.js.html +++ b/docs/InversePointProxy.js.html @@ -536,7 +536,7 @@

Source: physics/p2/InversePointProxy.js

* @property {number} x - The x property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -556,7 +556,7 @@

Source: physics/p2/InversePointProxy.js

* @property {number} y - The y property of this InversePointProxy. */ Object.defineProperty(Phaser.Physics.P2.InversePointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -591,7 +591,7 @@

Source: physics/p2/InversePointProxy.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Key.js.html b/docs/Key.js.html index 6e050a2c3b..9c6a825efc 100644 --- a/docs/Key.js.html +++ b/docs/Key.js.html @@ -523,7 +523,7 @@

Source: input/Key.js

Phaser.Key = function (game, keycode) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -612,7 +612,7 @@

Source: input/Key.js

* @property {Phaser.Signal} onUp - This Signal is dispatched every time this Key is pressed down. It is only dispatched once (until the key is released again). */ this.onUp = new Phaser.Signal(); - + }; Phaser.Key.prototype = { @@ -751,7 +751,7 @@

Source: input/Key.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Keyboard.js.html b/docs/Keyboard.js.html index 280966b20a..41eb92445e 100644 --- a/docs/Keyboard.js.html +++ b/docs/Keyboard.js.html @@ -559,7 +559,7 @@

Source: input/Keyboard.js

* @private */ this._keys = []; - + /** * @property {array} _capture - The array the key capture values are stored in. * @private @@ -572,14 +572,20 @@

Source: input/Keyboard.js

* @default */ this._onKeyDown = null; - + /** * @property {function} _onKeyUp * @private * @default */ this._onKeyUp = null; - + + /** + * @property {number} _i - Internal cache var + * @private + */ + this._i = 0; + }; Phaser.Keyboard.prototype = { @@ -636,7 +642,7 @@

Source: input/Keyboard.js

if (this._keys[keycode]) { this._keys[keycode] = null; - + this.removeKeyCapture(keycode); } @@ -655,12 +661,12 @@

Source: input/Keyboard.js

down: this.addKey(Phaser.Keyboard.DOWN), left: this.addKey(Phaser.Keyboard.LEFT), right: this.addKey(Phaser.Keyboard.RIGHT) - } + }; }, /** - * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. + * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. * This is called automatically by Phaser.Input and should not normally be invoked directly. * * @method Phaser.Keyboard#start @@ -689,17 +695,37 @@

Source: input/Keyboard.js

}, /** - * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body. + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { + this._onKeyDown = null; + this._onKeyUp = null; + window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); }, + /** + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. + * Also clears all key captures and currently created Key objects. + * + * @method Phaser.Keyboard#destroy + */ + destroy: function () { + + this.stop(); + + this.clearCaptures(); + + this._keys.length = 0; + this._i = 0; + + }, + /** * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. @@ -754,13 +780,13 @@

Source: input/Keyboard.js

*/ update: function () { - var i = this._keys.length; + this._i = this._keys.length; - while (i--) + while (this._i--) { - if (this._keys[i]) + if (this._keys[this._i]) { - this._keys[i].update(); + this._keys[this._i].update(); } } @@ -797,7 +823,7 @@

Source: input/Keyboard.js

{ this._keys[event.keyCode] = new Phaser.Key(this.game, event.keyCode); } - + this._keys[event.keyCode].processKeyDown(event); }, @@ -1041,7 +1067,7 @@

Source: input/Keyboard.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Line.js.html b/docs/Line.js.html index cde1230e81..aaf4b63bb8 100644 --- a/docs/Line.js.html +++ b/docs/Line.js.html @@ -569,12 +569,12 @@

Source: geom/Line.js

* @method Phaser.Line#fromSprite * @param {Phaser.Sprite} startSprite - The coordinates of this Sprite will be set to the Line.start point. * @param {Phaser.Sprite} endSprite - The coordinates of this Sprite will be set to the Line.start point. - * @param {boolean} [useCenter=true] - If true it will use startSprite.center.x, if false startSprite.x. + * @param {boolean} [useCenter=false] - If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class. * @return {Phaser.Line} This line object */ fromSprite: function (startSprite, endSprite, useCenter) { - if (typeof useCenter === 'undefined') { useCenter = true; } + if (typeof useCenter === 'undefined') { useCenter = false; } if (useCenter) { @@ -667,7 +667,7 @@

Source: geom/Line.js

while (!((x1 == x2) && (y1 == y2))) { var e2 = err << 1; - + if (e2 > -dy) { err -= dy; @@ -886,7 +886,7 @@

Source: geom/Line.js

result.x = ((b1 * c2) - (b2 * c1)) / denom; result.y = ((a2 * c1) - (a1 * c2)) / denom; - + if (asSegment) { if (Math.pow((result.x - b.x) + (result.y - b.y), 2) > Math.pow((a.x - b.x) + (a.y - b.y), 2)) @@ -954,7 +954,7 @@

Source: geom/Line.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/LinkedList.js.html b/docs/LinkedList.js.html index 1bc2acc6f0..40c99e5cd0 100644 --- a/docs/LinkedList.js.html +++ b/docs/LinkedList.js.html @@ -544,7 +544,7 @@

Source: core/LinkedList.js

* @default */ this.last = null; - + /** * @property {object} game - Number of elements in the list. * @default @@ -557,7 +557,7 @@

Source: core/LinkedList.js

/** * Adds a new element to this linked list. - * + * * @method Phaser.LinkedList#add * @param {object} child - The element to add to this list. Can be a Phaser.Sprite or any other object you need to quickly iterate through. * @return {object} The child that was added. @@ -590,7 +590,7 @@

Source: core/LinkedList.js

/** * Removes the given element from this linked list if it exists. - * + * * @method Phaser.LinkedList#remove * @param {object} child - The child to be removed from the list. */ @@ -633,7 +633,7 @@

Source: core/LinkedList.js

/** * Calls a function on all members of this list, using the member as the context for the callback. * The function must exist on the member. - * + * * @method Phaser.LinkedList#callAll * @param {function} callback - The function to call. */ @@ -645,7 +645,7 @@

Source: core/LinkedList.js

} var entity = this.first; - + do { if (entity && entity[callback]) @@ -656,7 +656,7 @@

Source: core/LinkedList.js

entity = entity.next; } - while(entity != this.last.next) + while(entity != this.last.next); } @@ -684,7 +684,7 @@

Source: core/LinkedList.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Loader.js.html b/docs/Loader.js.html index 209e08dcd1..d8b377d8dd 100644 --- a/docs/Loader.js.html +++ b/docs/Loader.js.html @@ -507,7 +507,8 @@

Source: loader/Loader.js

-
/**
+            
/* jshint wsh:true */
+/**
 * @author       Richard Davey <rich@photonstorm.com>
 * @copyright    2014 Photon Storm Ltd.
 * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
@@ -606,17 +607,17 @@ 

Source: loader/Loader.js

* @property {Phaser.Signal} onFileComplete - Event signal. */ this.onFileComplete = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onFileError - Event signal. */ this.onFileError = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadStart - Event signal. */ this.onLoadStart = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoadComplete - Event signal. */ @@ -704,7 +705,7 @@

Source: loader/Loader.js

} return false; - + }, /** @@ -729,7 +730,7 @@

Source: loader/Loader.js

} return -1; - + }, /** @@ -754,7 +755,7 @@

Source: loader/Loader.js

} return false; - + }, /** @@ -1672,11 +1673,11 @@

Source: loader/Loader.js

if (file.autoDecode) { - this.game.cache.updateSound(key, 'isDecoding', true); - var that = this; var key = file.key; + this.game.cache.updateSound(key, 'isDecoding', true); + this.game.sound.context.decodeAudioData(file.data, function (buffer) { if (buffer) { @@ -1911,7 +1912,7 @@

Source: loader/Loader.js

{ this.hasLoaded = true; this.isLoading = false; - + this.removeAll(); this.onLoadComplete.dispatch(); @@ -1985,7 +1986,7 @@

Source: loader/Loader.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/LoaderParser.js.html b/docs/LoaderParser.js.html index abbbe4b6e1..2b3fb10f11 100644 --- a/docs/LoaderParser.js.html +++ b/docs/LoaderParser.js.html @@ -613,7 +613,7 @@

Source: loader/LoaderParser.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/LockConstraint.js.html b/docs/LockConstraint.js.html index 4b9a2e4ef4..fac79b1597 100644 --- a/docs/LockConstraint.js.html +++ b/docs/LockConstraint.js.html @@ -548,7 +548,7 @@

Source: physics/p2/LockConstraint.js

p2.LockConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.LockConstraint.prototype = Object.create(p2.LockConstraint.prototype); Phaser.Physics.P2.LockConstraint.prototype.constructor = Phaser.Physics.P2.LockConstraint; @@ -573,7 +573,7 @@

Source: physics/p2/LockConstraint.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/MSPointer.js.html b/docs/MSPointer.js.html index aaa7e6d9c9..92b07c304e 100644 --- a/docs/MSPointer.js.html +++ b/docs/MSPointer.js.html @@ -529,7 +529,7 @@

Source: input/MSPointer.js

* @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called (defaults to game). */ @@ -546,13 +546,13 @@

Source: input/MSPointer.js

* @private */ this._onMSPointerDown = null; - + /** * @property {function} _onMSPointerMove - Internal function to handle MSPointer events. * @private */ this._onMSPointerMove = null; - + /** * @property {function} _onMSPointerUp - Internal function to handle MSPointer events. * @private @@ -704,7 +704,7 @@

Source: input/MSPointer.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Material.js.html b/docs/Material.js.html index 14aa479b87..7c3b1a5c3b 100644 --- a/docs/Material.js.html +++ b/docs/Material.js.html @@ -530,7 +530,7 @@

Source: physics/p2/Material.js

p2.Material.call(this); -} +}; Phaser.Physics.P2.Material.prototype = Object.create(p2.Material.prototype); Phaser.Physics.P2.Material.prototype.constructor = Phaser.Physics.P2.Material; @@ -555,7 +555,7 @@

Source: physics/p2/Material.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Math.js.html b/docs/Math.js.html index 3f15c8fae5..7f729d4b71 100644 --- a/docs/Math.js.html +++ b/docs/Math.js.html @@ -527,11 +527,11 @@

Source: math/Math.js

PI2: Math.PI * 2, /** - * Two number are fuzzyEqual if their difference is less than ε. + * Two number are fuzzyEqual if their difference is less than ε. * @method Phaser.Math#fuzzyEqual * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if |a-b|<ε */ fuzzyEqual: function (a, b, epsilon) { @@ -540,11 +540,11 @@

Source: math/Math.js

}, /** - * a is fuzzyLessThan b if it is less than b + ε. + * a is fuzzyLessThan b if it is less than b + ε. * @method Phaser.Math#fuzzyLessThan * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if a<b+ε */ fuzzyLessThan: function (a, b, epsilon) { @@ -553,11 +553,11 @@

Source: math/Math.js

}, /** - * a is fuzzyGreaterThan b if it is more than b - ε. + * a is fuzzyGreaterThan b if it is more than b - ε. * @method Phaser.Math#fuzzyGreaterThan * @param {number} a * @param {number} b - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} True if a>b+ε */ fuzzyGreaterThan: function (a, b, epsilon) { @@ -565,10 +565,10 @@

Source: math/Math.js

return a > b - epsilon; }, - /** + /** * @method Phaser.Math#fuzzyCeil * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} ceiling(val-ε) */ fuzzyCeil: function (val, epsilon) { @@ -576,10 +576,10 @@

Source: math/Math.js

return Math.ceil(val - epsilon); }, - /** + /** * @method Phaser.Math#fuzzyFloor * @param {number} val - * @param {number} epsilon + * @param {number} epsilon * @return {boolean} floor(val-ε) */ fuzzyFloor: function (val, epsilon) { @@ -587,7 +587,7 @@

Source: math/Math.js

return Math.floor(val + epsilon); }, - /** + /** * Averages all values passed to the function and returns the result. You can pass as many parameters as you like. * @method Phaser.Math#average * @return {number} The average of all given values. @@ -610,7 +610,7 @@

Source: math/Math.js

}, - /** + /** * @method Phaser.Math#truncate * @param {number} n * @return {number} @@ -619,7 +619,7 @@

Source: math/Math.js

return (n > 0) ? Math.floor(n) : Math.ceil(n); }, - /** + /** * @method Phaser.Math#shear * @param {number} n * @return {number} n mod 1 @@ -711,7 +711,7 @@

Source: math/Math.js

* Snaps a value to the nearest value in an array. * @method Phaser.Math#snapToInArray * @param {number} input - * @param {array} arr + * @param {array} arr * @param {boolean} sort - True if the array needs to be sorted. * @return {number} */ @@ -728,14 +728,14 @@

Source: math/Math.js

} var i = 1; - + while (arr[i] < input) { i++; } var low = arr[i - 1]; var high = (i < arr.length) ? arr[i] : Number.POSITIVE_INFINITY; - + return ((high - input) <= (input - low)) ? high : low; }, @@ -769,7 +769,7 @@

Source: math/Math.js

* * Note what occurs when we round to the 3rd space (8ths place), 100100000, this is to be assumed * because we are rounding 100011.1011011011011011 which rounds up. - * + * * @method Phaser.Math#roundTo * @param {number} value - The value to round. * @param {number} place - The place to round to. @@ -780,9 +780,9 @@

Source: math/Math.js

if (typeof place === "undefined") { place = 0; } if (typeof base === "undefined") { base = 10; } - + var p = Math.pow(base, -place); - + return Math.round(value * p) / p; }, @@ -828,7 +828,7 @@

Source: math/Math.js

* @method Phaser.Math#interpolateFloat * @param {number} a * @param {number} b - * @param {number} weight + * @param {number} weight * @return {number} */ interpolateFloat: function (a, b, weight) { @@ -879,7 +879,7 @@

Source: math/Math.js

angleRad = angleRad % (2 * Math.PI); return angleRad >= 0 ? angleRad : angleRad + 2 * Math.PI; - + }, /** @@ -925,7 +925,7 @@

Source: math/Math.js

var rd = (radians) ? Math.PI : 180; a1 = this.normalizeAngle(a1, radians); a2 = this.normalizeAngle(a2, radians); - + if (a1 < -rd / 2 && a2 > rd / 2) { a1 += rd * 2; @@ -975,7 +975,7 @@

Source: math/Math.js

chanceRoll: function (chance) { if (typeof chance === "undefined") { chance = 50; } - + if (chance <= 0) { return false; @@ -1053,7 +1053,7 @@

Source: math/Math.js

minSub: function (value, amount, min) { value -= amount; - + if (value < min) { value = min; @@ -1088,7 +1088,7 @@

Source: math/Math.js

{ result += range; } - + return result + min; }, @@ -1323,7 +1323,7 @@

Source: math/Math.js

* @method Phaser.Math#linearInterpolation * @param {number} v * @param {number} k - * @return {number} + * @return {number} */ linearInterpolation: function (v, k) { @@ -1436,7 +1436,7 @@

Source: math/Math.js

* @param {number} p2 * @param {number} p3 * @param {number} t - * @return {number} + * @return {number} */ catmullRom: function (p0, p1, p2, p3, t) { @@ -1470,7 +1470,7 @@

Source: math/Math.js

if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -1504,7 +1504,7 @@

Source: math/Math.js

if (typeof startIndex === "undefined") { startIndex = 0; } if (typeof length === "undefined") { length = 0; } - + if (objects != null) { var l = length; @@ -1571,14 +1571,14 @@

Source: math/Math.js

if (typeof sinAmplitude === "undefined") { sinAmplitude = 1.0; } if (typeof cosAmplitude === "undefined") { cosAmplitude = 1.0; } if (typeof frequency === "undefined") { frequency = 1.0; } - + var sin = sinAmplitude; var cos = cosAmplitude; var frq = frequency * Math.PI / length; - + var cosTable = []; var sinTable = []; - + for (var c = 0; c < length; c++) { cos -= sin * frq; @@ -1596,7 +1596,7 @@

Source: math/Math.js

/** * Removes the top element from the stack and re-inserts it onto the bottom, then returns it. * The original stack is modified in the process. This effectively moves the position of the data from the start to the end of the table. - * + * * @method Phaser.Math#shift * @param {array} stack - The array to shift. * @return {any} The shifted value. @@ -1632,7 +1632,7 @@

Source: math/Math.js

/** * Returns the distance between the two given set of coordinates. - * + * * @method Phaser.Math#distance * @param {number} x1 * @param {number} y1 @@ -1651,7 +1651,7 @@

Source: math/Math.js

/** * Returns the distance between the two given set of coordinates at the power given. - * + * * @method Phaser.Math#distancePow * @param {number} x1 * @param {number} y1 @@ -1670,7 +1670,7 @@

Source: math/Math.js

/** * Returns the rounded distance between the two given set of coordinates. - * + * * @method Phaser.Math#distanceRounded * @param {number} x1 * @param {number} y1 @@ -1687,7 +1687,7 @@

Source: math/Math.js

/** * Force a value within the boundaries of two values. * Clamp value to range <a, b> - * + * * @method Phaser.Math#clamp * @param {number} x * @param {number} a @@ -1699,10 +1699,10 @@

Source: math/Math.js

return ( x < a ) ? a : ( ( x > b ) ? b : x ); }, - + /** * Clamp value to range <a, inf). - * + * * @method Phaser.Math#clampBottom * @param {number} x * @param {number} a @@ -1716,7 +1716,7 @@

Source: math/Math.js

/** * Checks if two values are within the given tolerance of each other. - * + * * @method Phaser.Math#within * @param {number} a - The first number to check * @param {number} b - The second number to check @@ -1728,10 +1728,10 @@

Source: math/Math.js

return (Math.abs(a - b) <= tolerance); }, - + /** * Linear mapping from range <a1, a2> to range <b1, b2> - * + * * @method Phaser.Math#mapLinear * @param {number} x the value to map * @param {number} a1 first endpoint of the range <a1, a2> @@ -1748,7 +1748,7 @@

Source: math/Math.js

/** * Smoothstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smoothstep * @param {number} x * @param {number} min @@ -1775,7 +1775,7 @@

Source: math/Math.js

/** * Smootherstep function as detailed at http://en.wikipedia.org/wiki/Smoothstep - * + * * @method Phaser.Math#smootherstep * @param {number} x * @param {number} min @@ -1803,7 +1803,7 @@

Source: math/Math.js

/** * A value representing the sign of the value. * -1 for negative, +1 for positive, 0 if value is 0 - * + * * @method Phaser.Math#sign * @param {number} x * @return {number} @@ -1816,11 +1816,11 @@

Source: math/Math.js

/** * Convert degrees to radians. - * + * * @method Phaser.Math#degToRad * @return {function} */ - degToRad: function() { + degToRad: (function() { var degreeToRadiansFactor = Math.PI / 180; @@ -1830,15 +1830,15 @@

Source: math/Math.js

}; - }(), + }()), /** * Convert degrees to radians. - * + * * @method Phaser.Math#radToDeg * @return {function} */ - radToDeg: function() { + radToDeg: (function() { var radianToDegreesFactor = 180 / Math.PI; @@ -1848,7 +1848,7 @@

Source: math/Math.js

}; - }() + }()) };
@@ -1872,7 +1872,7 @@

Source: math/Math.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Mouse.js.html b/docs/Mouse.js.html index b8bbea4e37..e6828e913c 100644 --- a/docs/Mouse.js.html +++ b/docs/Mouse.js.html @@ -526,7 +526,7 @@

Source: input/Mouse.js

* @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Object} callbackContext - The context under which callbacks are called. */ @@ -536,12 +536,12 @@

Source: input/Mouse.js

* @property {function} mouseDownCallback - A callback that can be fired when the mouse is pressed down. */ this.mouseDownCallback = null; - + /** * @property {function} mouseMoveCallback - A callback that can be fired when the mouse is moved while pressed down. */ this.mouseMoveCallback = null; - + /** * @property {function} mouseUpCallback - A callback that can be fired when the mouse is released from a pressed down state. */ @@ -865,7 +865,7 @@

Source: input/Mouse.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Net.js.html b/docs/Net.js.html index 9640975e83..3b5e169731 100644 --- a/docs/Net.js.html +++ b/docs/Net.js.html @@ -521,7 +521,7 @@

Source: net/Net.js

* @param {Phaser.Game} game - A reference to the currently running game. */ Phaser.Net = function (game) { - + this.game = game; }; @@ -530,7 +530,7 @@

Source: net/Net.js

/** * Returns the hostname given by the browser. - * + * * @method Phaser.Net#getHostName * @return {string} */ @@ -549,7 +549,7 @@

Source: net/Net.js

* If the domain name is found it returns true. * You can specify a part of a domain, for example 'google' would match 'google.com', 'google.co.uk', etc. * Do not include 'http://' at the start. - * + * * @method Phaser.Net#checkDomainName * @param {string} domain * @return {boolean} true if the given domain fragment can be found in the window.location.hostname @@ -563,7 +563,7 @@

Source: net/Net.js

* If the value doesn't already exist it is set. * If the value exists it is replaced with the new value given. If you don't provide a new value it is removed from the query string. * Optionally you can redirect to the new url, or just return it as a string. - * + * * @method Phaser.Net#updateQueryString * @param {string} key - The querystring key to update. * @param {string} value - The new value to be set. If it already exists it will be replaced. @@ -578,7 +578,7 @@

Source: net/Net.js

var output = ''; var re = new RegExp("([?|&])" + key + "=.*?(&|#|$)(.*)", "gi"); - + if (re.test(url)) { if (typeof value !== 'undefined' && value !== null) @@ -625,7 +625,7 @@

Source: net/Net.js

/** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#getQueryString * @param {string} [parameter=''] - If specified this will return just the value for that key. * @return {string|object} An object containing the key value pairs found in the query string or just the value if a parameter was given. @@ -661,7 +661,7 @@

Source: net/Net.js

/** * Returns the Query String as an object. * If you specify a parameter it will return just the value of that parameter, should it exist. - * + * * @method Phaser.Net#decodeURI * @param {string} value - The URI component to be decoded. * @return {string} The decoded value. @@ -694,7 +694,7 @@

Source: net/Net.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Particles.js.html b/docs/Particles.js.html index 3f58b2f3e2..562d6b6375 100644 --- a/docs/Particles.js.html +++ b/docs/Particles.js.html @@ -534,7 +534,7 @@

Source: particles/Particles.js

this.emitters = {}; /** - * @property {number} ID - + * @property {number} ID - * @default */ this.ID = 0; @@ -609,7 +609,7 @@

Source: particles/Particles.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Animation.html b/docs/Phaser.Animation.html index 1a0609d15d..74e225d9b5 100644 --- a/docs/Phaser.Animation.html +++ b/docs/Phaser.Animation.html @@ -3693,7 +3693,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:39 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.AnimationManager.html b/docs/Phaser.AnimationManager.html index ca3f8d0367..5b228e42da 100644 --- a/docs/Phaser.AnimationManager.html +++ b/docs/Phaser.AnimationManager.html @@ -3051,7 +3051,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:39 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.AnimationParser.html b/docs/Phaser.AnimationParser.html index 18bdbd0d96..3afc8c7f14 100644 --- a/docs/Phaser.AnimationParser.html +++ b/docs/Phaser.AnimationParser.html @@ -1572,7 +1572,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:39 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.BitmapData.html b/docs/Phaser.BitmapData.html index 321a178898..5662180581 100644 --- a/docs/Phaser.BitmapData.html +++ b/docs/Phaser.BitmapData.html @@ -4061,7 +4061,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:39 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.BitmapText.html b/docs/Phaser.BitmapText.html index 052758779f..729b981367 100644 --- a/docs/Phaser.BitmapText.html +++ b/docs/Phaser.BitmapText.html @@ -3097,7 +3097,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:39 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Button.html b/docs/Phaser.Button.html index 437b3616c8..fbe65fa50a 100644 --- a/docs/Phaser.Button.html +++ b/docs/Phaser.Button.html @@ -8143,7 +8143,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:40 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:24 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Cache.html b/docs/Phaser.Cache.html index 3b7db5a63e..126de9466d 100644 --- a/docs/Phaser.Cache.html +++ b/docs/Phaser.Cache.html @@ -9355,7 +9355,7 @@

Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:40 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Camera.html b/docs/Phaser.Camera.html index e4803c3304..2902dc2235 100644 --- a/docs/Phaser.Camera.html +++ b/docs/Phaser.Camera.html @@ -2057,7 +2057,7 @@

view -

Camera view. +

Camera view. The view into the world we wish to render (by default the game dimensions). The x/y values are in world coordinates, not screen coordinates, the width/height is how many pixels to render. Objects outside of this view are not rendered if set to camera cull.

@@ -3698,7 +3698,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:40 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Canvas.html b/docs/Phaser.Canvas.html index 8fc50e1423..87fa71dcf4 100644 --- a/docs/Phaser.Canvas.html +++ b/docs/Phaser.Canvas.html @@ -2755,7 +2755,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:40 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Circle.html b/docs/Phaser.Circle.html index d7185b9141..8eb18e953b 100644 --- a/docs/Phaser.Circle.html +++ b/docs/Phaser.Circle.html @@ -4394,7 +4394,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:40 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Color.html b/docs/Phaser.Color.html index 23f2e05004..f220258600 100644 --- a/docs/Phaser.Color.html +++ b/docs/Phaser.Color.html @@ -3703,7 +3703,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:25 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Device.html b/docs/Phaser.Device.html index 146f89edac..964a7c7f37 100644 --- a/docs/Phaser.Device.html +++ b/docs/Phaser.Device.html @@ -6817,7 +6817,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Back.html b/docs/Phaser.Easing.Back.html index d87586690f..fa4e727332 100644 --- a/docs/Phaser.Easing.Back.html +++ b/docs/Phaser.Easing.Back.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Bounce.html b/docs/Phaser.Easing.Bounce.html index 3feded2ad2..0dbe3cf16d 100644 --- a/docs/Phaser.Easing.Bounce.html +++ b/docs/Phaser.Easing.Bounce.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Circular.html b/docs/Phaser.Easing.Circular.html index b74d17cf00..d8f2690fa0 100644 --- a/docs/Phaser.Easing.Circular.html +++ b/docs/Phaser.Easing.Circular.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Cubic.html b/docs/Phaser.Easing.Cubic.html index 4bb93110ac..e3e94176a0 100644 --- a/docs/Phaser.Easing.Cubic.html +++ b/docs/Phaser.Easing.Cubic.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Elastic.html b/docs/Phaser.Easing.Elastic.html index 852c295a89..0239c423da 100644 --- a/docs/Phaser.Easing.Elastic.html +++ b/docs/Phaser.Easing.Elastic.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Exponential.html b/docs/Phaser.Easing.Exponential.html index 551abfc8e5..d87fa57045 100644 --- a/docs/Phaser.Easing.Exponential.html +++ b/docs/Phaser.Easing.Exponential.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Linear.html b/docs/Phaser.Easing.Linear.html index 1867a05685..927cc0352a 100644 --- a/docs/Phaser.Easing.Linear.html +++ b/docs/Phaser.Easing.Linear.html @@ -773,7 +773,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quadratic.html b/docs/Phaser.Easing.Quadratic.html index 030bf7ee7b..be5d3901ff 100644 --- a/docs/Phaser.Easing.Quadratic.html +++ b/docs/Phaser.Easing.Quadratic.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quartic.html b/docs/Phaser.Easing.Quartic.html index 4b768890f5..cf85769c09 100644 --- a/docs/Phaser.Easing.Quartic.html +++ b/docs/Phaser.Easing.Quartic.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Quintic.html b/docs/Phaser.Easing.Quintic.html index 8e1c6dbebd..017a577d17 100644 --- a/docs/Phaser.Easing.Quintic.html +++ b/docs/Phaser.Easing.Quintic.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:42 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.Sinusoidal.html b/docs/Phaser.Easing.Sinusoidal.html index 5adcfe1011..a9184871ec 100644 --- a/docs/Phaser.Easing.Sinusoidal.html +++ b/docs/Phaser.Easing.Sinusoidal.html @@ -1055,7 +1055,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Easing.html b/docs/Phaser.Easing.html index e0533454c0..7cef3ef4cc 100644 --- a/docs/Phaser.Easing.html +++ b/docs/Phaser.Easing.html @@ -665,7 +665,7 @@

Classes

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:41 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:26 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Ellipse.html b/docs/Phaser.Ellipse.html index 7c7acedac4..eb1acecb40 100644 --- a/docs/Phaser.Ellipse.html +++ b/docs/Phaser.Ellipse.html @@ -2902,7 +2902,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:27 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Events.html b/docs/Phaser.Events.html index 49ea3b618c..70eb30612c 100644 --- a/docs/Phaser.Events.html +++ b/docs/Phaser.Events.html @@ -679,7 +679,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Filter.html b/docs/Phaser.Filter.html index 8622921b23..7bc93809ed 100644 --- a/docs/Phaser.Filter.html +++ b/docs/Phaser.Filter.html @@ -1964,7 +1964,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Frame.html b/docs/Phaser.Frame.html index 32f4989f4a..5702fe0e93 100644 --- a/docs/Phaser.Frame.html +++ b/docs/Phaser.Frame.html @@ -3193,7 +3193,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.FrameData.html b/docs/Phaser.FrameData.html index a9ee47a840..3b7983462b 100644 --- a/docs/Phaser.FrameData.html +++ b/docs/Phaser.FrameData.html @@ -1987,7 +1987,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Game.html b/docs/Phaser.Game.html index 4c2bf2dff7..fc5571500f 100644 --- a/docs/Phaser.Game.html +++ b/docs/Phaser.Game.html @@ -6558,7 +6558,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:43 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.GameObjectCreator.html b/docs/Phaser.GameObjectCreator.html index 0178ac24d7..f1e082924e 100644 --- a/docs/Phaser.GameObjectCreator.html +++ b/docs/Phaser.GameObjectCreator.html @@ -3522,7 +3522,7 @@

retroFont @@ -5670,7 +5670,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:28 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.GameObjectFactory.html b/docs/Phaser.GameObjectFactory.html index ae1e8197f6..35acff2e60 100644 --- a/docs/Phaser.GameObjectFactory.html +++ b/docs/Phaser.GameObjectFactory.html @@ -4127,7 +4127,7 @@

retroFont @@ -6481,7 +6481,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Gamepad.html b/docs/Phaser.Gamepad.html index 02eb3fc136..0da7f0231a 100644 --- a/docs/Phaser.Gamepad.html +++ b/docs/Phaser.Gamepad.html @@ -3312,7 +3312,7 @@

stop Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.GamepadButton.html b/docs/Phaser.GamepadButton.html index 08c99f1a1a..bf87b3a270 100644 --- a/docs/Phaser.GamepadButton.html +++ b/docs/Phaser.GamepadButton.html @@ -2632,7 +2632,7 @@

Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Graphics.html b/docs/Phaser.Graphics.html index 19e5bb43a9..9b24d71052 100644 --- a/docs/Phaser.Graphics.html +++ b/docs/Phaser.Graphics.html @@ -2081,7 +2081,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Group.html b/docs/Phaser.Group.html index 62c12baba7..0d5e53c902 100644 --- a/docs/Phaser.Group.html +++ b/docs/Phaser.Group.html @@ -1360,7 +1360,7 @@

Properties:
Source:
@@ -1467,7 +1467,7 @@
Properties:
Source:
@@ -2096,7 +2096,7 @@
Properties:
Source:
@@ -2300,7 +2300,7 @@
Properties:
Source:
@@ -2611,7 +2611,7 @@
Properties:
Source:
@@ -2815,7 +2815,7 @@
Properties:
Source:
@@ -3019,7 +3019,7 @@
Properties:
Source:
@@ -3126,7 +3126,7 @@
Properties:
Source:
@@ -3233,7 +3233,7 @@
Properties:
Source:
@@ -3977,7 +3977,7 @@
Parameters:
Source:
@@ -4755,7 +4755,7 @@

countDeadSource:
@@ -4847,7 +4847,7 @@

countLivin
Source:
@@ -5568,7 +5568,7 @@

Parameters:
Source:
@@ -5745,7 +5745,7 @@
Parameters:
Source:
@@ -5961,7 +5961,7 @@
Parameters:
-

forEach(callback, callbackContext, checkExists)

+

forEach(callback, callbackContext, checkExists)

@@ -5994,8 +5994,12 @@
Parameters:
Type + Argument + + Default + Description @@ -6019,8 +6023,20 @@
Parameters:
+ + + + + + + + + + + +

The function that will be called. Each child of the Group will be passed to it as its first parameter.

@@ -6042,8 +6058,20 @@
Parameters:
+ + + + + + + + + + + +

The context in which the function should be called (usually 'this').

@@ -6065,8 +6093,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + false + + +

If set only children with exists=true will be passed to the callback, otherwise all children will be passed.

@@ -6243,7 +6287,7 @@
Parameters:
Source:
@@ -6386,7 +6430,7 @@
Parameters:
Source:
@@ -6529,7 +6573,7 @@
Parameters:
Source:
@@ -6739,7 +6783,7 @@

getBottomSource:
@@ -6832,7 +6876,7 @@

getFirst
Source:
@@ -6925,7 +6969,7 @@

getFirstD
Source:
@@ -7066,7 +7110,7 @@

Parameters:
Source:
@@ -7371,7 +7415,7 @@
Parameters:
Source:
@@ -7463,7 +7507,7 @@

getTopSource:
@@ -7768,7 +7812,7 @@
Parameters:
Source:
@@ -8655,7 +8699,7 @@
Parameters:
Source:
@@ -8748,7 +8792,7 @@

removeAllSource:
@@ -8889,7 +8933,7 @@
Parameters:
Source:
@@ -10584,7 +10628,7 @@
Parameters:
Source:
@@ -11267,7 +11311,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:44 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Image.html b/docs/Phaser.Image.html index c1a9e73856..793699d4ef 100644 --- a/docs/Phaser.Image.html +++ b/docs/Phaser.Image.html @@ -4264,7 +4264,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:45 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:29 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Input.html b/docs/Phaser.Input.html index c82bfd998e..15f3ca8b65 100644 --- a/docs/Phaser.Input.html +++ b/docs/Phaser.Input.html @@ -7907,7 +7907,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:45 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.InputHandler.html b/docs/Phaser.InputHandler.html index b10705a46a..7bb7f50cbc 100644 --- a/docs/Phaser.InputHandler.html +++ b/docs/Phaser.InputHandler.html @@ -8221,7 +8221,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:45 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Key.html b/docs/Phaser.Key.html index 03ca842a0b..09b40ead72 100644 --- a/docs/Phaser.Key.html +++ b/docs/Phaser.Key.html @@ -2991,7 +2991,7 @@

reset Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:45 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Keyboard.html b/docs/Phaser.Keyboard.html index a39bc3d23a..4a7c0e605a 100644 --- a/docs/Phaser.Keyboard.html +++ b/docs/Phaser.Keyboard.html @@ -1463,7 +1463,7 @@

Parameters:
Source:
@@ -1582,7 +1582,7 @@
Parameters:
Source:
@@ -1726,7 +1726,7 @@
Parameters:
Source:
@@ -1795,7 +1795,7 @@

clearCap
Source:
@@ -1864,7 +1864,7 @@

creat
Source:
@@ -1910,6 +1910,76 @@

Returns:
+ + + + +
+

destroy()

+ + +
+
+ + +
+

Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. +Also clears all key captures and currently created Key objects.

+
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + +
@@ -2005,7 +2075,7 @@
Parameters:
Source:
@@ -2201,7 +2271,7 @@
Parameters:
Source:
@@ -2397,7 +2467,7 @@
Parameters:
Source:
@@ -2538,7 +2608,7 @@
Parameters:
Source:
@@ -2656,7 +2726,7 @@
Parameters:
Source:
@@ -2774,7 +2844,7 @@
Parameters:
Source:
@@ -2892,7 +2962,7 @@
Parameters:
Source:
@@ -2961,7 +3031,7 @@

resetSource:
@@ -2997,7 +3067,7 @@

start -

Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. +

Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. This is called automatically by Phaser.Input and should not normally be invoked directly.

@@ -3031,7 +3101,7 @@

startSource:
@@ -3067,7 +3137,7 @@

stop -

Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body.

+

Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window.

@@ -3100,7 +3170,7 @@

stopSource:
@@ -3169,7 +3239,7 @@

updateSource:
@@ -3220,7 +3290,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Line.html b/docs/Phaser.Line.html index 4dc8ee911f..1180149925 100644 --- a/docs/Phaser.Line.html +++ b/docs/Phaser.Line.html @@ -3208,12 +3208,12 @@

Parameters:
- true + false -

If true it will use startSprite.center.x, if false startSprite.x.

+

If true it will use startSprite.center.x, if false startSprite.x. Note that Sprites don't have a center property by default, so only enable if you've over-ridden your Sprite with a custom class.

@@ -4160,7 +4160,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:30 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.LinkedList.html b/docs/Phaser.LinkedList.html index 12da39ef46..9907b20d28 100644 --- a/docs/Phaser.LinkedList.html +++ b/docs/Phaser.LinkedList.html @@ -1541,7 +1541,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Loader.html b/docs/Phaser.Loader.html index 4eabbc345d..f1b4b07eef 100644 --- a/docs/Phaser.Loader.html +++ b/docs/Phaser.Loader.html @@ -617,7 +617,7 @@
Parameters:
Source:
@@ -703,7 +703,7 @@
Type:
Source:
@@ -763,7 +763,7 @@
Type:
Source:
@@ -823,7 +823,7 @@
Type:
Source:
@@ -883,7 +883,7 @@
Type:
Source:
@@ -991,7 +991,7 @@
Properties:
Source:
@@ -1099,7 +1099,7 @@
Properties:
Source:
@@ -1201,7 +1201,7 @@
Properties:
Source:
@@ -1306,7 +1306,7 @@
Properties:
Source:
@@ -1411,7 +1411,7 @@
Properties:
Source:
@@ -1513,7 +1513,7 @@
Properties:
Source:
@@ -1615,7 +1615,7 @@
Properties:
Source:
@@ -1717,7 +1717,7 @@
Properties:
Source:
@@ -1819,7 +1819,7 @@
Properties:
Source:
@@ -1932,7 +1932,7 @@
Properties:
Source:
@@ -2037,7 +2037,7 @@
Properties:
Source:
@@ -2142,7 +2142,7 @@
Properties:
Source:
@@ -2325,7 +2325,7 @@
Parameters:
Source:
@@ -2583,7 +2583,7 @@
Parameters:
Source:
@@ -2831,7 +2831,7 @@
Parameters:
Source:
@@ -3079,7 +3079,7 @@
Parameters:
Source:
@@ -3327,7 +3327,7 @@
Parameters:
Source:
@@ -3517,7 +3517,7 @@
Parameters:
Source:
@@ -3767,7 +3767,7 @@
Parameters:
Source:
@@ -4111,7 +4111,7 @@
Parameters:
Source:
@@ -4275,7 +4275,7 @@
Parameters:
Source:
@@ -4416,7 +4416,7 @@
Parameters:
Source:
@@ -4534,7 +4534,7 @@
Parameters:
Source:
@@ -4652,7 +4652,7 @@
Parameters:
Source:
@@ -4770,7 +4770,7 @@
Parameters:
Source:
@@ -4911,7 +4911,7 @@
Parameters:
Source:
@@ -5075,7 +5075,7 @@
Parameters:
Source:
@@ -5306,7 +5306,7 @@
Parameters:
Source:
@@ -5537,7 +5537,7 @@
Parameters:
Source:
@@ -5678,7 +5678,7 @@
Parameters:
Source:
@@ -5926,7 +5926,7 @@
Parameters:
Source:
@@ -6018,7 +6018,7 @@

removeAllSource:
@@ -6159,7 +6159,7 @@
Parameters:
Source:
@@ -6346,7 +6346,7 @@
Parameters:
Source:
@@ -6415,7 +6415,7 @@

resetSource:
@@ -6641,7 +6641,7 @@
Parameters:
Source:
@@ -6842,7 +6842,7 @@
Parameters:
Source:
@@ -7198,7 +7198,7 @@
Parameters:
Source:
@@ -7290,7 +7290,7 @@

startSource:
@@ -7498,7 +7498,7 @@
Parameters:
Source:
@@ -7768,7 +7768,7 @@
Parameters:
Source:
@@ -7860,7 +7860,7 @@

total
Source:
@@ -7952,7 +7952,7 @@

total
Source:
@@ -8093,7 +8093,7 @@

Parameters:
Source:
@@ -8144,7 +8144,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.LoaderParser.html b/docs/Phaser.LoaderParser.html index ff16df76af..76a2c002ed 100644 --- a/docs/Phaser.LoaderParser.html +++ b/docs/Phaser.LoaderParser.html @@ -796,7 +796,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.MSPointer.html b/docs/Phaser.MSPointer.html index cceccd59ae..444e00148b 100644 --- a/docs/Phaser.MSPointer.html +++ b/docs/Phaser.MSPointer.html @@ -1491,7 +1491,7 @@

stop Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Math.html b/docs/Phaser.Math.html index 12feed6399..f13cb52912 100644 --- a/docs/Phaser.Math.html +++ b/docs/Phaser.Math.html @@ -11524,7 +11524,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:46 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Mouse.html b/docs/Phaser.Mouse.html index a59c610ad9..edf987b761 100644 --- a/docs/Phaser.Mouse.html +++ b/docs/Phaser.Mouse.html @@ -2808,7 +2808,7 @@

stop Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:31 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Net.html b/docs/Phaser.Net.html index b2c6496e13..f8891db795 100644 --- a/docs/Phaser.Net.html +++ b/docs/Phaser.Net.html @@ -1435,7 +1435,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Particles.Arcade.Emitter.html b/docs/Phaser.Particles.Arcade.Emitter.html index a6e0909d33..f2c23697fc 100644 --- a/docs/Phaser.Particles.Arcade.Emitter.html +++ b/docs/Phaser.Particles.Arcade.Emitter.html @@ -996,7 +996,7 @@
Properties:
Source:
@@ -1108,7 +1108,7 @@
Properties:
Source:
@@ -2287,7 +2287,7 @@
Properties:
Source:
@@ -2918,7 +2918,7 @@
Properties:
Source:
@@ -4478,7 +4478,7 @@
Properties:
Source:
@@ -4794,7 +4794,7 @@
Properties:
Source:
@@ -5003,7 +5003,7 @@
Properties:
Source:
@@ -6291,7 +6291,7 @@
Parameters:
Source:
@@ -7215,7 +7215,7 @@

countDeadSource:
@@ -7312,7 +7312,7 @@

countLivin
Source:
@@ -8048,7 +8048,7 @@

Parameters:
Source:
@@ -8230,7 +8230,7 @@
Parameters:
Source:
@@ -8520,7 +8520,7 @@

emitParti
-

forEach(callback, callbackContext, checkExists)

+

forEach(callback, callbackContext, checkExists)

@@ -8553,8 +8553,12 @@

Parameters:
Type + Argument + + Default + Description @@ -8578,8 +8582,20 @@
Parameters:
+ + + + + + + + + + + +

The function that will be called. Each child of the Group will be passed to it as its first parameter.

@@ -8601,8 +8617,20 @@
Parameters:
+ + + + + + + + + + + +

The context in which the function should be called (usually 'this').

@@ -8624,8 +8652,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + false + + +

If set only children with exists=true will be passed to the callback, otherwise all children will be passed.

@@ -8812,7 +8856,7 @@
Parameters:
Source:
@@ -8960,7 +9004,7 @@
Parameters:
Source:
@@ -9108,7 +9152,7 @@
Parameters:
Source:
@@ -9328,7 +9372,7 @@

getBottomSource:
@@ -9426,7 +9470,7 @@

getFirst
Source:
@@ -9524,7 +9568,7 @@

getFirstD
Source:
@@ -9670,7 +9714,7 @@

Parameters:
Source:
@@ -9985,7 +10029,7 @@
Parameters:
Source:
@@ -10082,7 +10126,7 @@

getTopSource:
@@ -10392,7 +10436,7 @@
Parameters:
Source:
@@ -11699,7 +11743,7 @@
Parameters:
Source:
@@ -11797,7 +11841,7 @@

removeAllSource:
@@ -11943,7 +11987,7 @@
Parameters:
Source:
@@ -14419,7 +14463,7 @@
Parameters:
Source:
@@ -15377,7 +15421,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Particles.html b/docs/Phaser.Particles.html index 429b83913b..339afc3e59 100644 --- a/docs/Phaser.Particles.html +++ b/docs/Phaser.Particles.html @@ -1324,7 +1324,7 @@

<protected> Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Arcade.Body.html b/docs/Phaser.Physics.Arcade.Body.html index a8e227ba71..8f86d83688 100644 --- a/docs/Phaser.Physics.Arcade.Body.html +++ b/docs/Phaser.Physics.Arcade.Body.html @@ -1477,7 +1477,7 @@

Properties:
Source:
@@ -1579,7 +1579,7 @@
Properties:
Source:
@@ -1890,7 +1890,7 @@
Properties:
Source:
@@ -1996,7 +1996,7 @@
Properties:
Source:
@@ -2106,7 +2106,7 @@
Properties:
Source:
@@ -2216,7 +2216,7 @@
Properties:
Source:
@@ -2526,7 +2526,7 @@
Properties:
Source:
@@ -2628,7 +2628,7 @@
Properties:
Source:
@@ -3238,7 +3238,7 @@
Properties:
Source:
@@ -3661,7 +3661,7 @@
Properties:
Source:
@@ -3971,7 +3971,7 @@
Properties:
Source:
@@ -4077,7 +4077,109 @@
Properties:
Source:
+ + + + + + + + + + + + + + + +
+

phase

+ + +
+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
phaser + + +number + + + +

Is this Body in a preUpdate or postUpdate state?

+
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -4485,7 +4587,7 @@
Properties:
Source:
@@ -5102,7 +5204,7 @@
Properties:
Source:
@@ -5209,7 +5311,7 @@
Properties:
Source:
@@ -5519,7 +5621,7 @@
Properties:
Source:
@@ -5723,7 +5825,7 @@
Properties:
Source:
@@ -5825,7 +5927,7 @@
Properties:
Source:
@@ -5890,7 +5992,7 @@

deltaAbsXSource:
@@ -5982,7 +6084,7 @@

deltaAbsYSource:
@@ -6074,7 +6176,7 @@

deltaXSource:
@@ -6166,7 +6268,7 @@

deltaYSource:
@@ -6258,7 +6360,7 @@

deltaZSource:
@@ -6350,7 +6452,7 @@

onFloorSource:
@@ -6442,7 +6544,7 @@

onWallSource:
@@ -6708,7 +6810,7 @@
Parameters:
Source:
@@ -6955,7 +7057,7 @@
Parameters:
Source:
@@ -7006,7 +7108,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Arcade.html b/docs/Phaser.Physics.Arcade.html index 9f14f8ae6a..b97137e41e 100644 --- a/docs/Phaser.Physics.Arcade.html +++ b/docs/Phaser.Physics.Arcade.html @@ -1957,7 +1957,7 @@
Parameters:
Source:
@@ -2271,7 +2271,7 @@
Parameters:
Source:
@@ -2618,7 +2618,7 @@
Parameters:
Source:
@@ -2855,7 +2855,7 @@
Parameters:
Source:
@@ -3021,7 +3021,7 @@
Parameters:
Source:
@@ -3205,7 +3205,7 @@
Parameters:
Source:
@@ -3392,7 +3392,7 @@
Parameters:
Source:
@@ -3484,7 +3484,7 @@

<protecte
Source:
@@ -4223,7 +4223,7 @@

destroySource:
@@ -4364,7 +4364,7 @@
Parameters:
Source:
@@ -4550,7 +4550,7 @@
Parameters:
Source:
@@ -4739,7 +4739,7 @@
Parameters:
Source:
@@ -5202,7 +5202,7 @@
Parameters:
Source:
@@ -5477,7 +5477,7 @@
Parameters:
Source:
@@ -5753,7 +5753,7 @@
Parameters:
Source:
@@ -6063,7 +6063,7 @@
Parameters:
Source:
@@ -6480,7 +6480,7 @@

<protected> Source:
@@ -6549,7 +6549,7 @@

<protected> Source:
@@ -6577,7 +6577,7 @@

<protected> -

<protected> processTileSeparationX(body, x) → {boolean}

+

reset(x, y)

@@ -6585,7 +6585,7 @@

<pr
-

Internal function to process the separation of a physics body from a tile.

+

Resets all Body values (velocity, acceleration, rotation, etc)

@@ -6619,13 +6619,13 @@
Parameters:
- body + x -Phaser.Physics.Arcade.Body +number @@ -6635,14 +6635,14 @@
Parameters:
-

The Body object to separate.

+

The new x position of the Body.

- x + y @@ -6658,7 +6658,7 @@
Parameters:
-

The x separation amount.

+

The new x position of the Body.

@@ -6690,7 +6690,7 @@
Parameters:
Source:
@@ -6711,29 +6711,6 @@
Parameters:
-
Returns:
- - -
-

Returns true as a pass-thru to the separateTile method.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - -

@@ -6741,7 +6718,7 @@
Returns:
-

<protected> processTileSeparationY(body, y)

+

setBounds(x, y, width, height)

@@ -6749,7 +6726,7 @@

<pr
-

Internal function to process the separation of a physics body from a tile.

+

Updates the size of this physics world.

@@ -6783,13 +6760,13 @@
Parameters:
- body + x -Phaser.Physics.Arcade.Body +number @@ -6799,7 +6776,7 @@
Parameters:
-

The Body object to separate.

+

Top left most corner of the world.

@@ -6822,7 +6799,53 @@
Parameters:
-

The y separation amount.

+

Top left most corner of the world.

+ + + + + + + width + + + + + +number + + + + + + + + + +

New width of the world. Can never be smaller than the Game.width.

+ + + + + + + height + + + + + +number + + + + + + + + + +

New height of the world. Can never be smaller than the Game.height.

@@ -6854,7 +6877,7 @@
Parameters:
Source:
@@ -6882,7 +6905,7 @@
Parameters:
-

reset(x, y)

+

setBoundsToWorld()

@@ -6890,7 +6913,7 @@

reset -

Resets all Body values (velocity, acceleration, rotation, etc)

+

Updates the size of this physics world to match the size of the game world.

@@ -6899,78 +6922,6 @@

resetParameters:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
x - - -number - - - -

The new x position of the Body.

y - - -number - - - -

The new x position of the Body.

- -
@@ -6995,7 +6946,7 @@
Parameters:
Source:
@@ -7023,7 +6974,7 @@
Parameters:
-

separate(body1, body2, processCallback, callbackContext, overlapOnly) → {boolean}

+

setSize(width, height, offsetX, offsetY)

@@ -7031,7 +6982,9 @@

separate -

The core separation function to separate two physics bodies.

+

You can modify the size of the physics Body to be any dimension you need. +So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which +is the position of the Body relative to the top-left of the Sprite.

@@ -7053,12 +7006,8 @@
Parameters:
Type - Argument - - Default - Description @@ -7069,1503 +7018,103 @@
Parameters:
- body1 + width -Phaser.Physics.Arcade.Body +number - - - - - - - - - - - - -

The first Body object to separate.

+

The width of the Body.

- body2 + height -Phaser.Physics.Arcade.Body +number - - - - - - - - - - - - -

The second Body object to separate.

+

The height of the Body.

- processCallback + offsetX -function +number - - - <optional>
- - - - - - - - - - null - - - -

A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true.

+

The X offset of the Body from the Sprite position.

- callbackContext + offsetY -object +number - - - <optional>
- - - - - - - - - - - -

The context in which to run the process callback.

+

The Y offset of the Body from the Sprite position.

+ + - - - overlapOnly - - - - - -boolean - - - - - - - - - - - - - - - - - - - - - -

Just run an overlap or a full collision.

- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

Returns true if the bodies collided, otherwise false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - - - - - -
-

separateTile(body, tile) → {boolean}

- - -
-
- - -
-

The core separation function to separate a physics body and a tile.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
body - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

tile - - -Phaser.Tile - - - -

The tile to collide against.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

Returns true if the body was separated, otherwise false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - -
- - - -
-

separateX(body1, body2, overlapOnly) → {boolean}

- - -
-
- - -
-

The core separation function to separate two physics bodies on the x axis.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
body1 - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

body2 - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

overlapOnly - - -boolean - - - -

If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

Returns true if the bodies were separated, otherwise false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - -
- - - -
-

separateY(body1, body2, overlapOnly) → {boolean}

- - -
-
- - -
-

The core separation function to separate two physics bodies on the y axis.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
body1 - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

body2 - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

overlapOnly - - -boolean - - - -

If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

Returns true if the bodies were separated, otherwise false.

-
- - - -
-
- Type -
-
- -boolean - - -
-
- - - - - -
- - - -
-

setBounds(x, y, width, height)

- - -
-
- - -
-

Updates the size of this physics world.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
x - - -number - - - -

Top left most corner of the world.

y - - -number - - - -

Top left most corner of the world.

width - - -number - - - -

New width of the world. Can never be smaller than the Game.width.

height - - -number - - - -

New height of the world. Can never be smaller than the Game.height.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
- - - -
-

setBoundsToWorld()

- - -
-
- - -
-

Updates the size of this physics world to match the size of the game world.

-
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
- - - -
-

setSize(width, height, offsetX, offsetY)

- - -
-
- - -
-

You can modify the size of the physics Body to be any dimension you need. -So it could be smaller or larger than the parent Sprite. You can also control the x and y offset, which -is the position of the Body relative to the top-left of the Sprite.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
width - - -number - - - -

The width of the Body.

height - - -number - - - -

The height of the Body.

offsetX - - -number - - - -

The X offset of the Body from the Sprite position.

offsetY - - -number - - - -

The Y offset of the Body from the Sprite position.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - - - -
- - - -
-

<protected> tileCheckX(body, tile) → {number}

- - -
-
- - -
-

Check the body against the given tile on the X axis.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
body - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

tile - - -Phaser.Tile - - - -

The tile to check.

- - - - -
- - - - - - - - - - - - - - - - - - - -
Source:
-
- - - - - - - -
- - - - - - - - - - - -
Returns:
- - -
-

The amount of separation that occured.

-
- - - -
-
- Type -
-
- -number - - -
-
- - - - - -
- - - -
-

<protected> tileCheckY(body, tile) → {number}

- - -
-
- - -
-

Check the body against the given tile on the Y axis.

-
- - - - - - - -
Parameters:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
body - - -Phaser.Physics.Arcade.Body - - - -

The Body object to separate.

tile - - -Phaser.Tile - - - -

The tile to check.

- - - - -
- + + + +
+ @@ -8586,7 +7135,7 @@
Parameters:
Source:
@@ -8607,29 +7156,6 @@
Parameters:
-
Returns:
- - -
-

The amount of separation that occured.

-
- - - -
-
- Type -
-
- -number - - -
-
- - -
@@ -8678,7 +7204,7 @@

<protected> <
Source:
@@ -9010,7 +7536,7 @@
Parameters:
Source:
@@ -9249,7 +7775,7 @@
Parameters:
Source:
@@ -9325,7 +7851,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Ninja.AABB.html b/docs/Phaser.Physics.Ninja.AABB.html index a52ef18285..1fb93fda83 100644 --- a/docs/Phaser.Physics.Ninja.AABB.html +++ b/docs/Phaser.Physics.Ninja.AABB.html @@ -707,7 +707,7 @@
Parameters:
Source:
@@ -835,7 +835,7 @@
Properties:
Source:
@@ -937,7 +937,7 @@
Properties:
Source:
@@ -1039,7 +1039,7 @@
Properties:
Source:
@@ -1141,7 +1141,7 @@
Properties:
Source:
@@ -1243,7 +1243,7 @@
Properties:
Source:
@@ -1345,7 +1345,7 @@
Properties:
Source:
@@ -1447,7 +1447,7 @@
Properties:
Source:
@@ -1549,7 +1549,7 @@
Properties:
Source:
@@ -1651,7 +1651,7 @@
Properties:
Source:
@@ -1753,7 +1753,7 @@
Properties:
Source:
@@ -1867,7 +1867,7 @@
Parameters:
Source:
@@ -1985,7 +1985,7 @@
Parameters:
Source:
@@ -2054,7 +2054,7 @@

col
Source:
@@ -2123,7 +2123,7 @@

destroySource:
@@ -2192,7 +2192,7 @@

integrateSource:
@@ -2379,7 +2379,7 @@
Parameters:
Source:
@@ -2589,7 +2589,7 @@
Parameters:
Source:
@@ -2799,7 +2799,7 @@
Parameters:
Source:
@@ -3009,7 +3009,7 @@
Parameters:
Source:
@@ -3219,7 +3219,7 @@
Parameters:
Source:
@@ -3429,7 +3429,7 @@
Parameters:
Source:
@@ -3639,7 +3639,7 @@
Parameters:
Source:
@@ -3849,7 +3849,7 @@
Parameters:
Source:
@@ -4059,7 +4059,7 @@
Parameters:
Source:
@@ -4292,7 +4292,7 @@
Parameters:
Source:
@@ -4502,7 +4502,7 @@
Parameters:
Source:
@@ -4689,7 +4689,7 @@
Parameters:
Source:
@@ -4763,7 +4763,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Ninja.Body.html b/docs/Phaser.Physics.Ninja.Body.html index 5d206099fc..4ac36efc4c 100644 --- a/docs/Phaser.Physics.Ninja.Body.html +++ b/docs/Phaser.Physics.Ninja.Body.html @@ -4617,7 +4617,7 @@

setZer Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Ninja.Circle.html b/docs/Phaser.Physics.Ninja.Circle.html index 0fc7980626..af998c1fa7 100644 --- a/docs/Phaser.Physics.Ninja.Circle.html +++ b/docs/Phaser.Physics.Ninja.Circle.html @@ -684,7 +684,7 @@

Parameters:
Source:
@@ -812,7 +812,7 @@
Properties:
Source:
@@ -914,7 +914,7 @@
Properties:
Source:
@@ -1016,7 +1016,7 @@
Properties:
Source:
@@ -1118,7 +1118,7 @@
Properties:
Source:
@@ -1220,7 +1220,7 @@
Properties:
Source:
@@ -1322,7 +1322,7 @@
Properties:
Source:
@@ -1424,7 +1424,7 @@
Properties:
Source:
@@ -1526,7 +1526,7 @@
Properties:
Source:
@@ -1628,7 +1628,7 @@
Properties:
Source:
@@ -1730,7 +1730,7 @@
Properties:
Source:
@@ -1832,7 +1832,7 @@
Properties:
Source:
@@ -1946,7 +1946,7 @@
Parameters:
Source:
@@ -2038,7 +2038,7 @@

col
Source:
@@ -2107,7 +2107,7 @@

destroySource:
@@ -2176,7 +2176,7 @@

integrateSource:
@@ -2665,7 +2665,7 @@
Parameters:
Source:
@@ -2921,7 +2921,7 @@
Parameters:
Source:
@@ -3177,7 +3177,7 @@
Parameters:
Source:
@@ -3433,7 +3433,7 @@
Parameters:
Source:
@@ -3689,7 +3689,7 @@
Parameters:
Source:
@@ -3945,7 +3945,7 @@
Parameters:
Source:
@@ -4201,7 +4201,7 @@
Parameters:
Source:
@@ -4457,7 +4457,7 @@
Parameters:
Source:
@@ -4690,7 +4690,7 @@
Parameters:
Source:
@@ -4923,7 +4923,7 @@
Parameters:
Source:
@@ -4997,7 +4997,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Ninja.Tile.html b/docs/Phaser.Physics.Ninja.Tile.html index a8a5375d1b..9442fd8f8a 100644 --- a/docs/Phaser.Physics.Ninja.Tile.html +++ b/docs/Phaser.Physics.Ninja.Tile.html @@ -813,7 +813,7 @@
Parameters:
Source:
@@ -941,7 +941,7 @@
Properties:
Source:
@@ -1145,7 +1145,7 @@
Properties:
Source:
@@ -1247,7 +1247,7 @@
Properties:
Source:
@@ -1349,7 +1349,7 @@
Properties:
Source:
@@ -1451,7 +1451,7 @@
Properties:
Source:
@@ -1655,7 +1655,7 @@
Properties:
Source:
@@ -1757,7 +1757,7 @@
Properties:
Source:
@@ -1859,7 +1859,7 @@
Properties:
Source:
@@ -1961,7 +1961,7 @@
Properties:
Source:
@@ -2165,7 +2165,7 @@
Properties:
Source:
@@ -2369,7 +2369,7 @@
Properties:
Source:
@@ -2503,7 +2503,7 @@

col
Source:
@@ -2641,7 +2641,7 @@

integrateSource:
@@ -2851,7 +2851,7 @@
Parameters:
Source:
@@ -3020,7 +3020,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:49 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.Ninja.html b/docs/Phaser.Physics.Ninja.html index bdf81d5995..2116f01820 100644 --- a/docs/Phaser.Physics.Ninja.html +++ b/docs/Phaser.Physics.Ninja.html @@ -1856,7 +1856,7 @@
Parameters:
Source:
@@ -3445,7 +3445,7 @@
Parameters:
Source:
@@ -3496,7 +3496,7 @@
Returns:
-

separate(body1, body2, processCallback, callbackContext) → {boolean}

+

separate(body1, body2) → {boolean}

@@ -3526,12 +3526,8 @@
Parameters:
Type - Argument - - Default - Description @@ -3555,19 +3551,7 @@
Parameters:
- - - - - - - - - - - -

The Body object to separate.

@@ -3590,101 +3574,13 @@
Parameters:
- - - - - - - - - - - -

The Body object to separate.

- - - - processCallback - - - - - -function - - - - - - - - - <optional>
- - - - - - - - - - - - null - - - - -

UN-USED: A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true.

- - - - - - - callbackContext - - - - - -object - - - - - - - - - <optional>
- - - - - - - - - - - - - - -

UN-USED: The context in which to run the process callback.

- - - @@ -3713,7 +3609,7 @@
Parameters:
Source:
@@ -4043,7 +3939,7 @@

setBo Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:48 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.Body.html b/docs/Phaser.Physics.P2.Body.html index 9915628e8b..c361cb9f3e 100644 --- a/docs/Phaser.Physics.P2.Body.html +++ b/docs/Phaser.Physics.P2.Body.html @@ -925,7 +925,7 @@

Properties:
Source:
@@ -1036,7 +1036,7 @@
Properties:
Source:
@@ -1147,7 +1147,7 @@
Properties:
Source:
@@ -1249,7 +1249,7 @@
Properties:
Source:
@@ -1357,7 +1357,7 @@
Properties:
Source:
@@ -1463,7 +1463,7 @@
Properties:
Source:
@@ -1565,7 +1565,7 @@
Properties:
Source:
@@ -1667,7 +1667,7 @@
Properties:
Source:
@@ -1774,7 +1774,7 @@
Properties:
Source:
@@ -1880,7 +1880,7 @@
Properties:
Source:
@@ -2084,7 +2084,7 @@
Properties:
Source:
@@ -2288,7 +2288,7 @@
Properties:
Source:
@@ -2390,7 +2390,7 @@
Properties:
Source:
@@ -2798,7 +2798,7 @@
Properties:
Source:
@@ -2900,7 +2900,7 @@
Properties:
Source:
@@ -3002,7 +3002,7 @@
Properties:
Source:
@@ -3104,7 +3104,7 @@
Properties:
Source:
@@ -3206,7 +3206,7 @@
Properties:
Source:
@@ -3837,7 +3837,7 @@
Properties:
Source:
@@ -3939,7 +3939,7 @@
Properties:
Source:
@@ -4143,7 +4143,7 @@
Properties:
Source:
@@ -4551,7 +4551,7 @@
Properties:
Source:
@@ -4653,7 +4653,7 @@
Properties:
Source:
@@ -6250,8 +6250,8 @@
Properties
-

An array of 2d vectors that form the convex or concave polygon. - Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], +

An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

@@ -8915,7 +8915,7 @@
Properties
Source:
@@ -9253,7 +9253,7 @@
Properties
Source:
@@ -12936,7 +12936,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:49 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.BodyDebug.html b/docs/Phaser.Physics.P2.BodyDebug.html index 5765943c9e..f77efdcdce 100644 --- a/docs/Phaser.Physics.P2.BodyDebug.html +++ b/docs/Phaser.Physics.P2.BodyDebug.html @@ -911,7 +911,7 @@
Properties:
Source:
@@ -1023,7 +1023,7 @@
Properties:
Source:
@@ -1886,7 +1886,7 @@
Properties:
Source:
@@ -2100,7 +2100,7 @@
Properties:
Source:
@@ -2528,7 +2528,7 @@
Properties:
Source:
@@ -2742,7 +2742,7 @@
Properties:
Source:
@@ -2956,7 +2956,7 @@
Properties:
Source:
@@ -3068,7 +3068,7 @@
Properties:
Source:
@@ -3180,7 +3180,7 @@
Properties:
Source:
@@ -3949,7 +3949,7 @@
Parameters:
Source:
@@ -4821,7 +4821,7 @@

countDeadSource:
@@ -4918,7 +4918,7 @@

countLivin
Source:
@@ -5654,7 +5654,7 @@

Parameters:
Source:
@@ -5836,7 +5836,7 @@
Parameters:
Source:
@@ -6540,7 +6540,7 @@

drawPlane -

forEach(callback, callbackContext, checkExists)

+

forEach(callback, callbackContext, checkExists)

@@ -6573,8 +6573,12 @@
Parameters:
Type + Argument + + Default + Description @@ -6598,8 +6602,20 @@
Parameters:
+ + + + + + + + + + + +

The function that will be called. Each child of the Group will be passed to it as its first parameter.

@@ -6621,8 +6637,20 @@
Parameters:
+ + + + + + + + + + + +

The context in which the function should be called (usually 'this').

@@ -6644,8 +6672,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + false + + +

If set only children with exists=true will be passed to the callback, otherwise all children will be passed.

@@ -6832,7 +6876,7 @@
Parameters:
Source:
@@ -6980,7 +7024,7 @@
Parameters:
Source:
@@ -7128,7 +7172,7 @@
Parameters:
Source:
@@ -7348,7 +7392,7 @@

getBottomSource:
@@ -7446,7 +7490,7 @@

getFirst
Source:
@@ -7544,7 +7588,7 @@

getFirstD
Source:
@@ -7690,7 +7734,7 @@

Parameters:
Source:
@@ -8005,7 +8049,7 @@
Parameters:
Source:
@@ -8102,7 +8146,7 @@

getTopSource:
@@ -8412,7 +8456,7 @@
Parameters:
Source:
@@ -9408,7 +9452,7 @@
Parameters:
Source:
@@ -9506,7 +9550,7 @@

removeAllSource:
@@ -9652,7 +9696,7 @@
Parameters:
Source:
@@ -11456,7 +11500,7 @@
Parameters:
Source:
@@ -12228,7 +12272,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:49 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.CollisionGroup.html b/docs/Phaser.Physics.P2.CollisionGroup.html index 9424147bea..048b398e19 100644 --- a/docs/Phaser.Physics.P2.CollisionGroup.html +++ b/docs/Phaser.Physics.P2.CollisionGroup.html @@ -736,7 +736,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.ContactMaterial.html b/docs/Phaser.Physics.P2.ContactMaterial.html index 57ee25b1ab..3b999ce2dd 100644 --- a/docs/Phaser.Physics.P2.ContactMaterial.html +++ b/docs/Phaser.Physics.P2.ContactMaterial.html @@ -753,7 +753,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.DistanceConstraint.html b/docs/Phaser.Physics.P2.DistanceConstraint.html index 9739381ebb..33d7166957 100644 --- a/docs/Phaser.Physics.P2.DistanceConstraint.html +++ b/docs/Phaser.Physics.P2.DistanceConstraint.html @@ -1023,7 +1023,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:34 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.GearConstraint.html b/docs/Phaser.Physics.P2.GearConstraint.html index 7a0e31d061..e40b7c5ca5 100644 --- a/docs/Phaser.Physics.P2.GearConstraint.html +++ b/docs/Phaser.Physics.P2.GearConstraint.html @@ -1051,7 +1051,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.InversePointProxy.html b/docs/Phaser.Physics.P2.InversePointProxy.html index d0fa78b87d..2c29d5fa1e 100644 --- a/docs/Phaser.Physics.P2.InversePointProxy.html +++ b/docs/Phaser.Physics.P2.InversePointProxy.html @@ -910,7 +910,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.LockConstraint.html b/docs/Phaser.Physics.P2.LockConstraint.html index 592423009e..5a94d5bf98 100644 --- a/docs/Phaser.Physics.P2.LockConstraint.html +++ b/docs/Phaser.Physics.P2.LockConstraint.html @@ -1086,7 +1086,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.Material.html b/docs/Phaser.Physics.P2.Material.html index 4e20699e25..a6f1a1677e 100644 --- a/docs/Phaser.Physics.P2.Material.html +++ b/docs/Phaser.Physics.P2.Material.html @@ -739,7 +739,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.PointProxy.html b/docs/Phaser.Physics.P2.PointProxy.html index 658984e757..7e91665f7f 100644 --- a/docs/Phaser.Physics.P2.PointProxy.html +++ b/docs/Phaser.Physics.P2.PointProxy.html @@ -910,7 +910,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:50 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.PrismaticConstraint.html b/docs/Phaser.Physics.P2.PrismaticConstraint.html index dc0620821c..307741cc06 100644 --- a/docs/Phaser.Physics.P2.PrismaticConstraint.html +++ b/docs/Phaser.Physics.P2.PrismaticConstraint.html @@ -1160,7 +1160,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.RevoluteConstraint.html b/docs/Phaser.Physics.P2.RevoluteConstraint.html index c36afdcac3..447e36d4e7 100644 --- a/docs/Phaser.Physics.P2.RevoluteConstraint.html +++ b/docs/Phaser.Physics.P2.RevoluteConstraint.html @@ -1083,7 +1083,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.Spring.html b/docs/Phaser.Physics.P2.Spring.html index a7aacd0331..67322d3910 100644 --- a/docs/Phaser.Physics.P2.Spring.html +++ b/docs/Phaser.Physics.P2.Spring.html @@ -1238,7 +1238,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:35 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.P2.html b/docs/Phaser.Physics.P2.html index e6b967ffba..f386b54fb0 100644 --- a/docs/Phaser.Physics.P2.html +++ b/docs/Phaser.Physics.P2.html @@ -926,7 +926,7 @@
Properties:
Source:
@@ -1028,7 +1028,7 @@
Properties:
Source:
@@ -1130,7 +1130,7 @@
Properties:
Source:
@@ -1436,7 +1436,7 @@
Properties:
Source:
@@ -1538,7 +1538,7 @@
Properties:
Source:
@@ -1742,7 +1742,7 @@
Properties:
Source:
@@ -3374,7 +3374,7 @@
Properties:
Source:
@@ -3476,7 +3476,7 @@
Properties:
Source:
@@ -3578,7 +3578,7 @@
Properties:
Source:
@@ -3680,7 +3680,7 @@
Properties:
Source:
@@ -4861,7 +4861,7 @@
Parameters:
Source:
@@ -5359,7 +5359,7 @@
Parameters:
Source:
@@ -5816,8 +5816,8 @@
Properties
-

An array of 2d vectors that form the convex or concave polygon. - Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], +

An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

@@ -7705,8 +7705,8 @@
Properties
-

An array of 2d vectors that form the convex or concave polygon. - Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], +

An array of 2d vectors that form the convex or concave polygon. + Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be flat x,y values e.g. setPolygon(options, x,y, x,y, x,y, ...) where x and y are numbers.

@@ -10556,7 +10556,7 @@
Parameters:
Source:
@@ -10699,7 +10699,7 @@
Parameters:
Source:
@@ -10911,7 +10911,7 @@
Parameters:
Source:
@@ -11054,7 +11054,7 @@
Parameters:
Source:
@@ -12946,7 +12946,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:49 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:33 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Physics.html b/docs/Phaser.Physics.html index 1fca3e0513..8d0d5d7950 100644 --- a/docs/Phaser.Physics.html +++ b/docs/Phaser.Physics.html @@ -3118,7 +3118,7 @@

<protected> Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:47 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:32 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Plugin.html b/docs/Phaser.Plugin.html index 3d4de14187..b278db438e 100644 --- a/docs/Phaser.Plugin.html +++ b/docs/Phaser.Plugin.html @@ -1998,7 +1998,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.PluginManager.html b/docs/Phaser.PluginManager.html index c9925958ce..a6b815f713 100644 --- a/docs/Phaser.PluginManager.html +++ b/docs/Phaser.PluginManager.html @@ -1663,7 +1663,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Point.html b/docs/Phaser.Point.html index 962b553862..12cebd9453 100644 --- a/docs/Phaser.Point.html +++ b/docs/Phaser.Point.html @@ -5523,7 +5523,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Pointer.html b/docs/Phaser.Pointer.html index e80fb12997..344777ee3e 100644 --- a/docs/Phaser.Pointer.html +++ b/docs/Phaser.Pointer.html @@ -4501,7 +4501,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:51 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Polygon.html b/docs/Phaser.Polygon.html index 99cf5ed10c..60d5a259ff 100644 --- a/docs/Phaser.Polygon.html +++ b/docs/Phaser.Polygon.html @@ -533,7 +533,7 @@

new Polygon

Creates a new Polygon. You have to provide a list of points. -This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], +This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], or the arguments passed can be all the points of the polygon e.g. new Phaser.Polygon(new Phaser.Point(), new Phaser.Point(), ...), or the arguments passed can be flat x,y values e.g. new Phaser.Polygon(x,y, x,y, x,y, ...) where x and y are numbers.

@@ -1156,7 +1156,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.QuadTree.html b/docs/Phaser.QuadTree.html index e7213ce4c0..eff3b3377b 100644 --- a/docs/Phaser.QuadTree.html +++ b/docs/Phaser.QuadTree.html @@ -2686,7 +2686,7 @@

split Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:36 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html index 8f7d2a82b3..1322146468 100644 --- a/docs/Phaser.RandomDataGenerator.html +++ b/docs/Phaser.RandomDataGenerator.html @@ -2129,7 +2129,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html index fe13531bac..8148bb7200 100644 --- a/docs/Phaser.Rectangle.html +++ b/docs/Phaser.Rectangle.html @@ -7726,7 +7726,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html index 8030b1cce5..d5355c1c8b 100644 --- a/docs/Phaser.RenderTexture.html +++ b/docs/Phaser.RenderTexture.html @@ -1638,7 +1638,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html index bfc6b20b5d..df477d85f5 100644 --- a/docs/Phaser.RequestAnimationFrame.html +++ b/docs/Phaser.RequestAnimationFrame.html @@ -1503,7 +1503,7 @@

updat Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:52 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.RetroFont.html b/docs/Phaser.RetroFont.html index 876b8ab6f8..7c081082cc 100644 --- a/docs/Phaser.RetroFont.html +++ b/docs/Phaser.RetroFont.html @@ -5160,7 +5160,7 @@

Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.ScaleManager.html b/docs/Phaser.ScaleManager.html index f3a976ff6f..d0ab5d687c 100644 --- a/docs/Phaser.ScaleManager.html +++ b/docs/Phaser.ScaleManager.html @@ -5594,7 +5594,7 @@

stopFul Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html index 503e9e8f93..cf716133d9 100644 --- a/docs/Phaser.Signal.html +++ b/docs/Phaser.Signal.html @@ -2380,7 +2380,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:37 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SinglePad.html b/docs/Phaser.SinglePad.html index aed97009ac..c06685764b 100644 --- a/docs/Phaser.SinglePad.html +++ b/docs/Phaser.SinglePad.html @@ -4009,7 +4009,7 @@

reset Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:38 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html index 65b29c46cc..1c12a5bfad 100644 --- a/docs/Phaser.Sound.html +++ b/docs/Phaser.Sound.html @@ -5891,7 +5891,7 @@

<protected> Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:38 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html index b4795171c2..286751d176 100644 --- a/docs/Phaser.SoundManager.html +++ b/docs/Phaser.SoundManager.html @@ -2910,7 +2910,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:53 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:38 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html index 9f3aee65f2..b54923882f 100644 --- a/docs/Phaser.Sprite.html +++ b/docs/Phaser.Sprite.html @@ -857,7 +857,7 @@

Properties:
Source:
@@ -1096,7 +1096,7 @@

body

By default Sprites won't add themselves to any physics system and their physics body will be null. -To enable them for physics you need to call game.physics.enable(sprite, system) where sprite is this object +To enable them for physics you need to call game.physics.enable(sprite, system) where sprite is this object and system is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via Sprite.body.

Important: Enabling a Sprite for P2 or Ninja physics will automatically set Sprite.anchor to 0.5 so the physics body is centered on the Sprite. If you need a different result then adjust or re-create the Body shape offsets manually, and/or reset the anchor after enabling physics.

@@ -1616,7 +1616,7 @@
Properties:
Source:
@@ -1722,7 +1722,7 @@
Properties:
Source:
@@ -1828,7 +1828,7 @@
Properties:
Source:
@@ -2038,7 +2038,7 @@
Properties:
Source:
@@ -2146,7 +2146,7 @@
Properties:
Source:
@@ -2248,7 +2248,7 @@
Properties:
Source:
@@ -2350,7 +2350,7 @@
Properties:
Source:
@@ -2660,7 +2660,7 @@
Properties:
Source:
@@ -2872,7 +2872,7 @@
Properties:
Source:
@@ -2978,7 +2978,7 @@
Properties:
Source:
@@ -3508,7 +3508,7 @@
Properties:
Source:
@@ -3614,7 +3614,7 @@
Properties:
Source:
@@ -3827,6 +3827,218 @@
Properties:
+

+ + + + + + + +
+

x

+ + +
+
+ +
+

The position of the Sprite on the x axis relative to the local coordinates of the parent.

+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
x + + +number + + + +

The position of the Sprite on the x axis relative to the local coordinates of the parent.

+
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

y

+ + +
+
+ +
+

The position of the Sprite on the y axis relative to the local coordinates of the parent.

+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
y + + +number + + + +

The position of the Sprite on the y axis relative to the local coordinates of the parent.

+
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -3986,7 +4198,7 @@

bringToTop<
Source:
@@ -4034,7 +4246,8 @@

crop

Crop allows you to crop the texture used to display this Sprite. -Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object.

+Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite.

@@ -4235,7 +4448,7 @@
Parameters:
Source:
@@ -4385,7 +4598,7 @@
Parameters:
Source:
@@ -4457,7 +4670,7 @@

killSource:
@@ -4645,6 +4858,161 @@
Parameters:
+

+ + + +
+

overlap(displayObject) → {boolean}

+ + +
+
+ + +
+

Checks to see if the bounds of this Sprite overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as a Button. +This check ignores the Sprites hitArea property and runs a Sprite.getBounds comparison on both objects to determine the result. +Therefore it's relatively expensive to use in large quantities (i.e. with lots of Sprites at a high frequency), but should be fine for low-volume testing where physics isn't required.

+
+ + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
displayObject + + +Phaser.Sprite +| + +Phaser.Image +| + +Phaser.TileSprite +| + +Phaser.Button +| + +PIXI.DisplayObject + + + +

The display object to check against.

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Returns:
+ + +
+

True if the bounds of this Sprite intersects at any point with the bounds of the given display object.

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + +
@@ -4874,7 +5242,7 @@
Parameters:
Source:
@@ -5268,7 +5636,7 @@
Parameters:
Source:
@@ -5419,7 +5787,7 @@
Parameters:
Source:
@@ -5551,7 +5919,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:38 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.SpriteBatch.html b/docs/Phaser.SpriteBatch.html index 786acd71dd..25c65298e2 100644 --- a/docs/Phaser.SpriteBatch.html +++ b/docs/Phaser.SpriteBatch.html @@ -995,7 +995,7 @@

Properties:
Source:
@@ -1107,7 +1107,7 @@
Properties:
Source:
@@ -1766,7 +1766,7 @@
Properties:
Source:
@@ -1980,7 +1980,7 @@
Properties:
Source:
@@ -2306,7 +2306,7 @@
Properties:
Source:
@@ -2520,7 +2520,7 @@
Properties:
Source:
@@ -2729,7 +2729,7 @@
Properties:
Source:
@@ -2841,7 +2841,7 @@
Properties:
Source:
@@ -2953,7 +2953,7 @@
Properties:
Source:
@@ -3722,7 +3722,7 @@
Parameters:
Source:
@@ -4525,7 +4525,7 @@

countDeadSource:
@@ -4622,7 +4622,7 @@

countLivin
Source:
@@ -5358,7 +5358,7 @@

Parameters:
Source:
@@ -5540,7 +5540,7 @@
Parameters:
Source:
@@ -5761,7 +5761,7 @@
Parameters:
-

forEach(callback, callbackContext, checkExists)

+

forEach(callback, callbackContext, checkExists)

@@ -5794,8 +5794,12 @@
Parameters:
Type + Argument + + Default + Description @@ -5819,8 +5823,20 @@
Parameters:
+ + + + + + + + + + + +

The function that will be called. Each child of the Group will be passed to it as its first parameter.

@@ -5842,8 +5858,20 @@
Parameters:
+ + + + + + + + + + + +

The context in which the function should be called (usually 'this').

@@ -5865,8 +5893,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + false + + +

If set only children with exists=true will be passed to the callback, otherwise all children will be passed.

@@ -6053,7 +6097,7 @@
Parameters:
Source:
@@ -6201,7 +6245,7 @@
Parameters:
Source:
@@ -6349,7 +6393,7 @@
Parameters:
Source:
@@ -6569,7 +6613,7 @@

getBottomSource:
@@ -6667,7 +6711,7 @@

getFirst
Source:
@@ -6765,7 +6809,7 @@

getFirstD
Source:
@@ -6911,7 +6955,7 @@

Parameters:
Source:
@@ -7226,7 +7270,7 @@
Parameters:
Source:
@@ -7323,7 +7367,7 @@

getTopSource:
@@ -7633,7 +7677,7 @@
Parameters:
Source:
@@ -8560,7 +8604,7 @@
Parameters:
Source:
@@ -8658,7 +8702,7 @@

removeAllSource:
@@ -8804,7 +8848,7 @@
Parameters:
Source:
@@ -10539,7 +10583,7 @@
Parameters:
Source:
@@ -11247,7 +11291,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:38 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html index 6fb242ddfe..c3007dcfa0 100644 --- a/docs/Phaser.Stage.html +++ b/docs/Phaser.Stage.html @@ -2201,7 +2201,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html index bfd5363b13..91a3eee242 100644 --- a/docs/Phaser.State.html +++ b/docs/Phaser.State.html @@ -2927,7 +2927,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html index 15a1e999e3..0466669dbb 100644 --- a/docs/Phaser.StateManager.html +++ b/docs/Phaser.StateManager.html @@ -3623,7 +3623,7 @@

<protected> Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html index 61de584156..a12595f7c0 100644 --- a/docs/Phaser.Text.html +++ b/docs/Phaser.Text.html @@ -4593,7 +4593,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:54 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tile.html b/docs/Phaser.Tile.html index b6c1a4fbf8..ba4fd5e723 100644 --- a/docs/Phaser.Tile.html +++ b/docs/Phaser.Tile.html @@ -4875,7 +4875,7 @@

Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html index c08815e06a..21fde4ba46 100644 --- a/docs/Phaser.TileSprite.html +++ b/docs/Phaser.TileSprite.html @@ -1138,7 +1138,7 @@

body

By default Sprites won't add themselves to any physics system and their physics body will be null. -To enable them for physics you need to call game.physics.enable(sprite, system) where sprite is this object +To enable them for physics you need to call game.physics.enable(sprite, system) where sprite is this object and system is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via Sprite.body.

Important: Enabling a Sprite for P2 or Ninja physics will automatically set Sprite.anchor to 0.5 so the physics body is centered on the Sprite. If you need a different result then adjust or re-create the Body shape offsets manually, and/or reset the anchor after enabling physics.

@@ -2709,6 +2709,218 @@
Properties:
+ + + + + + + + +
+

x

+ + +
+
+ +
+

The position of the TileSprite on the x axis relative to the local coordinates of the parent.

+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
x + + +number + + + +

The position of the TileSprite on the x axis relative to the local coordinates of the parent.

+
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
+ + + +
+

y

+ + +
+
+ +
+

The position of the TileSprite on the y axis relative to the local coordinates of the parent.

+
+ + + + + +
+ + +
Properties:
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
y + + +number + + + +

The position of the TileSprite on the y axis relative to the local coordinates of the parent.

+
+ + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + +
@@ -3919,7 +4131,7 @@

update Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tilemap.html b/docs/Phaser.Tilemap.html index 5b7a96fd04..83bd56ebe6 100644 --- a/docs/Phaser.Tilemap.html +++ b/docs/Phaser.Tilemap.html @@ -11928,7 +11928,7 @@

Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:39 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TilemapLayer.html b/docs/Phaser.TilemapLayer.html index c1d5d11efb..6796212735 100644 --- a/docs/Phaser.TilemapLayer.html +++ b/docs/Phaser.TilemapLayer.html @@ -5108,7 +5108,7 @@

updateMax Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TilemapParser.html b/docs/Phaser.TilemapParser.html index 9065bc7b91..79db2415b8 100644 --- a/docs/Phaser.TilemapParser.html +++ b/docs/Phaser.TilemapParser.html @@ -1448,7 +1448,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tileset.html b/docs/Phaser.Tileset.html index b04130fc05..fed349e494 100644 --- a/docs/Phaser.Tileset.html +++ b/docs/Phaser.Tileset.html @@ -2522,7 +2522,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:55 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html index b431fec6d2..a570fd86d6 100644 --- a/docs/Phaser.Time.html +++ b/docs/Phaser.Time.html @@ -3389,7 +3389,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Timer.html b/docs/Phaser.Timer.html index 2bb0e987ef..536c2811b8 100644 --- a/docs/Phaser.Timer.html +++ b/docs/Phaser.Timer.html @@ -3978,7 +3978,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TimerEvent.html b/docs/Phaser.TimerEvent.html index 7e735f1bea..94209f3f41 100644 --- a/docs/Phaser.TimerEvent.html +++ b/docs/Phaser.TimerEvent.html @@ -1763,7 +1763,7 @@
Properties:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:40 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html index 11f8d068be..30a27f1f45 100644 --- a/docs/Phaser.Touch.html +++ b/docs/Phaser.Touch.html @@ -2733,7 +2733,7 @@

stop Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html index fe60affa30..759d8403bf 100644 --- a/docs/Phaser.Tween.html +++ b/docs/Phaser.Tween.html @@ -3445,7 +3445,7 @@

Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html index 590ce01d56..db778510f0 100644 --- a/docs/Phaser.TweenManager.html +++ b/docs/Phaser.TweenManager.html @@ -1726,7 +1726,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:56 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html index 4983183eb2..bd12fb515a 100644 --- a/docs/Phaser.Utils.Debug.html +++ b/docs/Phaser.Utils.Debug.html @@ -6750,7 +6750,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:57 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html index 79b2df50a4..5c2517a959 100644 --- a/docs/Phaser.Utils.html +++ b/docs/Phaser.Utils.html @@ -1518,7 +1518,7 @@
Returns:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:57 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html index 0899f2babc..f9954aa64a 100644 --- a/docs/Phaser.World.html +++ b/docs/Phaser.World.html @@ -866,7 +866,7 @@
Properties:
Source:
@@ -978,7 +978,7 @@
Properties:
Source:
@@ -2052,7 +2052,7 @@
Properties:
Source:
@@ -2368,7 +2368,7 @@
Properties:
Source:
@@ -2898,7 +2898,7 @@
Properties:
Source:
@@ -3112,7 +3112,7 @@
Properties:
Source:
@@ -3326,7 +3326,7 @@
Properties:
Source:
@@ -3540,7 +3540,7 @@
Properties:
Source:
@@ -3652,7 +3652,7 @@
Properties:
Source:
@@ -4421,7 +4421,7 @@
Parameters:
Source:
@@ -5293,7 +5293,7 @@

countDeadSource:
@@ -5390,7 +5390,7 @@

countLivin
Source:
@@ -6126,7 +6126,7 @@

Parameters:
Source:
@@ -6308,7 +6308,7 @@
Parameters:
Source:
@@ -6529,7 +6529,7 @@
Parameters:
-

forEach(callback, callbackContext, checkExists)

+

forEach(callback, callbackContext, checkExists)

@@ -6562,8 +6562,12 @@
Parameters:
Type + Argument + + Default + Description @@ -6587,8 +6591,20 @@
Parameters:
+ + + + + + + + + + + +

The function that will be called. Each child of the Group will be passed to it as its first parameter.

@@ -6610,8 +6626,20 @@
Parameters:
+ + + + + + + + + + + +

The context in which the function should be called (usually 'this').

@@ -6633,8 +6661,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + false + + +

If set only children with exists=true will be passed to the callback, otherwise all children will be passed.

@@ -6821,7 +6865,7 @@
Parameters:
Source:
@@ -6969,7 +7013,7 @@
Parameters:
Source:
@@ -7117,7 +7161,7 @@
Parameters:
Source:
@@ -7337,7 +7381,7 @@

getBottomSource:
@@ -7435,7 +7479,7 @@

getFirst
Source:
@@ -7533,7 +7577,7 @@

getFirstD
Source:
@@ -7679,7 +7723,7 @@

Parameters:
Source:
@@ -7994,7 +8038,7 @@
Parameters:
Source:
@@ -8091,7 +8135,7 @@

getTopSource:
@@ -8401,7 +8445,7 @@
Parameters:
Source:
@@ -9328,7 +9372,7 @@
Parameters:
Source:
@@ -9426,7 +9470,7 @@

removeAllSource:
@@ -9572,7 +9616,7 @@
Parameters:
Source:
@@ -11563,7 +11607,7 @@
Parameters:
Source:
@@ -12271,7 +12315,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:57 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:41 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.html b/docs/Phaser.html index 2ac9cba498..c7752b3e1c 100644 --- a/docs/Phaser.html +++ b/docs/Phaser.html @@ -543,7 +543,7 @@

Source:
@@ -828,7 +828,7 @@

Classes

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html index a79c786406..d21de0d574 100644 --- a/docs/Phaser.js.html +++ b/docs/Phaser.js.html @@ -507,7 +507,8 @@

Source: D:/wamp/www/phaser/src/Phaser.js

-
/**
+            
/* global Phaser:true */
+/**
 * @author       Richard Davey <rich@photonstorm.com>
 * @copyright    2014 Photon Storm Ltd.
 * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
@@ -519,73 +520,73 @@ 

Source: D:/wamp/www/phaser/src/Phaser.js

var Phaser = Phaser || { VERSION: '<%= version %>', - DEV_VERSION: '2.0.1', + DEV_VERSION: '2.0.2', GAMES: [], - AUTO: 0, - CANVAS: 1, - WEBGL: 2, - HEADLESS: 3, - - NONE: 0, - LEFT: 1, - RIGHT: 2, - UP: 3, - DOWN: 4, - - SPRITE: 0, - BUTTON: 1, - IMAGE: 2, - GRAPHICS: 3, - TEXT: 4, - TILESPRITE: 5, - BITMAPTEXT: 6, - GROUP: 7, - RENDERTEXTURE: 8, - TILEMAP: 9, - TILEMAPLAYER: 10, - EMITTER: 11, - POLYGON: 12, - BITMAPDATA: 13, - CANVAS_FILTER: 14, - WEBGL_FILTER: 15, - ELLIPSE: 16, - SPRITEBATCH: 17, - RETROFONT: 18, - - // The various blend modes supported by pixi / phaser - 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 - }, - - // The scale modes - scaleModes: { - DEFAULT:0, - LINEAR:0, - NEAREST:1 - } + AUTO: 0, + CANVAS: 1, + WEBGL: 2, + HEADLESS: 3, + + NONE: 0, + LEFT: 1, + RIGHT: 2, + UP: 3, + DOWN: 4, + + SPRITE: 0, + BUTTON: 1, + IMAGE: 2, + GRAPHICS: 3, + TEXT: 4, + TILESPRITE: 5, + BITMAPTEXT: 6, + GROUP: 7, + RENDERTEXTURE: 8, + TILEMAP: 9, + TILEMAPLAYER: 10, + EMITTER: 11, + POLYGON: 12, + BITMAPDATA: 13, + CANVAS_FILTER: 14, + WEBGL_FILTER: 15, + ELLIPSE: 16, + SPRITEBATCH: 17, + RETROFONT: 18, + + // The various blend modes supported by pixi / phaser + 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 + }, + + // The scale modes + scaleModes: { + DEFAULT:0, + LINEAR:0, + NEAREST:1 + } }; -PIXI.InteractionManager = function (dummy) { - // We don't need this in Pixi, so we've removed it to save space - // however the Stage object expects a reference to it, so here is a dummy entry. +PIXI.InteractionManager = function () { + // We don't need this in Pixi, so we've removed it to save space + // however the Stage object expects a reference to it, so here is a dummy entry. };
@@ -608,7 +609,7 @@

Source: D:/wamp/www/phaser/src/Phaser.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Physics.js.html b/docs/Physics.js.html index c6c1bece75..d6615f7762 100644 --- a/docs/Physics.js.html +++ b/docs/Physics.js.html @@ -655,11 +655,11 @@

Source: physics/Physics.js

} else if (system === Phaser.Physics.BOX2D && this.box2d === null) { - // Coming soon + throw new Error('The Box2D physics system has not been implemented yet.'); } else if (system === Phaser.Physics.CHIPMUNK && this.chipmunk === null) { - // Coming soon + throw new Error('The Chipmunk physics system has not been implemented yet.'); } }, @@ -818,7 +818,7 @@

Source: physics/Physics.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html index 7c963f901d..baf3399473 100644 --- a/docs/Plugin.js.html +++ b/docs/Plugin.js.html @@ -513,9 +513,9 @@

Source: core/Plugin.js

* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * This is a base Plugin template to use for any Phaser plugin development. -* +* * @class Phaser.Plugin * @classdesc Phaser - Plugin * @constructor @@ -530,30 +530,30 @@

Source: core/Plugin.js

* @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Any} parent - The parent of this plugin. If added to the PluginManager the parent will be set to that, otherwise it will be null. */ this.parent = parent; - + /** * @property {boolean} active - A Plugin with active=true has its preUpdate and update methods called by the parent, otherwise they are skipped. * @default */ this.active = false; - + /** * @property {boolean} visible - A Plugin with visible=true has its render and postRender methods called by the parent, otherwise they are skipped. * @default */ this.visible = false; - + /** * @property {boolean} hasPreUpdate - A flag to indicate if this plugin has a preUpdate method. * @default */ this.hasPreUpdate = false; - + /** * @property {boolean} hasUpdate - A flag to indicate if this plugin has an update method. * @default @@ -565,13 +565,13 @@

Source: core/Plugin.js

* @default */ this.hasPostUpdate = false; - + /** * @property {boolean} hasRender - A flag to indicate if this plugin has a render method. * @default */ this.hasRender = false; - + /** * @property {boolean} hasPostRender - A flag to indicate if this plugin has a postRender method. * @default @@ -624,7 +624,7 @@

Source: core/Plugin.js

this.parent = null; this.active = false; this.visible = false; - + } }; @@ -651,7 +651,7 @@

Source: core/Plugin.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html index 74c6caf456..40b7c5c7e0 100644 --- a/docs/PluginManager.js.html +++ b/docs/PluginManager.js.html @@ -515,9 +515,9 @@

Source: core/PluginManager.js

* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ -/** +/** * The Plugin Manager is responsible for the loading, running and unloading of Phaser Plugins. -* +* * @class Phaser.PluginManager * @classdesc Phaser - PluginManager * @constructor @@ -530,18 +530,18 @@

Source: core/PluginManager.js

* @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {Description} _parent - Description. * @private */ this._parent = parent; - + /** * @property {array} plugins - Description. */ this.plugins = []; - + /** * @property {array} _pluginsLength - Description. * @private @@ -641,7 +641,7 @@

Source: core/PluginManager.js

* @param {Phaser.Plugin} plugin - The plugin to be removed. */ remove: function (plugin) { - + if (this._pluginsLength === 0) { return; @@ -664,7 +664,7 @@

Source: core/PluginManager.js

* @method Phaser.PluginManager#removeAll */ removeAll: function() { - + for (this._p = 0; this._p < this._pluginsLength; this._p++) { this.plugins[this._p].destroy(); @@ -676,7 +676,7 @@

Source: core/PluginManager.js

/** * Pre-update is called at the very start of the update cycle, before any other subsystems have been updated (including Physics). * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#preUpdate */ preUpdate: function () { @@ -699,11 +699,11 @@

Source: core/PluginManager.js

/** * Update is called after all the core subsystems (Input, Tweens, Sound, etc) and the State have updated, but before the render. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#update */ update: function () { - + if (this._pluginsLength === 0) { return; @@ -723,11 +723,11 @@

Source: core/PluginManager.js

* PostUpdate is the last thing to be called before the world render. * In particular, it is called after the world postUpdate, which means the camera has been adjusted. * It only calls plugins who have active=true. - * + * * @method Phaser.PluginManager#postUpdate */ postUpdate: function () { - + if (this._pluginsLength === 0) { return; @@ -746,7 +746,7 @@

Source: core/PluginManager.js

/** * Render is called right after the Game Renderer completes, but before the State.render. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#render */ render: function () { @@ -769,7 +769,7 @@

Source: core/PluginManager.js

/** * Post-render is called after the Game Renderer and State.render have run. * It only calls plugins who have visible=true. - * + * * @method Phaser.PluginManager#postRender */ postRender: function () { @@ -791,7 +791,7 @@

Source: core/PluginManager.js

/** * Clear down this PluginManager and null out references - * + * * @method Phaser.PluginManager#destroy */ destroy: function () { @@ -827,7 +827,7 @@

Source: core/PluginManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Point.js.html b/docs/Point.js.html index 12a8524760..2009e7a4d6 100644 --- a/docs/Point.js.html +++ b/docs/Point.js.html @@ -530,7 +530,7 @@

Source: geom/Point.js

* @property {number} x - The x coordinate of the point. */ this.x = x; - + /** * @property {number} y - The y coordinate of the point. */ @@ -572,7 +572,7 @@

Source: geom/Point.js

this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -588,7 +588,7 @@

Source: geom/Point.js

this.y = y || ( (y !== 0) ? this.x : 0 ); return this; - + }, /** @@ -662,7 +662,7 @@

Source: geom/Point.js

this.x = Phaser.Math.clamp(this.x, min, max); return this; - + }, /** @@ -676,7 +676,7 @@

Source: geom/Point.js

this.y = Phaser.Math.clamp(this.y, min, max); return this; - + }, /** @@ -920,7 +920,7 @@

Source: geom/Point.js

*/ Phaser.Point.distance = function (a, b, round) { - if (typeof round === "undefined") { round = false } + if (typeof round === "undefined") { round = false; } if (round) { @@ -987,7 +987,7 @@

Source: geom/Point.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/PointProxy.js.html b/docs/PointProxy.js.html index f48b5f3501..2a8cd315e0 100644 --- a/docs/PointProxy.js.html +++ b/docs/PointProxy.js.html @@ -536,7 +536,7 @@

Source: physics/p2/PointProxy.js

* @property {number} x - The x property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "x", { - + get: function () { return this.destination[0]; @@ -556,7 +556,7 @@

Source: physics/p2/PointProxy.js

* @property {number} y - The y property of this PointProxy. */ Object.defineProperty(Phaser.Physics.P2.PointProxy.prototype, "y", { - + get: function () { return this.destination[1]; @@ -591,7 +591,7 @@

Source: physics/p2/PointProxy.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html index c7c29d71b3..bd401a947a 100644 --- a/docs/Pointer.js.html +++ b/docs/Pointer.js.html @@ -678,7 +678,7 @@

Source: input/Pointer.js

* @property {Phaser.Point} position - A Phaser.Point object containing the current x/y values of the pointer on the display. */ this.position = new Phaser.Point(); - + /** * @property {Phaser.Point} positionDown - A Phaser.Point object containing the x/y values of the pointer when it was last in a down state on the display. */ @@ -785,7 +785,7 @@

Source: input/Pointer.js

x: this.position.x, y: this.position.y }); - + if (this._history.length > this.game.input.recordLimit) { this._history.shift(); @@ -887,7 +887,7 @@

Source: input/Pointer.js

} currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this._highestRenderObject === null) @@ -1007,17 +1007,17 @@

Source: input/Pointer.js

if (this.game.input.interactiveItems.total > 0) { var currentNode = this.game.input.interactiveItems.next; - + do { if (currentNode) { currentNode._releasedHandler(this); } - + currentNode = currentNode.next; } - while (currentNode != null) + while (currentNode != null); } if (this.targetObject) @@ -1167,7 +1167,7 @@

Source: input/Pointer.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Polygon.js.html b/docs/Polygon.js.html index 429d97e1c4..9d621f98c3 100644 --- a/docs/Polygon.js.html +++ b/docs/Polygon.js.html @@ -516,7 +516,7 @@

Source: geom/Polygon.js

/** * Creates a new Polygon. You have to provide a list of points. -* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], +* This can be an array of Points that form the polygon, a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be all the points of the polygon e.g. `new Phaser.Polygon(new Phaser.Point(), new Phaser.Point(), ...)`, or the * arguments passed can be flat x,y values e.g. `new Phaser.Polygon(x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @@ -638,7 +638,7 @@

Source: geom/Polygon.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/PrismaticConstraint.js.html b/docs/PrismaticConstraint.js.html index e91220fa83..cc7165deac 100644 --- a/docs/PrismaticConstraint.js.html +++ b/docs/PrismaticConstraint.js.html @@ -553,7 +553,7 @@

Source: physics/p2/PrismaticConstraint.js

p2.PrismaticConstraint.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.PrismaticConstraint.prototype = Object.create(p2.PrismaticConstraint.prototype); Phaser.Physics.P2.PrismaticConstraint.prototype.constructor = Phaser.Physics.P2.PrismaticConstraint; @@ -578,7 +578,7 @@

Source: physics/p2/PrismaticConstraint.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/QuadTree.js.html b/docs/QuadTree.js.html index a664ed6ac4..d5120d4fd0 100644 --- a/docs/QuadTree.js.html +++ b/docs/QuadTree.js.html @@ -864,7 +864,7 @@

Source: math/QuadTree.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html index 1962c55409..e28e0635a4 100644 --- a/docs/RandomDataGenerator.js.html +++ b/docs/RandomDataGenerator.js.html @@ -517,17 +517,17 @@

Source: math/RandomDataGenerator.js

/** * Phaser.RandomDataGenerator constructor. -* +* * @class Phaser.RandomDataGenerator * @classdesc An extremely useful repeatable random data generator. Access it via Phaser.Game.rnd * Based on Nonsense by Josh Faul https://github.com/jocafa/Nonsense. * Random number generator from http://baagoe.org/en/wiki/Better_random_numbers_for_javascript -* +* * @constructor * @param {array} seeds */ Phaser.RandomDataGenerator = function (seeds) { - + if (typeof seeds === "undefined") { seeds = []; } /** @@ -580,7 +580,7 @@

Source: math/RandomDataGenerator.js

/** * Reset the seed of the random data generator. - * + * * @method Phaser.RandomDataGenerator#sow * @param {array} seeds */ @@ -604,7 +604,7 @@

Source: math/RandomDataGenerator.js

this.s2 -= this.hash(seed); this.s2 += ~~(this.s2 < 0); } - + }, /** @@ -778,7 +778,7 @@

Source: math/RandomDataGenerator.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html index 585900da5f..9a9aabaac4 100644 --- a/docs/Rectangle.js.html +++ b/docs/Rectangle.js.html @@ -535,17 +535,17 @@

Source: geom/Rectangle.js

* @property {number} x - The x coordinate of the top-left corner of the Rectangle. */ this.x = x; - + /** * @property {number} y - The y coordinate of the top-left corner of the Rectangle. */ this.y = y; - + /** * @property {number} width - The width of the Rectangle. */ this.width = width; - + /** * @property {number} height - The height of the Rectangle. */ @@ -570,7 +570,7 @@

Source: geom/Rectangle.js

return this; }, - + /** * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter. * @method Phaser.Rectangle#offsetPoint @@ -582,7 +582,7 @@

Source: geom/Rectangle.js

return this.offset(point.x, point.y); }, - + /** * Sets the members of Rectangle to the specified values. * @method Phaser.Rectangle#setTo @@ -613,7 +613,7 @@

Source: geom/Rectangle.js

this.y = Math.floor(this.y); }, - + /** * Runs Math.floor() on the x, y, width and height values of this Rectangle. * @method Phaser.Rectangle#floorAll @@ -685,7 +685,7 @@

Source: geom/Rectangle.js

* Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object. * @method Phaser.Rectangle#clone * @param {Phaser.Rectangle} [output] - Optional Rectangle object. If given the values will be set into the object, otherwise a brand new Rectangle object will be created and returned. - * @return {Phaser.Rectangle} + * @return {Phaser.Rectangle} */ clone: function (output) { @@ -833,11 +833,11 @@

Source: geom/Rectangle.js

* @property {number} bottom - The sum of the y and height properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottom", { - + get: function () { return this.y + this.height; }, - + set: function (value) { if (value <= this.y) { this.height = 0; @@ -854,7 +854,7 @@

Source: geom/Rectangle.js

* @property {Phaser.Point} bottomRight - Gets or sets the location of the Rectangles bottom right corner as a Point object. */ Object.defineProperty(Phaser.Rectangle.prototype, "bottomRight", { - + get: function () { return new Phaser.Point(this.right, this.bottom); }, @@ -872,7 +872,7 @@

Source: geom/Rectangle.js

* @property {number} left - The x coordinate of the left of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "left", { - + get: function () { return this.x; }, @@ -894,7 +894,7 @@

Source: geom/Rectangle.js

* @property {number} right - The sum of the x and width properties. */ Object.defineProperty(Phaser.Rectangle.prototype, "right", { - + get: function () { return this.x + this.width; }, @@ -916,7 +916,7 @@

Source: geom/Rectangle.js

* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "volume", { - + get: function () { return this.width * this.height; } @@ -930,7 +930,7 @@

Source: geom/Rectangle.js

* @readonly */ Object.defineProperty(Phaser.Rectangle.prototype, "perimeter", { - + get: function () { return (this.width * 2) + (this.height * 2); } @@ -943,7 +943,7 @@

Source: geom/Rectangle.js

* @property {number} centerX - The x coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerX", { - + get: function () { return this.x + this.halfWidth; }, @@ -960,7 +960,7 @@

Source: geom/Rectangle.js

* @property {number} centerY - The y coordinate of the center of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "centerY", { - + get: function () { return this.y + this.halfHeight; }, @@ -978,7 +978,7 @@

Source: geom/Rectangle.js

* @property {number} top - The y coordinate of the top of the Rectangle. */ Object.defineProperty(Phaser.Rectangle.prototype, "top", { - + get: function () { return this.y; }, @@ -1004,7 +1004,7 @@

Source: geom/Rectangle.js

get: function () { return new Phaser.Point(this.x, this.y); }, - + set: function (value) { this.x = value.x; this.y = value.y; @@ -1014,12 +1014,12 @@

Source: geom/Rectangle.js

/** * Determines whether or not this Rectangle object is empty. A Rectangle object is empty if its width or height is less than or equal to 0. -* If set to true then all of the Rectangle properties are set to 0. +* If set to true then all of the Rectangle properties are set to 0. * @name Phaser.Rectangle#empty * @property {boolean} empty - Gets or sets the Rectangles empty state. */ Object.defineProperty(Phaser.Rectangle.prototype, "empty", { - + get: function () { return (!this.width || !this.height); }, @@ -1030,7 +1030,7 @@

Source: geom/Rectangle.js

{ this.setTo(0, 0, 0, 0); } - + } }); @@ -1276,7 +1276,7 @@

Source: geom/Rectangle.js

} return output.setTo(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.max(a.right, b.right) - Math.min(a.left, b.left), Math.max(a.bottom, b.bottom) - Math.min(a.top, b.top)); - + }; // Because PIXI uses its own Rectangle, we'll replace it with ours to avoid duplicating code or confusion. @@ -1303,7 +1303,7 @@

Source: geom/Rectangle.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html index e680f8ea02..8e846969f0 100644 --- a/docs/RenderTexture.js.html +++ b/docs/RenderTexture.js.html @@ -525,7 +525,7 @@

Source: gameobjects/RenderTexture.js

Phaser.RenderTexture = function (game, width, height, key) { /** - * @property {Phaser.Game} game - A reference to the currently running game. + * @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; @@ -535,7 +535,7 @@

Source: gameobjects/RenderTexture.js

this.key = key; /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RENDERTEXTURE; @@ -546,7 +546,7 @@

Source: gameobjects/RenderTexture.js

this._temp = new Phaser.Point(); PIXI.RenderTexture.call(this, width, height); - + }; Phaser.RenderTexture.prototype = Object.create(PIXI.RenderTexture.prototype); @@ -567,7 +567,7 @@

Source: gameobjects/RenderTexture.js

this.render(displayObject, this._temp, clear); -} +}; // Documentation stubs @@ -608,7 +608,7 @@

Source: gameobjects/RenderTexture.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html index e024986ea2..36451877f7 100644 --- a/docs/RequestAnimationFrame.js.html +++ b/docs/RequestAnimationFrame.js.html @@ -516,13 +516,13 @@

Source: system/RequestAnimationFrame.js

/** * Abstracts away the use of RAF or setTimeOut for the core game update loop. * -* @class Phaser.RequestAnimationFrame +* @class Phaser.RequestAnimationFrame * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {boolean} [forceSetTimeOut=false] - Tell Phaser to use setTimeOut even if raf is available. */ Phaser.RequestAnimationFrame = function(game, forceSetTimeOut) { - + if (typeof forceSetTimeOut === 'undefined') { forceSetTimeOut = false; } /** @@ -611,7 +611,7 @@

Source: system/RequestAnimationFrame.js

/** * The update method for the requestAnimationFrame - * @method Phaser.RequestAnimationFrame#updateRAF + * @method Phaser.RequestAnimationFrame#updateRAF */ updateRAF: function () { @@ -694,7 +694,7 @@

Source: system/RequestAnimationFrame.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RetroFont.js.html b/docs/RetroFont.js.html index ee02a14299..0adcae4d4e 100644 --- a/docs/RetroFont.js.html +++ b/docs/RetroFont.js.html @@ -617,13 +617,13 @@

Source: gameobjects/RetroFont.js

* @private */ this.grabData = []; - + // Now generate our rects for faster copying later on var currentX = this.offsetX; var currentY = this.offsetY; var r = 0; var data = new Phaser.FrameData(); - + for (var c = 0; c < chars.length; c++) { var uuid = game.rnd.uuid(); @@ -638,9 +638,9 @@

Source: gameobjects/RetroFont.js

width: this.characterWidth, height: this.characterHeight }); - + r++; - + if (r == this.characterPerRow) { r = 0; @@ -660,10 +660,10 @@

Source: gameobjects/RetroFont.js

Phaser.RenderTexture.call(this, game); /** - * @property {number} type - Base Phaser object type. + * @property {number} type - Base Phaser object type. */ this.type = Phaser.RETROFONT; - + }; Phaser.RetroFont.prototype = Object.create(Phaser.RenderTexture.prototype); @@ -675,91 +675,91 @@

Source: gameobjects/RetroFont.js

* @type {string} */ Phaser.RetroFont.ALIGN_LEFT = "left"; - + /** * Align each line of multi-line text to the right. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_RIGHT = "right"; - + /** * Align each line of multi-line text in the center. * @constant * @type {string} */ Phaser.RetroFont.ALIGN_CENTER = "center"; - + /** * Text Set 1 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET1 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; - + /** * Text Set 2 = !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET2 = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** -* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 +* Text Set 3 = ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "; - + /** * Text Set 4 = ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET4 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789"; - + /** * Text Set 5 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET5 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789"; - + /** -* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' +* Text Set 6 = ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET6 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' "; - + /** * Text Set 7 = AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39 * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET7 = "AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39"; - + /** * Text Set 8 = 0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET8 = "0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 9 = ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?! * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!"; - + /** * Text Set 10 = ABCDEFGHIJKLMNOPQRSTUVWXYZ * @constant * @type {string} */ Phaser.RetroFont.TEXT_SET10 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - + /** * Text Set 11 = ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789 * @constant @@ -783,11 +783,11 @@

Source: gameobjects/RetroFont.js

this.fixedWidth = width; this.align = lineAlignment; -} +}; /** * A helper function that quickly sets lots of variables at once, and then updates the text. -* +* * @method Phaser.RetroFont#setText * @memberof Phaser.RetroFont * @param {string} content - The text of this sprite. @@ -803,7 +803,7 @@

Source: gameobjects/RetroFont.js

this.customSpacingX = characterSpacing || 0; this.customSpacingY = lineSpacing || 0; this.align = lineAlignment || 'left'; - + if (allowLowerCase) { this.autoUpperCase = false; @@ -812,17 +812,17 @@

Source: gameobjects/RetroFont.js

{ this.autoUpperCase = true; } - + if (content.length > 0) { this.text = content; } -} +}; /** * Over rides the default PIXI.RenderTexture resize event as we need our baseTexture resized as well. -* +* * @method Phaser.RetroFont#resize * @memberof Phaser.RetroFont */ @@ -844,7 +844,7 @@

Source: gameobjects/RetroFont.js

var gl = this.renderer.gl; gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTextures[gl.id]); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); } else { @@ -853,11 +853,11 @@

Source: gameobjects/RetroFont.js

PIXI.Texture.frameUpdates.push(this); -} +}; /** * Updates the BitmapData of the Sprite with the text -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont */ @@ -869,7 +869,7 @@

Source: gameobjects/RetroFont.js

if (this.multiLine) { var lines = this._text.split("\n"); - + if (this.fixedWidth > 0) { this.resize(this.fixedWidth, (lines.length * (this.characterHeight + this.customSpacingY)) - this.customSpacingY); @@ -880,7 +880,7 @@

Source: gameobjects/RetroFont.js

} this.textureBuffer.clear(); - + // Loop through each line of text for (var i = 0; i < lines.length; i++) { @@ -890,25 +890,25 @@

Source: gameobjects/RetroFont.js

case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (lines[i].length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((lines[i].length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + // Sanity checks if (cx < 0) { cx = 0; } - + this.pasteLine(lines[i], cx, cy, this.customSpacingX); - + cy += this.characterHeight + this.customSpacingY; } } @@ -924,32 +924,32 @@

Source: gameobjects/RetroFont.js

} this.textureBuffer.clear(); - + switch (this.align) { case Phaser.RetroFont.ALIGN_LEFT: cx = 0; break; - + case Phaser.RetroFont.ALIGN_RIGHT: cx = this.width - (this._text.length * (this.characterWidth + this.customSpacingX)); break; - + case Phaser.RetroFont.ALIGN_CENTER: cx = (this.width / 2) - ((this._text.length * (this.characterWidth + this.customSpacingX)) / 2); cx += this.customSpacingX / 2; break; } - + this.pasteLine(this._text, cx, 0, this.customSpacingX); } -} +}; /** * Internal function that takes a single line of text (2nd parameter) and pastes it into the BitmapData at the given coordinates. * Used by getLine and getMultiLine -* +* * @method Phaser.RetroFont#buildRetroFontText * @memberof Phaser.RetroFont * @param {string} line - The single line of text to paste. @@ -976,9 +976,9 @@

Source: gameobjects/RetroFont.js

this.stamp.frame = this.grabData[line.charCodeAt(c)]; p.set(x, y); this.render(this.stamp, p, false); - + x += this.characterWidth + customSpacingX; - + if (x > this.width) { break; @@ -986,11 +986,11 @@

Source: gameobjects/RetroFont.js

} } } -} - +}; + /** * Works out the longest line of text in _text and returns its length -* +* * @method Phaser.RetroFont#getLongestLine * @memberof Phaser.RetroFont * @return {number} The length of the longest line of text. @@ -998,11 +998,11 @@

Source: gameobjects/RetroFont.js

Phaser.RetroFont.prototype.getLongestLine = function () { var longestLine = 0; - + if (this._text.length > 0) { var lines = this._text.split("\n"); - + for (var i = 0; i < lines.length; i++) { if (lines[i].length > longestLine) @@ -1011,13 +1011,13 @@

Source: gameobjects/RetroFont.js

} } } - + return longestLine; -} - +}; + /** * Internal helper function that removes all unsupported characters from the _text String, leaving only characters contained in the font set. -* +* * @method Phaser.RetroFont#removeUnsupportedCharacters * @memberof Phaser.RetroFont * @protected @@ -1027,7 +1027,7 @@

Source: gameobjects/RetroFont.js

Phaser.RetroFont.prototype.removeUnsupportedCharacters = function (stripCR) { var newString = ""; - + for (var c = 0; c < this._text.length; c++) { var aChar = this._text[c]; @@ -1038,16 +1038,16 @@

Source: gameobjects/RetroFont.js

newString = newString.concat(aChar); } } - + return newString; -} +}; /** * @name Phaser.BitmapText#text * @property {string} text - Set this value to update the text in this sprite. Carriage returns are automatically stripped out if multiLine is false. Text is converted to upper case if autoUpperCase is true. */ Object.defineProperty(Phaser.RetroFont.prototype, "text", { - + get: function () { return this._text; @@ -1057,7 +1057,7 @@

Source: gameobjects/RetroFont.js

set: function (value) { var newText; - + if (this.autoUpperCase) { newText = value.toUpperCase(); @@ -1066,13 +1066,13 @@

Source: gameobjects/RetroFont.js

{ newText = value; } - + if (newText !== this._text) { this._text = newText; - + this.removeUnsupportedCharacters(this.multiLine); - + this.buildRetroFontText(); } @@ -1100,7 +1100,7 @@

Source: gameobjects/RetroFont.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/RevoluteConstraint.js.html b/docs/RevoluteConstraint.js.html index fabfdc5ca0..2ff9b29564 100644 --- a/docs/RevoluteConstraint.js.html +++ b/docs/RevoluteConstraint.js.html @@ -546,7 +546,7 @@

Source: physics/p2/RevoluteConstraint.js

p2.RevoluteConstraint.call(this, bodyA, pivotA, bodyB, pivotB, maxForce); -} +}; Phaser.Physics.P2.RevoluteConstraint.prototype = Object.create(p2.RevoluteConstraint.prototype); Phaser.Physics.P2.RevoluteConstraint.prototype.constructor = Phaser.Physics.P2.RevoluteConstraint; @@ -571,7 +571,7 @@

Source: physics/p2/RevoluteConstraint.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/ScaleManager.js.html b/docs/ScaleManager.js.html index 09d27db467..336e9b8f79 100644 --- a/docs/ScaleManager.js.html +++ b/docs/ScaleManager.js.html @@ -516,7 +516,7 @@

Source: core/ScaleManager.js

/** * The ScaleManager object is responsible for helping you manage the scaling, resizing and alignment of your game within the browser. * -* @class Phaser.ScaleManager +* @class Phaser.ScaleManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. * @param {number} width - The native width of the game. @@ -748,7 +748,7 @@

Source: core/ScaleManager.js

document.addEventListener('fullscreenchange', function (event) { return _this.fullScreenChange(event); }, false); - + }; /** @@ -1067,7 +1067,7 @@

Source: core/ScaleManager.js

{ force = false; } - + if (this.game.device.iPad === false && this.game.device.webApp === false && this.game.device.desktop === false) { if (this.game.device.android && this.game.device.chrome === false) @@ -1086,7 +1086,7 @@

Source: core/ScaleManager.js

{ // Set minimum height of content to new window height document.documentElement['style'].minHeight = window.innerHeight + 'px'; - + if (this.incorrectOrientation === true) { this.setMaximum(); @@ -1152,7 +1152,7 @@

Source: core/ScaleManager.js

this.game.canvas.style.width = this.width + 'px'; this.game.canvas.style.height = this.height + 'px'; - + this.game.input.scale.setTo(this.game.width / this.width, this.game.height / this.height); if (this.pageAlignHorizontally) @@ -1184,9 +1184,9 @@

Source: core/ScaleManager.js

} Phaser.Canvas.getOffset(this.game.canvas, this.game.stage.offset); - + this.aspectRatio = this.width / this.height; - + this.scaleFactor.x = this.game.width / this.width; this.scaleFactor.y = this.game.height / this.height; @@ -1265,7 +1265,7 @@

Source: core/ScaleManager.js

get: function () { - return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']) + return (document['fullscreenElement'] || document['mozFullScreenElement'] || document['webkitFullscreenElement']); } @@ -1317,7 +1317,7 @@

Source: core/ScaleManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Signal.js.html b/docs/Signal.js.html index 2434871a23..e1508bbe90 100644 --- a/docs/Signal.js.html +++ b/docs/Signal.js.html @@ -526,7 +526,7 @@

Source: core/Signal.js

* @private */ this._bindings = []; - + /** * @property {any} _prevParams - Internal variable. * @private @@ -556,7 +556,7 @@

Source: core/Signal.js

memorize: false, /** - * @property {boolean} _shouldPropagate + * @property {boolean} _shouldPropagate * @private */ _shouldPropagate: true, @@ -577,7 +577,7 @@

Source: core/Signal.js

*/ validateListener: function (listener, fnName) { if (typeof listener !== 'function') { - throw new Error( 'listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName) ); + throw new Error('listener is a required param of {fn}() and should be a Function.'.replace('{fn}', fnName)); } }, @@ -598,14 +598,14 @@

Source: core/Signal.js

if (prevIndex !== -1) { binding = this._bindings[prevIndex]; if (binding.isOnce() !== isOnce) { - throw new Error('You cannot add'+ (isOnce? '' : 'Once') +'() then add'+ (!isOnce? '' : 'Once') +'() the same listener without removing the relationship first.'); + throw new Error('You cannot add' + (isOnce ? '' : 'Once') + '() then add' + (!isOnce ? '' : 'Once') + '() the same listener without removing the relationship first.'); } } else { binding = new Phaser.SignalBinding(this, listener, isOnce, listenerContext, priority); this._addBinding(binding); } - if (this.memorize && this._prevParams){ + if (this.memorize && this._prevParams) { binding.execute(this._prevParams); } @@ -613,7 +613,7 @@

Source: core/Signal.js

}, /** - * @method Phaser.Signal#_addBinding + * @method Phaser.Signal#_addBinding * @param {Phaser.SignalBinding} binding - An Object representing the binding between the Signal and listener. * @private */ @@ -644,7 +644,7 @@

Source: core/Signal.js

/** * Check if listener was attached to Signal. - * + * * @method Phaser.Signal#has * @param {Function} listener - Signal handler function. * @param {Object} [context] - Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -656,7 +656,7 @@

Source: core/Signal.js

/** * Add a listener to the signal. - * + * * @method Phaser.Signal#add * @param {function} listener - Signal handler function. * @param {object} [listenerContext] Context on which listener will be executed (object that should represent the `this` variable inside listener function). @@ -774,7 +774,7 @@

Source: core/Signal.js

//execute all callbacks until end of the list or until a callback returns `false` or stops propagation //reverse loop since listeners with higher priority will be added at the end of the list do { n--; } while (bindings[n] && this._shouldPropagate && bindings[n].execute(paramsArr) !== false); - + }, /** @@ -832,7 +832,7 @@

Source: core/Signal.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html index a68519691e..39a5f6464b 100644 --- a/docs/SignalBinding.html +++ b/docs/SignalBinding.html @@ -825,7 +825,7 @@
Parameters:
Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:57 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:42 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html index 560626bae1..388b30926e 100644 --- a/docs/SignalBinding.js.html +++ b/docs/SignalBinding.js.html @@ -576,8 +576,8 @@

Source: core/SignalBinding.js

/** * Default parameters passed to listener during `Signal.dispatch` and `SignalBinding.execute` (curried parameters). - * @property {array|null} params - * @default + * @property {array|null} params + * @default */ params: null, @@ -588,13 +588,13 @@

Source: core/SignalBinding.js

* @param {array} [paramsArr] - Array of parameters that should be passed to the listener. * @return {any} Value returned by the listener. */ - execute: function (paramsArr) { + execute: function(paramsArr) { var handlerReturn, params; if (this.active && !!this._listener) { - params = this.params? this.params.concat(paramsArr) : paramsArr; + params = this.params ? this.params.concat(paramsArr) : paramsArr; handlerReturn = this._listener.apply(this.context, params); if (this._isOnce) @@ -692,7 +692,7 @@

Source: core/SignalBinding.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SinglePad.js.html b/docs/SinglePad.js.html index 33fe282051..00b1fa019d 100644 --- a/docs/SinglePad.js.html +++ b/docs/SinglePad.js.html @@ -785,7 +785,7 @@

Source: input/SinglePad.js

} this._axes[axisState.axis] = axisState.value; - + if (this._padParent.onAxisCallback) { this._padParent.onAxisCallback.call(this._padParent.callbackContext, axisState, this._index); @@ -1097,7 +1097,7 @@

Source: input/SinglePad.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Sound.js.html b/docs/Sound.js.html index 0a3b719bff..029096e57d 100644 --- a/docs/Sound.js.html +++ b/docs/Sound.js.html @@ -525,7 +525,7 @@

Source: sound/Sound.js

* @param {boolean} [loop=false] - Whether or not the sound will loop. */ Phaser.Sound = function (game, key, volume, loop, connect) { - + if (typeof volume == 'undefined') { volume = 1; } if (typeof loop == 'undefined') { loop = false; } if (typeof connect === 'undefined') { connect = game.sound.connectToMaster; } @@ -561,7 +561,7 @@

Source: sound/Sound.js

* @property {object} markers - The sound markers. */ this.markers = {}; - + /** * @property {AudioContext} context - Reference to the AudioContext instance. */ @@ -589,34 +589,34 @@

Source: sound/Sound.js

* @property {number} totalDuration - The total duration of the sound, in milliseconds */ this.totalDuration = 0; - + /** * @property {number} startTime - The time the Sound starts at (typically 0 unless starting from a marker) * @default */ this.startTime = 0; - + /** * @property {number} currentTime - The current time the sound is at. */ this.currentTime = 0; - + /** * @property {number} duration - The duration of the sound. */ this.duration = 0; - + /** * @property {number} stopTime - The time the sound stopped. */ this.stopTime = 0; - + /** * @property {boolean} paused - true if the sound is paused, otherwise false. * @default */ this.paused = false; - + /** * @property {number} pausedPosition - The position the sound had reached when it was paused. */ @@ -632,31 +632,31 @@

Source: sound/Sound.js

* @default */ this.isPlaying = false; - + /** * @property {string} currentMarker - The string ID of the currently playing marker, if any. * @default */ this.currentMarker = ''; - + /** * @property {boolean} pendingPlayback - true if the sound file is pending playback * @readonly */ this.pendingPlayback = false; - + /** * @property {boolean} override - if true when you play this sound it will always start from the beginning. * @default */ this.override = false; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = this.game.sound.usingWebAudio; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. */ @@ -710,37 +710,37 @@

Source: sound/Sound.js

* @property {Phaser.Signal} onDecoded - The onDecoded event is dispatched when the sound has finished decoding (typically for mp3 files) */ this.onDecoded = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPlay - The onPlay event is dispatched each time this sound is played. */ this.onPlay = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onPause - The onPause event is dispatched when this sound is paused. */ this.onPause = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onResume - The onResume event is dispatched when this sound is resumed from a paused state. */ this.onResume = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onLoop - The onLoop event is dispatched when this sound loops during playback. */ this.onLoop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onStop - The onStop event is dispatched when this sound stops playback. */ this.onStop = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMute - The onMouse event is dispatched when this sound is muted. */ this.onMute = new Phaser.Signal(); - + /** * @property {Phaser.Signal} onMarkerComplete - The onMarkerComplete event is dispatched when a marker within this sound completes playback. */ @@ -1001,7 +1001,7 @@

Source: sound/Sound.js

this._sound = this.context.createBufferSource(); this._sound.buffer = this._buffer; - + if (this.externalNode) { this._sound.connect(this.externalNode.input); @@ -1081,7 +1081,7 @@

Source: sound/Sound.js

// console.log('playing', this._sound); this._sound.currentTime = this.position; this._sound.muted = this._muted; - + if (this._muted) { this._sound.volume = 0; @@ -1222,7 +1222,7 @@

Source: sound/Sound.js

this.isPlaying = false; var prevMarker = this.currentMarker; - + if (this.currentMarker !== '') { this.onMarkerComplete.dispatch(this.currentMarker, this); @@ -1268,11 +1268,11 @@

Source: sound/Sound.js

* @property {boolean} mute - Gets or sets the muted state of this sound. */ Object.defineProperty(Phaser.Sound.prototype, "mute", { - + get: function () { return this._muted; }, - + set: function (value) { value = value || null; @@ -1363,7 +1363,7 @@

Source: sound/Sound.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html index 79f6d11b96..aa6b642944 100644 --- a/docs/SoundManager.js.html +++ b/docs/SoundManager.js.html @@ -529,12 +529,12 @@

Source: sound/SoundManager.js

* @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {Phaser.Signal} onSoundDecode - The event dispatched when a sound decodes (typically only for mp3 files) */ this.onSoundDecode = new Phaser.Signal(); - + /** * @property {boolean} _codeMuted - Internal mute tracking var. * @private @@ -548,7 +548,7 @@

Source: sound/SoundManager.js

* @default */ this._muted = false; - + /** * @property {Description} _unlockSource - Internal unlock tracking var. * @private @@ -559,12 +559,12 @@

Source: sound/SoundManager.js

/** * @property {number} _volume - The global audio volume. A value between 0 (silence) and 1 (full volume). * @private - * @default + * @default */ this._volume = 1; /** - * @property {array} _sounds - An array containing all the sounds + * @property {array} _sounds - An array containing all the sounds * @private * @default The empty array. */ @@ -575,19 +575,19 @@

Source: sound/SoundManager.js

* @default */ this.context = null; - + /** * @property {boolean} usingWebAudio - true if this sound is being played with Web Audio. * @readonly */ this.usingWebAudio = true; - + /** * @property {boolean} usingAudioTag - true if the sound is being played via the Audio tag. * @readonly */ this.usingAudioTag = false; - + /** * @property {boolean} noAudio - Has audio been disabled via the PhaserGlobal object? Useful if you need to use a 3rd party audio library instead. * @default @@ -611,7 +611,7 @@

Source: sound/SoundManager.js

* @default */ this.channels = 32; - + }; Phaser.SoundManager.prototype = { @@ -777,7 +777,7 @@

Source: sound/SoundManager.js

this._sounds[i].resume(); } } - + }, /** @@ -992,7 +992,7 @@

Source: sound/SoundManager.js

* @property {number} volume - Gets or sets the global volume of the SoundManager, a value between 0 and 1. */ Object.defineProperty(Phaser.SoundManager.prototype, "volume", { - + get: function () { if (this.usingWebAudio) @@ -1025,7 +1025,7 @@

Source: sound/SoundManager.js

} } } - + } }); @@ -1050,7 +1050,7 @@

Source: sound/SoundManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Spring.js.html b/docs/Spring.js.html index daf4cb81cd..b06f67b73f 100644 --- a/docs/Spring.js.html +++ b/docs/Spring.js.html @@ -576,7 +576,7 @@

Source: physics/p2/Spring.js

p2.Spring.call(this, bodyA, bodyB, options); -} +}; Phaser.Physics.P2.Spring.prototype = Object.create(p2.Spring.prototype); Phaser.Physics.P2.Spring.prototype.constructor = Phaser.Physics.P2.Spring; @@ -601,7 +601,7 @@

Source: physics/p2/Spring.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html index aaf178fa0e..e427ad47e9 100644 --- a/docs/Sprite.js.html +++ b/docs/Sprite.js.html @@ -536,7 +536,7 @@

Source: gameobjects/Sprite.js

y = y || 0; key = key || null; frame = frame || null; - + /** * @property {Phaser.Game} game - A reference to the currently running Game. */ @@ -614,7 +614,7 @@

Source: gameobjects/Sprite.js

/** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -917,6 +917,7 @@

Source: gameobjects/Sprite.js

/** * Crop allows you to crop the texture used to display this Sprite. * Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite. * * @method Phaser.Sprite#crop * @memberof Phaser.Sprite @@ -965,7 +966,7 @@

Source: gameobjects/Sprite.js

* Brings a 'dead' Sprite back to life, optionally giving it the health value specified. * A resurrected Sprite has its alive, exists and visible properties all set to true. * It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal. -* +* * @method Phaser.Sprite#revive * @memberof Phaser.Sprite * @param {number} [health=1] - The health to give the Sprite. @@ -994,7 +995,7 @@

Source: gameobjects/Sprite.js

* It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal. * Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory. * If you don't need this Sprite any more you should call Sprite.destroy instead. -* +* * @method Phaser.Sprite#kill * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -1017,7 +1018,7 @@

Source: gameobjects/Sprite.js

/** * Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.Sprite#destroy * @memberof Phaser.Sprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -1090,7 +1091,7 @@

Source: gameobjects/Sprite.js

/** * Damages the Sprite, this removes the given amount from the Sprites health property. * If health is then taken below or is equal to zero `Sprite.kill` is called. -* +* * @method Phaser.Sprite#damage * @memberof Phaser.Sprite * @param {number} amount - The amount to subtract from the Sprite.health value. @@ -1116,7 +1117,7 @@

Source: gameobjects/Sprite.js

* Resets the Sprite. This places the Sprite at the given x/y world coordinates and then * sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values. * If the Sprite has a physics body that too is reset. -* +* * @method Phaser.Sprite#reset * @memberof Phaser.Sprite * @param {number} x - The x coordinate (in world space) to position the Sprite at. @@ -1147,13 +1148,13 @@

Source: gameobjects/Sprite.js

this._cache[4] = 1; return this; - + }; /** * Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only * bought to the top of that Group, not the entire display list. -* +* * @method Phaser.Sprite#bringToTop * @memberof Phaser.Sprite * @return (Phaser.Sprite) This instance. @@ -1172,7 +1173,7 @@

Source: gameobjects/Sprite.js

/** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.Sprite#play * @memberof Phaser.Sprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -1190,11 +1191,27 @@

Source: gameobjects/Sprite.js

}; +/** +* Checks to see if the bounds of this Sprite overlaps with the bounds of the given Display Object, which can be a Sprite, Image, TileSprite or anything that extends those such as a Button. +* This check ignores the Sprites hitArea property and runs a Sprite.getBounds comparison on both objects to determine the result. +* Therefore it's relatively expensive to use in large quantities (i.e. with lots of Sprites at a high frequency), but should be fine for low-volume testing where physics isn't required. +* +* @method Phaser.Sprite#overlap +* @memberof Phaser.Sprite +* @param {Phaser.Sprite|Phaser.Image|Phaser.TileSprite|Phaser.Button|PIXI.DisplayObject} displayObject - The display object to check against. +* @return {boolean} True if the bounds of this Sprite intersects at any point with the bounds of the given display object. +*/ +Phaser.Sprite.prototype.overlap = function (displayObject) { + + return Phaser.Rectangle.intersects(this.getBounds(), displayObject.getBounds()); + +}; + /** * Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.Sprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -1241,7 +1258,7 @@

Source: gameobjects/Sprite.js

Object.defineProperty(Phaser.Sprite.prototype, "deltaY", { get: function() { - + return this.world.y - this._cache[1]; } @@ -1258,7 +1275,7 @@

Source: gameobjects/Sprite.js

Object.defineProperty(Phaser.Sprite.prototype, "deltaZ", { get: function() { - + return this.rotation - this._cache[2]; } @@ -1292,7 +1309,7 @@

Source: gameobjects/Sprite.js

Object.defineProperty(Phaser.Sprite.prototype, "inCamera", { get: function() { - + return this.game.world.camera.screenView.intersects(this.getBounds()); } @@ -1354,7 +1371,7 @@

Source: gameobjects/Sprite.js

* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -1391,7 +1408,7 @@

Source: gameobjects/Sprite.js

* @property {boolean} exists - If the Sprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.Sprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -1438,7 +1455,7 @@

Source: gameobjects/Sprite.js

* @property {boolean} fixedToCamera - Set to true to fix this Sprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Sprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -1467,7 +1484,7 @@

Source: gameobjects/Sprite.js

* @property {boolean} smoothed - Set to true to smooth the texture of this Sprite, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { - + get: function () { return !this.texture.baseTexture.scaleMode; @@ -1492,6 +1509,60 @@

Source: gameobjects/Sprite.js

} } +}); + +/** +* The position of the Sprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#x +* @property {number} x - The position of the Sprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the Sprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#y +* @property {number} y - The position of the Sprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + });

@@ -1514,7 +1585,7 @@

Source: gameobjects/Sprite.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/SpriteBatch.js.html b/docs/SpriteBatch.js.html index 2223f46709..37e86c13da 100644 --- a/docs/SpriteBatch.js.html +++ b/docs/SpriteBatch.js.html @@ -563,7 +563,7 @@

Source: gameobjects/SpriteBatch.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Stage.js.html b/docs/Stage.js.html index a28bc3156b..39bdadd38b 100644 --- a/docs/Stage.js.html +++ b/docs/Stage.js.html @@ -535,7 +535,7 @@

Source: core/Stage.js

* @property {Phaser.Point} offset - Holds the offset coordinates of the Game.canvas from the top-left of the browser window (used by Input and other classes) */ this.offset = new Phaser.Point(); - + PIXI.Stage.call(this, 0x000000, false); /** @@ -605,11 +605,11 @@

Source: core/Stage.js

/** * This is called automatically after the plugins preUpdate and before the State.update. * Most objects have preUpdate methods and it's where initial movement and positioning is done. -* +* * @method Phaser.Stage#preUpdate */ Phaser.Stage.prototype.preUpdate = function () { - + this.currentRenderOrderID = 0; // This can't loop in reverse, we need the orderID to be in sequence @@ -620,11 +620,11 @@

Source: core/Stage.js

this.children[i].preUpdate(); } -} +}; /** * This is called automatically after the State.update, but before particles or plugins update. -* +* * @method Phaser.Stage#update */ Phaser.Stage.prototype.update = function () { @@ -636,14 +636,14 @@

Source: core/Stage.js

this.children[i].update(); } -} +}; /** * This is called automatically before the renderer runs and after the plugins have updated. * In postUpdate this is where all the final physics calculatations and object positioning happens. * The objects are processed in the order of the display list. * The only exception to this is if the camera is following an object, in which case that is updated first. -* +* * @method Phaser.Stage#postUpdate */ Phaser.Stage.prototype.postUpdate = function () { @@ -685,7 +685,7 @@

Source: core/Stage.js

} } -} +}; /** * Parses a Game configuration object. @@ -738,7 +738,7 @@

Source: core/Stage.js

this.backgroundColor = config['backgroundColor']; } -} +}; /** * Initialises the stage and adds the event listeners. @@ -755,14 +755,14 @@

Source: core/Stage.js

this._onChange = function (event) { return _this.visibilityChange(event); - } + }; Phaser.Canvas.setUserSelect(this.game.canvas, 'none'); Phaser.Canvas.setTouchAction(this.game.canvas, 'none'); this.checkVisibility(); -} +}; /** * Starts a page visibility event listener running, or window.blur/focus if not supported by the browser. @@ -803,7 +803,7 @@

Source: core/Stage.js

window.onblur = this._onChange; window.onfocus = this._onChange; -} +}; /** * This method is called when the document visibility is changed. @@ -840,7 +840,7 @@

Source: core/Stage.js

this.game.gameResumed(event); } -} +}; /** * Sets the background color for the stage. @@ -855,7 +855,7 @@

Source: core/Stage.js

var hex = this._backgroundColor.toString(16); hex = '000000'.substr(0, 6 - hex.length) + hex; this.backgroundColorString = '#' + hex; -} +}; /** * @name Phaser.Stage#backgroundColor @@ -892,7 +892,7 @@

Source: core/Stage.js

* @property {boolean} smoothed - Set to true to smooth all sprites rendered on this Stage, or false to disable smoothing (great for pixel art) */ Object.defineProperty(Phaser.Stage.prototype, "smoothed", { - + get: function () { return !PIXI.scaleModes.LINEAR; @@ -933,7 +933,7 @@

Source: core/Stage.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/State.js.html b/docs/State.js.html index 8e2d8ea3d4..237b405d66 100644 --- a/docs/State.js.html +++ b/docs/State.js.html @@ -527,12 +527,12 @@

Source: core/State.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = null; - + /** * @property {Phaser.GameObjectFactory} add - Reference to the GameObjectFactory. */ this.add = null; - + /** * @property {Phaser.GameObjectCreator} make - Reference to the GameObjectCreator. */ @@ -542,32 +542,32 @@

Source: core/State.js

* @property {Phaser.Camera} camera - A handy reference to world.camera. */ this.camera = null; - + /** * @property {Phaser.Cache} cache - Reference to the assets cache. */ this.cache = null; - + /** * @property {Phaser.Input} input - Reference to the input manager */ this.input = null; - + /** * @property {Phaser.Loader} load - Reference to the assets loader. */ this.load = null; - + /** * @property {Phaser.Math} math - Reference to the math helper. */ this.math = null; - + /** * @property {Phaser.SoundManager} sound - Reference to the sound manager. */ this.sound = null; - + /** * @property {Phaser.ScaleManager} scale - Reference to the game scale manager. */ @@ -577,27 +577,27 @@

Source: core/State.js

* @property {Phaser.Stage} stage - Reference to the stage. */ this.stage = null; - + /** * @property {Phaser.TimeManager} time - Reference to game clock. */ this.time = null; - + /** * @property {Phaser.TweenManager} tweens - Reference to the tween manager. */ this.tweens = null; - + /** * @property {Phaser.World} world - Reference to the world. */ this.world = null; - + /** * @property {Phaser.Particles} particles - The Particle Manager for the game. It is called during the game update loop and in turn updates any Emitters attached to it. */ this.particles = null; - + /** * @property {Phaser.Physics.World} physics - Reference to the physics manager. */ @@ -615,7 +615,7 @@

Source: core/State.js

/** * Override this method to add some load operations. * If you need to use the loader, you may need to use them here. - * + * * @method Phaser.State#preload */ preload: function () { @@ -623,7 +623,7 @@

Source: core/State.js

/** * Put update logic here. - * + * * @method Phaser.State#loadUpdate */ loadUpdate: function () { @@ -631,7 +631,7 @@

Source: core/State.js

/** * Put render operations here. - * + * * @method Phaser.State#loadRender */ loadRender: function () { @@ -640,7 +640,7 @@

Source: core/State.js

/** * This method is called after the game engine successfully switches states. * Feel free to add any setup code here (do not load anything here, override preload() instead). - * + * * @method Phaser.State#create */ create: function () { @@ -648,7 +648,7 @@

Source: core/State.js

/** * Put update logic here. - * + * * @method Phaser.State#update */ update: function () { @@ -656,7 +656,7 @@

Source: core/State.js

/** * Put render operations here. - * + * * @method Phaser.State#render */ render: function () { @@ -664,7 +664,7 @@

Source: core/State.js

/** * This method will be called when game paused. - * + * * @method Phaser.State#paused */ paused: function () { @@ -701,7 +701,7 @@

Source: core/State.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html index 79b5f21059..15177b113b 100644 --- a/docs/StateManager.js.html +++ b/docs/StateManager.js.html @@ -517,7 +517,7 @@

Source: core/StateManager.js

/** * The State Manager is responsible for loading, setting up and switching game states. -* +* * @class Phaser.StateManager * @constructor * @param {Phaser.Game} game - A reference to the currently running game. @@ -584,7 +584,7 @@

Source: core/StateManager.js

* @property {function} onPreloadCallback - This will be called when init states (loading assets...). */ this.onPreloadCallback = null; - + /** * @property {function} onCreateCallback - This will be called when create states (setup states...). */ @@ -765,7 +765,7 @@

Source: core/StateManager.js

} }, - + /** * Used by onInit and onShutdown when those functions don't exist on the state * @method Phaser.StateManager#dummy @@ -1111,7 +1111,7 @@

Source: core/StateManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Text.js.html b/docs/Text.js.html index 9ffc536ffa..1e58d35b48 100644 --- a/docs/Text.js.html +++ b/docs/Text.js.html @@ -547,7 +547,7 @@

Source: gameobjects/Text.js

* @property {Phaser.Game} game - A reference to the currently running Game. */ this.game = game; - + /** * @property {boolean} exists - If exists = false then the Text isn't updated by the core game loop. * @default @@ -684,7 +684,7 @@

Source: gameobjects/Text.js

return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -694,7 +694,7 @@

Source: gameobjects/Text.js

*/ Phaser.Text.prototype.update = function() { -} +}; /** * Automatically called by World.postUpdate. @@ -714,7 +714,7 @@

Source: gameobjects/Text.js

this.children[i].postUpdate(); } -} +}; /** * @method Phaser.Text.prototype.destroy @@ -774,7 +774,7 @@

Source: gameobjects/Text.js

this.mask = null; this.game = null; -} +}; /** * @method Phaser.Text.prototype.setShadow @@ -791,7 +791,7 @@

Source: gameobjects/Text.js

this.style.shadowBlur = blur || 0; this.dirty = true; -} +}; /** * Set the style of the text by passing a single style object to it. @@ -824,7 +824,7 @@

Source: gameobjects/Text.js

this.style = style; this.dirty = true; -} +}; /** * Renders text. This replaces the Pixi.Text.updateText function as we need a few extra bits in here. @@ -862,15 +862,15 @@

Source: gameobjects/Text.js

this.canvas.width = maxLineWidth + this.style.strokeThickness; //calculate text height - var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; + var lineHeight = this.determineFontHeight('font: ' + this.style.font + ';') + this.style.strokeThickness + this._lineSpacing + this.style.shadowOffsetY; this.canvas.height = lineHeight * lines.length; if (navigator.isCocoonJS) { - this.context.clearRect(0,0,this.canvas.width,this.canvas.height); + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); } - + //set canvas text styles this.context.fillStyle = this.style.fill; this.context.font = this.style.font; @@ -890,30 +890,30 @@

Source: gameobjects/Text.js

{ var linePosition = new PIXI.Point(this.style.strokeThickness / 2, this.style.strokeThickness / 2 + i * lineHeight); - if(this.style.align === 'right') + if (this.style.align === 'right') { linePosition.x += maxLineWidth - lineWidths[i]; } - else if(this.style.align === 'center') + else if (this.style.align === 'center') { linePosition.x += (maxLineWidth - lineWidths[i]) / 2; } linePosition.y += this._lineSpacing; - if(this.style.stroke && this.style.strokeThickness) + if (this.style.stroke && this.style.strokeThickness) { this.context.strokeText(lines[i], linePosition.x, linePosition.y); } - if(this.style.fill) + if (this.style.fill) { this.context.fillText(lines[i], linePosition.x, linePosition.y); } } this.updateTexture(); -} +}; /** * Greedy wrapping algorithm that will wrap words as the line grows longer than its horizontal bounds. @@ -961,7 +961,7 @@

Source: gameobjects/Text.js

return result; -} +}; /** * Indicates the rotation of the Text, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. @@ -1331,7 +1331,7 @@

Source: gameobjects/Text.js

* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.Text.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -1368,7 +1368,7 @@

Source: gameobjects/Text.js

* @property {boolean} fixedToCamera - Set to true to fix this Text to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.Text.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -1410,7 +1410,7 @@

Source: gameobjects/Text.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tile.js.html b/docs/Tile.js.html index 1ccceba045..0f37fbdaa0 100644 --- a/docs/Tile.js.html +++ b/docs/Tile.js.html @@ -507,7 +507,8 @@

Source: physics/ninja/Tile.js

-
/**
+            
/* jshint camelcase: false */
+/**
 * @author       Richard Davey <rich@photonstorm.com>
 * @copyright    2014 Photon Storm Ltd.
 * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
@@ -518,7 +519,7 @@ 

Source: physics/ninja/Tile.js

* A Tile is defined by its width, height and type. It's type can include slope data, such as 45 degree slopes, or convex slopes. * Understand that for any type including a slope (types 2 to 29) the Tile must be SQUARE, i.e. have an equal width and height. * Also note that as Tiles are primarily used for levels they have gravity disabled and world bounds collision disabled by default. -* +* * Note: This class could be massively optimised and reduced in size. I leave that challenge up to you. * * @class Phaser.Physics.Ninja.Tile @@ -532,7 +533,7 @@

Source: physics/ninja/Tile.js

* @param {number} [type=1] - The type of Ninja shape to create. 1 = AABB, 2 = Circle or 3 = Tile. */ Phaser.Physics.Ninja.Tile = function (body, x, y, width, height, type) { - + if (typeof type === 'undefined') { type = Phaser.Physics.Ninja.Tile.EMPTY; } /** @@ -710,8 +711,7 @@

Source: physics/ninja/Tile.js

* @param {number} dy - Collision normal * @param {number} obj - Object this Tile collided with */ - reportCollisionVsWorld: function (px, py, dx, dy, obj) { - + reportCollisionVsWorld: function (px, py, dx, dy) { var p = this.pos; var o = this.oldpos; @@ -862,28 +862,28 @@

Source: physics/ninja/Tile.js

this.signx = 1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnn) { this.signx = -1; this.signy = -1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGnp) { this.signx = -1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else if (this.id == Phaser.Physics.Ninja.Tile.SLOPE_45DEGpp) { this.signx = 1; this.signy = 1; this.sx = this.signx / Math.SQRT2;//get slope _unit_ normal - this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) + this.sy = this.signy / Math.SQRT2;//since normal is (1,-1), length is sqrt(1*1 + -1*-1) = sqrt(2) } else { @@ -1174,14 +1174,14 @@

Source: physics/ninja/Tile.js

} } -} +}; /** * @name Phaser.Physics.Ninja.Tile#x * @property {number} x - The x position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "x", { - + get: function () { return this.pos.x - this.xw; }, @@ -1197,7 +1197,7 @@

Source: physics/ninja/Tile.js

* @property {number} y - The y position. */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "y", { - + get: function () { return this.pos.y - this.yw; }, @@ -1214,7 +1214,7 @@

Source: physics/ninja/Tile.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "bottom", { - + get: function () { return this.pos.y + this.yw; } @@ -1227,7 +1227,7 @@

Source: physics/ninja/Tile.js

* @readonly */ Object.defineProperty(Phaser.Physics.Ninja.Tile.prototype, "right", { - + get: function () { return this.pos.x + this.xw; } @@ -1300,7 +1300,7 @@

Source: physics/ninja/Tile.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tile.js_.html b/docs/Tile.js_.html index a5b494ac24..5fdea30a17 100644 --- a/docs/Tile.js_.html +++ b/docs/Tile.js_.html @@ -537,12 +537,12 @@

Source: tilemap/Tile.js

* @property {number} index - The index of this tile within the map data corresponding to the tileset. */ this.index = index; - + /** * @property {number} x - The x map coordinate of this tile. */ this.x = x; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -552,7 +552,7 @@

Source: tilemap/Tile.js

* @property {number} x - The x map coordinate of this tile. */ this.worldX = x * width; - + /** * @property {number} y - The y map coordinate of this tile. */ @@ -562,7 +562,7 @@

Source: tilemap/Tile.js

* @property {number} width - The width of the tile in pixels. */ this.width = width; - + /** * @property {number} height - The height of the tile in pixels. */ @@ -572,7 +572,7 @@

Source: tilemap/Tile.js

* @property {number} width - The width of the tile in pixels. */ this.centerX = Math.abs(width / 2); - + /** * @property {number} height - The height of the tile in pixels. */ @@ -705,7 +705,7 @@

Source: tilemap/Tile.js

/** * Set a callback to be called when this tile is hit by an object. * The callback must true true for collision processing to take place. - * + * * @method Phaser.Tile#setCollisionCallback * @param {function} callback - Callback function. * @param {object} context - Callback will be called within this context. @@ -727,7 +727,7 @@

Source: tilemap/Tile.js

this.collisionCallback = null; this.collisionCallbackContext = null; this.properties = null; - + }, /** @@ -829,7 +829,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "collides", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown); } @@ -842,7 +842,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "canCollide", { - + get: function () { return (this.collideLeft || this.collideRight || this.collideUp || this.collideDown || this.collisionCallback); } @@ -855,7 +855,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "left", { - + get: function () { return this.worldX; } @@ -868,7 +868,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "right", { - + get: function () { return this.worldX + this.width; } @@ -881,7 +881,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "top", { - + get: function () { return this.worldY; } @@ -894,7 +894,7 @@

Source: tilemap/Tile.js

* @readonly */ Object.defineProperty(Phaser.Tile.prototype, "bottom", { - + get: function () { return this.worldY + this.height; } @@ -921,7 +921,7 @@

Source: tilemap/Tile.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html index 1d5f292894..5ba252a46f 100644 --- a/docs/TileSprite.js.html +++ b/docs/TileSprite.js.html @@ -633,7 +633,7 @@

Source: gameobjects/TileSprite.js

/** * By default Sprites won't add themselves to any physics system and their physics body will be `null`. - * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object + * To enable them for physics you need to call `game.physics.enable(sprite, system)` where `sprite` is this object * and `system` is the Physics system you want to use to manage this body. Once enabled you can access all physics related properties via `Sprite.body`. * * Important: Enabling a Sprite for P2 or Ninja physics will automatically set `Sprite.anchor` to 0.5 so the physics body is centered on the Sprite. @@ -762,7 +762,7 @@

Source: gameobjects/TileSprite.js

return true; -} +}; /** * Override and use this function in your own custom objects to handle any update requirements you may have. @@ -772,7 +772,7 @@

Source: gameobjects/TileSprite.js

*/ Phaser.TileSprite.prototype.update = function() { -} +}; /** * Internal function called by the World postUpdate cycle. @@ -800,7 +800,7 @@

Source: gameobjects/TileSprite.js

this.children[i].postUpdate(); } -} +}; /** * Sets this TileSprite to automatically scroll in the given direction until stopped via TileSprite.stopScroll(). @@ -815,7 +815,7 @@

Source: gameobjects/TileSprite.js

this._scroll.set(x, y); -} +}; /** * Stops an automatically scrolling TileSprite. @@ -827,7 +827,7 @@

Source: gameobjects/TileSprite.js

this._scroll.set(0, 0); -} +}; /** * Changes the Texture the TileSprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache. @@ -899,12 +899,12 @@

Source: gameobjects/TileSprite.js

} } -} +}; /** * Destroys the TileSprite. This removes it from its parent group, destroys the event and animation handlers if present * and nulls its reference to game, freeing it up for garbage collection. -* +* * @method Phaser.TileSprite#destroy * @memberof Phaser.TileSprite * @param {boolean} [destroyChildren=true] - Should every child of this object have its destroy method called? @@ -960,12 +960,12 @@

Source: gameobjects/TileSprite.js

this.mask = null; this.game = null; -} +}; /** * Play an animation based on the given key. The animation should previously have been added via sprite.animations.add() * If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself. -* +* * @method Phaser.TileSprite#play * @memberof Phaser.TileSprite * @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump". @@ -978,7 +978,7 @@

Source: gameobjects/TileSprite.js

return this.animations.play(name, frameRate, loop, killOnComplete); -} +}; /** * Resets the TileSprite. This places the TileSprite at the given x/y world coordinates, resets the tilePosition and then @@ -1020,7 +1020,7 @@

Source: gameobjects/TileSprite.js

* Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. * Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90. * If you wish to work in radians instead of degrees use the property Sprite.rotation instead. Working in radians is also a little faster as it doesn't have to convert the angle. -* +* * @name Phaser.TileSprite#angle * @property {number} angle - The angle of this Sprite in degrees. */ @@ -1091,7 +1091,7 @@

Source: gameobjects/TileSprite.js

* @property {boolean} fixedToCamera - Set to true to fix this TileSprite to the Camera at its current world coordinates. */ Object.defineProperty(Phaser.TileSprite.prototype, "fixedToCamera", { - + get: function () { return !!this._cache[7]; @@ -1122,7 +1122,7 @@

Source: gameobjects/TileSprite.js

* @property {boolean} exists - If the TileSprite is processed by the core game update and physics. */ Object.defineProperty(Phaser.TileSprite.prototype, "exists", { - + get: function () { return !!this._cache[6]; @@ -1168,7 +1168,7 @@

Source: gameobjects/TileSprite.js

* @property {boolean} inputEnabled - Set to true to allow this object to receive input events. */ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { - + get: function () { return (this.input && this.input.enabled); @@ -1194,6 +1194,60 @@

Source: gameobjects/TileSprite.js

} } +}); + +/** +* The position of the TileSprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#x +* @property {number} x - The position of the TileSprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the TileSprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#y +* @property {number} y - The position of the TileSprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + });
@@ -1216,7 +1270,7 @@

Source: gameobjects/TileSprite.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tilemap.js.html b/docs/Tilemap.js.html index 64b6f4a96d..daf0f81ef1 100644 --- a/docs/Tilemap.js.html +++ b/docs/Tilemap.js.html @@ -686,7 +686,7 @@

Source: tilemap/Tilemap.js

* @param {Phaser.Group} [group] - Optional Group to add the layer to. If not specified it will be added to the World group. * @return {Phaser.TilemapLayer} The TilemapLayer object. This is an extension of Phaser.Image and can be moved around the display list accordingly. */ - create: function (name, width, height, tileWidth, tileHeight) { + create: function (name, width, height, tileWidth, tileHeight, group) { if (typeof group === 'undefined') { group = this.game.world; } @@ -1267,7 +1267,7 @@

Source: tilemap/Tilemap.js

} } - for (var y = 0; y < this.layers[layer].height ; y++) + for (var y = 0; y < this.layers[layer].height; y++) { for (var x = 0; x < this.layers[layer].width; x++) { @@ -1566,7 +1566,7 @@

Source: tilemap/Tilemap.js

this.layers[layer].dirty = true; this.calculateFaces(layer); - + return this.layers[layer].data[y][x]; } @@ -1689,7 +1689,7 @@

Source: tilemap/Tilemap.js

this._results.length = 0; - this._results.push( { x: x, y: y, width: width, height: height, layer: layer }); + this._results.push({ x: x, y: y, width: width, height: height, layer: layer }); for (var ty = y; ty < y + height; ty++) { @@ -1716,7 +1716,7 @@

Source: tilemap/Tilemap.js

if (typeof x === "undefined") { x = 0; } if (typeof y === "undefined") { y = 0; } - + layer = this.getLayer(layer); if (!tileblock || tileblock.length < 2) @@ -2063,7 +2063,7 @@

Source: tilemap/Tilemap.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TilemapLayer.js.html b/docs/TilemapLayer.js.html index d51c9aae6d..36a50f6188 100644 --- a/docs/TilemapLayer.js.html +++ b/docs/TilemapLayer.js.html @@ -555,17 +555,17 @@

Source: tilemap/TilemapLayer.js

* @property {CanvasRenderingContext2D} context - The 2d context of the canvas. */ this.context = this.canvas.getContext('2d'); - + /** * @property {PIXI.BaseTexture} baseTexture - Required Pixi var. */ this.baseTexture = new PIXI.BaseTexture(this.canvas); - + /** * @property {PIXI.Texture} texture - Required Pixi var. */ this.texture = new PIXI.Texture(this.baseTexture); - + /** * @property {Phaser.Frame} textureFrame - Dimensions of the renderable area. */ @@ -667,7 +667,7 @@

Source: tilemap/TilemapLayer.js

/** * @property {object} _mc - Local map data and calculation cache. - * @private + * @private */ this._mc = { @@ -696,7 +696,7 @@

Source: tilemap/TilemapLayer.js

/** * @property {array} _results - Local render loop var to help avoid gc spikes. - * @private + * @private */ this._results = []; @@ -717,8 +717,8 @@

Source: tilemap/TilemapLayer.js

// console.log('layer pu'); - Phaser.Image.prototype.postUpdate.call(this); - + Phaser.Image.prototype.postUpdate.call(this); + // Stops you being able to auto-scroll the camera if it's not following a sprite this.scrollX = this.game.camera.x * this.scrollFactorX; this.scrollY = this.game.camera.y * this.scrollFactorY; @@ -738,7 +738,7 @@

Source: tilemap/TilemapLayer.js

// this.children[i].postUpdate(); // } -} +}; /** * Sets the world size to match the size of this layer. @@ -750,10 +750,10 @@

Source: tilemap/TilemapLayer.js

this.game.world.setBounds(0, 0, this.layer.widthInPixels, this.layer.heightInPixels); -} +}; /** -* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it +* Take an x coordinate that doesn't account for scrollFactorX and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixX * @memberof Phaser.TilemapLayer @@ -775,10 +775,10 @@

Source: tilemap/TilemapLayer.js

return this._mc.x + (x - (this._mc.x / this.scrollFactorX)); -} +}; /** -* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it +* Take an x coordinate that _does_ account for scrollFactorX and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixX * @memberof Phaser.TilemapLayer @@ -795,10 +795,10 @@

Source: tilemap/TilemapLayer.js

return (this._mc.x / this.scrollFactorX) + (x - this._mc.x); -} +}; /** -* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it +* Take a y coordinate that doesn't account for scrollFactorY and 'fix' it * into a scrolled local space. Used primarily internally * @method Phaser.TilemapLayer#_fixY * @memberof Phaser.TilemapLayer @@ -820,10 +820,10 @@

Source: tilemap/TilemapLayer.js

return this._mc.y + (y - (this._mc.y / this.scrollFactorY)); -} +}; /** -* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it +* Take a y coordinate that _does_ account for scrollFactorY and 'unfix' it * back to camera space. Used primarily internally * @method Phaser.TilemapLayer#_unfixY * @memberof Phaser.TilemapLayer @@ -840,7 +840,7 @@

Source: tilemap/TilemapLayer.js

return (this._mc.y / this.scrollFactorY) + (y - this._mc.y); -} +}; /** * Convert a pixel value to a tile coordinate. @@ -855,7 +855,7 @@

Source: tilemap/TilemapLayer.js

return this.game.math.snapToFloor(this._fixX(x), this.map.tileWidth) / this.map.tileWidth; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -870,7 +870,7 @@

Source: tilemap/TilemapLayer.js

return this.game.math.snapToFloor(this._fixY(y), this.map.tileHeight) / this.map.tileHeight; -} +}; /** * Convert a pixel value to a tile coordinate. @@ -888,7 +888,7 @@

Source: tilemap/TilemapLayer.js

return point; -} +}; /** * Gets all tiles that intersect with the given line. @@ -934,7 +934,7 @@

Source: tilemap/TilemapLayer.js

return results; -} +}; /** * Get all tiles that exist within the given area, defined by the top-left corner, width and height. Values given are in pixels, not tiles. @@ -993,7 +993,7 @@

Source: tilemap/TilemapLayer.js

return this._results; -} +}; /** * Internal function to update maximum values. @@ -1020,7 +1020,7 @@

Source: tilemap/TilemapLayer.js

this.dirty = true; -} +}; /** * Renders the tiles to the layer canvas and pushes to the display. @@ -1103,7 +1103,7 @@

Source: tilemap/TilemapLayer.js

if (this.game.renderType === Phaser.WEBGL) { - // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); + // PIXI.updateWebGLTexture(this.baseTexture, renderSession.gl); PIXI.updateWebGLTexture(this.baseTexture, this.game.renderer.gl); } @@ -1112,7 +1112,7 @@

Source: tilemap/TilemapLayer.js

return true; -} +}; /** * Renders a collision debug overlay on-top of the canvas. Called automatically by render when debug = true. @@ -1182,14 +1182,14 @@

Source: tilemap/TilemapLayer.js

} -} +}; /** * @name Phaser.TilemapLayer#scrollX * @property {number} scrollX - Scrolls the map horizontally or returns the current x position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollX", { - + get: function () { return this._mc.x; }, @@ -1199,7 +1199,7 @@

Source: tilemap/TilemapLayer.js

if (value !== this._mc.x && value >= 0 && this.layer.widthInPixels > this.width) { this._mc.x = value; - + if (this._mc.x > (this.layer.widthInPixels - this.width)) { this._mc.x = this.layer.widthInPixels - this.width; @@ -1229,7 +1229,7 @@

Source: tilemap/TilemapLayer.js

* @property {number} scrollY - Scrolls the map vertically or returns the current y position. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "scrollY", { - + get: function () { return this._mc.y; }, @@ -1269,7 +1269,7 @@

Source: tilemap/TilemapLayer.js

* @property {number} collisionWidth - The width of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionWidth", { - + get: function () { return this._mc.cw; }, @@ -1289,7 +1289,7 @@

Source: tilemap/TilemapLayer.js

* @property {number} collisionHeight - The height of the collision tiles. */ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", { - + get: function () { return this._mc.ch; }, @@ -1324,7 +1324,7 @@

Source: tilemap/TilemapLayer.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TilemapParser.js.html b/docs/TilemapParser.js.html index 6e422d8535..6439279277 100644 --- a/docs/TilemapParser.js.html +++ b/docs/TilemapParser.js.html @@ -877,7 +877,7 @@

Source: tilemap/TilemapParser.js

properties: json.layers[i].objects[v].properties }; - + objects[json.layers[i].name].push(object); } else if (json.layers[i].objects[v].polyline) @@ -918,7 +918,7 @@

Source: tilemap/TilemapParser.js

for (var i = 0; i < map.tilesets.length; i++) { var set = map.tilesets[i]; - + var x = set.tileMargin; var y = set.tileMargin; @@ -963,7 +963,7 @@

Source: tilemap/TilemapParser.js

} -} +};
@@ -985,7 +985,7 @@

Source: tilemap/TilemapParser.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tileset.js.html b/docs/Tileset.js.html index e93f95f8bb..862dbd257d 100644 --- a/docs/Tileset.js.html +++ b/docs/Tileset.js.html @@ -705,7 +705,7 @@

Source: tilemap/Tileset.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Time.js.html b/docs/Time.js.html index 68ef030beb..1df4239053 100644 --- a/docs/Time.js.html +++ b/docs/Time.js.html @@ -731,7 +731,7 @@

Source: time/Time.js

{ this.time = this.now; this._justResumed = false; - + this.events.resume(); for (var i = 0; i < this._timers.length; i++) @@ -804,7 +804,7 @@

Source: time/Time.js

* @private */ gamePaused: function () { - + this._pauseStarted = this.now; this.events.pause(); @@ -903,7 +903,7 @@

Source: time/Time.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Timer.js.html b/docs/Timer.js.html index f89d2738ce..860d2d8fd7 100644 --- a/docs/Timer.js.html +++ b/docs/Timer.js.html @@ -936,7 +936,7 @@

Source: time/Timer.js

* @method Phaser.Timer#pause */ pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -953,7 +953,7 @@

Source: time/Timer.js

* @private */ _pause: function () { - + if (this.running && !this.expired) { this._pauseStarted = this.game.time.now; @@ -1060,7 +1060,7 @@

Source: time/Timer.js

Object.defineProperty(Phaser.Timer.prototype, "duration", { get: function () { - + if (this.running && this.nextTick > this._now) { return this.nextTick - this._now; @@ -1135,7 +1135,7 @@

Source: time/Timer.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TimerEvent.js.html b/docs/TimerEvent.js.html index 8fbb2be350..f919a60621 100644 --- a/docs/TimerEvent.js.html +++ b/docs/TimerEvent.js.html @@ -601,7 +601,7 @@

Source: time/TimerEvent.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Touch.js.html b/docs/Touch.js.html index 78648e8a27..cd0015cf5d 100644 --- a/docs/Touch.js.html +++ b/docs/Touch.js.html @@ -527,7 +527,7 @@

Source: input/Touch.js

* @property {Phaser.Game} game - A reference to the currently running game. */ this.game = game; - + /** * @property {boolean} disabled - You can disable all Touch events by setting disabled = true. While set all new touch events will be ignored. * @return {boolean} @@ -543,32 +543,32 @@

Source: input/Touch.js

* @property {function} touchStartCallback - A callback that can be fired on a touchStart event. */ this.touchStartCallback = null; - + /** * @property {function} touchMoveCallback - A callback that can be fired on a touchMove event. */ this.touchMoveCallback = null; - + /** * @property {function} touchEndCallback - A callback that can be fired on a touchEnd event. */ this.touchEndCallback = null; - + /** * @property {function} touchEnterCallback - A callback that can be fired on a touchEnter event. */ this.touchEnterCallback = null; - + /** * @property {function} touchLeaveCallback - A callback that can be fired on a touchLeave event. */ this.touchLeaveCallback = null; - + /** * @property {function} touchCancelCallback - A callback that can be fired on a touchCancel event. */ this.touchCancelCallback = null; - + /** * @property {boolean} preventDefault - If true the TouchEvent will have prevent.default called on it. * @default @@ -905,7 +905,7 @@

Source: input/Touch.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Tween.js.html b/docs/Tween.js.html index a811068dcb..c123e6dce7 100644 --- a/docs/Tween.js.html +++ b/docs/Tween.js.html @@ -634,7 +634,7 @@

Source: tween/Tween.js

* @default null */ this._onUpdateCallback = null; - + /** * @property {object} _onUpdateCallbackContext - The context in which to call the onUpdate callback. * @private @@ -673,7 +673,7 @@

Source: tween/Tween.js

// { // this._valuesStart[field] = parseFloat(object[field], 10); // } - + /** * @property {Phaser.Signal} onStart - The onStart event is fired when the Tween begins. */ @@ -858,7 +858,7 @@

Source: tween/Tween.js

// Simulate the tween. We will run for frameRate * (this._duration / 1000) (ms) var time = 0; - var total = frameRate * (this._duration / 1000); + var total = Math.floor(frameRate * (this._duration / 1000)); var tick = this._duration / total; var output = []; @@ -985,7 +985,7 @@

Source: tween/Tween.js

}, /** - * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. + * Set easing function this tween will use, i.e. Phaser.Easing.Linear.None. * * @method Phaser.Tween#easing * @param {function} easing - The easing function this tween will use, i.e. Phaser.Easing.Linear.None. @@ -1029,7 +1029,7 @@

Source: tween/Tween.js

/** * Loop a chain of tweens - * + * * Usage: * game.add.tween(p).to({ x: 700 }, 1000, Phaser.Easing.Linear.None, true) * .to({ y: 300 }, 1000, Phaser.Easing.Linear.None) @@ -1063,7 +1063,7 @@

Source: tween/Tween.js

}, /** - * Pauses the tween. + * Pauses the tween. * * @method Phaser.Tween#pause */ @@ -1081,7 +1081,7 @@

Source: tween/Tween.js

* @private */ _pause: function () { - + if (!this._codePaused) { this._paused = true; @@ -1246,7 +1246,7 @@

Source: tween/Tween.js

return true; } - + }; Phaser.Tween.prototype.constructor = Phaser.Tween; @@ -1271,7 +1271,7 @@

Source: tween/Tween.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html index f09ec85096..36b890ab92 100644 --- a/docs/TweenManager.js.html +++ b/docs/TweenManager.js.html @@ -515,9 +515,9 @@

Source: tween/TweenManager.js

/** * Phaser - TweenManager -* +* * @class Phaser.TweenManager -* @classdesc +* @classdesc * Phaser.Game has a single instance of the TweenManager through which all Tween objects are created and updated. * Tweens are hooked into the game clock and pause system, adjusting based on the game state. * @@ -535,13 +535,13 @@

Source: tween/TweenManager.js

* @property {Phaser.Game} game - Local reference to game. */ this.game = game; - + /** * @property {array<Phaser.Tween>} _tweens - All of the currently running tweens. * @private */ this._tweens = []; - + /** * @property {array<Phaser.Tween>} _add - All of the tweens queued to be added in the next update. * @private @@ -596,7 +596,7 @@

Source: tween/TweenManager.js

}, /** - * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. + * Create a tween object for a specific object. The object can be any JavaScript object or Phaser object such as Sprite. * * @method Phaser.TweenManager#create * @param {Object} object - Object the tween will be run on. @@ -763,7 +763,7 @@

Source: tween/TweenManager.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/Utils.js.html b/docs/Utils.js.html index 255e12985b..4e7c15131a 100644 --- a/docs/Utils.js.html +++ b/docs/Utils.js.html @@ -520,7 +520,7 @@

Source: utils/Utils.js

* @static */ Phaser.Utils = { - + /** * Get a unit dimension from a string. * @@ -581,7 +581,7 @@

Source: utils/Utils.js

} return array; - + }, /** @@ -589,7 +589,7 @@

Source: utils/Utils.js

* pad = the string to pad it out with (defaults to a space) * dir = 1 (left), 2 (right), 3 (both) * @method Phaser.Utils.pad - * @param {string} str - The target string. + * @param {string} str - The target string. * @param {number} len - The number of characters to be added. * @param {number} pad - The string to pad it out with (defaults to a space). * @param {number} [dir=3] The direction dir = 1 (left), 2 (right), 3 (both). @@ -608,17 +608,17 @@

Source: utils/Utils.js

switch (dir) { case 1: - str = Array(len + 1 - str.length).join(pad) + str; + str = new Array(len + 1 - str.length).join(pad) + str; break; case 3: var right = Math.ceil((padlen = len - str.length) / 2); var left = padlen - right; - str = Array(left+1).join(pad) + str + Array(right+1).join(pad); + str = new Array(left+1).join(pad) + str + new Array(right+1).join(pad); break; default: - str = str + Array(len + 1 - str.length).join(pad); + str = str + new Array(len + 1 - str.length).join(pad); break; } } @@ -649,7 +649,7 @@

Source: utils/Utils.js

// the "constructor" property of certain host objects, ie. |window.location| // https://bugzilla.mozilla.org/show_bug.cgi?id=814622 try { - if (obj.constructor && !hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) + if (obj.constructor && !({}).hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf")) { return false; } @@ -700,7 +700,7 @@

Source: utils/Utils.js

--i; } - for ( ; i < length; i++ ) + for (; i < length; i++) { // Only deal with non-null/undefined values if ((options = arguments[i]) != null) @@ -754,6 +754,7 @@

Source: utils/Utils.js

*/ if (typeof Function.prototype.bind != 'function') { + /* jshint freeze: false */ Function.prototype.bind = (function () { var slice = Array.prototype.slice; @@ -761,26 +762,29 @@

Source: utils/Utils.js

return function (thisArg) { var target = this, boundArgs = slice.call(arguments, 1); - + if (typeof target != 'function') { throw new TypeError(); } - + function bound() { var args = boundArgs.concat(slice.call(arguments)); target.apply(this instanceof bound ? this : thisArg, args); } - + bound.prototype = (function F(proto) { - proto && (F.prototype = proto); + if (proto) + { + F.prototype = proto; + } if (!(this instanceof F)) { return new F; } })(target.prototype); - + return bound; }; })(); @@ -794,7 +798,7 @@

Source: utils/Utils.js

Array.isArray = function (arg) { return Object.prototype.toString.call(arg) == '[object Array]'; - } + }; } @@ -817,7 +821,7 @@

Source: utils/Utils.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/World.js.html b/docs/World.js.html index b7ea0c5f9d..c9bc046921 100644 --- a/docs/World.js.html +++ b/docs/World.js.html @@ -546,7 +546,7 @@

Source: physics/p2/World.js

* @property {number} frameRate - The frame rate the world will be stepped at. Defaults to 1 / 60, but you can change here. Also see useElapsedTime property. * @default */ - this.frameRate = 1 / 60; + this.frameRate = 1 / 60; /** * @property {boolean} useElapsedTime - If true the frameRate value will be ignored and instead p2 will step with the value of Game.Time.physicsElapsed, which is a delta time value. @@ -656,7 +656,7 @@

Source: physics/p2/World.js

* @property {array} _toRemove - Internal var used to hold references to bodies to remove from the world on the next step. */ this._toRemove = []; - + /** * @property {array} collisionGroups - Internal var. */ @@ -788,7 +788,7 @@

Source: physics/p2/World.js

if (object.hasOwnProperty('body') && object.body === null) { object.body = new Phaser.Physics.P2.Body(this.game, object, object.x, object.y, 1); - object.body.debug = debug + object.body.debug = debug; object.anchor.set(0.5); } @@ -1088,7 +1088,7 @@

Source: physics/p2/World.js

} else { - this.bounds = new p2.Body({ mass: 0, position:[this.pxmi(cx), this.pxmi(cy)] }); + this.bounds = new p2.Body({ mass: 0, position: [this.pxmi(cx), this.pxmi(cy)] }); } if (left) @@ -1100,7 +1100,7 @@

Source: physics/p2/World.js

this._wallShapes[0].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[0], [this.pxmi(-hw), 0], 1.5707963267948966); } if (right) @@ -1112,7 +1112,7 @@

Source: physics/p2/World.js

this._wallShapes[1].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966 ); + this.bounds.addShape(this._wallShapes[1], [this.pxmi(hw), 0], -1.5707963267948966); } if (top) @@ -1124,7 +1124,7 @@

Source: physics/p2/World.js

this._wallShapes[2].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793 ); + this.bounds.addShape(this._wallShapes[2], [0, this.pxmi(-hh)], -3.141592653589793); } if (bottom) @@ -1136,7 +1136,7 @@

Source: physics/p2/World.js

this._wallShapes[3].collisionGroup = this.boundsCollisionGroup.mask; } - this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)] ); + this.bounds.addShape(this._wallShapes[3], [0, this.pxmi(hh)]); } this.world.addBody(this.bounds); @@ -1816,12 +1816,12 @@

Source: physics/p2/World.js

* @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. * @return {Phaser.Physics.P2.Body} The body */ @@ -1858,12 +1858,12 @@

Source: physics/p2/World.js

* @param {number} y - The y coordinate of Body. * @param {number} mass - The mass of the Body. A mass of 0 means a 'static' Body is created. * @param {boolean} [addToWorld=false] - Automatically add this Body to the world? (usually false as it won't have any shapes on construction). - * @param {object} options - An object containing the build options: + * @param {object} options - An object containing the build options: * @param {boolean} [options.optimalDecomp=false] - Set to true if you need optimal decomposition. Warning: very slow for polygons with more than 10 vertices. * @param {boolean} [options.skipSimpleCheck=false] - Set to true if you already know that the path is not intersecting itself. * @param {boolean|number} [options.removeCollinearPoints=false] - Set to a number (angle threshold value) to remove collinear points, or false to keep all points. - * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. - * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], + * @param {(number[]|...number)} points - An array of 2d vectors that form the convex or concave polygon. + * Either [[0,0], [0,1],...] or a flat array of numbers that will be interpreted as [x,y, x,y, ...], * or the arguments passed can be flat x,y values e.g. `setPolygon(options, x,y, x,y, x,y, ...)` where `x` and `y` are numbers. */ createParticle: function (x, y, mass, addToWorld, options, data) { @@ -1905,8 +1905,6 @@

Source: physics/p2/World.js

if (typeof addToWorld === 'undefined') { addToWorld = true; } - layer = map.getLayer(layer); - var output = []; for (var i = 0, len = map.collision[layer].length; i < len; i++) @@ -2050,7 +2048,7 @@

Source: physics/p2/World.js

* Convert p2 physics value (meters) to pixel scale. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpx * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -2065,7 +2063,7 @@

Source: physics/p2/World.js

* Convert pixel value to p2 physics scale (meters). * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxm * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -2080,7 +2078,7 @@

Source: physics/p2/World.js

* Convert p2 physics value (meters) to pixel scale and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#mpxi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -2095,7 +2093,7 @@

Source: physics/p2/World.js

* Convert pixel value to p2 physics scale (meters) and inverses it. * By default Phaser uses a scale of 20px per meter. * If you need to modify this you can over-ride these functions via the Physics Configuration object. - * + * * @method Phaser.Physics.P2#pxmi * @param {number} v - The value to convert. * @return {number} The scaled value. @@ -2113,7 +2111,7 @@

Source: physics/p2/World.js

* @property {number} friction - Friction between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "friction", { - + get: function () { return this.world.defaultFriction; @@ -2133,7 +2131,7 @@

Source: physics/p2/World.js

* @property {number} restitution - Default coefficient of restitution between colliding bodies. This value is used if no matching ContactMaterial is found for a Material pair. */ Object.defineProperty(Phaser.Physics.P2.prototype, "restituion", { - + get: function () { return this.world.defaultRestitution; @@ -2153,7 +2151,7 @@

Source: physics/p2/World.js

* @property {boolean} applySpringForces - Enable to automatically apply spring forces each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applySpringForces", { - + get: function () { return this.world.applySpringForces; @@ -2173,7 +2171,7 @@

Source: physics/p2/World.js

* @property {boolean} applyDamping - Enable to automatically apply body damping each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyDamping", { - + get: function () { return this.world.applyDamping; @@ -2193,7 +2191,7 @@

Source: physics/p2/World.js

* @property {boolean} applyGravity - Enable to automatically apply gravity each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "applyGravity", { - + get: function () { return this.world.applyGravity; @@ -2213,7 +2211,7 @@

Source: physics/p2/World.js

* @property {boolean} solveConstraints - Enable/disable constraint solving in each step. */ Object.defineProperty(Phaser.Physics.P2.prototype, "solveConstraints", { - + get: function () { return this.world.solveConstraints; @@ -2234,7 +2232,7 @@

Source: physics/p2/World.js

* @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "time", { - + get: function () { return this.world.time; @@ -2248,7 +2246,7 @@

Source: physics/p2/World.js

* @property {boolean} emitImpactEvent - Set to true if you want to the world to emit the "impact" event. Turning this off could improve performance. */ Object.defineProperty(Phaser.Physics.P2.prototype, "emitImpactEvent", { - + get: function () { return this.world.emitImpactEvent; @@ -2268,7 +2266,7 @@

Source: physics/p2/World.js

* @property {boolean} enableBodySleeping - Enable / disable automatic body sleeping. */ Object.defineProperty(Phaser.Physics.P2.prototype, "enableBodySleeping", { - + get: function () { return this.world.enableBodySleeping; @@ -2289,7 +2287,7 @@

Source: physics/p2/World.js

* @readonly */ Object.defineProperty(Phaser.Physics.P2.prototype, "total", { - + get: function () { return this.world.bodies.length; @@ -2318,7 +2316,7 @@

Source: physics/p2/World.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:22 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/World.js_.html b/docs/World.js_.html index f2ed858ee2..9af7488b7c 100644 --- a/docs/World.js_.html +++ b/docs/World.js_.html @@ -522,7 +522,7 @@

Source: physics/arcade/World.js

* @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Arcade = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -849,7 +849,7 @@

Source: physics/arcade/World.js

* @param {function} [overlapCallback=null] - An optional callback function that is called if the objects overlap. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then overlapCallback will only be called if processCallback returns true. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if an overlap occured otherwise false. + * @return {boolean} True if an overlap occured otherwise false. */ overlap: function (object1, object2, overlapCallback, processCallback, callbackContext) { @@ -890,7 +890,7 @@

Source: physics/arcade/World.js

* @param {function} [collideCallback=null] - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this is set then collision will only happen if processCallback returns true. The two objects will be passed to this function in the same order in which you specified them. * @param {object} [callbackContext] - The context in which to run the callbacks. - * @returns {boolean} True if a collision occured otherwise false. + * @return {boolean} True if a collision occured otherwise false. */ collide: function (object1, object2, collideCallback, processCallback, callbackContext) { @@ -1160,10 +1160,10 @@

Source: physics/arcade/World.js

collideSpriteVsTilemapLayer: function (sprite, tilemapLayer, collideCallback, processCallback, callbackContext) { this._mapData = tilemapLayer.getTiles( - sprite.body.position.x - sprite.body.tilePadding.x, - sprite.body.position.y - sprite.body.tilePadding.y, - sprite.body.width + sprite.body.tilePadding.x, - sprite.body.height + sprite.body.tilePadding.y, + sprite.body.position.x - sprite.body.tilePadding.x, + sprite.body.position.y - sprite.body.tilePadding.y, + sprite.body.width + sprite.body.tilePadding.x, + sprite.body.height + sprite.body.tilePadding.y, false, false); if (this._mapData.length === 0) @@ -1205,8 +1205,8 @@

Source: physics/arcade/World.js

/** * An internal function. Use Phaser.Physics.Arcade.collide instead. * - * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @private + * @method Phaser.Physics.Arcade#collideGroupVsTilemapLayer * @param {Phaser.Group} group - The Group to check. * @param {Phaser.TilemapLayer} tilemapLayer - The layer to check. * @param {function} collideCallback - An optional callback function that is called if the objects collide. The two objects will be passed to this function in the same order in which you specified them. @@ -1234,13 +1234,14 @@

Source: physics/arcade/World.js

/** * The core separation function to separate two physics bodies. * + * @private * @method Phaser.Physics.Arcade#separate * @param {Phaser.Physics.Arcade.Body} body1 - The first Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The second Body object to separate. * @param {function} [processCallback=null] - A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. * @param {object} [callbackContext] - The context in which to run the process callback. * @param {boolean} overlapOnly - Just run an overlap or a full collision. - * @returns {boolean} Returns true if the bodies collided, otherwise false. + * @return {boolean} Returns true if the bodies collided, otherwise false. */ separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { @@ -1312,11 +1313,13 @@

Source: physics/arcade/World.js

/** * The core separation function to separate two physics bodies on the x axis. + * + * @private * @method Phaser.Physics.Arcade#separateX * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateX: function (body1, body2, overlapOnly) { @@ -1425,11 +1428,13 @@

Source: physics/arcade/World.js

/** * The core separation function to separate two physics bodies on the y axis. + * + * @private * @method Phaser.Physics.Arcade#separateY * @param {Phaser.Physics.Arcade.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Arcade.Body} body2 - The Body object to separate. * @param {boolean} overlapOnly - If true the bodies will only have their overlap data set, no separation or exchange of velocity will take place. - * @returns {boolean} Returns true if the bodies were separated, otherwise false. + * @return {boolean} Returns true if the bodies were separated, otherwise false. */ separateY: function (body1, body2, overlapOnly) { @@ -1551,10 +1556,12 @@

Source: physics/arcade/World.js

/** * The core separation function to separate a physics body and a tile. + * + * @private * @method Phaser.Physics.Arcade#separateTile * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to collide against. - * @returns {boolean} Returns true if the body was separated, otherwise false. + * @return {boolean} Returns true if the body was separated, otherwise false. */ separateTile: function (i, body, tile) { @@ -1623,7 +1630,7 @@

Source: physics/arcade/World.js

return true; } } - + if (tile.faceTop || tile.faceBottom) { oy = this.tileCheckY(body, tile); @@ -1641,7 +1648,7 @@

Source: physics/arcade/World.js

return true; } } - + if (tile.faceLeft || tile.faceRight) { ox = this.tileCheckX(body, tile); @@ -1655,11 +1662,11 @@

Source: physics/arcade/World.js

/** * Check the body against the given tile on the X axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckX: function (body, tile) { @@ -1704,11 +1711,11 @@

Source: physics/arcade/World.js

/** * Check the body against the given tile on the Y axis. * + * @private * @method Phaser.Physics.Arcade#tileCheckY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {Phaser.Tile} tile - The tile to check. - * @returns {number} The amount of separation that occured. + * @return {number} The amount of separation that occured. */ tileCheckY: function (body, tile) { @@ -1752,11 +1759,12 @@

Source: physics/arcade/World.js

/** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationX - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} x - The x separation amount. - * @returns {boolean} Returns true as a pass-thru to the separateTile method. + * @return {boolean} Returns true as a pass-thru to the separateTile method. */ processTileSeparationX: function (body, x) { @@ -1784,12 +1792,13 @@

Source: physics/arcade/World.js

/** * Internal function to process the separation of a physics body from a tile. + * + * @private * @method Phaser.Physics.Arcade#processTileSeparationY - * @protected * @param {Phaser.Physics.Arcade.Body} body - The Body object to separate. * @param {number} y - The y separation amount. */ - processTileSeparationY: function (body, y, tile) { + processTileSeparationY: function (body, y) { if (y < 0) { @@ -1820,7 +1829,7 @@

Source: physics/arcade/World.js

* Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -1834,13 +1843,13 @@

Source: physics/arcade/World.js

if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(destination.y - displayObject.y, destination.x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceBetween(displayObject, destination) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -1854,7 +1863,7 @@

Source: physics/arcade/World.js

* Timings are approximate due to the way browser timers work. Allow for a variance of +- 50ms. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#moveToPointer * @param {any} displayObject - The display object to move. * @param {number} [speed=60] - The speed it will move, in pixels per second (default is 60 pixels/sec) @@ -1875,7 +1884,7 @@

Source: physics/arcade/World.js

// We know how many pixels we need to move, but how fast? speed = this.distanceToPointer(displayObject, pointer) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -1890,7 +1899,7 @@

Source: physics/arcade/World.js

* Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. * Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set drag or acceleration too high this object may not move at all) - * + * * @method Phaser.Physics.Arcade#moveToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to move towards. @@ -1905,13 +1914,13 @@

Source: physics/arcade/World.js

if (typeof maxTime === 'undefined') { maxTime = 0; } this._angle = Math.atan2(y - displayObject.y, x - displayObject.x); - + if (maxTime > 0) { // We know how many pixels we need to move, but how fast? speed = this.distanceToXY(displayObject, x, y) / (maxTime / 1000); } - + displayObject.body.velocity.x = Math.cos(this._angle) * speed; displayObject.body.velocity.y = Math.sin(this._angle) * speed; @@ -1922,7 +1931,7 @@

Source: physics/arcade/World.js

/** * Given the angle (in degrees) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromAngle * @param {number} angle - The angle in degrees calculated in clockwise positive direction (down = 90 degrees positive, right = 0 degrees positive, up = 90 degrees negative) * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -1941,7 +1950,7 @@

Source: physics/arcade/World.js

/** * Given the rotation (in radians) and speed calculate the velocity and return it as a Point object, or set it to the given point object. * One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) which will set the values directly to the sprites velocity and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#velocityFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -1960,7 +1969,7 @@

Source: physics/arcade/World.js

/** * Given the rotation (in radians) and speed calculate the acceleration and return it as a Point object, or set it to the given point object. * One way to use this is: accelerationFromRotation(rotation, 200, sprite.acceleration) which will set the values directly to the sprites acceleration and not create a new Point object. - * + * * @method Phaser.Physics.Arcade#accelerationFromRotation * @param {number} rotation - The angle in radians. * @param {number} [speed=60] - The speed it will move, in pixels per second sq. @@ -1981,7 +1990,7 @@

Source: physics/arcade/World.js

* You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToObject * @param {any} displayObject - The display object to move. * @param {any} destination - The display object to move towards. Can be any object but must have visible x/y properties. @@ -2010,7 +2019,7 @@

Source: physics/arcade/World.js

* You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToPointer * @param {any} displayObject - The display object to move. * @param {Phaser.Pointer} [pointer] - The pointer to move towards. Defaults to Phaser.Input.activePointer. @@ -2027,7 +2036,7 @@

Source: physics/arcade/World.js

if (typeof ySpeedMax === 'undefined') { ySpeedMax = 1000; } this._angle = this.angleToPointer(displayObject, pointer); - + displayObject.body.acceleration.setTo(Math.cos(this._angle) * speed, Math.sin(this._angle) * speed); displayObject.body.maxVelocity.setTo(xSpeedMax, ySpeedMax); @@ -2040,7 +2049,7 @@

Source: physics/arcade/World.js

* You must give a maximum speed value, beyond which the display object won't go any faster. * Note: The display object does not continuously track the target. If the target changes location during transit the display object will not modify its course. * Note: The display object doesn't stop moving once it reaches the destination coordinates. - * + * * @method Phaser.Physics.Arcade#accelerateToXY * @param {any} displayObject - The display object to move. * @param {number} x - The x coordinate to accelerate towards. @@ -2067,7 +2076,7 @@

Source: physics/arcade/World.js

/** * Find the distance between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#distanceBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -2077,7 +2086,7 @@

Source: physics/arcade/World.js

this._dx = source.x - target.x; this._dy = source.y - target.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -2086,7 +2095,7 @@

Source: physics/arcade/World.js

* Find the distance between a display object (like a Sprite) and the given x/y coordinates. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to move towards. @@ -2097,7 +2106,7 @@

Source: physics/arcade/World.js

this._dx = displayObject.x - x; this._dy = displayObject.y - y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, @@ -2106,7 +2115,7 @@

Source: physics/arcade/World.js

* Find the distance between a display object (like a Sprite) and a Pointer. If no Pointer is given the Input.activePointer is used. * The calculation is made from the display objects x/y coordinate. This may be the top-left if its anchor hasn't been changed. * If you need to calculate from the center of a display object instead use the method distanceBetweenCenters() - * + * * @method Phaser.Physics.Arcade#distanceToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -2118,14 +2127,14 @@

Source: physics/arcade/World.js

this._dx = displayObject.x - pointer.x; this._dy = displayObject.y - pointer.y; - + return Math.sqrt(this._dx * this._dx + this._dy * this._dy); }, /** * Find the angle in radians between two display objects (like Sprites). - * + * * @method Phaser.Physics.Arcade#angleBetween * @param {any} source - The Display Object to test from. * @param {any} target - The Display Object to test to. @@ -2142,7 +2151,7 @@

Source: physics/arcade/World.js

/** * Find the angle in radians between a display object (like a Sprite) and the given x/y coordinate. - * + * * @method Phaser.Physics.Arcade#angleToXY * @param {any} displayObject - The Display Object to test from. * @param {number} x - The x coordinate to get the angle to. @@ -2153,14 +2162,14 @@

Source: physics/arcade/World.js

this._dx = x - displayObject.x; this._dy = y - displayObject.y; - + return Math.atan2(this._dy, this._dx); }, - + /** * Find the angle in radians between a display object (like a Sprite) and a Pointer, taking their x/y and center into account. - * + * * @method Phaser.Physics.Arcade#angleToPointer * @param {any} displayObject - The Display Object to test from. * @param {Phaser.Pointer} [pointer] - The Phaser.Pointer to test to. If none is given then Input.activePointer is used. @@ -2172,7 +2181,7 @@

Source: physics/arcade/World.js

this._dx = pointer.worldX - displayObject.x; this._dy = pointer.worldY - displayObject.y; - + return Math.atan2(this._dy, this._dx); } @@ -2199,7 +2208,7 @@

Source: physics/arcade/World.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/World.js__.html b/docs/World.js__.html index c34308409e..5532955400 100644 --- a/docs/World.js__.html +++ b/docs/World.js__.html @@ -537,7 +537,7 @@

Source: physics/ninja/World.js

* @param {Phaser.Game} game reference to the current game instance. */ Phaser.Physics.Ninja = function (game) { - + /** * @property {Phaser.Game} game - Local reference to game. */ @@ -645,7 +645,7 @@

Source: physics/ninja/World.js

if (Array.isArray(object)) { - i = object.length; + var i = object.length; while (i--) { @@ -773,9 +773,6 @@

Source: physics/ninja/World.js

layer = map.getLayer(layer); - if (typeof addToWorld === 'undefined') { addToWorld = true; } - if (typeof optimize === 'undefined') { optimize = true; } - // If the bodies array is already populated we need to nuke it this.clearTilemapLayerBodies(map, layer); @@ -1079,11 +1076,9 @@

Source: physics/ninja/World.js

* @method Phaser.Physics.Ninja#separate * @param {Phaser.Physics.Ninja.Body} body1 - The Body object to separate. * @param {Phaser.Physics.Ninja.Body} body2 - The Body object to separate. - * @param {function} [processCallback=null] - UN-USED: A callback function that lets you perform additional checks against the two objects if they overlap. If this function is set then the sprites will only be collided if it returns true. - * @param {object} [callbackContext] - UN-USED: The context in which to run the process callback. * @returns {boolean} Returns true if the bodies collided, otherwise false. */ - separate: function (body1, body2, processCallback, callbackContext, overlapOnly) { + separate: function (body1, body2) { if (body1.type !== Phaser.Physics.NINJA || body2.type !== Phaser.Physics.NINJA) { @@ -1139,7 +1134,7 @@

Source: physics/ninja/World.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/World.js___.html b/docs/World.js___.html index 012f816892..1a3f5a8ba5 100644 --- a/docs/World.js___.html +++ b/docs/World.js___.html @@ -542,8 +542,8 @@

Source: core/World.js

* @property {Phaser.Camera} camera - Camera instance. */ this.camera = null; - -} + +}; Phaser.World.prototype = Object.create(Phaser.Group.prototype); Phaser.World.prototype.constructor = Phaser.World; @@ -566,7 +566,7 @@

Source: core/World.js

this.game.stage.addChild(this); -} +}; /** * Updates the size of this world. Note that this doesn't modify the world x/y coordinates, just the width and height. @@ -599,7 +599,7 @@

Source: core/World.js

this.game.physics.setBoundsToWorld(); -} +}; /** * Destroyer of worlds. @@ -611,7 +611,7 @@

Source: core/World.js

// World is a Group, so run a soft destruction on this and all children. this.destroy(true, true); -} +}; /** * @name Phaser.World#width @@ -735,7 +735,7 @@

Source: core/World.js

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/classes.list.html b/docs/classes.list.html index 2c2ee3fc3d..334e421992 100644 --- a/docs/classes.list.html +++ b/docs/classes.list.html @@ -935,7 +935,7 @@

Namespaces

Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/index.html b/docs/index.html index d18fc98b26..8814c0b9e5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -528,9 +528,9 @@

Phaser 2.0

-

Phaser 2.0.1

+

Phaser 2.0.2

Phaser is a fast, free and fun open source game framework for making desktop and mobile browser HTML5 games. It uses Pixi.js internally for fast 2D Canvas and WebGL rendering.

-

Version: 2.0.1 "Lyrelle" - Released: 24th March 2014

+

Version: 2.0.2 "Ghealdan" - Released: 28th March 2014

By Richard Davey, Photon Storm

Subscribe to our new Phaser Newsletter. We'll email you when new versions are released as well as send you our regular Phaser game making magazine.

Bitdeli Badge

-

What's new in 2.0.1?

-

The 2.0.1 release of Phaser is mostly a maintenance release. With 2.0 being such a significant upgrade there were bound to be some issues, and this release addresses them. One of the core things a lot of you kept telling us was that you need Arcade Physics to work pretty much exactly as it did in the past. So in 2.0.1 we've taken ArcadePhysics back another iteration, fixed a few of the most common complaints you had with it, and fixed every single physics example as well.

-

2.0.1 also brings the TypeScript definitions virtually bang up to date, covering P2 and Ninja physics, Arcade updates and more. Our thanks to Clarke for his continued support of these.

-

There are a few new features as well including a Phaser export script for PhysicsEditor (found in the resources folder), updates to the Particle Emitter and device enhancements. As always if you find a bug that you can confirm with a test case, please report it to us via github. If you think you may have found a bug, but aren't quite sure, please post it to the forum first.

+

What's new in 2.0.2?

+

The great thing about running an open source project are all the awesome contributions from the community, and this release reflects that. Aside from a raft of small but important ArcadePhysics fixes we've also had the entirely library jshinted and tidied up by xtian. We have had jshint configs in place for a while now, but he's forced us to make them part of the build process and helped tidy-up a number of things that had crept in.

+

We've also updated the included tutorial (and the web version) so it's now fully compatible with Phaser 2 and re-published and updated all of the API documentation, which you'll find in the docs folder in this release.

Welcome to Phaser

6 months ago we released Phaser 1.0 into the world. Suffice to say that since then we've been overwhelmed at the huge surge of developers taking to it! Our github repository is consistently in the top JavaScript lists, we've over 3200 stars at the time of writing, and a wonderful, vibrant and friendly community. Phaser 2 is a natural evolution of what we started. We've focused specifically on performance and expansion with this release. Lots of developers have already reported to us considerably speed increases just by swapping to Phaser 2 (reports of 200% faster speeds on mobile aren't unheard of!). There's also a full-body physics system available now, in the form of the excellent p2.js. The upgrade to Pixi 1.5 under the hood bought lots of new visual effects in, including blend modes and tints.

And we're also really pleased to have closed down over 550 issues reported on github. We literally went through every last bug reported to us, and fixed it. All kinds of little things that as a whole make the library that much more solid. With the 2.0 release we're now freezing the API. Before we have to admit that the API changed somewhat on a whim, and we moved things around and changed things without too much consideration for fellow developers. With 2.0 that stops - we've spent long enough on this release that we're now extremely happy with the organisation of classes and methods, and while we may still need to make small tweaks in the future, none of them will be API breaking without prior community approval first. This means if you're using Phaser to teach in classes, or writing a book / tutorials around it, this is the version to base off.

@@ -560,82 +559,29 @@

Getting Started Guides

There is also an un-official Getting Started Guide.

Phaser Logo

Change Log

-

Version 2.0.1 - "Lyrelle" - 24th March 2014

+

Version 2.0.2 - "Ghealdan" - 28th March 2014

Bug Fixes

    -
  • The Static, Kinematic and Dynamic consts that P2.Body uses were incorrect (fixes #563)
  • -
  • Sprite.destroy would fail if it had an Arcade Physics body, now added.
  • -
  • Group.getAt comparison updated (fixes #578)
  • -
  • Fixed the IE11 version check (fixes #579)
  • -
  • Ninja world collision to check right and bottom bounds (thanks dreadhorse, fix #571)
  • -
  • Group enableBody parameter was incorrectly assigned to the debug var (thanks BurnedToast, fix #565)
  • -
  • Fixed Tile callback check in Arcade Physics (fix #562)
  • -
  • Removed the examples build script from the Gruntfile (fix #592)
  • -
  • The P2 World wouldn't clear down fully on a State change, now properly clears out contacts, resets the bitmask, etc.
  • -
  • Button.onInputUpHandler wouldn't set an upFrame for a frame ID of zero, made the check more strict.
  • -
  • Fixed the Loader.preloadSprite crop effect on WebGL.
  • -
  • Fixed Grunt script that stopped the P2 constraint classes from building properly.
  • -
  • World.destroy incorrectly clashed with the Group.destroy method it over-rode, renamed to World.shutdown and updated StateManager accordingly.
  • -
  • World.shutdown now removes all children iteratively, calling destroy on each one, ultimately performing a soft reset of the World.
  • -
  • Objects with a scale.x or y of 0 are no longer considered valid for input (fix #602)
  • -
  • InputHandler will set the browser pointer back to default if destroyed while over (fix #602)
  • -
  • ArcadePhysics.separate doesn't pass over to seperateX/Y if overlapOnly is true (fix #604)
  • -
  • ArcadePhysics.collideSpriteVsSprite checks if both objects have bodies before processing.
  • -
  • Debug.spriteBounds will now take the position of the camera into consideration when rendering the bounds (fix #603)
  • -
  • InputHandler.dragFromCenter will now work regardless of the anchor point of the Sprite (fix #600)
  • -
  • Emitter.friction property removed and replaced with Emitter.particleDrag, which is now correctly applied.
  • -
  • ArcadePhysics.Body.reset incorrectly set the Body.rotation to Sprite.rotation instead of angle.
  • -
  • Emitter.emitParticle resets the rotation on the particle to zero before emitting it.
  • -
  • If no seed was given in the Game config object, the RandomDataGenerator wouldn't be started (thank tylerjhutchison fix #619)
  • -
  • p2 revolute pivots were wrongly signed (thanks georgiee, fix #621)
  • -
  • P2.Body.loadPolygon no longer modifies the Cache array (fix #613)
  • -
  • The volume given in Sound.play now over-rides that set in Sound.addMarker if specified (fix #623)
  • -
  • BitmapDatas when used as Game Object textures in WebGL now update themselves properly.
  • -
  • Timer.ms now correctly reports the ms time even if the Timer has been paused (thanks Nambew, fix #624)
  • -
  • If you added a Tileset to an empty map it would eventually throw an out of memory error.
  • -
  • Timer objects incorrectly set the first tick value on events if you added the events prior to starting them.
  • +
  • Sprite would glitch if it had an ArcadePhysics Body that was re-positioned out of loop.
  • +
  • Sprite would "fly off" if it had an ArcadePhysics Body that was re-positioned during an input handler.
  • +
  • Tween.generateData would enter an eternal loop if the total resulted in a float. Now wrapped in Math.floor.
  • +
  • ArcadePhysics.Body preUpdate has been modified to stop Sprites with non-1 scaling from gaining delta and moving off the screen (fix #644).
  • +
  • ArcadePhysics.Body deltaMaxY wasn't being correctly applied.
  • +
  • P2.World - Removing tilemap layer retrieval for object layers in convertCollisionObjects() (thanks bmceldowney, fix #653)
  • +
  • Calling Keyboard.stop() wouldn't let you call Keyboard.start() later on in the same game

Updated

    -
  • Updated Device.isConsoleOpen as it no longer works in Chrome. Revised code and documentation accordingly (fix #593)
  • -
  • Removed State.destroy empty method and replaced with State.shutdown, as that is what the StateManager expects (fix #586)
  • -
  • P2.removeBody will check if the body is part of the world before removing, this avoids a TypeError from the p2 layer.
  • -
  • Tilemap.createFromObjects has a new parameter: adjustY, which is true by default. Because Tiled uses a bottom-left coordinate system Phaser used to set the Sprite anchor to 0,1 to compensate. If adjustY is true it now reduces the y value by the object height instead.
  • -
  • Swapped the order of the _pollGamepads gamepads check, to stop the Chrome 'webkitGamepads is deprecated' error in the console.
  • -
  • Lots of TypeScript definitions updates (thanks as always to clark for these)
  • -
  • Removed Device.patchAndroidClearRectBug as it's no longer used internally.
  • -
  • Math.wrapAngle now supports radians (thanks Cryszon, #597)
  • -
  • Group.replace will now return the old child, the one that was replaced in the Group.
  • -
  • Group.destroy has a new parameter: soft. A soft destruction won't remove the Group from its parent or null game references. Default is false.
  • -
  • InputHandler.validForInput is a new method that checks if the handler and its owner should be considered for Pointer input handling or not.
  • -
  • ArcadePhysics.Body now checks the ArcadePhysics.World bounds, not the game bounds.
  • -
  • ArcadePhysics.Body has reverted to the 1.1.3 method of preUpdate, so you can now position sprites with x/y, drag them, etc, regardless of the Body.moves flag (issue #606)
  • -
  • ArcadePhysics.World now has setBounds and setBoundsToWorld methods, which are called automatically on world resizing.
  • -
  • ArcadePhysics.Body no longer sets the offset to match the anchor.
  • -
  • The StateManager is now responsible for clearing down input, timers, tweens, physics, camera and the World display list.
  • -
  • Removed the use of Int16Array from all Game Objects, swapped for standard Array. Phaser now runs on Android 2.x and IE9 again (fix #590)
  • -
  • When creating a Sprite (via Group.create or directly) with exists = false and a P2 body, the body is not added to the world.
  • -
  • Every Input class now checks to see if it has already been started. If so it doesn't add the listeners again unless they have been nulled.
  • -
  • Lots of fixes to the TypeScript definitions file (thanks as always to clark-stevenson for his tireless work on these)
  • -
  • Emitters now bring the particle they are about to emit to the top of the Group before doing so. Avoids particles hidden behind others.
  • -
  • ArcadePhysics.Body.setSize corrected to take the parameters as positive, not negative values.
  • -
  • ArcadePhysics.World.seperate will now check gravity totals to determine separation order. You can set World.forceX to true to always separate on X first and skip this check.
  • -
  • TileSprites now emit outOfBounds and enterBounds events accordingly.
  • -
  • You can now create multiple blank layers in a Tilemap.
  • +
  • The "Build your First Phaser Game" Tutorial has been updated for Phaser 2
  • +
  • Line.fromSprite now sets "fromCenter" to false by default as Sprite.center is deprecated in 2.x. Documentation and Examples updated to reflect this.
  • +
  • All the documentation has been re-published for 2.0.2.
  • +
  • Lots of ArcadePhysics.World methods have been marked as private where they shouldn't be called directly (separateX, etc)
  • +
  • xtian jshint fixed nearly every single file in the repository!

New Features

    -
  • Device.getUserMedia boolean added, useful if you need access to the webcam or microphone.
  • -
  • Math.removeRandom allows you to remove (and return) a random object from an array.
  • -
  • ArcadePhysics.World now has a checkCollision object which can be used to toggle collision against the 4 walls of its bounds.
  • -
  • Sprite.events.onEnterBounds added. This is dispatched if the Sprite leaves the bounds but then returns. The opposite of onOutOfBounds.
  • -
  • Timer.removeAll will remove and clear down all events, but keeps the Timer running.
  • -
  • Group.setAllChildren recursively checks if its children are Groups, and if so recursively applies the value to their children as well (feature #589)
  • -
  • Time.deltaCap lets you set a cap for the delta timer. It defaults to zero (which is disabled). If you use ArcadePhysics it gets set to 0.2, but you can modify as needed.
  • -
  • ArcadePhysics.Body has a deltaMax object, which allows you to cap the delta applied to the position to +- this value.
  • -
  • ArcadePhysics.Body now checks the Sprite scale automatically and adjusts the body size accordingly (fix #608)
  • -
  • Emitter.particleClass can now be set to any object that extends Phaser.Sprite, which will be emitted instead of a regular Sprite.
  • -
  • There is a brand new PhysicsEditor export script specifically for Phaser (in the resources folder), and new p2 polygon parsing functions thanks to georgiee.
  • +
  • Sprite.overlap lets you quickly check to see if the bounds of two display objects are intersecting or not, without having to use a physics system.
  • +
  • Keyboard.destroy will now clear all event listeners and any custom set callbacks or Keys.

There is an extensive Migration Guide available for those converting from Phaser 1.x to 2.x. In the guide we detail the API breaking changes and approach to our new physics system.

The full Change Log is at https://github.com/photonstorm/phaser/blob/master/changelog.md

@@ -653,9 +599,9 @@

Bower

Tanks

CDNJS

Thanks to a community member Phaser is now available on CDNJS. You can include the following in your html:

-

http://cdnjs.cloudflare.com/ajax/libs/phaser/2.0.1/phaser.min.js

+

http://cdnjs.cloudflare.com/ajax/libs/phaser/2.0.2/phaser.min.js

Or if you prefer you can leave the protocol off, so it works via http and https:

-

//cdnjs.cloudflare.com/ajax/libs/phaser/2.0.1/phaser.min.js

+

//cdnjs.cloudflare.com/ajax/libs/phaser/2.0.2/phaser.min.js

Requirements

Games created with Phaser require a modern web browser that supports the canvas tag. This includes Internet Explorer 9+, Firefox, Chrome, Safari and Opera. It also works on mobile web browsers including stock Android 2.x browser and above and iOS5 Mobile Safari and above.

If you need to support IE9 or Android 2.x then you must use a build of Phaser that doesn't include P2 physics. You'll find these in the build/custom folder.

@@ -733,6 +679,7 @@

Road Map

  • DragonBones support.
  • Cache to localStorage using If-Modified-Since. See github request
  • Allow for complex assets like Bitmap Fonts to be stored within a texture atlas.
  • +
  • Look at XDomainRequest for IE9 CORs issues.
  • Nadion

    Nadion is a set of powerful enhancements for Phaser that makes level building even easier. It includes features such as Trigger, Area, Alarms and Emitters, debug panels, state machines, parallax layer scrolling, 'developer mode' short-cuts and more.

    @@ -745,7 +692,7 @@

    Contributing

  • If you issue a Pull Request for Phaser, please only do so againt the dev branch and not against the master branch.

  • -
  • Before submitting a Pull Request please run your code through JSHint to check for stylistic or formatting errors. To use JSHint, first install it by running npm install jshint, then test your code by running jshint src. This isn't a strict requirement and we are happy to receive Pull Requests that haven't been JSHinted, so don't let it put you off contributing, but do know that we'll reformat your source before going live with it.

    +
  • Before submitting a Pull Request please run your code through JSHint to check for stylistic or formatting errors. To use JSHint, run grunt jshint. This isn't a strict requirement and we are happy to receive Pull Requests that haven't been JSHinted, so don't let it put you off contributing, but do know that we'll reformat your source before going live with it.

  • Bugs?

    @@ -776,7 +723,7 @@

    License

    Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html index f0f9d7a37a..3a52db9f75 100644 --- a/docs/namespaces.list.html +++ b/docs/namespaces.list.html @@ -935,7 +935,7 @@

    Namespaces

    Documentation generated by JSDoc 3.3.0-dev - on Mon Mar 24 2014 12:38:38 GMT-0000 (GMT) using the DocStrap template. + on Fri Mar 28 2014 01:41:23 GMT-0000 (GMT) using the DocStrap template. diff --git a/docs/old_RenderTexture.js.html b/docs/old_RenderTexture.js.html deleted file mode 100644 index 97a6b9fbb5..0000000000 --- a/docs/old_RenderTexture.js.html +++ /dev/null @@ -1,840 +0,0 @@ - - - - - - Phaser Source: gameobjects/old_RenderTexture.js - - - - - - - - - - -
    - - -
    - - -
    - -
    - - - -

    Source: gameobjects/old_RenderTexture.js

    - -
    -
    -
    /**
    -* @author       Richard Davey <rich@photonstorm.com>
    -* @copyright    2014 Photon Storm Ltd.
    -* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    -*/
    -
    -/**
    -* A RenderTexture is a special texture that allows any displayObject to be rendered to it.
    -* @class Phaser.RenderTexture
    -* @constructor
    -* @param {Phaser.Game} game - Current game instance.
    -* @param {string} key - Asset key for the render texture.
    -* @param {number} width - the width of the render texture.
    -* @param {number} height - the height of the render texture.
    -*/
    -Phaser.RenderTexture = function (game, key, width, height) {
    -
    -    /**
    -    * @property {Phaser.Game} game - A reference to the currently running game. 
    -    */
    -    this.game = game;
    -
    -    /**
    -    * @property {string} name - the name of the object. 
    -    */
    -    this.name = key;
    -
    -    PIXI.EventTarget.call(this);
    -
    -    /**
    -    * @property {number} width - the width. 
    -    */
    -    this.width = width || 100;
    -    
    -    /**
    -    * @property {number} height - the height. 
    -    */
    -    this.height = height || 100;
    -
    -    /**
    -    * @property {PIXI.mat3} indetityMatrix - Matrix object. 
    -    */
    -    this.indetityMatrix = PIXI.mat3.create();
    -
    -    /**
    -    * @property {PIXI.Rectangle} frame - The frame for this texture. 
    -    */
    -    this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
    -
    -    /**
    -    * @property {number} type - Base Phaser object type. 
    -    */
    -    this.type = Phaser.RENDERTEXTURE;
    -
    -    this._tempPoint = { x: 0, y: 0 };
    -
    -    if (PIXI.gl)
    -    {
    -        this.initWebGL();
    -    }
    -    else
    -    {
    -        this.initCanvas();
    -    }
    -    
    -};
    -
    -Phaser.RenderTexture.prototype = Object.create(PIXI.Texture.prototype);
    -Phaser.RenderTexture.prototype.constructor = PIXI.RenderTexture;
    -
    -/**
    -* This function will draw the display object to the texture. If the display object is a Group or has children it will
    -* draw all children as well.
    -* 
    -* @method Phaser.RenderTexture#render
    -* @memberof Phaser.RenderTexture
    -* @param {DisplayObject} displayObject - The display object to render this texture on.
    -* @param {Phaser.Point} [position] - Where to draw the display object.
    -* @param {boolean} [clear=false] - If true the texture will be cleared before the displayObject is drawn.
    -* @param {boolean} [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
    -*/
    -Phaser.RenderTexture.prototype.render = function(displayObject, position, clear, renderHidden) {
    -
    -    if (typeof position === 'undefined') { position = false; }
    -    if (typeof clear === 'undefined') { clear = false; }
    -    if (typeof renderHidden === 'undefined') { renderHidden = false; }
    -
    -    if (PIXI.gl)
    -    {
    -        this.renderWebGL(displayObject, position, clear, renderHidden);
    -    }
    -    else
    -    {
    -        this.renderCanvas(displayObject, position, clear, renderHidden);
    -    }
    -
    -}
    -
    -/**
    -* This function will draw the display object to the texture at the given x/y coordinates.
    -* If the display object is a Group or has children it will draw all children as well.
    -*
    -* @method Phaser.RenderTexture#renderXY
    -* @memberof Phaser.RenderTexture
    -* @param {DisplayObject} displayObject - The display object to render this texture on.
    -* @param {number} x - The x coordinate to draw the display object at.
    -* @param {number} y - The y coordinate to draw the display object at.
    -* @param {boolean} [clear=false] - If true the texture will be cleared before the displayObject is drawn.
    -* @param {boolean} [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
    -*/
    -Phaser.RenderTexture.prototype.renderXY = function(displayObject, x, y, clear, renderHidden) {
    -
    -    this._tempPoint.x = x;
    -    this._tempPoint.y = y;
    -
    -    this.render(displayObject, this._tempPoint, clear, renderHidden);
    -
    -}
    -
    -/**
    -* Initializes the webgl data for this texture
    -*
    -* @method Phaser.RenderTexture#initWebGL
    -* @memberof Phaser.RenderTexture
    -* @private
    -*/
    -Phaser.RenderTexture.prototype.initWebGL = function() {
    -
    -    var gl = PIXI.gl;
    -    this.glFramebuffer = gl.createFramebuffer();
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
    -
    -    this.glFramebuffer.width = this.width;
    -    this.glFramebuffer.height = this.height;
    -
    -    this.baseTexture = new PIXI.BaseTexture();
    -
    -    this.baseTexture.width = this.width;
    -    this.baseTexture.height = this.height;
    -
    -    this.baseTexture._glTexture = gl.createTexture();
    -    gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture);
    -
    -    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  this.width,  this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
    -    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
    -
    -    this.baseTexture.isRender = true;
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
    -    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.baseTexture._glTexture, 0);
    -
    -    // create a projection matrix..
    -    this.projection = new PIXI.Point(this.width/2 , -this.height/2);
    -
    -    // set the correct render function..
    -    // this.render = this.renderWebGL;
    -}
    -
    -/**
    -* Resizes the RenderTexture.
    -*
    -* @method Phaser.RenderTexture#resize
    -* @memberof Phaser.RenderTexture
    -*/
    -Phaser.RenderTexture.prototype.resize = function(width, height)
    -{
    -
    -    this.width = width;
    -    this.height = height;
    -    
    -    if(PIXI.gl)
    -    {
    -        this.projection.x = this.width/2
    -        this.projection.y = -this.height/2;
    -    
    -        var gl = PIXI.gl;
    -        gl.bindTexture(gl.TEXTURE_2D, this.baseTexture._glTexture);
    -        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA,  this.width,  this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
    -    }
    -    else
    -    {
    -        
    -        this.frame.width = this.width
    -        this.frame.height = this.height;
    -        this.renderer.resize(this.width, this.height);
    -    }
    -}
    -
    -/**
    -* Initializes the canvas data for this texture
    -*
    -* @method Phaser.RenderTexture#initCanvas
    -* @memberof Phaser.RenderTexture
    -* @private
    -*/
    -Phaser.RenderTexture.prototype.initCanvas = function()
    -{
    -    this.renderer = new PIXI.CanvasRenderer(this.width, this.height, null, 0);
    -
    -    this.baseTexture = new PIXI.BaseTexture(this.renderer.view);
    -    this.frame = new PIXI.Rectangle(0, 0, this.width, this.height);
    -
    -    // this.render = this.renderCanvas;
    -}
    -
    -/**
    -* This function will draw the display object to the texture.
    -*
    -* @method Phaser.RenderTexture#renderWebGL
    -* @memberof Phaser.RenderTexture
    -* @private
    -* @param {DisplayObject} displayObject - The display object to render this texture on.
    -* @param {Phaser.Point} [position] - Where to draw the display object.
    -* @param {boolean} [clear=false] - If true the texture will be cleared before the displayObject is drawn.
    -* @param {boolean} [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
    -*/
    -Phaser.RenderTexture.prototype.renderWebGL = function(displayObject, position, clear, renderHidden)
    -{
    -    var gl = PIXI.gl;
    -
    -    // enable the alpha color mask..
    -    gl.colorMask(true, true, true, true);
    -
    -    gl.viewport(0, 0, this.width, this.height);
    -
    -    gl.bindFramebuffer(gl.FRAMEBUFFER, this.glFramebuffer );
    -
    -    if (clear)
    -    {
    -        gl.clearColor(0,0,0, 0);
    -        gl.clear(gl.COLOR_BUFFER_BIT);
    -    }
    -
    -    // THIS WILL MESS WITH HIT TESTING!
    -    var children = displayObject.children;
    -
    -    //TODO -? create a new one??? dont think so!
    -    var originalWorldTransform = displayObject.worldTransform;
    -    displayObject.worldTransform = PIXI.mat3.create();//sthis.indetityMatrix;
    -    // modify to flip...
    -    displayObject.worldTransform[4] = -1;
    -    displayObject.worldTransform[5] = this.projection.y * -2;
    -
    -    if (position)
    -    {
    -        displayObject.worldTransform[2] = position.x;
    -        displayObject.worldTransform[5] -= position.y;
    -    }
    -    
    -    PIXI.visibleCount++;
    -    displayObject.vcount = PIXI.visibleCount;
    -    
    -    for (var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    var renderGroup = displayObject.__renderGroup;
    -
    -    if (renderGroup)
    -    {
    -        if (displayObject == renderGroup.root)
    -        {
    -            renderGroup.render(this.projection, this.glFramebuffer);
    -        }
    -        else
    -        {
    -            renderGroup.renderSpecific(displayObject, this.projection, this.glFramebuffer);
    -        }
    -    }
    -    else
    -    {
    -        if (!this.renderGroup)
    -        {
    -            this.renderGroup = new PIXI.WebGLRenderGroup(gl);
    -        }
    -
    -        this.renderGroup.setRenderable(displayObject);
    -        this.renderGroup.render(this.projection, this.glFramebuffer);
    -    }
    -    
    -    displayObject.worldTransform = originalWorldTransform;
    -}
    -
    -/**
    - * This function will draw the display object to the texture.
    - *
    -* @method Phaser.RenderTexture#renderCanvas
    -* @memberof Phaser.RenderTexture
    -* @private
    -* @param {DisplayObject} displayObject - The display object to render this texture on.
    -* @param {Phaser.Point} [position] - Where to draw the display object.
    -* @param {boolean} [clear=false] - If true the texture will be cleared before the displayObject is drawn.
    -* @param {boolean} [renderHidden=false] - If true displayObjects that have their visible property set to false will still be rendered.
    -*/
    -Phaser.RenderTexture.prototype.renderCanvas = function(displayObject, position, clear, renderHidden)
    -{
    -    var children = displayObject.children;
    -
    -    displayObject.worldTransform = PIXI.mat3.create();
    -    
    -    if (position)
    -    {
    -        displayObject.worldTransform[2] = position.x;
    -        displayObject.worldTransform[5] = position.y;
    -    }
    -
    -    for (var i = 0, j = children.length; i < j; i++)
    -    {
    -        children[i].updateTransform();
    -    }
    -
    -    if (clear)
    -    {
    -        this.renderer.context.clearRect(0, 0, this.width, this.height);
    -    }
    -
    -    this.renderer.renderDisplayObject(displayObject, renderHidden);
    -    
    -    this.renderer.context.setTransform(1, 0, 0, 1, 0, 0);
    -
    -}
    -
    -
    -
    - - - - - -
    - -
    -
    - - - - Phaser Copyright © 2012-2014 Photon Storm Ltd. - -
    - - - Documentation generated by JSDoc 3.3.0-dev - on Sat Feb 08 2014 07:19:40 GMT-0000 (GMT) using the DocStrap template. - -
    -
    - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/docs/old_Sprite.js.html b/docs/old_Sprite.js.html deleted file mode 100644 index 5ae387446d..0000000000 --- a/docs/old_Sprite.js.html +++ /dev/null @@ -1,1724 +0,0 @@ - - - - - - Phaser Source: gameobjects/old_Sprite.js - - - - - - - - - - -
    - - -
    - - -
    - -
    - - - -

    Source: gameobjects/old_Sprite.js

    - -
    -
    -
    /**
    -* @author       Richard Davey <rich@photonstorm.com>
    -* @copyright    2014 Photon Storm Ltd.
    -* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
    -*/
    -
    -/**
    -* @class Phaser.Sprite
    -*
    -* @classdesc Create a new `Sprite` object. Sprites are the lifeblood of your game, used for nearly everything visual.
    -*
    -* At its most basic a Sprite consists of a set of coordinates and a texture that is rendered to the canvas.
    -* They also contain additional properties allowing for physics motion (via Sprite.body), input handling (via Sprite.input),
    -* events (via Sprite.events), animation (via Sprite.animations), camera culling and more. Please see the Examples for use cases.
    -*
    -* @constructor
    -* @param {Phaser.Game} game - A reference to the currently running game.
    -* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    -* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    -* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
    -* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    -*/
    -Phaser.Sprite = function (game, x, y, key, frame) {
    -
    -    x = x || 0;
    -    y = y || 0;
    -    key = key || null;
    -    frame = frame || null;
    -    
    -    /**
    -    * @property {Phaser.Game} game - A reference to the currently running Game.
    -    */
    -    this.game = game;
    - 
    -    /**
    -    * @property {boolean} exists - If exists = false then the Sprite isn't updated by the core game loop or physics subsystem at all.
    -    * @default
    -    */
    -    this.exists = true;
    -
    -    /**
    -    * @property {boolean} alive - This is a handy little var your game can use to determine if a sprite is alive or not, it doesn't effect rendering.
    -    * @default
    -    */
    -    this.alive = true;
    -
    -    /**
    -    * @property {Phaser.Group|Phaser.Sprite} parent - The parent of this Sprite.
    -    */
    -    // this.group = null;
    -
    -    /**
    -    * @property {string} name - The user defined name given to this Sprite.
    -    * @default
    -    */
    -    this.name = '';
    -
    -    /**
    -    * @property {number} type - The const type of this object.
    -    * @readonly
    -    */
    -    this.type = Phaser.SPRITE;
    -
    -    /**
    -    * @property {number} renderOrderID - Used by the Renderer and Input Manager to control picking order.
    -    * @default
    -    */
    -    this.renderOrderID = -1;
    -
    -    /**
    -    * If you would like the Sprite to have a lifespan once 'born' you can set this to a positive value. Handy for particles, bullets, etc.
    -    * The lifespan is decremented by game.time.elapsed each update, once it reaches zero the kill() function is called.
    -    * @property {number} lifespan - The lifespan of the Sprite (in ms) before it will be killed.
    -    * @default
    -    */
    -    this.lifespan = 0;
    -
    -    /**
    -    * @property {Phaser.Events} events - The Events you can subscribe to that are dispatched when certain things happen on this Sprite or its components.
    -    */
    -    this.events = new Phaser.Events(this);
    -
    -    /**
    -    * @property {Phaser.AnimationManager} animations - This manages animations of the sprite. You can modify animations through it (see Phaser.AnimationManager)
    -    */
    -    this.animations = new Phaser.AnimationManager(this);
    -
    -    /**
    -    * @property {Phaser.InputHandler} input - The Input Handler Component.
    -    */
    -    this.input = new Phaser.InputHandler(this);
    -
    -    /**
    -    *  @property {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture, BitmapData or PIXI.Texture.
    -    */
    -    this.key = key;
    -
    -    /**
    -    *  @property {Phaser.Frame} currentFrame - A reference to the currently displayed frame.
    -    */
    -    this.currentFrame = null;
    -
    -    if (key instanceof Phaser.RenderTexture)
    -    {
    -        PIXI.Sprite.call(this, key);
    -
    -        this.currentFrame = this.game.cache.getTextureFrame(key.name);
    -    }
    -    else if (key instanceof Phaser.BitmapData)
    -    {
    -        PIXI.Sprite.call(this, key.texture, key.textureFrame);
    -
    -        this.currentFrame = key.textureFrame;
    -    }
    -    else if (key instanceof PIXI.Texture)
    -    {
    -        PIXI.Sprite.call(this, key);
    -
    -        this.currentFrame = frame;
    -    }
    -    else
    -    {
    -        if (key === null || typeof key === 'undefined')
    -        {
    -            key = '__default';
    -            this.key = key;
    -        }
    -        else if (typeof key === 'string' && this.game.cache.checkImageKey(key) === false)
    -        {
    -            key = '__missing';
    -            this.key = key;
    -        }
    -
    -        PIXI.Sprite.call(this, PIXI.TextureCache[key]);
    -
    -        if (this.game.cache.isSpriteSheet(key))
    -        {
    -            this.animations.loadFrameData(this.game.cache.getFrameData(key));
    -
    -            if (frame !== null)
    -            {
    -                if (typeof frame === 'string')
    -                {
    -                    this.frameName = frame;
    -                }
    -                else
    -                {
    -                    this.frame = frame;
    -                }
    -            }
    -        }
    -        else
    -        {
    -            this.currentFrame = this.game.cache.getFrame(key);
    -        }
    -    }
    -
    -    /**
    -    * The rectangular area from the texture that will be rendered.
    -    * @property {Phaser.Rectangle} textureRegion
    -    */
    -    this.textureRegion = new Phaser.Rectangle(this.texture.frame.x, this.texture.frame.y, this.texture.frame.width, this.texture.frame.height);
    -
    -    /**
    -    * The anchor sets the origin point of the texture.
    -    * The default is 0,0 this means the textures origin is the top left 
    -    * Setting than anchor to 0.5,0.5 means the textures origin is centered
    -    * Setting the anchor to 1,1 would mean the textures origin points will be the bottom right
    -    *
    -    * @property {Phaser.Point} anchor - The anchor around which rotation and scaling takes place.
    -    */
    -    // this.anchor = new Phaser.Point();
    -
    -    // this.position.x = x;
    -    // this.position.y = y;
    -
    -    /**
    -    * @property {number} x - The x coordinate in world space of this Sprite.
    -    */
    -    this.x = x;
    -    
    -    /**
    -    * @property {number} y - The y coordinate in world space of this Sprite.
    -    */
    -    this.y = y;
    -
    -
    -    /**
    -    * @property {Phaser.Point} world - The world coordinates of this Sprite. This differs from the x/y coordinates which are relative to the Sprites container.
    -    */
    -    this.world = new Phaser.Point(x, y);
    -
    -    /**
    -    * Should this Sprite be automatically culled if out of range of the camera?
    -    * A culled sprite has its renderable property set to 'false'.
    -    *
    -    * @property {boolean} autoCull - A flag indicating if the Sprite should be automatically camera culled or not.
    -    * @default
    -    */
    -    this.autoCull = false;
    -
    -    /**
    -    * @property {Phaser.Point} scale - The scale of the Sprite when rendered. By default it's set to 1 (no scale). You can modify it via scale.x or scale.y or scale.setTo(x, y). A value of 1 means no change to the scale, 0.5 means "half the size", 2 means "twice the size", etc.
    -    */
    -    // this.scale = new Phaser.Point(1, 1);
    -
    -    /**
    -    * @property {object} _cache - A mini cache for storing all of the calculated values.
    -    * @private
    -    */
    -    this._cache = {
    -
    -        fresh: true,
    -        dirty: false,
    -
    -        //  Transform cache
    -        a00: -1,
    -        a01: -1,
    -        a02: -1,
    -        a10: -1,
    -        a11: -1,
    -        a12: -1,
    -        id: -1,
    -
    -        //  Input specific transform cache
    -        i01: -1,
    -        i10: -1,
    -        idi: -1,
    -
    -        //  Bounds check
    -        left: null,
    -        right: null,
    -        top: null,
    -        bottom: null,
    -
    -        //  delta cache
    -        prevX: x,
    -        prevY: y,
    -
    -        //  The previous calculated position
    -        x: -1,
    -        y: -1,
    -
    -        //  The actual scale values based on the worldTransform
    -        scaleX: 1,
    -        scaleY: 1,
    -
    -        //  The width/height of the image, based on the un-modified frame size multiplied by the final calculated scale size
    -        width: this.currentFrame.sourceSizeW,
    -        height: this.currentFrame.sourceSizeH,
    -
    -        //  The actual width/height of the image if from a trimmed atlas, multiplied by the final calculated scale size
    -        halfWidth: Math.floor(this.currentFrame.sourceSizeW / 2),
    -        halfHeight: Math.floor(this.currentFrame.sourceSizeH / 2),
    -
    -        //  The width/height of the image, based on the un-modified frame size multiplied by the final calculated scale size
    -        calcWidth: -1,
    -        calcHeight: -1,
    -
    -        //  The current frame details
    -        // frameID: this.currentFrame.uuid, frameWidth: this.currentFrame.width, frameHeight: this.currentFrame.height,
    -        frameID: -1,
    -        frameWidth: this.currentFrame.width,
    -        frameHeight: this.currentFrame.height,
    -
    -        //  If this sprite visible to the camera (regardless of being set to visible or not)
    -        cameraVisible: true,
    -
    -        //  Crop cache
    -        cropX: 0,
    -        cropY: 0,
    -        cropWidth: this.currentFrame.sourceSizeW,
    -        cropHeight: this.currentFrame.sourceSizeH
    -
    -    };
    -  
    -    /**
    -    * @property {Phaser.Point} offset - Corner point defaults. Should not typically be modified.
    -    */
    -    this.offset = new Phaser.Point();
    -    
    -    /**
    -    * @property {Phaser.Point} center - A Point containing the center coordinate of the Sprite. Takes rotation and scale into account.
    -    */
    -    this.center = new Phaser.Point(x + Math.floor(this._cache.width / 2), y + Math.floor(this._cache.height / 2));
    -   
    -    /**
    -    * @property {Phaser.Point} topLeft - A Point containing the top left coordinate of the Sprite. Takes rotation and scale into account.
    -    */
    -    this.topLeft = new Phaser.Point(x, y);
    -    
    -    /**
    -    * @property {Phaser.Point} topRight - A Point containing the top right coordinate of the Sprite. Takes rotation and scale into account.
    -    */
    -    this.topRight = new Phaser.Point(x + this._cache.width, y);
    -    
    -    /**
    -    * @property {Phaser.Point} bottomRight - A Point containing the bottom right coordinate of the Sprite. Takes rotation and scale into account.
    -    */
    -    this.bottomRight = new Phaser.Point(x + this._cache.width, y + this._cache.height);
    -    
    -    /**
    -    * @property {Phaser.Point} bottomLeft - A Point containing the bottom left coordinate of the Sprite. Takes rotation and scale into account.
    -    */
    -    this.bottomLeft = new Phaser.Point(x, y + this._cache.height);
    -    
    -    /**
    -    * This Rectangle object fully encompasses the Sprite and is updated in real-time.
    -    * The bounds is the full bounding area after rotation and scale have been taken into account. It should not be modified directly.
    -    * It's used for Camera culling and physics body alignment.
    -    * @property {Phaser.Rectangle} bounds
    -    */
    -    this.bounds = new Phaser.Rectangle(x, y, this._cache.width, this._cache.height);
    -    
    -    /**
    -    * @property {Phaser.Physics.Arcade.Body} body - By default Sprites have a Phaser.Physics Body attached to them. You can operate physics actions via this property, or null it to skip all physics updates.
    -    */
    -    this.body = new Phaser.Physics.Arcade.Body(this);
    -
    -    /**
    -    * @property {number} health - Health value. Used in combination with damage() to allow for quick killing of Sprites.
    -    */
    -    this.health = 1;
    -
    -    /**
    -    * @property {boolean} inWorld - This value is set to true if the Sprite is positioned within the World, otherwise false.
    -    */
    -    this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds);
    -    
    -    /**
    -    * @property {number} inWorldThreshold - A threshold value applied to the inWorld check. If you don't want a Sprite to be considered "out of the world" until at least 100px away for example then set it to 100.
    -    * @default
    -    */
    -    this.inWorldThreshold = 0;
    -
    -    /**
    -    * @property {boolean} outOfBoundsKill - If true the Sprite is killed as soon as Sprite.inWorld is false.
    -    * @default
    -    */
    -    this.outOfBoundsKill = false;
    -    
    -    /**
    -    * @property {boolean} _outOfBoundsFired - Internal flag.
    -    * @private
    -    * @default
    -    */
    -    this._outOfBoundsFired = false;
    -
    -    /**
    -    * A Sprite that is fixed to the camera ignores the position of any ancestors in the display list and uses its x/y coordinates as offsets from the top left of the camera.
    -    * @property {boolean} fixedToCamera - Fixes this Sprite to the Camera.
    -    * @default
    -    */
    -    this.fixedToCamera = false;
    -
    -    /**
    -    * @property {Phaser.Point} cameraOffset - If this Sprite is fixed to the camera then use this Point to specify how far away from the Camera x/y it's rendered.
    -    */
    -    this.cameraOffset = new Phaser.Point(x, y);
    -
    -    /**
    -    * You can crop the Sprites texture by modifying the crop properties. For example crop.width = 50 would set the Sprite to only render 50px wide.
    -    * The crop is only applied if you have set Sprite.cropEnabled to true.
    -    * @property {Phaser.Rectangle} crop - The crop Rectangle applied to the Sprite texture before rendering.
    -    * @default
    -    */
    -    this.crop = new Phaser.Rectangle(0, 0, this._cache.width, this._cache.height);
    -
    -    /**
    -    * @property {boolean} cropEnabled - If true the Sprite.crop property is used to crop the texture before render. Set to false to disable.
    -    * @default
    -    */
    -    this.cropEnabled = false;
    -
    -    /**
    -    * @property {boolean} debug - Handy flag to use with Game.enableStep
    -    * @default
    -    */
    -    this.debug = false;
    -
    -    this.updateCache();
    -    this.updateBounds();
    -
    -    /**
    -    * @property {Phaser.Point} pivot - The pivot point of the displayObject that it rotates around.
    -    */
    -
    -};
    -
    -//  Needed to keep the PIXI.Sprite constructor in the prototype chain (as the core pixi renderer uses an instanceof check sadly)
    -Phaser.Sprite.prototype = Object.create(PIXI.Sprite.prototype);
    -Phaser.Sprite.prototype.constructor = Phaser.Sprite;
    -
    -/**
    -* Automatically called by World.preUpdate. Handles cache updates, lifespan checks, animation updates and physics updates.
    -*
    -* @method Phaser.Sprite#preUpdate
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.preUpdate = function() {
    -
    -    if (this._cache.fresh)
    -    {
    -        this.world.setTo(this.parent.position.x + this.position.x, this.parent.position.y + this.position.y);
    -        this.worldTransform[2] = this.world.x;
    -        this.worldTransform[5] = this.world.y;
    -        this._cache.fresh = false;
    -
    -        if (this.body)
    -        {
    -            this.body.x = (this.world.x - (this.anchor.x * this.width)) + this.body.offset.x;
    -            this.body.y = (this.world.y - (this.anchor.y * this.height)) + this.body.offset.y;
    -            this.body.preX = this.body.x;
    -            this.body.preY = this.body.y;
    -        }
    -
    -        return;
    -    }
    -
    -    if (!this.exists || (this.group && !this.group.exists))
    -    {
    -        this.renderOrderID = -1;
    -        
    -        // Skip children if not exists
    -        return false;
    -    }
    -
    -    if (this.lifespan > 0)
    -    {
    -        this.lifespan -= this.game.time.elapsed;
    -
    -        if (this.lifespan <= 0)
    -        {
    -            this.kill();
    -            return false;
    -        }
    -    }
    -
    -    this._cache.dirty = false;
    -
    -    if (this.visible)
    -    {
    -        this.renderOrderID = this.game.world.currentRenderOrderID++;
    -    }
    -
    -    this.updateCache();
    -
    -    this.updateAnimation();
    -
    -    this.updateCrop();
    -
    -    //  Re-run the camera visibility check
    -    if (this._cache.dirty || this.world.x !== this._cache.prevX || this.world.y !== this._cache.prevY)
    -    {
    -        this.updateBounds();
    -    }
    -
    -    if (this.body)
    -    {
    -        this.body.preUpdate();
    -    }
    -
    -    return true;
    -
    -};
    -
    -/**
    -* Internal function called by preUpdate.
    -*
    -* @method Phaser.Sprite#updateCache
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.updateCache = function() {
    -
    -    this._cache.prevX = this.world.x;
    -    this._cache.prevY = this.world.y;
    -
    -    if (this.fixedToCamera)
    -    {
    -        this.x = this.game.camera.view.x + this.cameraOffset.x;
    -        this.y = this.game.camera.view.y + this.cameraOffset.y;
    -    }
    -
    -    this.world.setTo(this.game.camera.x + this.worldTransform[2], this.game.camera.y + this.worldTransform[5]);
    -
    -    if (this.worldTransform[1] != this._cache.i01 || this.worldTransform[3] != this._cache.i10 || this.worldTransform[0] != this._cache.a00 || this.worldTransform[41] != this._cache.a11)
    -    {
    -        this._cache.a00 = this.worldTransform[0];  //  scaleX         a     |a c tx|
    -        this._cache.a01 = this.worldTransform[1];  //  skewY          c     |b d ty|
    -        this._cache.a10 = this.worldTransform[3];  //  skewX          b     |0 0  1|
    -        this._cache.a11 = this.worldTransform[4];  //  scaleY         d
    -
    -        this._cache.i01 = this.worldTransform[1];  //  skewY          c (remains non-modified for input checks)
    -        this._cache.i10 = this.worldTransform[3];  //  skewX          b (remains non-modified for input checks)
    -
    -        this._cache.scaleX = Math.sqrt((this._cache.a00 * this._cache.a00) + (this._cache.a01 * this._cache.a01)); // round this off a bit?
    -        this._cache.scaleY = Math.sqrt((this._cache.a10 * this._cache.a10) + (this._cache.a11 * this._cache.a11)); // round this off a bit?
    -
    -        this._cache.a01 *= -1;
    -        this._cache.a10 *= -1;
    -
    -        this._cache.id = 1 / (this._cache.a00 * this._cache.a11 + this._cache.a01 * -this._cache.a10);
    -        this._cache.idi = 1 / (this._cache.a00 * this._cache.a11 + this._cache.i01 * -this._cache.i10);
    -
    -        this._cache.dirty = true;
    -    }
    -
    -    this._cache.a02 = this.worldTransform[2];  //  translateX     tx
    -    this._cache.a12 = this.worldTransform[5];  //  translateY     ty
    -
    -};
    -
    -/**
    -* Internal function called by preUpdate.
    -*
    -* @method Phaser.Sprite#updateAnimation
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.updateAnimation = function() {
    -
    -    if (this.animations.update() || (this.currentFrame && this.currentFrame.uuid != this._cache.frameID))
    -    {
    -        this._cache.frameID = this.currentFrame.uuid;
    -
    -        this._cache.frameWidth = this.texture.frame.width;
    -        this._cache.frameHeight = this.texture.frame.height;
    -
    -        this._cache.width = this.currentFrame.width;
    -        this._cache.height = this.currentFrame.height;
    -
    -        this._cache.halfWidth = Math.floor(this._cache.width / 2);
    -        this._cache.halfHeight = Math.floor(this._cache.height / 2);
    -
    -        this._cache.dirty = true;
    -    }
    -
    -};
    -
    -/**
    -* Internal function called by preUpdate.
    -*
    -* @method Phaser.Sprite#updateCrop
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.updateCrop = function() {
    -
    -    //  This only runs if crop is enabled
    -    if (this.cropEnabled && (this.crop.width != this._cache.cropWidth || this.crop.height != this._cache.cropHeight || this.crop.x != this._cache.cropX || this.crop.y != this._cache.cropY))
    -    {
    -        this.crop.floorAll();
    -
    -        this._cache.cropX = this.crop.x;
    -        this._cache.cropY = this.crop.y;
    -        this._cache.cropWidth = this.crop.width;
    -        this._cache.cropHeight = this.crop.height;
    -
    -        this.texture.frame = this.crop;
    -        this.texture.width = this.crop.width;
    -        this.texture.height = this.crop.height;
    -
    -        this.texture.updateFrame = true;
    -
    -        PIXI.Texture.frameUpdates.push(this.texture);
    -    }
    -
    -};
    -
    -/**
    -* Internal function called by preUpdate.
    -*
    -* @method Phaser.Sprite#updateBounds
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.updateBounds = function() {
    -
    -    this.offset.setTo(this._cache.a02 - (this.anchor.x * this.width), this._cache.a12 - (this.anchor.y * this.height));
    -
    -    this.getLocalPosition(this.center, this.offset.x + (this.width / 2), this.offset.y + (this.height / 2));
    -    this.getLocalPosition(this.topLeft, this.offset.x, this.offset.y);
    -    this.getLocalPosition(this.topRight, this.offset.x + this.width, this.offset.y);
    -    this.getLocalPosition(this.bottomLeft, this.offset.x, this.offset.y + this.height);
    -    this.getLocalPosition(this.bottomRight, this.offset.x + this.width, this.offset.y + this.height);
    -
    -    this._cache.left = Phaser.Math.min(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    -    this._cache.right = Phaser.Math.max(this.topLeft.x, this.topRight.x, this.bottomLeft.x, this.bottomRight.x);
    -    this._cache.top = Phaser.Math.min(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    -    this._cache.bottom = Phaser.Math.max(this.topLeft.y, this.topRight.y, this.bottomLeft.y, this.bottomRight.y);
    -
    -    this.bounds.setTo(this._cache.left, this._cache.top, this._cache.right - this._cache.left, this._cache.bottom - this._cache.top);
    -
    -    this.updateFrame = true;
    -
    -    if (this.inWorld === false)
    -    {
    -        //  Sprite WAS out of the screen, is it still?
    -        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    -
    -        if (this.inWorld)
    -        {
    -            //  It's back again, reset the OOB check
    -            this._outOfBoundsFired = false;
    -        }
    -    }
    -    else
    -    {
    -        //   Sprite WAS in the screen, has it now left?
    -        this.inWorld = Phaser.Rectangle.intersects(this.bounds, this.game.world.bounds, this.inWorldThreshold);
    -
    -        if (this.inWorld === false)
    -        {
    -            this.events.onOutOfBounds.dispatch(this);
    -            this._outOfBoundsFired = true;
    -
    -            if (this.outOfBoundsKill)
    -            {
    -                this.kill();
    -            }
    -        }
    -    }
    -
    -    this._cache.cameraVisible = Phaser.Rectangle.intersects(this.game.world.camera.screenView, this.bounds, 0);
    -
    -    if (this.autoCull)
    -    {
    -        //  Won't get rendered but will still get its transform updated
    -        this.renderable = this._cache.cameraVisible;
    -    }
    -
    -};
    -
    -/**
    -* Gets the local position of a coordinate relative to the Sprite, factoring in rotation and scale.
    -* Mostly only used internally.
    -* 
    -* @method Phaser.Sprite#getLocalPosition
    -* @memberof Phaser.Sprite
    -* @param {Phaser.Point} p - The Point object to store the results in.
    -* @param {number} x - x coordinate within the Sprite to translate.
    -* @param {number} y - y coordinate within the Sprite to translate.
    -* @return {Phaser.Point} The translated point.
    -*/
    -Phaser.Sprite.prototype.getLocalPosition = function(p, x, y) {
    -
    -    p.x = ((this._cache.a11 * this._cache.id * x + -this._cache.a01 * this._cache.id * y + (this._cache.a12 * this._cache.a01 - this._cache.a02 * this._cache.a11) * this._cache.id) * this.scale.x) + this._cache.a02;
    -    p.y = ((this._cache.a00 * this._cache.id * y + -this._cache.a10 * this._cache.id * x + (-this._cache.a12 * this._cache.a00 + this._cache.a02 * this._cache.a10) * this._cache.id) * this.scale.y) + this._cache.a12;
    -
    -    return p;
    -
    -};
    -
    -/**
    -* Gets the local unmodified position of a coordinate relative to the Sprite, factoring in rotation and scale.
    -* Mostly only used internally by the Input Manager, but also useful for custom hit detection.
    -* 
    -* @method Phaser.Sprite#getLocalUnmodifiedPosition
    -* @memberof Phaser.Sprite
    -* @param {Phaser.Point} p - The Point object to store the results in.
    -* @param {number} gx - x coordinate within the Sprite to translate.
    -* @param {number} gy - y coordinate within the Sprite to translate.
    -* @return {Phaser.Point} The translated point.
    -*/
    -Phaser.Sprite.prototype.getLocalUnmodifiedPosition = function(p, gx, gy) {
    -
    -    p.x = (this._cache.a11 * this._cache.idi * gx + -this._cache.i01 * this._cache.idi * gy + (this._cache.a12 * this._cache.i01 - this._cache.a02 * this._cache.a11) * this._cache.idi) + (this.anchor.x * this._cache.width);
    -    p.y = (this._cache.a00 * this._cache.idi * gy + -this._cache.i10 * this._cache.idi * gx + (-this._cache.a12 * this._cache.a00 + this._cache.a02 * this._cache.i10) * this._cache.idi) + (this.anchor.y * this._cache.height);
    -
    -    return p;
    -
    -};
    -
    -/**
    -* Resets the Sprite.crop value back to the frame dimensions.
    -*
    -* @method Phaser.Sprite#resetCrop
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.resetCrop = function() {
    -
    -    this.crop = new Phaser.Rectangle(0, 0, this._cache.width, this._cache.height);
    -    this.texture.setFrame(this.crop);
    -    this.cropEnabled = false;
    -
    -};
    -
    -/**
    -* Internal function called by the World postUpdate cycle.
    -*
    -* @method Phaser.Sprite#postUpdate
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.postUpdate = function() {
    -
    -    if (this.key instanceof Phaser.BitmapData && this.key._dirty)
    -    {
    -        this.key.render();
    -    }
    -
    -    if (this.exists)
    -    {
    -        if (this.body)
    -        {
    -            this.body.postUpdate();
    -        }
    -
    -        if (this.fixedToCamera)
    -        {
    -            this._cache.x = this.game.camera.view.x + this.cameraOffset.x;
    -            this._cache.y = this.game.camera.view.y + this.cameraOffset.y;
    -        }
    -        else
    -        {
    -            this._cache.x = this.x;
    -            this._cache.y = this.y;
    -        }
    -
    -        this.position.x = this._cache.x;
    -        this.position.y = this._cache.y;
    -    }
    -
    -};
    -
    -/**
    -* Changes the Texture the Sprite is using entirely. The old texture is removed and the new one is referenced or fetched from the Cache.
    -* This causes a WebGL texture update, so use sparingly or in low-intensity portions of your game.
    -*
    -* @method Phaser.Sprite#loadTexture
    -* @memberof Phaser.Sprite
    -* @param {string|Phaser.RenderTexture|Phaser.BitmapData|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture, BitmapData or PIXI.Texture.
    -* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
    -*/
    -Phaser.Sprite.prototype.loadTexture = function (key, frame) {
    -
    -    this.key = key;
    -
    -    if (key instanceof Phaser.RenderTexture)
    -    {
    -        this.currentFrame = this.game.cache.getTextureFrame(key.name);
    -    }
    -    else if (key instanceof Phaser.BitmapData)
    -    {
    -        this.setTexture(key.texture);
    -        this.currentFrame = key.textureFrame;
    -    }
    -    else if (key instanceof PIXI.Texture)
    -    {
    -        this.currentFrame = frame;
    -    }
    -    else
    -    {
    -        if (typeof key === 'undefined' || this.game.cache.checkImageKey(key) === false)
    -        {
    -            key = '__default';
    -            this.key = key;
    -        }
    -
    -        if (this.game.cache.isSpriteSheet(key))
    -        {
    -            this.animations.loadFrameData(this.game.cache.getFrameData(key));
    -
    -            if (typeof frame !== 'undefined')
    -            {
    -                if (typeof frame === 'string')
    -                {
    -                    this.frameName = frame;
    -                }
    -                else
    -                {
    -                    this.frame = frame;
    -                }
    -            }
    -        }
    -        else
    -        {
    -            this.currentFrame = this.game.cache.getFrame(key);
    -            this.setTexture(PIXI.TextureCache[key]);
    -        }
    -    }
    -
    -};
    -
    -/**
    -* Moves the sprite so its center is located on the given x and y coordinates.
    -* Doesn't change the anchor point of the sprite.
    -* 
    -* @method Phaser.Sprite#centerOn
    -* @memberof Phaser.Sprite
    -* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    -* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.centerOn = function(x, y) {
    -
    -    if (this.fixedToCamera)
    -    {
    -        this.cameraOffset.x = x + (this.cameraOffset.x - this.center.x);
    -        this.cameraOffset.y = y + (this.cameraOffset.y - this.center.y);
    -    }
    -    else
    -    {
    -        this.x = x + (this.x - this.center.x);
    -        this.y = y + (this.y - this.center.y);
    -    }
    -
    -    return this;
    -
    -};
    -
    -/**
    -* Brings a 'dead' Sprite back to life, optionally giving it the health value specified.
    -* A resurrected Sprite has its alive, exists and visible properties all set to true.
    -* It will dispatch the onRevived event, you can listen to Sprite.events.onRevived for the signal.
    -* 
    -* @method Phaser.Sprite#revive
    -* @memberof Phaser.Sprite
    -* @param {number} [health=1] - The health to give the Sprite.
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.revive = function(health) {
    -
    -    if (typeof health === 'undefined') { health = 1; }
    -
    -    this.alive = true;
    -    this.exists = true;
    -    this.visible = true;
    -    this.health = health;
    -
    -    if (this.events)
    -    {
    -        this.events.onRevived.dispatch(this);
    -    }
    -
    -    return this;
    -
    -};
    -
    -/**
    -* Kills a Sprite. A killed Sprite has its alive, exists and visible properties all set to false.
    -* It will dispatch the onKilled event, you can listen to Sprite.events.onKilled for the signal.
    -* Note that killing a Sprite is a way for you to quickly recycle it in a Sprite pool, it doesn't free it up from memory.
    -* If you don't need this Sprite any more you should call Sprite.destroy instead.
    -* 
    -* @method Phaser.Sprite#kill
    -* @memberof Phaser.Sprite
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.kill = function() {
    -
    -    this.alive = false;
    -    this.exists = false;
    -    this.visible = false;
    -
    -    if (this.events)
    -    {
    -        this.events.onKilled.dispatch(this);
    -    }
    -
    -    return this;
    -
    -};
    -
    -/**
    -* Destroys the Sprite. This removes it from its parent group, destroys the input, event and animation handlers if present
    -* and nulls its reference to game, freeing it up for garbage collection.
    -* 
    -* @method Phaser.Sprite#destroy
    -* @memberof Phaser.Sprite
    -*/
    -Phaser.Sprite.prototype.destroy = function() {
    -
    -    if (this.filters)
    -    {
    -        this.filters = null;
    -    }
    -
    -    if (this.parent)
    -    {
    -        this.parent.remove(this);
    -    }
    -
    -    if (this.input)
    -    {
    -        this.input.destroy();
    -    }
    -
    -    if (this.events)
    -    {
    -        this.events.destroy();
    -    }
    -
    -    if (this.animations)
    -    {
    -        this.animations.destroy();
    -    }
    -
    -    if (this.body)
    -    {
    -        this.body.destroy();
    -    }
    -
    -    this.alive = false;
    -    this.exists = false;
    -    this.visible = false;
    -
    -    this.game = null;
    -
    -};
    -
    -/**
    -* Damages the Sprite, this removes the given amount from the Sprites health property.
    -* If health is then taken below zero Sprite.kill is called.
    -* 
    -* @method Phaser.Sprite#damage
    -* @memberof Phaser.Sprite
    -* @param {number} amount - The amount to subtract from the Sprite.health value.
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.damage = function(amount) {
    -
    -    if (this.alive)
    -    {
    -        this.health -= amount;
    -
    -        if (this.health < 0)
    -        {
    -            this.kill();
    -        }
    -    }
    -
    -    return this;
    -
    -};
    -
    -/**
    -* Resets the Sprite. This places the Sprite at the given x/y world coordinates and then
    -* sets alive, exists, visible and renderable all to true. Also resets the outOfBounds state and health values.
    -* If the Sprite has a physics body that too is reset.
    -* 
    -* @method Phaser.Sprite#reset
    -* @memberof Phaser.Sprite
    -* @param {number} x - The x coordinate (in world space) to position the Sprite at.
    -* @param {number} y - The y coordinate (in world space) to position the Sprite at.
    -* @param {number} [health=1] - The health to give the Sprite.
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.reset = function(x, y, health) {
    -
    -    if (typeof health === 'undefined') { health = 1; }
    -
    -    // this.x = x;
    -    // this.y = y;
    -    this.world.setTo(x, y);
    -    this.position.x = this.x;
    -    this.position.y = this.y;
    -    this.alive = true;
    -    this.exists = true;
    -    this.visible = true;
    -    this.renderable = true;
    -    this._outOfBoundsFired = false;
    -
    -    this.health = health;
    -
    -    if (this.body)
    -    {
    -        this.body.reset(false);
    -    }
    -
    -    return this;
    -    
    -};
    -
    -/**
    -* Brings the Sprite to the top of the display list it is a child of. Sprites that are members of a Phaser.Group are only
    -* bought to the top of that Group, not the entire display list.
    -* 
    -* @method Phaser.Sprite#bringToTop
    -* @memberof Phaser.Sprite
    -* @return (Phaser.Sprite) This instance.
    -*/
    -Phaser.Sprite.prototype.bringToTop = function() {
    -
    -    if (this.parent)
    -    {
    -        this.parent.bringToTop(this);
    -    }
    -    else
    -    {
    -        this.game.world.bringToTop(this);
    -    }
    -
    -    return this;
    -
    -};
    -
    -/**
    -* Play an animation based on the given key. The animation should previously have been added via sprite.animations.add()
    -* If the requested animation is already playing this request will be ignored. If you need to reset an already running animation do so directly on the Animation object itself.
    -* 
    -* @method Phaser.Sprite#play
    -* @memberof Phaser.Sprite
    -* @param {string} name - The name of the animation to be played, e.g. "fire", "walk", "jump".
    -* @param {number} [frameRate=null] - The framerate to play the animation at. The speed is given in frames per second. If not provided the previously set frameRate of the Animation is used.
    -* @param {boolean} [loop=false] - Should the animation be looped after playback. If not provided the previously set loop value of the Animation is used.
    -* @param {boolean} [killOnComplete=false] - If set to true when the animation completes (only happens if loop=false) the parent Sprite will be killed.
    -* @return {Phaser.Animation} A reference to playing Animation instance.
    -*/
    -Phaser.Sprite.prototype.play = function (name, frameRate, loop, killOnComplete) {
    -
    -    if (this.animations)
    -    {
    -        return this.animations.play(name, frameRate, loop, killOnComplete);
    -    }
    -
    -};
    -
    -/**
    -* Returns the delta x value. The difference between Sprite.x now and in the previous step.
    -*
    -* @method Phaser.Sprite#deltaX
    -* @memberof Phaser.Sprite
    -* @return {number} The delta value. Positive if the motion was to the right, negative if to the left.
    -*/
    -Phaser.Sprite.prototype.deltaX = function () {
    -
    -    return this.world.x - this._cache.prevX;
    -
    -};
    -
    -/**
    -* Returns the delta x value. The difference between Sprite.y now and in the previous step.
    -*
    -* @method Phaser.Sprite#deltaY
    -* @memberof Phaser.Sprite
    -* @return {number} The delta value. Positive if the motion was downwards, negative if upwards.
    -*/
    -Phaser.Sprite.prototype.deltaY = function () {
    -
    -    return this.world.y - this._cache.prevY;
    -
    -};
    -
    -/**
    -* Indicates the rotation of the Sprite, in degrees, from its original orientation. Values from 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation.
    -* Values outside this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement player.angle = 450 is the same as player.angle = 90.
    -* If you wish to work in radians instead of degrees use the property Sprite.rotation instead.
    -* @name Phaser.Sprite#angle
    -* @property {number} angle - Gets or sets the Sprites angle of rotation in degrees.
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, 'angle', {
    -
    -    get: function() {
    -        return Phaser.Math.wrapAngle(Phaser.Math.radToDeg(this.rotation));
    -    },
    -
    -    set: function(value) {
    -        this.rotation = Phaser.Math.degToRad(Phaser.Math.wrapAngle(value));
    -    }
    -
    -});
    -
    -/**
    -* @name Phaser.Sprite#frame
    -* @property {number} frame - Gets or sets the current frame index and updates the Texture Cache for display.
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "frame", {
    -    
    -    get: function () {
    -        return this.animations.frame;
    -    },
    -
    -    set: function (value) {
    -        this.animations.frame = value;
    -    }
    -
    -});
    -
    -/**
    -* @name Phaser.Sprite#frameName
    -* @property {string} frameName - Gets or sets the current frame name and updates the Texture Cache for display.
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "frameName", {
    -    
    -    get: function () {
    -        return this.animations.frameName;
    -    },
    -
    -    set: function (value) {
    -        this.animations.frameName = value;
    -    }
    -
    -});
    -
    -/**
    -* @name Phaser.Sprite#inCamera
    -* @property {boolean} inCamera - Is this sprite visible to the camera or not?
    -* @readonly
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "inCamera", {
    -    
    -    get: function () {
    -        return this._cache.cameraVisible;
    -    }
    -
    -});
    -
    -/**
    -* @name Phaser.Sprite#worldCenterX
    -* @property {number} worldCenterX - The center of the Sprite in world coordinates.
    -* @readonly
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "worldCenterX", {
    -    
    -    get: function () {
    -        return this.game.camera.x + this.center.x;
    -    }
    -
    -});
    -
    -/**
    -* @name Phaser.Sprite#worldCenterY
    -* @property {number} worldCenterY - The center of the Sprite in world coordinates.
    -* @readonly
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "worldCenterY", {
    -    
    -    get: function () {
    -        return this.game.camera.y + this.center.y;
    -    }
    -
    -});
    -
    -/**
    -* The width of the sprite in pixels, setting this will actually modify the scale to acheive the value desired.
    -* If you wish to crop the Sprite instead see the Sprite.crop value.
    -*
    -* @name Phaser.Sprite#width
    -* @property {number} width - The width of the Sprite in pixels.
    -*/
    -// Object.defineProperty(Phaser.Sprite.prototype, 'width', {
    -
    -//     get: function() {
    -//         return this.scale.x * this.currentFrame.width;
    -//     },
    -
    -//     set: function(value) {
    -
    -//         this.scale.x = value / this.currentFrame.width;
    -//         this._cache.scaleX = value / this.currentFrame.width;
    -//         this._width = value;
    -
    -//     }
    -
    -// });
    -
    -/**
    -* The height of the sprite in pixels, setting this will actually modify the scale to acheive the value desired.
    -* If you wish to crop the Sprite instead see the Sprite.crop value.
    -*
    -* @name Phaser.Sprite#height
    -* @property {number} height - The height of the Sprite in pixels.
    -*/
    -// Object.defineProperty(Phaser.Sprite.prototype, 'height', {
    -
    -//     get: function() {
    -//         return this.scale.y * this.currentFrame.height;
    -//     },
    -
    -//     set: function(value) {
    -
    -//         this.scale.y = value / this.currentFrame.height;
    -//         this._cache.scaleY = value / this.currentFrame.height;
    -//         this._height = value;
    -
    -//     }
    -
    -// });
    -
    -/**
    -* By default a Sprite won't process any input events at all. By setting inputEnabled to true the Phaser.InputHandler is
    -* activated for this Sprite instance and it will then start to process click/touch events and more.
    -*
    -* @name Phaser.Sprite#inputEnabled
    -* @property {boolean} inputEnabled - Set to true to allow this Sprite to receive input events, otherwise false.
    -*/
    -Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", {
    -    
    -    get: function () {
    -
    -        return (this.input.enabled);
    -
    -    },
    -
    -    set: function (value) {
    -
    -        if (value)
    -        {
    -            if (this.input.enabled === false)
    -            {
    -                this.input.start();
    -            }
    -        }
    -        else
    -        {
    -            if (this.input.enabled)
    -            {
    -                this.input.stop();
    -            }
    -        }
    -
    -    }
    -
    -});
    -
    -
    -
    - - - - - -
    - -
    -
    - - - - Phaser Copyright © 2012-2014 Photon Storm Ltd. - -
    - - - Documentation generated by JSDoc 3.3.0-dev - on Sat Feb 08 2014 07:19:40 GMT-0000 (GMT) using the DocStrap template. - -
    -
    - - -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/package.json b/package.json index 4873ac566b..fe2fcb7b6f 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,10 @@ "grunt-contrib-connect": "~0.5.0", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-clean": "~0.5.0", - "grunt-contrib-jshint": "^0.9.2", + "grunt-contrib-jshint": "~0.9.2", "grunt-contrib-uglify": "~0.3.3", "lodash": "~2.2.1", - "grunt-text-replace": "~0.3.11" + "grunt-text-replace": "~0.3.11", + "jshint": "~2.4.4" } } diff --git a/src/gameobjects/Sprite.js b/src/gameobjects/Sprite.js index 014104b5fa..dd36f3c83e 100644 --- a/src/gameobjects/Sprite.js +++ b/src/gameobjects/Sprite.js @@ -408,6 +408,7 @@ Phaser.Sprite.prototype.loadTexture = function (key, frame) { /** * Crop allows you to crop the texture used to display this Sprite. * Cropping takes place from the top-left of the Sprite and can be modified in real-time by providing an updated rectangle object. +* Note that cropping a Sprite will reset its animation to the first frame. You cannot currently crop an animated Sprite. * * @method Phaser.Sprite#crop * @memberof Phaser.Sprite @@ -1000,3 +1001,57 @@ Object.defineProperty(Phaser.Sprite.prototype, "smoothed", { } }); + +/** +* The position of the Sprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#x +* @property {number} x - The position of the Sprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the Sprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.Sprite#y +* @property {number} y - The position of the Sprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.Sprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); diff --git a/src/gameobjects/TileSprite.js b/src/gameobjects/TileSprite.js index e551d2f7e5..31b58ce607 100644 --- a/src/gameobjects/TileSprite.js +++ b/src/gameobjects/TileSprite.js @@ -686,3 +686,57 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", { } }); + +/** +* The position of the TileSprite on the x axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#x +* @property {number} x - The position of the TileSprite on the x axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "x", { + + get: function () { + + return this.position.x; + + }, + + set: function (value) { + + this.position.x = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); + +/** +* The position of the TileSprite on the y axis relative to the local coordinates of the parent. +* +* @name Phaser.TileSprite#y +* @property {number} y - The position of the TileSprite on the y axis relative to the local coordinates of the parent. +*/ +Object.defineProperty(Phaser.TileSprite.prototype, "y", { + + get: function () { + + return this.position.y; + + }, + + set: function (value) { + + this.position.y = value; + + if (this.body && this.body.type === Phaser.Physics.ARCADE && this.body.phase === 2) + { + this.body._reset = 1; + } + + } + +}); diff --git a/src/input/Keyboard.js b/src/input/Keyboard.js index 631bb86be5..7cb8548b70 100644 --- a/src/input/Keyboard.js +++ b/src/input/Keyboard.js @@ -71,6 +71,12 @@ Phaser.Keyboard = function (game) { */ this._onKeyUp = null; + /** + * @property {number} _i - Internal cache var + * @private + */ + this._i = 0; + }; Phaser.Keyboard.prototype = { @@ -151,7 +157,7 @@ Phaser.Keyboard.prototype = { }, /** - * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the document.body. + * Starts the Keyboard event listeners running (keydown and keyup). They are attached to the window. * This is called automatically by Phaser.Input and should not normally be invoked directly. * * @method Phaser.Keyboard#start @@ -180,17 +186,37 @@ Phaser.Keyboard.prototype = { }, /** - * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the document.body. + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. * * @method Phaser.Keyboard#stop */ stop: function () { + this._onKeyDown = null; + this._onKeyUp = null; + window.removeEventListener('keydown', this._onKeyDown); window.removeEventListener('keyup', this._onKeyUp); }, + /** + * Stops the Keyboard event listeners from running (keydown and keyup). They are removed from the window. + * Also clears all key captures and currently created Key objects. + * + * @method Phaser.Keyboard#destroy + */ + destroy: function () { + + this.stop(); + + this.clearCaptures(); + + this._keys.length = 0; + this._i = 0; + + }, + /** * By default when a key is pressed Phaser will not stop the event from propagating up to the browser. * There are some keys this can be annoying for, like the arrow keys or space bar, which make the browser window scroll. @@ -245,13 +271,13 @@ Phaser.Keyboard.prototype = { */ update: function () { - var i = this._keys.length; + this._i = this._keys.length; - while (i--) + while (this._i--) { - if (this._keys[i]) + if (this._keys[this._i]) { - this._keys[i].update(); + this._keys[this._i].update(); } } diff --git a/src/physics/arcade/Body.js b/src/physics/arcade/Body.js index 5669cbb152..54da348b1f 100644 --- a/src/physics/arcade/Body.js +++ b/src/physics/arcade/Body.js @@ -191,12 +191,6 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.speed = 0; - /** - * @property {boolean} skipQuadTree - If the Body is an irregular shape you can set this to true to avoid it being added to any QuadTrees. - * @default - this.skipQuadTree = false; - */ - /** * @property {number} facing - A const reference to the direction the Body is traveling or facing. * @default @@ -292,6 +286,11 @@ Phaser.Physics.Arcade.Body = function (sprite) { */ this.tilePadding = new Phaser.Point(); + /** + * @property {number} phaser - Is this Body in a preUpdate or postUpdate state? + */ + this.phase = 0; + /** * @property {boolean} _reset - Internal cache var. * @private @@ -360,6 +359,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ preUpdate: function () { + this.phase = 1; + // Store and reset collision flags this.wasTouching.none = this.touching.none; this.wasTouching.up = this.touching.up; @@ -418,6 +419,9 @@ Phaser.Physics.Arcade.Body.prototype = { } } + this._dx = this.deltaX(); + this._dy = this.deltaY(); + this._reset = false; }, @@ -430,6 +434,8 @@ Phaser.Physics.Arcade.Body.prototype = { */ postUpdate: function () { + this.phase = 2; + if (this.deltaX() < 0) { this.facing = Phaser.LEFT; @@ -467,7 +473,7 @@ Phaser.Physics.Arcade.Body.prototype = { if (this.deltaMax.y !== 0 && this._dy !== 0) { - if (this._dy < 0 && this._dx < -this.deltaMax.y) + if (this._dy < 0 && this._dy < -this.deltaMax.y) { this._dy = -this.deltaMax.y; } @@ -708,6 +714,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "x", { }, set: function (value) { + this.position.x = value; } @@ -724,7 +731,9 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", { }, set: function (value) { + this.position.y = value; + } }); @@ -769,8 +778,7 @@ Phaser.Physics.Arcade.Body.render = function (context, body, filled, color) { Phaser.Physics.Arcade.Body.renderBodyInfo = function (debug, body) { debug.line('x: ' + body.x.toFixed(2), 'y: ' + body.y.toFixed(2), 'width: ' + body.width, 'height: ' + body.height); - // debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body.deltaX().toFixed(2), 'deltaY: ' + body.deltaY().toFixed(2)); - debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'new velocity x: ' + body.newVelocity.x.toFixed(2), 'y: ' + body.newVelocity.y.toFixed(2)); + debug.line('velocity x: ' + body.velocity.x.toFixed(2), 'y: ' + body.velocity.y.toFixed(2), 'deltaX: ' + body._dx.toFixed(2), 'deltaY: ' + body._dy.toFixed(2)); debug.line('acceleration x: ' + body.acceleration.x.toFixed(2), 'y: ' + body.acceleration.y.toFixed(2), 'speed: ' + body.speed.toFixed(2), 'angle: ' + body.angle.toFixed(2)); debug.line('gravity x: ' + body.gravity.x, 'y: ' + body.gravity.y, 'bounce x: ' + body.bounce.x.toFixed(2), 'y: ' + body.bounce.y.toFixed(2)); debug.line('touching left: ' + body.touching.left, 'right: ' + body.touching.right, 'up: ' + body.touching.up, 'down: ' + body.touching.down);