From d9323de752ad1ae6fdbf6085ff91ffd1bf12fb31 Mon Sep 17 00:00:00 2001
From: photonstorm
Date: Wed, 12 Feb 2014 15:26:29 +0000
Subject: [PATCH] Docs and Examples update.
---
README.md | 1 +
build/phaser.js | 285 +++-
build/phaser.min.js | 10 +-
docs/Animation.js.html | 16 +-
docs/AnimationManager.js.html | 20 +-
docs/AnimationParser.js.html | 16 +-
docs/ArcadePhysics.js.html | 18 +-
docs/BitmapData.js.html | 16 +-
docs/BitmapText.js.html | 16 +-
docs/Body.js.html | 65 +-
docs/Button.js.html | 16 +-
docs/Cache.js.html | 16 +-
docs/Camera.js.html | 16 +-
docs/Canvas.js.html | 16 +-
docs/Circle.js.html | 16 +-
docs/Color.js.html | 16 +-
docs/DOMSprite.js.html | 16 +-
docs/Debug.js.html | 16 +-
docs/Device.js.html | 16 +-
docs/Easing.js.html | 16 +-
docs/Emitter.js.html | 16 +-
docs/Events.js.html | 16 +-
docs/Filter.js.html | 16 +-
docs/Frame.js.html | 16 +-
docs/FrameData.js.html | 16 +-
docs/Game.js.html | 16 +-
docs/GameObjectFactory.js.html | 16 +-
docs/Gamepad.js.html | 16 +-
docs/GamepadButton.js.html | 16 +-
docs/Graphics.js.html | 16 +-
docs/Group.js.html | 16 +-
docs/Input.js.html | 16 +-
docs/InputHandler.js.html | 16 +-
docs/Key.js.html | 16 +-
docs/Keyboard.js.html | 16 +-
docs/Line.js.html | 16 +-
docs/LinkedList.js.html | 16 +-
docs/Loader.js.html | 16 +-
docs/LoaderParser.js.html | 16 +-
docs/MSPointer.js.html | 16 +-
docs/Math.js.html | 16 +-
docs/Mouse.js.html | 16 +-
docs/Net.js.html | 16 +-
docs/Particles.js.html | 16 +-
docs/Phaser.Animation.html | 16 +-
docs/Phaser.AnimationManager.html | 23 +-
docs/Phaser.AnimationParser.html | 16 +-
docs/Phaser.BitmapData.html | 16 +-
docs/Phaser.BitmapText.html | 16 +-
docs/Phaser.Button.html | 16 +-
docs/Phaser.Cache.html | 16 +-
docs/Phaser.Camera.html | 16 +-
docs/Phaser.Canvas.html | 16 +-
docs/Phaser.Circle.html | 16 +-
docs/Phaser.Color.html | 16 +-
docs/Phaser.DOMSprite.html | 16 +-
docs/Phaser.Device.html | 16 +-
docs/Phaser.Easing.Back.html | 16 +-
docs/Phaser.Easing.Bounce.html | 16 +-
docs/Phaser.Easing.Circular.html | 16 +-
docs/Phaser.Easing.Cubic.html | 16 +-
docs/Phaser.Easing.Elastic.html | 16 +-
docs/Phaser.Easing.Exponential.html | 16 +-
docs/Phaser.Easing.Linear.html | 16 +-
docs/Phaser.Easing.Quadratic.html | 16 +-
docs/Phaser.Easing.Quartic.html | 16 +-
docs/Phaser.Easing.Quintic.html | 16 +-
docs/Phaser.Easing.Sinusoidal.html | 16 +-
docs/Phaser.Easing.html | 16 +-
docs/Phaser.Events.html | 16 +-
docs/Phaser.Filter.html | 16 +-
docs/Phaser.Frame.html | 16 +-
docs/Phaser.FrameData.html | 16 +-
docs/Phaser.Game.html | 16 +-
docs/Phaser.GameObjectFactory.html | 16 +-
docs/Phaser.Gamepad.html | 16 +-
docs/Phaser.GamepadButton.html | 16 +-
docs/Phaser.Graphics.html | 16 +-
docs/Phaser.Group.html | 16 +-
docs/Phaser.Input.html | 16 +-
docs/Phaser.InputHandler.html | 16 +-
docs/Phaser.Key.html | 16 +-
docs/Phaser.Keyboard.html | 16 +-
docs/Phaser.Line.html | 16 +-
docs/Phaser.LinkedList.html | 16 +-
docs/Phaser.Loader.html | 16 +-
docs/Phaser.LoaderParser.html | 16 +-
docs/Phaser.MSPointer.html | 16 +-
docs/Phaser.Math.html | 16 +-
docs/Phaser.Mouse.html | 16 +-
docs/Phaser.Net.html | 16 +-
docs/Phaser.Particles.Arcade.Emitter.html | 16 +-
docs/Phaser.Particles.html | 16 +-
docs/Phaser.Physics.Arcade.Body.html | 52 +-
docs/Phaser.Physics.Arcade.html | 46 +-
docs/Phaser.Physics.html | 16 +-
docs/Phaser.Plugin.html | 16 +-
docs/Phaser.PluginManager.html | 16 +-
docs/Phaser.Point.html | 16 +-
docs/Phaser.Pointer.html | 16 +-
docs/Phaser.Polygon.html | 16 +-
docs/Phaser.QuadTree.html | 16 +-
docs/Phaser.RandomDataGenerator.html | 16 +-
docs/Phaser.Rectangle.html | 16 +-
docs/Phaser.RenderTexture.html | 16 +-
docs/Phaser.RequestAnimationFrame.html | 16 +-
docs/Phaser.Signal.html | 16 +-
docs/Phaser.SinglePad.html | 16 +-
docs/Phaser.Sound.html | 16 +-
docs/Phaser.SoundManager.html | 16 +-
docs/Phaser.Sprite.html | 16 +-
docs/Phaser.Stage.html | 16 +-
docs/Phaser.StageScaleMode.html | 16 +-
docs/Phaser.State.html | 16 +-
docs/Phaser.StateManager.html | 16 +-
docs/Phaser.Text.html | 16 +-
docs/Phaser.Tile.html | 16 +-
docs/Phaser.TileSprite.html | 16 +-
docs/Phaser.Tilemap.html | 16 +-
docs/Phaser.TilemapLayer.html | 16 +-
docs/Phaser.TilemapParser.html | 16 +-
docs/Phaser.Tileset.html | 16 +-
docs/Phaser.Time.html | 16 +-
docs/Phaser.Timer.html | 32 +-
docs/Phaser.TimerEvent.html | 118 +-
docs/Phaser.Touch.html | 16 +-
docs/Phaser.Tween.html | 16 +-
docs/Phaser.TweenManager.html | 16 +-
docs/Phaser.Utils.Debug.html | 16 +-
docs/Phaser.Utils.html | 22 +-
docs/Phaser.World.html | 16 +-
docs/Phaser.html | 16 +-
docs/Phaser.js.html | 18 +-
docs/Plugin.js.html | 16 +-
docs/PluginManager.js.html | 16 +-
docs/Point.js.html | 16 +-
docs/Pointer.js.html | 16 +-
docs/Polygon.js.html | 16 +-
docs/QuadTree.js.html | 16 +-
docs/RandomDataGenerator.js.html | 16 +-
docs/Rectangle.js.html | 16 +-
docs/RenderTexture.js.html | 16 +-
docs/RequestAnimationFrame.js.html | 16 +-
docs/SAT.js.html | 157 +-
docs/Signal.js.html | 16 +-
docs/SignalBinding.html | 16 +-
docs/SignalBinding.js.html | 16 +-
docs/SinglePad.js.html | 16 +-
docs/Sound.js.html | 16 +-
docs/SoundManager.js.html | 16 +-
docs/Sprite.js.html | 16 +-
docs/Stage.js.html | 16 +-
docs/StageScaleMode.js.html | 16 +-
docs/State.js.html | 16 +-
docs/StateManager.js.html | 16 +-
docs/Text.js.html | 16 +-
docs/Tile.js.html | 16 +-
docs/TileSprite.js.html | 16 +-
docs/Tilemap.js.html | 20 +-
docs/TilemapLayer.js.html | 16 +-
docs/TilemapParser.js.html | 16 +-
docs/Tileset.js.html | 16 +-
docs/Time.js.html | 16 +-
docs/Timer.js.html | 60 +-
docs/TimerEvent.js.html | 22 +-
docs/Touch.js.html | 16 +-
docs/Tween.js.html | 16 +-
docs/TweenManager.js.html | 16 +-
docs/Utils.js.html | 22 +-
docs/World.js.html | 16 +-
docs/classes.list.html | 16 +-
docs/global.html | 627 +-------
docs/index.html | 212 +--
docs/namespaces.list.html | 16 +-
docs/old_RenderTexture.js.html | 840 ++++++++++
docs/old_Sprite.js.html | 1724 +++++++++++++++++++++
examples/_site/js/phaser-examples.js | 2 +-
examples/_site/js/phaser-viewer.js | 2 +-
examples/_site/view_full.html | 2 +-
examples/index.html | 4 +-
examples/sideview.html | 2 +-
src/physics/arcade/Body.js | 14 +-
182 files changed, 5726 insertions(+), 1158 deletions(-)
create mode 100644 docs/old_RenderTexture.js.html
create mode 100644 docs/old_Sprite.js.html
diff --git a/README.md b/README.md
index 0a1375c4..d8351756 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,7 @@ Bug Fixes:
* Added missing return value in Body.hitLeft and hitRight, fixes issue #398 (thanks ram64).
* Fixed easing tween example case. Issue #379 (thanks wesleywerner)
* Removed SAT.js UMD wrapped, fixes issue #361 (thanks luizbills)
+* Removed inContact check from Body.separate.
See the full Change Log for all the 1.1.4 updates and API changes (as there were a lot of them!)
diff --git a/build/phaser.js b/build/phaser.js
index 91aab3a6..0d47d086 100644
--- a/build/phaser.js
+++ b/build/phaser.js
@@ -18,7 +18,7 @@
*
* Phaser - http://www.phaser.io
*
-* v1.1.5 - Built at: Wed Feb 12 2014 15:08:44
+* v1.1.5 - Built at: Wed Feb 12 2014 15:20:51
*
* By Richard Davey http://www.photonstorm.com @photonstorm
*
@@ -29068,6 +29068,271 @@ Phaser.Polygon.prototype.constructor = Phaser.Polygon;
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/
+/**
+* Creates a new Line object with a start and an end point.
+* @class Line
+* @classdesc Phaser - Line
+* @constructor
+* @param {number} [x1=0] - The x coordinate of the start of the line.
+* @param {number} [y1=0] - The y coordinate of the start of the line.
+* @param {number} [x2=0] - The x coordinate of the end of the line.
+* @param {number} [y2=0] - The y coordinate of the end of the line.
+* @return {Phaser.Line} This line object
+*/
+Phaser.Line = function (x1, y1, x2, y2) {
+
+ x1 = x1 || 0;
+ y1 = y1 || 0;
+ x2 = x2 || 0;
+ y2 = y2 || 0;
+
+ /**
+ * @property {Phaser.Point} start - The start point of the line.
+ */
+ this.start = new Phaser.Point(x1, y1);
+
+ /**
+ * @property {Phaser.Point} end - The end point of the line.
+ */
+ this.end = new Phaser.Point(x2, y2);
+
+};
+
+Phaser.Line.prototype = {
+
+ /**
+ * Sets the components of the Line to the specified values.
+ * @method Phaser.Line#setTo
+ * @param {number} [x1=0] - The x coordinate of the start of the line.
+ * @param {number} [y1=0] - The y coordinate of the start of the line.
+ * @param {number} [x2=0] - The x coordinate of the end of the line.
+ * @param {number} [y2=0] - The y coordinate of the end of the line.
+ * @return {Phaser.Line} This line object
+ */
+ setTo: function (x1, y1, x2, y2) {
+
+ this.start.setTo(x1, y1);
+ this.end.setTo(x2, y2);
+
+ return this;
+
+ },
+
+ /**
+ * Sets the line to match the x/y coordinates of the two given sprites.
+ * Can optionally be calculated from their center coordinates.
+ * @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.
+ * @return {Phaser.Line} This line object
+ */
+ fromSprite: function (startSprite, endSprite, useCenter) {
+
+ if (typeof useCenter === 'undefined') { useCenter = true; }
+
+ if (useCenter)
+ {
+ return this.setTo(startSprite.center.x, startSprite.center.y, endSprite.center.x, endSprite.center.y);
+ }
+ else
+ {
+ return this.setTo(startSprite.x, startSprite.y, endSprite.x, endSprite.y);
+ }
+
+ },
+
+ /**
+ * Checks for intersection between this line and another Line.
+ * If asSegment is true it will check for segment intersection. If asSegment is false it will check for line intersection.
+ * Returns the intersection segment of AB and EF as a Point, or null if there is no intersection.
+ *
+ * @method Phaser.Line#intersects
+ * @param {Phaser.Line} line - The line to check against this one.
+ * @param {boolean} [asSegment=true] - If true it will check for segment intersection, otherwise full line intersection.
+ * @param {Phaser.Point} [result] - A Point object to store the result in, if not given a new one will be created.
+ * @return {Phaser.Point} The intersection segment of the two lines as a Point, or null if there is no intersection.
+ */
+ intersects: function (line, asSegment, result) {
+
+ return Phaser.Line.intersectsPoints(this.start, this.end, line.start, line.end, asSegment, result);
+
+ },
+
+ /**
+ * Tests if the given coordinates fall on this line. See pointOnSegment to test against just the line segment.
+ * @method Phaser.Line#pointOnLine
+ * @param {number} x - The line to check against this one.
+ * @param {number} y - The line to check against this one.
+ * @return {boolean} True if the point is on the line, false if not.
+ */
+ pointOnLine: function (x, y) {
+
+ return ((x - this.start.x) * (this.end.y - this.end.y) === (this.end.x - this.start.x) * (y - this.end.y));
+
+ },
+
+ /**
+ * Tests if the given coordinates fall on this line and within the segment. See pointOnLine to test against just the line.
+ * @method Phaser.Line#pointOnSegment
+ * @param {number} x - The line to check against this one.
+ * @param {number} y - The line to check against this one.
+ * @return {boolean} True if the point is on the line and segment, false if not.
+ */
+ pointOnSegment: function (x, y) {
+
+ var xMin = Math.min(this.start.x, this.end.x);
+ var xMax = Math.max(this.start.x, this.end.x);
+ var yMin = Math.min(this.start.y, this.end.y);
+ var yMax = Math.max(this.start.y, this.end.y);
+
+ return (this.pointOnLine(x, y) && (x >= xMin && x <= xMax) && (y >= yMin && y <= yMax));
+
+ }
+
+};
+
+/**
+* @name Phaser.Line#length
+* @property {number} length - Gets the length of the line segment.
+* @readonly
+*/
+Object.defineProperty(Phaser.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));
+ }
+
+});
+
+/**
+* @name Phaser.Line#angle
+* @property {number} angle - Gets the angle of the line.
+* @readonly
+*/
+Object.defineProperty(Phaser.Line.prototype, "angle", {
+
+ get: function () {
+ return Math.atan2(this.end.x - this.start.x, this.end.y - this.start.y);
+ }
+
+});
+
+/**
+* @name Phaser.Line#slope
+* @property {number} slope - Gets the slope of the line (y/x).
+* @readonly
+*/
+Object.defineProperty(Phaser.Line.prototype, "slope", {
+
+ get: function () {
+ return (this.end.y - this.start.y) / (this.end.x - this.start.x);
+ }
+
+});
+
+/**
+* @name Phaser.Line#perpSlope
+* @property {number} perpSlope - Gets the perpendicular slope of the line (x/y).
+* @readonly
+*/
+Object.defineProperty(Phaser.Line.prototype, "perpSlope", {
+
+ get: function () {
+ return -((this.end.x - this.start.x) / (this.end.y - this.start.y));
+ }
+
+});
+
+/**
+* Checks for intersection between two lines as defined by the given start and end points.
+* If asSegment is true it will check for line segment intersection. If asSegment is false it will check for line intersection.
+* Returns the intersection segment of AB and EF as a Point, or null if there is no intersection.
+* Adapted from code by Keith Hair
+*
+* @method Phaser.Line.intersects
+* @param {Phaser.Point} a - The start of the first Line to be checked.
+* @param {Phaser.Point} b - The end of the first line to be checked.
+* @param {Phaser.Point} e - The start of the second Line to be checked.
+* @param {Phaser.Point} f - The end of the second line to be checked.
+* @param {boolean} [asSegment=true] - If true it will check for segment intersection, otherwise full line intersection.
+* @param {Phaser.Point} [result] - A Point object to store the result in, if not given a new one will be created.
+* @return {Phaser.Point} The intersection segment of the two lines as a Point, or null if there is no intersection.
+*/
+Phaser.Line.intersectsPoints = function (a, b, e, f, asSegment, result) {
+
+ if (typeof asSegment === 'undefined') { asSegment = true; }
+ if (typeof result === 'undefined') { result = new Phaser.Point(); }
+
+ var a1 = b.y - a.y;
+ var a2 = f.y - e.y;
+ var b1 = a.x - b.x;
+ var b2 = e.x - f.x;
+ var c1 = (b.x * a.y) - (a.x * b.y);
+ var c2 = (f.x * e.y) - (e.x * f.y);
+ var denom = (a1 * b2) - (a2 * b1);
+
+ if (denom === 0)
+ {
+ return null;
+ }
+
+ 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))
+ {
+ return null;
+ }
+
+ if (Math.pow((result.x - a.x) + (result.y - a.y), 2) > Math.pow((a.x - b.x) + (a.y - b.y), 2))
+ {
+ return null;
+ }
+
+ if (Math.pow((result.x - f.x) + (result.y - f.y), 2) > Math.pow((e.x - f.x) + (e.y - f.y), 2))
+ {
+ return null;
+ }
+
+ if (Math.pow((result.x - e.x) + (result.y - e.y), 2) > Math.pow((e.x - f.x) + (e.y - f.y), 2))
+ {
+ return null;
+ }
+ }
+
+ return result;
+
+};
+
+/**
+* Checks for intersection between two lines.
+* If asSegment is true it will check for segment intersection.
+* If asSegment is false it will check for line intersection.
+* Returns the intersection segment of AB and EF as a Point, or null if there is no intersection.
+* Adapted from code by Keith Hair
+*
+* @method Phaser.Line.intersects
+* @param {Phaser.Line} a - The first Line to be checked.
+* @param {Phaser.Line} b - The second Line to be checked.
+* @param {boolean} [asSegment=true] - If true it will check for segment intersection, otherwise full line intersection.
+* @param {Phaser.Point} [result] - A Point object to store the result in, if not given a new one will be created.
+* @return {Phaser.Point} The intersection segment of the two lines as a Point, or null if there is no intersection.
+*/
+Phaser.Line.intersects = function (a, b, asSegment, result) {
+
+ return Phaser.Line.intersectsPoints(a.start, a.end, b.start, b.end, asSegment, result);
+
+};
+
+/**
+* @author Richard Davey
+* @copyright 2014 Photon Storm Ltd.
+* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
+*/
+
/**
* Phaser.Net handles browser URL related tasks such as checking host names, domain names and query string manipulation.
*
@@ -41133,10 +41398,10 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
separate: function (body, response) {
- if (this.inContact(body))
- {
- return false;
- }
+ // if (this.inContact(body))
+ // {
+ // return false;
+ // }
this._distances[0] = body.right - this.x; // Distance of B to face on left side of A
this._distances[1] = this.right - body.x; // Distance of B to face on right side of A
@@ -41195,10 +41460,10 @@ Phaser.Physics.Arcade.Body.prototype = {
else
{
// They can only contact like this if at least one of their sides is open, otherwise it's a separation
- // if (!this.checkCollision.up || !this.checkCollision.down || !this.checkCollision.left || !this.checkCollision.right || !body.checkCollision.up || !body.checkCollision.down || !body.checkCollision.left || !body.checkCollision.right)
- // {
+ if (!this.checkCollision.up || !this.checkCollision.down || !this.checkCollision.left || !this.checkCollision.right || !body.checkCollision.up || !body.checkCollision.down || !body.checkCollision.left || !body.checkCollision.right)
+ {
this.addContact(body);
- // }
+ }
}
return hasSeparated;
@@ -43718,8 +43983,8 @@ Phaser.Tilemap.prototype = {
}
// Find out the difference between tileblock[1].x/y and x/y and use it as an offset, as it's the top left of the block to paste
- var diffX = tileblock[1].x - x;
- var diffY = tileblock[1].y - y;
+ var diffX = x - tileblock[1].x;
+ var diffY = y - tileblock[1].y;
for (var i = 1; i < tileblock.length; i++)
{
diff --git a/build/phaser.min.js b/build/phaser.min.js
index e298c73f..123d53e4 100644
--- a/build/phaser.min.js
+++ b/build/phaser.min.js
@@ -6,8 +6,8 @@
},reset:function(){for(var a in this._keys)this._keys[a].isDown=!1},justPressed:function(a,b){return"undefined"==typeof b&&(b=250),this._keys[a]&&this._keys[a].isDown&&this._keys[a].duration=this.game.input.holdRate&&((this.game.input.multiInputOverride==c.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==c.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==c.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){if(!this.game.input.pollLocked){if("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==c.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==c.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==c.Input.TOUCH_OVERRIDES_MOUSE&&0===this.game.input.currentPointers)&&(this.game.input.activePointer=this,this.game.input.x=this.x,this.game.input.y=this.y,this.game.input.position.setTo(this.game.input.x,this.game.input.y),this.game.input.circle.x=this.game.input.x,this.game.input.circle.y=this.game.input.y),this.game.paused)return this;if(this.game.input.moveCallback&&this.game.input.moveCallback.call(this.game.input.moveCallbackContext,this,this.x,this.y),null!==this.targetObject&&this.targetObject.isDragged===!0)return this.targetObject.update(this)===!1&&(this.targetObject=null),this;if(this._highestRenderOrderID=-1,this._highestRenderObject=null,this._highestInputPriorityID=-1,this.game.input.interactiveItems.total>0){var b=this.game.input.interactiveItems.next;do(b.pixelPerfect||b.priorityID>this._highestInputPriorityID||b.priorityID==this._highestInputPriorityID&&b.sprite.renderOrderID>this._highestRenderOrderID)&&b.checkPointerOver(this)&&(this._highestRenderOrderID=b.sprite.renderOrderID,this._highestInputPriorityID=b.priorityID,this._highestRenderObject=b),b=b.next;while(null!=b)}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)},stop:function(a){if(this._stateReset)return a.preventDefault(),void 0;if(this.timeUp=this.game.time.now,(this.game.input.multiInputOverride==c.Input.MOUSE_OVERRIDES_TOUCH||this.game.input.multiInputOverride==c.Input.MOUSE_TOUCH_COMBINE||this.game.input.multiInputOverride==c.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 b=this.game.input.interactiveItems.next;do b&&b._releasedHandler(this),b=b.next;while(null!=b)}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}},c.Pointer.prototype.constructor=c.Pointer,Object.defineProperty(c.Pointer.prototype,"duration",{get:function(){return this.isUp?-1:this.game.time.now-this.timeDown}}),Object.defineProperty(c.Pointer.prototype,"worldX",{get:function(){return this.game.world.camera.x+this.x}}),Object.defineProperty(c.Pointer.prototype,"worldY",{get:function(){return this.game.world.camera.y+this.y}}),c.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},c.Touch.prototype={start:function(){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.renderer.view.addEventListener("touchstart",this._onTouchStart,!1),this.game.renderer.view.addEventListener("touchmove",this._onTouchMove,!1),this.game.renderer.view.addEventListener("touchend",this._onTouchEnd,!1),this.game.renderer.view.addEventListener("touchenter",this._onTouchEnter,!1),this.game.renderer.view.addEventListener("touchleave",this._onTouchLeave,!1),this.game.renderer.view.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;bd;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 c.Point,this.enabled=!0,this.sprite.events&&null==this.sprite.events.onInputOver&&(this.sprite.events.onInputOver=new c.Signal,this.sprite.events.onInputOut=new c.Signal,this.sprite.events.onInputDown=new c.Signal,this.sprite.events.onInputUp=new c.Signal,this.sprite.events.onDragStart=new c.Signal,this.sprite.events.onDragStop=new c.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.enabled=!1,this.game.input.interactiveItems.remove(this),this.stop(),this.sprite=null)},pointerX:function(a){return a=a||0,this._pointerData[a].x},pointerY:function(a){return a=a||0,this._pointerData[a].y},pointerDown:function(a){return a=a||0,this._pointerData[a].isDown},pointerUp:function(a){return a=a||0,this._pointerData[a].isUp},pointerTimeDown:function(a){return a=a||0,this._pointerData[a].timeDown},pointerTimeUp:function(a){return a=a||0,this._pointerData[a].timeUp},pointerOver:function(a){if(this.enabled){if("undefined"!=typeof a)return this._pointerData[a].isOver;for(var b=0;10>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},checkPointerOver:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.group&&this.sprite.group.visible===!1?!1:(this.sprite.getLocalUnmodifiedPosition(this._tempPoint,a.x,a.y),this._tempPoint.x>=0&&this._tempPoint.x<=this.sprite.currentFrame.width&&this._tempPoint.y>=0&&this._tempPoint.y<=this.sprite.currentFrame.height?this.pixelPerfect?this.checkPixel(this._tempPoint.x,this._tempPoint.y):!0:void 0)},checkPixel:function(a,b){if(this.sprite.texture.baseTexture.source){this.game.input.hitContext.clearRect(0,0,1,1),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 c=this.game.input.hitContext.getImageData(0,0,1,1);if(c.data[3]>=this.pixelPerfectAlpha)return!0}return!1},update:function(a){return this.enabled===!1||this.sprite.visible===!1||this.sprite.group&&this.sprite.group.visible===!1?(this._pointerOutHandler(a),!1):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},_pointerOverHandler:function(a){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.sprite.events.onInputOver.dispatch(this.sprite,a))},_pointerOutHandler:function(a){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.sprite&&this.sprite.events&&this.sprite.events.onInputOut.dispatch(this.sprite,a)},_touchedHandler:function(a){return this._pointerData[a.id].isDown===!1&&this._pointerData[a.id].isOver===!0&&(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()),this.consumePointerEvent},_releasedHandler:function(a){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.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){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):this.dragFromCenter?(this.sprite.centerOn(a.x,a.y),this._dragPoint.setTo(this.sprite.x-a.x,this.sprite.y-a.y)):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.sprite.events.onInputUp.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){"undefined"==typeof c&&(c=!0),"undefined"==typeof d&&(d=!1),"undefined"==typeof snapOffsetX&&(snapOffsetX=0),"undefined"==typeof snapOffsetY&&(snapOffsetY=0),this.snapX=a,this.snapY=b,this.snapOffsetX=snapOffsetX,this.snapOffsetY=snapOffsetY,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))}},c.InputHandler.prototype.constructor=c.InputHandler,c.Gamepad=function(a){this.game=a,this._gamepads=[new c.SinglePad(a,this),new c.SinglePad(a,this),new c.SinglePad(a,this),new c.SinglePad(a,this)],this._gamepadIndexMap={},this._rawPads=[],this._active=!1,this.disabled=!1,this._gamepadSupportAvailable=!!navigator.webkitGetGamepads||!!navigator.webkitGamepads||-1!=navigator.userAgent.indexOf("Firefox/"),this._prevRawGamepadTypes=[],this._prevTimestamps=[],this.callbackContext=this,this.onConnectCallback=null,this.onDisconnectCallback=null,this.onDownCallback=null,this.onUpCallback=null,this.onAxisCallback=null,this.onFloatCallback=null,this._ongamepadconnected=null,this._gamepaddisconnected=null},c.Gamepad.prototype={addCallbacks:function(a,b){"undefined"!=typeof b&&(this.onConnectCallback="function"==typeof b.onConnect?b.onConnect:this.onConnectCallback,this.onDisconnectCallback="function"==typeof b.onDisconnect?b.onDisconnect:this.onDisconnectCallback,this.onDownCallback="function"==typeof b.onDown?b.onDown:this.onDownCallback,this.onUpCallback="function"==typeof b.onUp?b.onUp:this.onUpCallback,this.onAxisCallback="function"==typeof b.onAxis?b.onAxis:this.onAxisCallback,this.onFloatCallback="function"==typeof b.onFloat?b.onFloat:this.onFloatCallback)},start:function(){this._active=!0;var a=this;this._ongamepadconnected=function(b){var c=b.gamepad;a._rawPads.push(c),a._gamepads[c.index].connect(c)},window.addEventListener("gamepadconnected",this._ongamepadconnected,!1),this._ongamepaddisconnected=function(b){var c=b.gamepad;for(var d in a._rawPads)a._rawPads[d].index===c.index&&a._rawPads.splice(d,1);a._gamepads[c.index].disconnect()},window.addEventListener("gamepaddisconnected",this._ongamepaddisconnected,!1)
},update:function(){this._pollGamepads();for(var a=0;a0&&e>this.deadZone||0>e&&e<-this.deadZone?this.processAxisChange({axis:d,value:e}):this.processAxisChange({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].timeUp=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)},arc:function(a,b,c,d,e,f){return"undefined"==typeof f&&(f=!1),this._dirty=!0,this.context.arc(a,b,c,d,e,f),this},arcTo:function(a,b,c,d,e){return this._dirty=!0,this.context.arcTo(a,b,c,d,e),this},beginFill:function(a){return this.fillStyle(a),this},beginLinearGradientFill:function(a,b,c,d,e,f){for(var g=this.createLinearGradient(c,d,e,f),h=0,i=a.length;i>h;h++)g.addColorStop(b[h],a[h]);return this.fillStyle(g),this},beginLinearGradientStroke:function(a,b,c,d,e,f){for(var g=this.createLinearGradient(c,d,e,f),h=0,i=a.length;i>h;h++)g.addColorStop(b[h],a[h]);return this.strokeStyle(g),this},beginRadialGradientStroke:function(a,b,c,d,e,f,g,h){for(var i=this.createRadialGradient(c,d,e,f,g,h),j=0,k=a.length;k>j;j++)i.addColorStop(b[j],a[j]);return this.strokeStyle(i),this},beginPath:function(){return this.context.beginPath(),this},beginStroke:function(a){return this.strokeStyle(a),this},bezierCurveTo:function(a,b,c,d,e,f){return this._dirty=!0,this.context.bezierCurveTo(a,b,c,d,e,f),this},circle:function(a,b,c){return this.arc(a,b,c,0,2*Math.PI),this},clearRect:function(a,b,c,d){return this._dirty=!0,this.context.clearRect(a,b,c,d),this},clip:function(){return this._dirty=!0,this.context.clip(),this},closePath:function(){return this._dirty=!0,this.context.closePath(),this},createLinearGradient:function(a,b,c,d){return this.context.createLinearGradient(a,b,c,d)},createRadialGradient:function(a,b,c,d,e,f){return this.context.createRadialGradient(a,b,c,d,e,f)},ellipse:function(a,b,c,d){var e=.5522848,f=c/2*e,g=d/2*e,h=a+c,i=b+d,j=a+c/2,k=b+d/2;return this.moveTo(a,k),this.bezierCurveTo(a,k-g,j-f,b,j,b),this.bezierCurveTo(j+f,b,h,k-g,h,k),this.bezierCurveTo(h,k+g,j+f,i,j,i),this.bezierCurveTo(j-f,i,a,k+g,a,k),this},fill:function(){return this._dirty=!0,this.context.fill(),this},fillRect:function(a,b,c,d){return this._dirty=!0,this.context.fillRect(a,b,c,d),this},fillStyle:function(a){return this.context.fillStyle=a,this},font:function(a){return this.context.font=a,this},globalAlpha:function(a){return this.context.globalAlpha=a,this},globalCompositeOperation:function(a){return this.context.globalCompositeOperation=a,this},lineCap:function(a){return this.context.lineCap=a,this},lineDashOffset:function(a){return this.context.lineDashOffset=a,this},lineJoin:function(a){return this.context.lineJoin=a,this},lineWidth:function(a){return this.context.lineWidth=a,this},miterLimit:function(a){return this.context.miterLimit=a,this},lineTo:function(a,b){return this._dirty=!0,this.context.lineTo(a,b),this},moveTo:function(a,b){return this.context.moveTo(a,b),this},quadraticCurveTo:function(a,b,c,d){return this._dirty=!0,this.context.quadraticCurveTo(a,b,c,d),this},rect:function(a,b,c,d){return this._dirty=!0,this.context.rect(a,b,c,d),this},restore:function(){return this._dirty=!0,this.context.restore(),this},rotate:function(a){return this._dirty=!0,this.context.rotate(a),this},setStrokeStyle:function(a,b,c,d,e){return"undefined"==typeof a&&(a=1),"undefined"==typeof b&&(b="butt"),"undefined"==typeof c&&(c="miter"),"undefined"==typeof d&&(d=10),e=!1,this.lineWidth(a),this.lineCap(b),this.lineJoin(c),this.miterLimit(d),this},save:function(){return this._dirty=!0,this.context.save(),this},scale:function(a,b){return this._dirty=!0,this.context.scale(a,b),this},scrollPathIntoView:function(){return this._dirty=!0,this.context.scrollPathIntoView(),this},stroke:function(){return this._dirty=!0,this.context.stroke(),this},strokeRect:function(a,b,c,d){return this._dirty=!0,this.context.strokeRect(a,b,c,d),this},strokeStyle:function(a){return this.context.strokeStyle=a,this},render:function(){this._dirty&&(this.game.renderType==c.WEBGL&&b.texturesToUpdate.push(this.baseTexture),this._dirty=!1)}},c.BitmapData.prototype.constructor=c.BitmapData,c.BitmapData.prototype.mt=c.BitmapData.prototype.moveTo,c.BitmapData.prototype.lt=c.BitmapData.prototype.lineTo,c.BitmapData.prototype.at=c.BitmapData.prototype.arcTo,c.BitmapData.prototype.bt=c.BitmapData.prototype.bezierCurveTo,c.BitmapData.prototype.qt=c.BitmapData.prototype.quadraticCurveTo,c.BitmapData.prototype.a=c.BitmapData.prototype.arc,c.BitmapData.prototype.r=c.BitmapData.prototype.rect,c.BitmapData.prototype.cp=c.BitmapData.prototype.closePath,c.BitmapData.prototype.c=c.BitmapData.prototype.clear,c.BitmapData.prototype.f=c.BitmapData.prototype.beginFill,c.BitmapData.prototype.lf=c.BitmapData.prototype.beginLinearGradientFill,c.BitmapData.prototype.rf=c.BitmapData.prototype.beginRadialGradientFill,c.BitmapData.prototype.ef=c.BitmapData.prototype.endFill,c.BitmapData.prototype.ss=c.BitmapData.prototype.setStrokeStyle,c.BitmapData.prototype.s=c.BitmapData.prototype.beginStroke,c.BitmapData.prototype.ls=c.BitmapData.prototype.beginLinearGradientStroke,c.BitmapData.prototype.rs=c.BitmapData.prototype.beginRadialGradientStroke,c.BitmapData.prototype.dr=c.BitmapData.prototype.rect,c.BitmapData.prototype.dc=c.BitmapData.prototype.circle,c.BitmapData.prototype.de=c.BitmapData.prototype.ellipse,c.Sprite=function(a,d,e,f,g){d=d||0,e=e||0,f=f||null,g=g||null,this.game=a,this.exists=!0,this.alive=!0,this.group=null,this.name="",this.type=c.SPRITE,this.renderOrderID=-1,this.lifespan=0,this.events=new c.Events(this),this.animations=new c.AnimationManager(this),this.input=new c.InputHandler(this),this.key=f,this.currentFrame=null,f instanceof c.RenderTexture?(b.Sprite.call(this,f),this.currentFrame=this.game.cache.getTextureFrame(f.name)):f instanceof c.BitmapData?(b.Sprite.call(this,f.texture,f.textureFrame),this.currentFrame=f.textureFrame):f instanceof b.Texture?(b.Sprite.call(this,f),this.currentFrame=g):(null===f||"undefined"==typeof f?(f="__default",this.key=f):"string"==typeof f&&this.game.cache.checkImageKey(f)===!1&&(f="__missing",this.key=f),b.Sprite.call(this,b.TextureCache[f]),this.game.cache.isSpriteSheet(f)?(this.animations.loadFrameData(this.game.cache.getFrameData(f)),null!==g&&("string"==typeof g?this.frameName=g:this.frame=g)):this.currentFrame=this.game.cache.getFrame(f)),this.textureRegion=new c.Rectangle(this.texture.frame.x,this.texture.frame.y,this.texture.frame.width,this.texture.frame.height),this.anchor=new c.Point,this.x=d,this.y=e,this.position.x=d,this.position.y=e,this.world=new c.Point(d,e),this.autoCull=!1,this.scale=new c.Point(1,1),this._cache={fresh:!0,dirty:!1,a00:-1,a01:-1,a02:-1,a10:-1,a11:-1,a12:-1,id:-1,i01:-1,i10:-1,idi:-1,left:null,right:null,top:null,bottom:null,prevX:d,prevY:e,x:-1,y:-1,scaleX:1,scaleY:1,width:this.currentFrame.sourceSizeW,height:this.currentFrame.sourceSizeH,halfWidth:Math.floor(this.currentFrame.sourceSizeW/2),halfHeight:Math.floor(this.currentFrame.sourceSizeH/2),calcWidth:-1,calcHeight:-1,frameID:-1,frameWidth:this.currentFrame.width,frameHeight:this.currentFrame.height,cameraVisible:!0,cropX:0,cropY:0,cropWidth:this.currentFrame.sourceSizeW,cropHeight:this.currentFrame.sourceSizeH},this.offset=new c.Point,this.center=new c.Point(d+Math.floor(this._cache.width/2),e+Math.floor(this._cache.height/2)),this.topLeft=new c.Point(d,e),this.topRight=new c.Point(d+this._cache.width,e),this.bottomRight=new c.Point(d+this._cache.width,e+this._cache.height),this.bottomLeft=new c.Point(d,e+this._cache.height),this.bounds=new c.Rectangle(d,e,this._cache.width,this._cache.height),this.body=new c.Physics.Arcade.Body(this),this.health=1,this.inWorld=c.Rectangle.intersects(this.bounds,this.game.world.bounds),this.inWorldThreshold=0,this.outOfBoundsKill=!1,this._outOfBoundsFired=!1,this.fixedToCamera=!1,this.cameraOffset=new c.Point(d,e),this.crop=new c.Rectangle(0,0,this._cache.width,this._cache.height),this.cropEnabled=!1,this.debug=!1,this.updateCache(),this.updateBounds()},c.Sprite.prototype=Object.create(b.Sprite.prototype),c.Sprite.prototype.constructor=c.Sprite,c.Sprite.prototype.preUpdate=function(){return this._cache.fresh?(this.world.setTo(this.parent.position.x+this.x,this.parent.position.y+this.y),this.worldTransform[2]=this.world.x,this.worldTransform[5]=this.world.y,this._cache.fresh=!1,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),void 0):!this.exists||this.group&&!this.group.exists?(this.renderOrderID=-1,!1):this.lifespan>0&&(this.lifespan-=this.game.time.elapsed,this.lifespan<=0)?(this.kill(),!1):(this._cache.dirty=!1,this.visible&&(this.renderOrderID=this.game.world.currentRenderOrderID++),this.updateCache(),this.updateAnimation(),this.updateCrop(),(this._cache.dirty||this.world.x!==this._cache.prevX||this.world.y!==this._cache.prevY)&&this.updateBounds(),this.body&&this.body.preUpdate(),!0)},c.Sprite.prototype.updateCache=function(){this._cache.prevX=this.world.x,this._cache.prevY=this.world.y,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]),(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],this._cache.a01=this.worldTransform[1],this._cache.a10=this.worldTransform[3],this._cache.a11=this.worldTransform[4],this._cache.i01=this.worldTransform[1],this._cache.i10=this.worldTransform[3],this._cache.scaleX=Math.sqrt(this._cache.a00*this._cache.a00+this._cache.a01*this._cache.a01),this._cache.scaleY=Math.sqrt(this._cache.a10*this._cache.a10+this._cache.a11*this._cache.a11),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=!0),this._cache.a02=this.worldTransform[2],this._cache.a12=this.worldTransform[5]},c.Sprite.prototype.updateAnimation=function(){(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=!0)},c.Sprite.prototype.updateCrop=function(){!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=!0,b.Texture.frameUpdates.push(this.texture))},c.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=c.Math.min(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x),this._cache.right=c.Math.max(this.topLeft.x,this.topRight.x,this.bottomLeft.x,this.bottomRight.x),this._cache.top=c.Math.min(this.topLeft.y,this.topRight.y,this.bottomLeft.y,this.bottomRight.y),this._cache.bottom=c.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=!0,this.inWorld===!1?(this.inWorld=c.Rectangle.intersects(this.bounds,this.game.world.bounds,this.inWorldThreshold),this.inWorld&&(this._outOfBoundsFired=!1)):(this.inWorld=c.Rectangle.intersects(this.bounds,this.game.world.bounds,this.inWorldThreshold),this.inWorld===!1&&(this.events.onOutOfBounds.dispatch(this),this._outOfBoundsFired=!0,this.outOfBoundsKill&&this.kill())),this._cache.cameraVisible=c.Rectangle.intersects(this.game.world.camera.screenView,this.bounds,0),this.autoCull&&(this.renderable=this._cache.cameraVisible)},c.Sprite.prototype.getLocalPosition=function(a,b,c){return a.x=(this._cache.a11*this._cache.id*b+-this._cache.a01*this._cache.id*c+(this._cache.a12*this._cache.a01-this._cache.a02*this._cache.a11)*this._cache.id)*this.scale.x+this._cache.a02,a.y=(this._cache.a00*this._cache.id*c+-this._cache.a10*this._cache.id*b+(-this._cache.a12*this._cache.a00+this._cache.a02*this._cache.a10)*this._cache.id)*this.scale.y+this._cache.a12,a},c.Sprite.prototype.getLocalUnmodifiedPosition=function(a,b,c){return a.x=this._cache.a11*this._cache.idi*b+-this._cache.i01*this._cache.idi*c+(this._cache.a12*this._cache.i01-this._cache.a02*this._cache.a11)*this._cache.idi+this.anchor.x*this._cache.width,a.y=this._cache.a00*this._cache.idi*c+-this._cache.i10*this._cache.idi*b+(-this._cache.a12*this._cache.a00+this._cache.a02*this._cache.i10)*this._cache.idi+this.anchor.y*this._cache.height,a},c.Sprite.prototype.resetCrop=function(){this.crop=new c.Rectangle(0,0,this._cache.width,this._cache.height),this.texture.setFrame(this.crop),this.cropEnabled=!1},c.Sprite.prototype.postUpdate=function(){this.key instanceof c.BitmapData&&this.key._dirty&&this.key.render(),this.exists&&(this.body&&this.body.postUpdate(),this.fixedToCamera?(this._cache.x=this.game.camera.view.x+this.cameraOffset.x,this._cache.y=this.game.camera.view.y+this.cameraOffset.y):(this._cache.x=this.x,this._cache.y=this.y),this.position.x=this._cache.x,this.position.y=this._cache.y)},c.Sprite.prototype.loadTexture=function(a,d){this.key=a,a instanceof c.RenderTexture?this.currentFrame=this.game.cache.getTextureFrame(a.name):a instanceof c.BitmapData?(this.setTexture(a.texture),this.currentFrame=a.textureFrame):a instanceof b.Texture?this.currentFrame=d:(("undefined"==typeof a||this.game.cache.checkImageKey(a)===!1)&&(a="__default",this.key=a),this.game.cache.isSpriteSheet(a)?(this.animations.loadFrameData(this.game.cache.getFrameData(a)),"undefined"!=typeof d&&("string"==typeof d?this.frameName=d:this.frame=d)):(this.currentFrame=this.game.cache.getFrame(a),this.setTexture(b.TextureCache[a])))},c.Sprite.prototype.centerOn=function(a,b){return this.fixedToCamera?(this.cameraOffset.x=a+(this.cameraOffset.x-this.center.x),this.cameraOffset.y=b+(this.cameraOffset.y-this.center.y)):(this.x=a+(this.x-this.center.x),this.y=b+(this.y-this.center.y)),this},c.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},c.Sprite.prototype.kill=function(){return this.alive=!1,this.exists=!1,this.visible=!1,this.events&&this.events.onKilled.dispatch(this),this},c.Sprite.prototype.destroy=function(){this.filters&&(this.filters=null),this.group&&this.group.remove(this),this.input&&this.input.destroy(),this.events&&this.events.destroy(),this.animations&&this.animations.destroy(),this.body&&this.body.destroy(),this.alive=!1,this.exists=!1,this.visible=!1,this.game=null},c.Sprite.prototype.damage=function(a){return this.alive&&(this.health-=a,this.health<0&&this.kill()),this},c.Sprite.prototype.reset=function(a,b,c){return"undefined"==typeof c&&(c=1),this.x=a,this.y=b,this.world.setTo(a,b),this.position.x=this.x,this.position.y=this.y,this.alive=!0,this.exists=!0,this.visible=!0,this.renderable=!0,this._outOfBoundsFired=!1,this.health=c,this.body&&this.body.reset(!1),this},c.Sprite.prototype.bringToTop=function(){return this.group?this.group.bringToTop(this):this.game.world.bringToTop(this),this},c.Sprite.prototype.play=function(a,b,c,d){return this.animations?this.animations.play(a,b,c,d):void 0},Object.defineProperty(c.Sprite.prototype,"deltaX",{get:function(){return this.world.x-this._cache.prevX}}),Object.defineProperty(c.Sprite.prototype,"deltaY",{get:function(){return this.world.y-this._cache.prevY}}),Object.defineProperty(c.Sprite.prototype,"angle",{get:function(){return c.Math.wrapAngle(c.Math.radToDeg(this.rotation))},set:function(a){this.rotation=c.Math.degToRad(c.Math.wrapAngle(a))}}),Object.defineProperty(c.Sprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(c.Sprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(c.Sprite.prototype,"inCamera",{get:function(){return this._cache.cameraVisible}}),Object.defineProperty(c.Sprite.prototype,"worldCenterX",{get:function(){return this.game.camera.x+this.center.x}}),Object.defineProperty(c.Sprite.prototype,"worldCenterY",{get:function(){return this.game.camera.y+this.center.y}}),Object.defineProperty(c.Sprite.prototype,"width",{get:function(){return this.scale.x*this.currentFrame.width},set:function(a){this.scale.x=a/this.currentFrame.width,this._cache.scaleX=a/this.currentFrame.width,this._width=a}}),Object.defineProperty(c.Sprite.prototype,"height",{get:function(){return this.scale.y*this.currentFrame.height},set:function(a){this.scale.y=a/this.currentFrame.height,this._cache.scaleY=a/this.currentFrame.height,this._height=a}}),Object.defineProperty(c.Sprite.prototype,"inputEnabled",{get:function(){return this.input.enabled},set:function(a){a?this.input.enabled===!1&&this.input.start():this.input.enabled&&this.input.stop()}}),c.TileSprite=function(a,d,e,f,g,h){d=d||0,e=e||0,f=f||256,g=g||256,h=h||null,c.Sprite.call(this,a,d,e,h),this.texture=b.TextureCache[h],b.TilingSprite.call(this,this.texture,f,g),this.type=c.TILESPRITE,this.tileScale=new c.Point(1,1),this.tilePosition=new c.Point(0,0),this.body.width=f,this.body.height=g
},c.TileSprite.prototype=c.Utils.extend(!0,b.TilingSprite.prototype,c.Sprite.prototype),c.TileSprite.prototype.constructor=c.TileSprite,Object.defineProperty(c.TileSprite.prototype,"angle",{get:function(){return c.Math.wrapAngle(c.Math.radToDeg(this.rotation))},set:function(a){this.rotation=c.Math.degToRad(c.Math.wrapAngle(a))}}),Object.defineProperty(c.TileSprite.prototype,"frame",{get:function(){return this.animations.frame},set:function(a){this.animations.frame=a}}),Object.defineProperty(c.TileSprite.prototype,"frameName",{get:function(){return this.animations.frameName},set:function(a){this.animations.frameName=a}}),Object.defineProperty(c.TileSprite.prototype,"inCamera",{get:function(){return this._cache.cameraVisible}}),Object.defineProperty(c.TileSprite.prototype,"inputEnabled",{get:function(){return this.input.enabled},set:function(a){a?this.input.enabled===!1&&this.input.start():this.input.enabled&&this.input.stop()}}),c.Text=function(a,d,e,f,g){d=d||0,e=e||0,f=f||"",g=g||"",this.game=a,this.exists=!0,this.alive=!0,this.group=null,this.name="",this.type=c.TEXT,this._text=f,this._style=g,b.Text.call(this,f,g),this.position.x=this.x=d,this.position.y=this.y=e,this.anchor=new c.Point,this.scale=new c.Point(1,1),this.fixedToCamera=!1,this.cameraOffset=new c.Point(d,e),this._cache={dirty:!1,a00:1,a01:0,a02:d,a10:0,a11:1,a12:e,id:1,x:-1,y:-1,scaleX:1,scaleY:1},this._cache.x=this.x,this._cache.y=this.y,this.renderable=!0},c.Text.prototype=Object.create(b.Text.prototype),c.Text.prototype.constructor=c.Text,c.Text.prototype.update=function(){this.exists&&(this.fixedToCamera&&(this.x=this.game.camera.view.x+this.cameraOffset.x,this.y=this.game.camera.view.y+this.cameraOffset.y),this._cache.dirty=!1,this._cache.x=this.x,this._cache.y=this.y,(this.position.x!=this._cache.x||this.position.y!=this._cache.y)&&(this.position.x=this._cache.x,this.position.y=this._cache.y,this._cache.dirty=!0))},c.Text.prototype.destroy=function(){this.group&&this.group.remove(this),this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null),this.exists=!1,this.group=null},Object.defineProperty(c.Text.prototype,"angle",{get:function(){return c.Math.radToDeg(this.rotation)},set:function(a){this.rotation=c.Math.degToRad(a)}}),Object.defineProperty(c.Text.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(c.Text.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),Object.defineProperty(c.Text.prototype,"content",{get:function(){return this._text},set:function(a){a!==this._text&&(this._text=a,this.setText(a))}}),Object.defineProperty(c.Text.prototype,"font",{get:function(){return this._style},set:function(a){a!==this._style&&(this._style=a,this.setStyle(a))}}),c.BitmapText=function(a,d,e,f,g){d=d||0,e=e||0,f=f||"",g=g||"",this.game=a,this.exists=!0,this.alive=!0,this.group=null,this.name="",this.type=c.BITMAPTEXT,b.BitmapText.call(this,f,g),this.position.x=d,this.position.y=e,this.anchor=new c.Point,this.scale=new c.Point(1,1),this._cache={dirty:!1,a00:1,a01:0,a02:d,a10:0,a11:1,a12:e,id:1,x:-1,y:-1,scaleX:1,scaleY:1},this._cache.x=this.x,this._cache.y=this.y},c.BitmapText.prototype=Object.create(b.BitmapText.prototype),c.BitmapText.prototype.constructor=c.BitmapText,c.BitmapText.prototype.update=function(){this.exists&&(this._cache.dirty=!1,this._cache.x=this.x,this._cache.y=this.y,(this.position.x!=this._cache.x||this.position.y!=this._cache.y)&&(this.position.x=this._cache.x,this.position.y=this._cache.y,this._cache.dirty=!0),this.pivot.x=this.anchor.x*this.width,this.pivot.y=this.anchor.y*this.height)},c.BitmapText.prototype.destroy=function(){this.group&&this.group.remove(this),this.canvas&&this.canvas.parentNode?this.canvas.parentNode.removeChild(this.canvas):(this.canvas=null,this.context=null),this.exists=!1,this.group=null},Object.defineProperty(c.BitmapText.prototype,"angle",{get:function(){return c.Math.radToDeg(this.rotation)},set:function(a){this.rotation=c.Math.degToRad(a)}}),Object.defineProperty(c.BitmapText.prototype,"x",{get:function(){return this.position.x},set:function(a){this.position.x=a}}),Object.defineProperty(c.BitmapText.prototype,"y",{get:function(){return this.position.y},set:function(a){this.position.y=a}}),c.Button=function(a,b,d,e,f,g,h,i,j,k){b=b||0,d=d||0,e=e||null,f=f||null,g=g||this,c.Sprite.call(this,a,b,d,e,i),this.type=c.BUTTON,this._onOverFrameName=null,this._onOutFrameName=null,this._onDownFrameName=null,this._onUpFrameName=null,this._onOverFrameID=null,this._onOutFrameID=null,this._onDownFrameID=null,this._onUpFrameID=null,this.onOverSound=null,this.onOutSound=null,this.onDownSound=null,this.onUpSound=null,this.onOverSoundMarker="",this.onOutSoundMarker="",this.onDownSoundMarker="",this.onUpSoundMarker="",this.onInputOver=new c.Signal,this.onInputOut=new c.Signal,this.onInputDown=new c.Signal,this.onInputUp=new c.Signal,this.freezeFrames=!1,this.forceOut=!1,this.setFrames(h,i,j,k),null!==f&&this.onInputUp.add(f,g),this.input.start(0,!0),this.events.onInputOver.add(this.onInputOverHandler,this),this.events.onInputOut.add(this.onInputOutHandler,this),this.events.onInputDown.add(this.onInputDownHandler,this),this.events.onInputUp.add(this.onInputUpHandler,this)},c.Button.prototype=Object.create(c.Sprite.prototype),c.Button.prototype=c.Utils.extend(!0,c.Button.prototype,c.Sprite.prototype,b.Sprite.prototype),c.Button.prototype.constructor=c.Button,c.Button.prototype.clearFrames=function(){this._onOverFrameName=null,this._onOverFrameID=null,this._onOutFrameName=null,this._onOutFrameID=null,this._onDownFrameName=null,this._onDownFrameID=null,this._onUpFrameName=null,this._onUpFrameID=null},c.Button.prototype.setFrames=function(a,b,c,d){this.clearFrames(),null!==a&&("string"==typeof a?(this._onOverFrameName=a,this.input.pointerOver()&&(this.frameName=a)):(this._onOverFrameID=a,this.input.pointerOver()&&(this.frame=a))),null!==b&&("string"==typeof b?(this._onOutFrameName=b,this.input.pointerOver()===!1&&(this.frameName=b)):(this._onOutFrameID=b,this.input.pointerOver()===!1&&(this.frame=b))),null!==c&&("string"==typeof c?(this._onDownFrameName=c,this.input.pointerDown()&&(this.frameName=c)):(this._onDownFrameID=c,this.input.pointerDown()&&(this.frame=c))),null!==d&&("string"==typeof d?(this._onUpFrameName=d,this.input.pointerUp()&&(this.frameName=d)):(this._onUpFrameID=d,this.input.pointerUp()&&(this.frame=d)))},c.Button.prototype.setSounds=function(a,b,c,d,e,f,g,h){this.setOverSound(a,b),this.setOutSound(e,f),this.setDownSound(c,d),this.setUpSound(g,h)},c.Button.prototype.setOverSound=function(a,b){this.onOverSound=null,this.onOverSoundMarker="",a instanceof c.Sound&&(this.onOverSound=a),"string"==typeof b&&(this.onOverSoundMarker=b)},c.Button.prototype.setOutSound=function(a,b){this.onOutSound=null,this.onOutSoundMarker="",a instanceof c.Sound&&(this.onOutSound=a),"string"==typeof b&&(this.onOutSoundMarker=b)},c.Button.prototype.setDownSound=function(a,b){this.onDownSound=null,this.onDownSoundMarker="",a instanceof c.Sound&&(this.onDownSound=a),"string"==typeof b&&(this.onDownSoundMarker=b)},c.Button.prototype.setUpSound=function(a,b){this.onUpSound=null,this.onUpSoundMarker="",a instanceof c.Sound&&(this.onUpSound=a),"string"==typeof b&&(this.onUpSoundMarker=b)},c.Button.prototype.onInputOverHandler=function(a,b){this.freezeFrames===!1&&this.setState(1),this.onOverSound&&this.onOverSound.play(this.onOverSoundMarker),this.onInputOver&&this.onInputOver.dispatch(this,b)},c.Button.prototype.onInputOutHandler=function(a,b){this.freezeFrames===!1&&this.setState(2),this.onOutSound&&this.onOutSound.play(this.onOutSoundMarker),this.onInputOut&&this.onInputOut.dispatch(this,b)},c.Button.prototype.onInputDownHandler=function(a,b){this.freezeFrames===!1&&this.setState(3),this.onDownSound&&this.onDownSound.play(this.onDownSoundMarker),this.onInputDown&&this.onInputDown.dispatch(this,b)},c.Button.prototype.onInputUpHandler=function(a,b,c){this.onUpSound&&this.onUpSound.play(this.onUpSoundMarker),this.onInputUp&&this.onInputUp.dispatch(this,b,c),this.freezeFrames||(this.forceOut?this.setState(2):this._onUpFrameName||this._onUpFrameID?this.setState(4):c?this.setState(1):this.setState(2))},c.Button.prototype.setState=function(a){1===a?null!=this._onOverFrameName?this.frameName=this._onOverFrameName:null!=this._onOverFrameID&&(this.frame=this._onOverFrameID):2===a?null!=this._onOutFrameName?this.frameName=this._onOutFrameName:null!=this._onOutFrameID&&(this.frame=this._onOutFrameID):3===a?null!=this._onDownFrameName?this.frameName=this._onDownFrameName:null!=this._onDownFrameID&&(this.frame=this._onDownFrameID):4===a&&(null!=this._onUpFrameName?this.frameName=this._onUpFrameName:null!=this._onUpFrameID&&(this.frame=this._onUpFrameID))},c.Graphics=function(a,d,e){this.game=a,b.Graphics.call(this),this.type=c.GRAPHICS,this.position.x=d,this.position.y=e},c.Graphics.prototype=Object.create(b.Graphics.prototype),c.Graphics.prototype.constructor=c.Graphics,c.Graphics.prototype.destroy=function(){this.clear(),this.group&&this.group.remove(this),this.game=null},c.Graphics.prototype.drawPolygon=function(a){this.moveTo(a.points[0].x,a.points[0].y);for(var b=1;bh;h++)f[h].updateTransform();var j=a.__renderGroup;j?a==j.root?j.render(this.projection,this.glFramebuffer):j.renderSpecific(a,this.projection,this.glFramebuffer):(this.renderGroup||(this.renderGroup=new b.WebGLRenderGroup(e)),this.renderGroup.setRenderable(a),this.renderGroup.render(this.projection,this.glFramebuffer)),a.worldTransform=g},c.RenderTexture.prototype.renderCanvas=function(a,c,d,e){var f=a.children;a.worldTransform=b.mat3.create(),c&&(a.worldTransform[2]=c.x,a.worldTransform[5]=c.y);for(var g=0,h=f.length;h>g;g++)f[g].updateTransform();d&&this.renderer.context.clearRect(0,0,this.width,this.height),this.renderer.renderDisplayObject(a,e),this.renderer.context.setTransform(1,0,0,1,0,0)},c.Canvas={create:function(a,b,c){a=a||256,b=b||256;var d=document.createElement("canvas");return"string"==typeof c&&(d.id=c),d.width=a,d.height=b,d.style.display="block",d},getOffset:function(a,b){b=b||new c.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),b.x=d.left+h-f,b.y=d.top+g-e,b},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}},c.StageScaleMode=function(a,b,d){this.game=a,this.width=b,this.height=d,this.minWidth=null,this.maxWidth=null,this.minHeight=null,this.maxHeight=null,this._startHeight=0,this.forceLandscape=!1,this.forcePortrait=!1,this.incorrectOrientation=!1,this.pageAlignHorizontally=!1,this.pageAlignVertically=!1,this._width=0,this._height=0,this.maxIterations=5,this.orientationSprite=null,this.enterLandscape=new c.Signal,this.enterPortrait=new c.Signal,this.enterIncorrectOrientation=new c.Signal,this.leaveIncorrectOrientation=new c.Signal,this.hasResized=new c.Signal,this.orientation=window.orientation?window.orientation:window.outerWidth>window.outerHeight?90:0,this.scaleFactor=new c.Point(1,1),this.scaleFactorInversed=new c.Point(1,1),this.margin=new c.Point(0,0),this.aspectRatio=0,this.event=null;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)},c.StageScaleMode.EXACT_FIT=0,c.StageScaleMode.NO_SCALE=1,c.StageScaleMode.SHOW_ALL=2,c.StageScaleMode.prototype={startFullScreen:function(a){if(!this.isFullScreen){"undefined"!=typeof a&&c.Canvas.setSmoothingEnabled(this.game.context,a);var b=this.game.canvas;this._width=this.width,this._height=this.height,b.requestFullScreen?b.requestFullScreen():b.mozRequestFullScreen?b.parentNode.mozRequestFullScreen():b.webkitRequestFullScreen&&b.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}},stopFullScreen:function(){document.cancelFullScreen?document.cancelFullScreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()},fullScreenChange:function(a){this.event=a,this.isFullScreen?this.game.stage.fullScreenScaleMode===c.StageScaleMode.EXACT_FIT?(this.game.stage.canvas.style.width="100%",this.game.stage.canvas.style.height="100%",this.setMaximum(),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.game.stage.fullScreenScaleMode===c.StageScaleMode.SHOW_ALL&&(this.game.stage.scale.setShowAll(),this.game.stage.scale.refresh()):(this.game.stage.canvas.style.width=this.game.width+"px",this.game.stage.canvas.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)},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.Sprite(b.TextureCache[d]),this.orientationSprite.anchor.x=.5,this.orientationSprite.anchor.y=.5,this.orientationSprite.position.x=this.game.width/2,this.orientationSprite.position.y=this.game.height/2,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._stage.addChild(this.orientationSprite))},checkOrientationState:function(){this.incorrectOrientation?(this.forceLandscape&&window.innerWidth>window.innerHeight||this.forcePortrait&&window.innerHeight>window.innerWidth)&&(this.game.paused=!1,this.incorrectOrientation=!1,this.leaveIncorrectOrientation.dispatch(),this.orientationSprite&&(this.orientationSprite.visible=!1,this.game.world.visible=!0),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.game.stage.scaleMode!==c.StageScaleMode.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.game.stage.fullScreenScaleMode==c.StageScaleMode.EXACT_FIT?this.setExactFit():this.game.stage.fullScreenScaleMode==c.StageScaleMode.SHOW_ALL&&this.setShowAll():this.game.stage.scaleMode==c.StageScaleMode.EXACT_FIT?this.setExactFit():this.game.stage.scaleMode==c.StageScaleMode.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}},c.StageScaleMode.prototype.constructor=c.StageScaleMode,Object.defineProperty(c.StageScaleMode.prototype,"isFullScreen",{get:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement}}),Object.defineProperty(c.StageScaleMode.prototype,"isPortrait",{get:function(){return 0===this.orientation||180==this.orientation}}),Object.defineProperty(c.StageScaleMode.prototype,"isLandscape",{get:function(){return 90===this.orientation||-90===this.orientation}}),c.Device=function(){this.patchAndroidClearRectBug=!1,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.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.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._checkAudio(),this._checkBrowser(),this._checkCSS3D(),this._checkDevice(),this._checkFeatures(),this._checkOS()},c.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),(this.windows||this.macOS||this.linux&&this.silk===!1)&&(this.desktop=!0)},_checkFeatures:function(){this.canvas=!!window.CanvasRenderingContext2D;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},_checkBrowser:function(){var a=navigator.userAgent;/Arora/.test(a)?this.arora=!0:/Chrome/.test(a)?this.chrome=!0:/Epiphany/.test(a)?this.epiphany=!0:/Firefox/.test(a)?this.firefox=!0:/Mobile Safari/.test(a)?this.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(a)?(this.ie=!0,this.ieVersion=parseInt(RegExp.$1,10)):/Midori/.test(a)?this.midori=!0:/Opera/.test(a)?this.opera=!0:/Safari/.test(a)?this.safari=!0:/Silk/.test(a)?this.silk=!0:/Trident\/(\d+\.\d+);/.test(a)&&(this.ie=!0,this.trident=!0,this.tridentVersion=parseInt(RegExp.$1,10)),navigator.standalone&&(this.webApp=!0),navigator.isCocoonJS&&(this.cocoonJS=!0),"undefined"!=typeof window.ejecta&&(this.ejecta=!0)},_checkAudio:function(){this.audioData=!!window.Audio,this.webAudio=!(!window.webkitAudioContext&&!window.AudioContext);var a=document.createElement("audio"),b=!1;try{(b=!!a.canPlayType)&&(a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(this.ogg=!0),a.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")&&(this.opus=!0),a.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(this.mp3=!0),a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,"")&&(this.wav=!0),(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;").replace(/^no$/,""))&&(this.m4a=!0),a.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(this.webm=!0))}catch(c){}},_checkDevice:function(){this.pixelRatio=window.devicePixelRatio||1,this.iPhone=-1!=navigator.userAgent.toLowerCase().indexOf("iphone"),this.iPhone4=2==this.pixelRatio&&this.iPhone,this.iPad=-1!=navigator.userAgent.toLowerCase().indexOf("ipad"),"undefined"!=typeof Int8Array?(this.littleEndian=new Int8Array(new Int16Array([1]).buffer)[0]>0,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.length>0):!1}},c.Device.prototype.constructor=c.Device,c.RequestAnimationFrame=function(a){this.game=a,this.isRunning=!1;for(var b=["ms","moz","webkit","o"],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*(0|2097152*this.rnd.apply(this))},real:function(){return this.integer()+this.frac()},integerInRange:function(a,b){return Math.floor(this.realInRange(a,b))},realInRange:function(a,b){return this.frac()*(b-a)+a},normal:function(){return 1-2*this.frac()},uuid:function(){var a="",b="";for(b=a="";a++<36;b+=~a%5|4&3*a?(15^a?8^this.frac()*(20^a?16:4):4).toString(16):"-");return b},pick:function(a){return a[this.integerInRange(0,a.length)]},weightedPick:function(a){return a[~~(Math.pow(this.frac(),2)*a.length)]},timestamp:function(a,b){return this.realInRange(a||9466848e5,b||1577862e6)},angle:function(){return this.integerInRange(-180,180)}},c.RandomDataGenerator.prototype.constructor=c.RandomDataGenerator,c.Math={PI2:2*Math.PI,fuzzyEqual:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),Math.abs(a-b)a},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(d-b,c-a)},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 180==a%360?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},max:function(){for(var a=1,b=0,c=arguments.length;c>a;a++)arguments[b]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){return this.wrap(a,-180,180)},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},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,b,d,e){return Math.round(c.Math.distance(a,b,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}}()},c.QuadTree=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=[],this.nodes=[]},c.QuadTree.prototype={populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.body.checkCollision.none===!1&&a.alive&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new c.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new c.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new c.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new c.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 this.nodes[b].insert(a),void 0;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;return a.body.quadTreeIndex=this.getIndex(a.body),this.nodes[0]&&(-1!==a.body.quadTreeIndex?b=b.concat(this.nodes[a.body.quadTreeIndex].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=[];for(var a=0,b=this.nodes.length;b>a;a++)this.nodes[a]&&(this.nodes[a].clear(),delete this.nodes[a])}},c.QuadTree.prototype.constructor=c.QuadTree,c.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},c.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,b){return"undefined"==typeof b&&(b=!1),b?c.Math.distanceRound(this.x,this.y,a.x,a.y):c.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a&&(a=new c.Circle),a.setTo(this.x,this.y,this.diameter)},contains:function(a,b){return c.Circle.contains(this,a,b)},circumferencePoint:function(a,b,d){return c.Circle.circumferencePoint(this,a,b,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+")}]"}},c.Circle.prototype.constructor=c.Circle,Object.defineProperty(c.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(c.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(c.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(c.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(c.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(a){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(c.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),c.Circle.contains=function(a,b,c){if(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},c.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},c.Circle.intersects=function(a,b){return c.Math.distance(a.x,a.y,b.x,b.y)<=a.radius+b.radius},c.Circle.circumferencePoint=function(a,b,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new c.Point),d===!0&&(b=c.Math.radToDeg(b)),e.x=a.x+a.radius*Math.cos(b),e.y=a.y+a.radius*Math.sin(b),e},c.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},c.Point=function(a,b){a=a||0,b=b||0,this.x=a,this.y=b},c.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,this.y=b,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,b){return this.x=c.Math.clamp(this.x,a,b),this},clampY:function(a,b){return this.y=c.Math.clamp(this.y,a,b),this},clamp:function(a,b){return this.x=c.Math.clamp(this.x,a,b),this.y=c.Math.clamp(this.y,a,b),this},clone:function(a){return"undefined"==typeof a&&(a=new c.Point),a.setTo(this.x,this.y)},copyTo:function(a){return a.x=this.x,a.y=this.y,a},distance:function(a,b){return c.Point.distance(this,a,b)},equals:function(a){return a.x==this.x&&a.y==this.y},rotate:function(a,b,d,e,f){return c.Point.rotate(this,a,b,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+")}]"}},c.Point.prototype.constructor=c.Point,c.Point.add=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x+b.x,d.y=a.y+b.y,d},c.Point.subtract=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x-b.x,d.y=a.y-b.y,d},c.Point.multiply=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x*b.x,d.y=a.y*b.y,d},c.Point.divide=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x/b.x,d.y=a.y/b.y,d},c.Point.equals=function(a,b){return a.x==b.x&&a.y==b.y},c.Point.distance=function(a,b,d){return"undefined"==typeof d&&(d=!1),d?c.Math.distanceRound(a.x,a.y,b.x,b.y):c.Math.distance(a.x,a.y,b.x,b.y)},c.Point.rotate=function(a,b,d,e,f,g){return f=f||!1,g=g||null,f&&(e=c.Math.degToRad(e)),null===g&&(g=Math.sqrt((b-a.x)*(b-a.x)+(d-a.y)*(d-a.y))),a.setTo(b+g*Math.cos(e),d+g*Math.sin(e))},c.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},c.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,b){return c.Rectangle.inflate(this,a,b)},size:function(a){return c.Rectangle.size(this,a)},clone:function(a){return c.Rectangle.clone(this,a)},contains:function(a,b){return c.Rectangle.contains(this,a,b)},containsRect:function(a){return c.Rectangle.containsRect(this,a)},equals:function(a){return c.Rectangle.equals(this,a)},intersection:function(a,b){return c.Rectangle.intersection(this,a,b)},intersects:function(a,b){return c.Rectangle.intersects(this,a,b)},intersectsRaw:function(a,b,d,e,f){return c.Rectangle.intersectsRaw(this,a,b,d,e,f)},union:function(a,b){return c.Rectangle.union(this,a,b)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},c.Rectangle.prototype.constructor=c.Rectangle,Object.defineProperty(c.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(c.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(c.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(c.Rectangle.prototype,"bottomRight",{get:function(){return new c.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(c.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(c.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(c.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(c.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(c.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(c.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(c.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(c.Rectangle.prototype,"topLeft",{get:function(){return new c.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(c.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(a){a===!0&&this.setTo(0,0,0,0)}}),c.Rectangle.inflate=function(a,b,c){return a.x-=b,a.width+=2*b,a.y-=c,a.height+=2*c,a},c.Rectangle.inflatePoint=function(a,b){return c.Rectangle.inflate(a,b.x,b.y)},c.Rectangle.size=function(a,b){return"undefined"==typeof b&&(b=new c.Point),b.setTo(a.width,a.height)},c.Rectangle.clone=function(a,b){return"undefined"==typeof b&&(b=new c.Rectangle),b.setTo(a.x,a.y,a.width,a.height)},c.Rectangle.contains=function(a,b,c){return b>=a.x&&b<=a.right&&c>=a.y&&c<=a.bottom},c.Rectangle.containsRaw=function(a,b,c,d,e,f){return e>=a&&a+c>=e&&f>=b&&b+d>=f},c.Rectangle.containsPoint=function(a,b){return c.Rectangle.contains(a,b.x,b.y)},c.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},c.Rectangle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.width==b.width&&a.height==b.height},c.Rectangle.intersection=function(a,b,d){return d=d||new c.Rectangle,c.Rectangle.intersects(a,b)&&(d.x=Math.max(a.x,b.x),d.y=Math.max(a.y,b.y),d.width=Math.min(a.right,b.right)-d.x,d.height=Math.min(a.bottom,b.bottom)-d.y),d},c.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)},c.Rectangle.intersectsRaw=function(a,b,c,d,e,f){return"undefined"==typeof f&&(f=0),!(b>a.right+f||ca.bottom+f||e1){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," "))}},c.Net.prototype.constructor=c.Net,c.TweenManager=function(a){this.game=a,this._tweens=[],this._add=[],this.game.onPause.add(this.pauseAll,this),this.game.onResume.add(this.resumeAll,this)},c.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()}},c.TweenManager.prototype.constructor=c.TweenManager,c.Tween=function(a,b){this._object=a,this.game=b,this._manager=this.game.tweens,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=c.Easing.Linear.None,this._interpolationFunction=c.Math.linearInterpolation,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,this._pausedTime=0,this.pendingDelete=!1;for(var d in a)this._valuesStart[d]=parseFloat(a[d],10);this.onStart=new c.Signal,this.onLoop=new c.Signal,this.onComplete=new c.Signal,this.isRunning=!1},c.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(this._valuesEnd[a]instanceof Array){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],this._valuesStart[a]instanceof Array==!1&&(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},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._paused=!0,this._pausedTime=this.game.time.now},resume:function(){this._paused=!1,this._startTime+=this.game.time.now-this._pausedTime},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}},c.Tween.prototype.constructor=c.Tween,c.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((a-b)*2*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((a-b)*2*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((a-b)*2*Math.PI/d):.5*c*Math.pow(2,-10*(a-=1))*Math.sin((a-b)*2*Math.PI/d)+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-c.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*c.Easing.Bounce.In(2*a):.5*c.Easing.Bounce.Out(2*a-1)+.5}}},c.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new c.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0,this.game.onPause.add(this.gamePaused,this),this.game.onResume.add(this.gameResumed,this)},c.Time.prototype={boot:function(){this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var b=new c.Timer(this.game,a);return this._timers.push(b),b},removeAll:function(){for(var a=0;athis._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.physicsElapsed=1*(this.elapsed/1e3),this.physicsElapsed>.05&&(this.physicsElapsed=.05),this.game.paused)this.pausedTime=this.now-this._pauseStarted;else 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._started,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;)this.events[this._i].loop===!0?(this.events[this._i].tick+=this.events[this._i].delay-(this._now-this.events[this._i].tick),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+=this.events[this._i].delay-(this._now-this.events[this._i].tick),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)},resume:function(){if(this.running&&!this.expired){for(var a=this.game.time.now-this._pauseStarted,b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(c.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(c.Timer.prototype,"ms",{get:function(){return this._now}}),Object.defineProperty(c.Timer.prototype,"seconds",{get:function(){return.001*this._now}}),c.Timer.prototype.constructor=c.Timer,c.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},c.TimerEvent.prototype.constructor=c.TimerEvent,c.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=[]},c.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,d,e,f,g){return null==this._frameData?(console.warn("No FrameData available for Phaser.Animation "+a),void 0):(e=e||60,"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=d&&"number"==typeof d[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new c.Signal,this.sprite.events.onAnimationComplete=new c.Signal,this.sprite.events.onAnimationLoop=new c.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(d,g,this._outputFrames),this._anims[a]=new c.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,e,f),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid]),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?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,this.sprite.currentFrame=this.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid])},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},c.AnimationManager.prototype.constructor=c.AnimationManager,Object.defineProperty(c.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(c.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(c.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(c.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._frameIndex=a,this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(c.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._frameIndex=this.currentFrame.index,this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid])):console.warn("Cannot set frameName: "+a)}}),c.Animation=function(a,b,c,d,e,f,g){this.game=a,this._parent=b,this._frameData=d,this.name=c,this._frames=[],this._frames=this._frames.concat(e),this.delay=1e3/f,this.looped=g,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])},c.Animation.prototype={play:function(a,c,d){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof c&&(this.looped=c),"undefined"!=typeof d&&(this.killOnComplete=d),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,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(b.TextureCache[this.currentFrame.uuid]),this._parent.events&&this._parent.events.onAnimationStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,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])},stop:function(a){"undefined"==typeof a&&(a=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0]))},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.looped?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setTexture(b.TextureCache[this.currentFrame.uuid]),this._parent.events.onAnimationLoop.dispatch(this._parent,this)):this.onComplete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setTexture(b.TextureCache[this.currentFrame.uuid])),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1},onComplete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events&&this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},c.Animation.prototype.constructor=c.Animation,Object.defineProperty(c.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(c.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(c.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(a),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(b.TextureCache[this.currentFrame.uuid]))}}),c.Animation.generateFrameNames=function(a,b,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>b)for(var i=b;d>=i;i++)h="number"==typeof f?c.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=b;i>=d;i--)h="number"==typeof f?c.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},c.Frame=function(a,b,d,e,f,g,h){this.index=a,this.x=b,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=c.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},c.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)}},c.Frame.prototype.constructor=c.Frame,c.FrameData=function(){this._frames=[],this._frameNames=[]},c.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 this._frames.length>a?this._frames[a]:null},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++)b?c.push(this.getFrame(a[d])):c.push(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}},c.FrameData.prototype.constructor=c.FrameData,Object.defineProperty(c.FrameData.prototype,"total",{get:function(){return this._frames.length}}),c.AnimationParser={spriteSheet:function(a,d,e,f,g,h,i){var j=a.cache.getImage(d);if(null==j)return null;var k=j.width,l=j.height;0>=e&&(e=Math.floor(-k/Math.min(-1,e))),0>=f&&(f=Math.floor(-l/Math.min(-1,f)));var m=Math.round(k/e),n=Math.round(l/f),o=m*n;if(-1!==g&&(o=g),0===k||0===l||e>k||f>l||0===o)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var p=new c.FrameData,q=h,r=h,s=0;o>s;s++){var t=a.rnd.uuid();p.addFrame(new c.Frame(s,q,r,e,f,"",t)),b.TextureCache[t]=new b.Texture(b.BaseTextureCache[d],{x:q,y:r,width:e,height:f}),q+=e+i,q===k&&(q=h,r+=f+i)}return p},JSONData:function(a,d,e){if(!d.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),console.log(d),void 0;for(var f,g=new c.FrameData,h=d.frames,i=0;i tag"),void 0;for(var f,g,h,i,j,k,l,m,n,o,p,q,r=new c.FrameData,s=d.getElementsByTagName("SubTexture"),t=0;t0)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 console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex),void 0;var a=this._fileList[this._fileIndex],b=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 b.fileComplete(b._fileIndex)},a.data.onerror=function(){return b.fileError(b._fileIndex)},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 b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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 b.fileError(b._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",c.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===c.Tilemap.TILED_JSON)this._xhr.onload=function(){return b.jsonLoadComplete(b._fileIndex)};else{if(a.format!==c.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return b.csvLoadComplete(b._fileIndex)}}this._xhr.onerror=function(){return b.dataLoadError(b._fileIndex)},this._xhr.send();break;case"text":case"script":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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 b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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.crop.width=Math.floor(this.preloadSprite.width/100*this.progress):this.preloadSprite.crop.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop=this.preloadSprite.crop),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 tag"),void 0;var e=b.TextureCache[d],f={},g=c.getElementsByTagName("info")[0],h=c.getElementsByTagName("common")[0];f.font=g.attributes.getNamedItem("face").nodeValue,f.size=parseInt(g.attributes.getNamedItem("size").nodeValue,10),f.lineHeight=parseInt(h.attributes.getNamedItem("lineHeight").nodeValue,10),f.chars={};for(var i=c.getElementsByTagName("char"),j=0;j=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):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(a=a||"",b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=!1),"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 console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist"),void 0;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,this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else 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.externalNode?this._sound.connect(this.externalNode.input):this._sound.connect(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.externalNode?this._sound.connect(this.externalNode.input):this._sound.connect(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.onStop.dispatch(this,a)}},c.Sound.prototype.constructor=c.Sound,Object.defineProperty(c.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(c.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(c.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(c.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)}}),c.SoundManager=function(a){this.game=a,this.onSoundDecode=new c.Signal,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},c.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,this.noAudio=!0,void 0;if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,this.noAudio=!1,void 0}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 c.Color.getColor(255,255,255);if(a>b)return c.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(b-a)),f=a+Math.round(Math.random()*(b-a)),g=a+Math.round(Math.random()*(b-a));return c.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:255&a>>16,green:255&a>>8,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=255&a>>16,d=255&a>>8,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 255&a>>16},getGreen:function(a){return 255&a>>8},getBlue:function(a){return 255&a}};var f=function(){"use strict";function a(a,b){this.x=a||0,this.y=b||0}function b(b,c){this.pos=b||new a,this.r=c||0}function c(b,c){this.pos=b||new a,this.points=c||[],this.recalc()}function d(b,c,d){this.pos=b||new a,this.w=c||0,this.h=d||0}function e(){this.a=null,this.b=null,this.overlapN=new a,this.overlapV=new a,this.clear()}function f(a,b,c){for(var d=Number.MAX_VALUE,e=-Number.MAX_VALUE,f=a.length,g=0;f>g;g++){var h=a[g].dot(b);d>h&&(d=h),h>e&&(e=h)}c[0]=d,c[1]=e}function g(a,b,c,d,e,g){var h=p.pop(),i=p.pop(),j=n.pop().copy(b).sub(a),k=j.dot(e);if(f(c,e,h),f(d,e,i),i[0]+=k,i[1]+=k,h[0]>i[1]||i[0]>h[1])return n.push(j),p.push(h),p.push(i),!0;if(g){var l=0;if(h[0]m?m:-o}else if(g.bInA=!1,h[1]>i[1])l=h[0]-i[1],g.aInB=!1;else{var m=h[1]-i[0],o=i[1]-h[0];l=o>m?m:-o}var q=Math.abs(l);ql&&g.overlapN.reverse())}return n.push(j),p.push(h),p.push(i),!1}function h(a,b){var c=a.len2(),d=b.dot(a);return 0>d?q:d>c?s:r}function i(a,b,c){var d=n.pop().copy(b.pos).sub(a.pos),e=a.r+b.r,f=e*e,g=d.len2();if(g>f)return n.push(d),!1;if(c){var h=Math.sqrt(g);c.a=a,c.b=b,c.overlap=e-h,c.overlapN.copy(d.normalize()),c.overlapV.copy(d).scale(c.overlap),c.aInB=a.r<=b.r&&h<=b.r-a.r,c.bInA=b.r<=a.r&&h<=a.r-b.r}return n.push(d),!0}function j(a,b,c){for(var d=n.pop().copy(b.pos).sub(a.pos),e=b.r,f=e*e,g=a.points,i=g.length,j=n.pop(),k=n.pop(),l=0;i>l;l++){var m=l===i-1?0:l+1,o=0===l?i-1:l-1,p=0,r=null;j.copy(a.edges[l]),k.copy(d).sub(g[l]),c&&k.len2()>f&&(c.aInB=!1);var t=h(j,k);if(t===q){j.copy(a.edges[o]);var u=n.pop().copy(d).sub(g[o]);if(t=h(j,u),t===s){var v=k.len();if(v>e)return n.push(d),n.push(j),n.push(k),n.push(u),!1;c&&(c.bInA=!1,r=k.normalize(),p=e-v)}n.push(u)}else if(t===s){if(j.copy(a.edges[m]),k.copy(d).sub(g[m]),t=h(j,k),t===q){var v=k.len();if(v>e)return n.push(d),n.push(j),n.push(k),!1;c&&(c.bInA=!1,r=k.normalize(),p=e-v)}}else{var w=j.perp().normalize(),v=k.dot(w),x=Math.abs(v);if(v>0&&x>e)return n.push(d),n.push(w),n.push(k),!1;c&&(r=w,p=e-v,(v>=0||2*e>p)&&(c.bInA=!1))}r&&c&&Math.abs(p)i;i++)if(g(a.pos,b.pos,d,f,a.normals[i],c))return!1;for(var i=0;h>i;i++)if(g(a.pos,b.pos,d,f,b.normals[i],c))return!1;return c&&(c.a=a,c.b=b,c.overlapV.copy(c.overlapN).scale(c.overlap)),!0}var m={};m.Vector=a,m.V=a,a.prototype.copy=a.prototype.copy=function(a){return this.x=a.x,this.y=a.y,this},a.prototype.perp=a.prototype.perp=function(){var a=this.x;return this.x=this.y,this.y=-a,this},a.prototype.rotate=a.prototype.rotate=function(a){var b=this.x,c=this.y;return this.x=b*Math.cos(a)-c*Math.sin(a),this.y=b*Math.sin(a)+c*Math.cos(a),this},a.prototype.rotatePrecalc=a.prototype.rotatePrecalc=function(a,b){var c=this.x,d=this.y;return this.x=c*b-d*a,this.y=c*a+d*b,this},a.prototype.reverse=a.prototype.reverse=function(){return this.x=-this.x,this.y=-this.y,this},a.prototype.normalize=a.prototype.normalize=function(){var a=this.len();return a>0&&(this.x=this.x/a,this.y=this.y/a),this},a.prototype.add=a.prototype.add=function(a){return this.x+=a.x,this.y+=a.y,this},a.prototype.sub=a.prototype.sub=function(a){return this.x-=a.x,this.y-=a.y,this},a.prototype.scale=a.prototype.scale=function(a,b){return this.x*=a,this.y*=b||a,this},a.prototype.project=a.prototype.project=function(a){var b=this.dot(a)/a.len2();return this.x=b*a.x,this.y=b*a.y,this},a.prototype.projectN=a.prototype.projectN=function(a){var b=this.dot(a);return this.x=b*a.x,this.y=b*a.y,this},a.prototype.reflect=a.prototype.reflect=function(a){var b=this.x,c=this.y;return this.project(a).scale(2),this.x-=b,this.y-=c,this},a.prototype.reflectN=a.prototype.reflectN=function(a){var b=this.x,c=this.y;return this.projectN(a).scale(2),this.x-=b,this.y-=c,this},a.prototype.dot=a.prototype.dot=function(a){return this.x*a.x+this.y*a.y},a.prototype.len2=a.prototype.len2=function(){return this.dot(this)
-},a.prototype.len=a.prototype.len=function(){return Math.sqrt(this.len2())},m.Circle=b,m.Polygon=c,c.prototype.recalc=c.prototype.recalc=function(){this.edges=[],this.normals=[];for(var b=this.points,c=b.length,d=0;c>d;d++){var e=b[d],f=c-1>d?b[d+1]:b[0],g=(new a).copy(f).sub(e),h=(new a).copy(g).perp().normalize();this.edges.push(g),this.normals.push(h)}return this},c.prototype.rotate=c.prototype.rotate=function(a){var b,c=this.points,d=this.edges,e=this.normals,f=c.length,g=Math.cos(a),h=Math.sin(a);for(b=0;f>b;b++)c[b].rotatePrecalc(h,g),d[b].rotatePrecalc(h,g),e[b].rotatePrecalc(h,g);return this},c.prototype.scale=c.prototype.scale=function(a,b){var c,d=this.points,e=this.edges,f=this.normals,g=d.length;for(c=0;g>c;c++)d[c].scale(a,b),e[c].scale(a,b),f[c].scale(a,b);return this},c.prototype.translate=c.prototype.translate=function(a,b){var c,d=this.points,e=d.length;for(c=0;e>c;c++)d[c].x+=a,d[c].y+=b;return this},m.Box=d,d.prototype.toPolygon=d.prototype.toPolygon=function(){var b=this.pos,d=this.w,e=this.h;return new c(new a(b.x,b.y),[new a,new a(d,0),new a(d,e),new a(0,e)])},m.Response=e,e.prototype.clear=e.prototype.clear=function(){return this.aInB=!0,this.bInA=!0,this.overlap=Number.MAX_VALUE,this};for(var n=[],o=0;10>o;o++)n.push(new a);for(var p=[],o=0;5>o;o++)p.push([]);var q=-1,r=0,s=1;return m.testCircleCircle=i,m.testPolygonCircle=j,m.testCirclePolygon=k,m.testPolygonPolygon=l,m}();return c.Physics={},c.Physics.Arcade=function(a){this.game=a,this.gravity=new c.Point,this.worldLeft=null,this.worldRight=null,this.worldTop=null,this.worldBottom=null,this.worldPolys=[null,null,null,null],this.quadTree=new c.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.maxObjects=10,this.maxLevels=4,this._mapData=[],this._mapTiles=0,this._result=!1,this._total=0,this._angle=0,this._drag=0,this._dx=0,this._dy=0,this._p=new c.Point(0,0),this._intersection=[0,0,0,0],this._gravityX=0,this._gravityY=0,this._response=new f.Response,this.setBoundsToWorld(!0,!0,!0,!0)},c.Physics.Arcade.RECT=0,c.Physics.Arcade.CIRCLE=1,c.Physics.Arcade.POLYGON=2,c.Physics.Arcade.prototype={checkBounds:function(a){if(!a.collideWorldBounds||!this.worldLeft&&!this.worldRight&&!this.worldTop&&!this.worldBottom)return!1;this._response.clear();var b=f.testPolygonPolygon,d=a.polygon,e=!1;return a.type===c.Physics.Arcade.CIRCLE&&(b=f.testPolygonCircle,d=a.shape),this.worldLeft&&b(this.worldPolys[0],d,this._response)?(a.blocked.left=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0):this.worldRight&&b(this.worldPolys[1],d,this._response)&&(a.blocked.right=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0),this._response.clear(),this.worldTop&&b(this.worldPolys[2],d,this._response)?(a.blocked.up=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0):this.worldBottom&&b(this.worldPolys[3],d,this._response)&&(a.blocked.down=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0),e},setBoundsToWorld:function(a,b,c,d){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)},setBounds:function(a,b,c,d,e,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=100;e?(this.worldLeft=new f.Box(new f.Vector(a-j,b),j,d),this.worldPolys[0]=this.worldLeft.toPolygon()):(this.worldLeft=null,this.worldPolys[0]=null),g?(this.worldRight=new f.Box(new f.Vector(a+c,b),j,d),this.worldPolys[1]=this.worldRight.toPolygon()):(this.worldRight=null,this.worldPolys[1]=null),h?(this.worldTop=new f.Box(new f.Vector(a,b-j),c,j),this.worldPolys[2]=this.worldTop.toPolygon()):(this.worldTop=null,this.worldPolys[2]=null),i?(this.worldBottom=new f.Box(new f.Vector(a,b+d),c,j),this.worldPolys[3]=this.worldBottom.toPolygon()):(this.worldBottom=null,this.worldPolys[3]=null)},updateMotion:function(a){return a.allowGravity?(this._gravityX=this.gravity.x+a.gravity.x,this._gravityY=this.gravity.y+a.gravity.y):(this._gravityX=a.gravity.x,this._gravityY=a.gravity.y),(this._gravityX<0&&a.blocked.left||this._gravityX>0&&a.blocked.right)&&(this._gravityX=0),(this._gravityY<0&&a.blocked.up||this._gravityY>0&&a.blocked.down)&&(this._gravityY=0),a.allowRotation&&(this._velocityDelta=a.angularAcceleration*this.game.time.physicsElapsed,0!==a.angularDrag&&0===a.angularAcceleration&&(this._drag=a.angularDrag*this.game.time.physicsElapsed,a.angularVelocity>0?a.angularVelocity-=this._drag:a.angularVelocity<0&&(a.angularVelocity+=this._drag)),a.rotation+=this.game.time.physicsElapsed*(a.angularVelocity+this._velocityDelta/2),a.angularVelocity+=this._velocityDelta,a.angularVelocity>a.maxAngular?a.angularVelocity=a.maxAngular:a.angularVelocity<-a.maxAngular&&(a.angularVelocity=-a.maxAngular)),this._p.setTo((a.acceleration.x+this._gravityX)*this.game.time.physicsElapsed,(a.acceleration.y+this._gravityY)*this.game.time.physicsElapsed),this._p},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,d,e,f,g){return"undefined"!=typeof b||a.type!==c.GROUP&&a.type!==c.EMITTER?(a&&b&&a.exists&&b.exists&&(a.type==c.SPRITE||a.type==c.TILESPRITE?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsSprite(a,b,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideSpriteVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,d,e,f):a.type==c.GROUP?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsGroup(b,a,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideGroupVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,d,e,f):a.type==c.TILEMAPLAYER?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,d,e,f):(b.type==c.GROUP||b.type==c.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,d,e,f):a.type==c.EMITTER&&(b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsGroup(b,a,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideGroupVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,d,e,f))),void 0):(this.collideGroupVsSelf(a,d,e,f,g),void 0)},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,d,e,f,g){if(0!==b.length){this.quadTree.clear(),this.quadTree=new c.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.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var h=0,i=this._potentials.length;i>h;h++)this.separate(a.body,this._potentials[h],e,f,g)&&(d&&d.call(f,a,this._potentials[h].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a._container.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a._container.children[g]&&a._container.children[h]&&a._container.children[g].exists&&a._container.children[h].exists&&this.collideSpriteVsSprite(a._container.children[g],a._container.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length&&a._container.first._iNext){var g=a._container.first._iNext;do g.exists&&this.collideSpriteVsGroup(g,b,c,d,e,f),g=g._iNext;while(g!=a._container.last._iNext)}},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.left,a.body.top,a.body.width,a.body.height,!0),0!==this._mapData.length)if(this._mapData.length>1)this.separateTiles(a.body,this._mapData);else{var f=0;this.separateTile(a.body,this._mapData[f])&&(d?d.call(e,a,this._mapData[f])&&(this._total++,c&&c.call(e,a,this._mapData[f])):(this._total++,c&&c.call(e,a,this._mapData[f])))}},collideGroupVsTilemapLayer:function(a,b,c,d,e){if(0!==a.length&&a._container.first._iNext){var f=a._container.first._iNext;do f.exists&&this.collideSpriteVsTilemapLayer(f,b,c,d,e),f=f._iNext;while(f!=a._container.last._iNext)}},separate:function(a,b,c,d,e){return a===b||this.intersects(a,b)===!1?!1:c&&c.call(d,a.sprite,b.sprite)===!1?!1:(this._response.clear(),e?a.overlap(b,this._response):a.overlap(b,this._response)?a.separate(b,this._response):!1)},intersects:function(a,b){var c=!1;(a.width<=0||a.height<=0||b.width<=0||b.height<=0)&&(c=!1),c=!(a.rightb.right||a.top>b.bottom),!c&&a.inContact(b)&&a.removeContact(b)},tileIntersects:function(a,b){return a.width<=0||a.height<=0||b.width<=0||b.height<=0?(this._intersection[4]=0,this._intersection):a.rightb.right||a.top>b.bottom?(this._intersection[4]=0,this._intersection):(this._intersection[0]=Math.max(a.left,b.x),this._intersection[1]=Math.max(a.top,b.y),this._intersection[2]=Math.min(a.right,b.right)-this._intersection[0],this._intersection[3]=Math.min(a.bottom,b.bottom)-this._intersection[1],this._intersection[4]=1,this._intersection)},separateTiles:function(a,b){for(var c,d=!1,e=0;e0&&a.checkCollision.right&&b.tile.faceLeft&&!a.blocked.right&&(a.overlapX=a.right-b.x,a.overlapX>0?c=!0:a.overlapX=0),a.deltaY()<0&&a.checkCollision.up&&b.tile.faceBottom&&!a.blocked.up?(a.overlapY=a.top-b.bottom,a.overlapY<0?c=!0:a.overlapY=0):a.deltaY()>0&&a.checkCollision.down&&b.tile.faceTop&&!a.blocked.down&&(a.overlapY=a.bottom-b.y,a.overlapY>0?c=!0:a.overlapY=0),0!==a.overlapX&&0!==a.overlapY&&(Math.abs(a.overlapX)>Math.abs(a.overlapY)?a.overlapX=0:a.overlapY=0),c?this.processTileSeparation(a):!1},processTileSeparation:function(a){return a.overlapX<0?(a.x-=a.overlapX,a.left-=a.overlapX,a.right-=a.overlapX,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.left=!0):a.overlapX>0&&(a.x-=a.overlapX,a.left-=a.overlapX,a.right-=a.overlapX,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.right=!0),a.overlapY<0?(a.y-=a.overlapY,a.top-=a.overlapY,a.bottom-=a.overlapY,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.up=!0):a.overlapY>0&&(a.y-=a.overlapY,a.top-=a.overlapY,a.bottom-=a.overlapY,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.down=!0),a.reboundCheck(a.overlapX,a.overlapY,!0),!0},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,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*b,Math.sin(this.game.math.degToRad(a))*b)},velocityFromRotation:function(a,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(a)*b,Math.sin(a)*b)},accelerationFromRotation:function(a,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(a)*b,Math.sin(a)*b)},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)}},c.Physics.Arcade.prototype.constructor=c.Physics.Arcade,c.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.offset=new c.Point,this.preX=a.world.x,this.preY=a.world.y,this.preRotation=a.angle,this.velocity=new c.Point,this.acceleration=new c.Point,this.speed=0,this.angle=0,this.gravity=new c.Point,this.bounce=new c.Point,this.minVelocity=new c.Point,this.maxVelocity=new c.Point(1e3,1e3),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.linearDamping=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.blocked={x:0,y:0,up:!1,down:!1,left:!1,right:!1},this.facing=c.NONE,this.rebound=!0,this.immovable=!1,this.moves=!0,this.rotation=0,this.allowRotation=!0,this.allowGravity=!0,this.customSeparateCallback=null,this.customSeparateContext=null,this.collideCallback=null,this.collideCallbackContext=null,this.collideWorldBounds=!1,this.type=c.Physics.Arcade.RECT,this.shape=null,this.polygon=null,this.left=0,this.right=0,this.top=0,this.bottom=0,this.width=0,this.height=0,this.contacts=[],this.overlapX=0,this.overlapY=0,this._temp=null,this._dx=0,this._dy=0,this._sx=a.scale.x,this._sy=a.scale.y,this._distances=[0,0,0,0],this._vx=0,this._vy=0,this.setRectangle(a.width,a.height,0,0),this.sprite.events.onBeginContact=new c.Signal,this.sprite.events.onEndContact=new c.Signal},c.Physics.Arcade.Body.prototype={updateScale:function(){this.polygon?this.polygon.scale(this.sprite.scale.x/this._sx,this.sprite.scale.y/this._sy):this.shape.r*=Math.max(this.sprite.scale.x,this.sprite.scale.y),this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y},preUpdate:function(){this.x=this.sprite.world.x-this.sprite.anchor.x*this.sprite.width+this.offset.x,this.y=this.sprite.world.y-this.sprite.anchor.y*this.sprite.height+this.offset.y,this.preX=this.x,this.preY=this.y,this.preRotation=this.sprite.angle,this.rotation=this.preRotation,(this.sprite.scale.x!==this._sx||this.sprite.scale.y!==this._sy)&&this.updateScale(),this.checkBlocked(),this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.moves?((this._vx!==this.velocity.x||this._vy!==this.velocity.y)&&(this._vx=this.velocity.x,this._vy=this.velocity.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.game.physics.checkBounds(this)&&this.reboundCheck(!0,!0,!0),this.applyDamping(),this.integrateVelocity(),this.updateBounds(),this.checkBlocked()):this.updateBounds()},checkBlocked:function(){!this.blocked.left&&!this.blocked.right||Math.floor(this.x)===this.blocked.x&&Math.floor(this.y)===this.blocked.y||(this.blocked.left=!1,this.blocked.right=!1),!this.blocked.up&&!this.blocked.down||Math.floor(this.x)===this.blocked.x&&Math.floor(this.y)===this.blocked.y||(this.blocked.up=!1,this.blocked.down=!1)},updateBounds:function(){this.type===c.Physics.Arcade.CIRCLE?(this.left=this.shape.pos.x-this.shape.r,this.right=this.shape.pos.x+this.shape.r,this.top=this.shape.pos.y-this.shape.r,this.bottom=this.shape.pos.y+this.shape.r):(this.left=c.Math.minProperty("x",this.polygon.points)+this.polygon.pos.x,this.right=c.Math.maxProperty("x",this.polygon.points)+this.polygon.pos.x,this.top=c.Math.minProperty("y",this.polygon.points)+this.polygon.pos.y,this.bottom=c.Math.maxProperty("y",this.polygon.points)+this.polygon.pos.y),this.width=this.right-this.left,this.height=this.bottom-this.top},applyDamping:function(){this.linearDamping>0&&this.acceleration.isZero()&&(this.speed>this.linearDamping?this.speed-=this.linearDamping:this.speed=0,this.speed>0&&(this.velocity.x=Math.cos(this.angle)*this.speed,this.velocity.y=Math.sin(this.angle)*this.speed,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)))},reboundCheck:function(a,b,c){if(a&&(c&&0!==this.bounce.x&&(this.blocked.left||this.blocked.right||this.touching.left||this.touching.right)&&(this._vx<=0&&this.velocity.x>0||this._vx>=0&&this.velocity.x<0||(this.velocity.x*=-this.bounce.x,this.angle=Math.atan2(this.velocity.y,this.velocity.x))),0===this.bounce.x||Math.abs(this.velocity.x)d||this.velocity.x<0)||(this.blocked.right||this.touching.right)&&(d>0||this.velocity.x>0))&&(this.velocity.x=0)}if(b&&(c&&0!==this.bounce.y&&(this.blocked.up||this.blocked.down||this.touching.up||this.touching.down)&&(this._vy<=0&&this.velocity.y>0||this._vy>=0&&this.velocity.y<0||(this.velocity.y*=-this.bounce.y,this.angle=Math.atan2(this.velocity.y,this.velocity.x))),0===this.bounce.y||Math.abs(this.velocity.y)e||this.velocity.y<0)||(this.blocked.down||this.touching.down)&&(e>0||this.velocity.y>0))&&(this.velocity.y=0)}},getUpwardForce:function(){return this.allowGravity?this.gravity.x+this.game.physics.gravity.x+this.velocity.x:this.gravity.x+this.velocity.x},getDownwardForce:function(){return this.allowGravity?this.gravity.y+this.game.physics.gravity.y+this.velocity.y:this.gravity.y+this.velocity.y},sub:function(a){this.x-=a.x,this.y-=a.y},add:function(a){this.x+=a.x,this.y+=a.y},give:function(a,b){this.add(b.overlapV),this.rebound&&(this.processRebound(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},take:function(a,b){this.sub(b.overlapV),this.rebound&&(this.processRebound(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},split:function(a,b){b.overlapV.scale(.5),this.sub(b.overlapV),a.add(b.overlapV),this.rebound&&(this.exchange(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},exchange:function(a){if(this.mass===a.mass&&this.speed>0&&a.speed>0)this._dx=a.velocity.x,this._dy=a.velocity.y,a.velocity.x=this.velocity.x*a.bounce.x,a.velocity.y=this.velocity.y*a.bounce.x,this.velocity.x=this._dx*this.bounce.x,this.velocity.y=this._dy*this.bounce.y;else{var b=Math.sqrt(a.velocity.x*a.velocity.x*a.mass/this.mass)*(a.velocity.x>0?1:-1),c=Math.sqrt(this.velocity.x*this.velocity.x*this.mass/a.mass)*(this.velocity.x>0?1:-1),d=.5*(b+c);b-=d,c-=d,this.velocity.x=b,a.velocity.x=c,b=Math.sqrt(a.velocity.y*a.velocity.y*a.mass/this.mass)*(a.velocity.y>0?1:-1),c=Math.sqrt(this.velocity.y*this.velocity.y*this.mass/a.mass)*(this.velocity.y>0?1:-1),d=.5*(b+c),b-=d,c-=d,this.velocity.y=b,a.velocity.y=c}},processRebound:function(a){this._vx<=0&&this.velocity.x>0||this._vx>=0&&this.velocity.x<0||(this.velocity.x=a.velocity.x-this.velocity.x*this.bounce.x),this._vy<=0&&this.velocity.y>0||this._vy>=0&&this.velocity.y<0||(this.velocity.y=a.velocity.y-this.velocity.y*this.bounce.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x),this.reboundCheck(!0,!0,!1)},overlap:function(a,b){var d=!1;return this.type!==c.Physics.Arcade.RECT&&this.type!==c.Physics.Arcade.POLYGON||a.type!==c.Physics.Arcade.RECT&&a.type!==c.Physics.Arcade.POLYGON?this.type===c.Physics.Arcade.CIRCLE&&a.type===c.Physics.Arcade.CIRCLE?d=f.testCircleCircle(this.shape,a.shape,b):this.type!==c.Physics.Arcade.RECT&&this.type!==c.Physics.Arcade.POLYGON||a.type!==c.Physics.Arcade.CIRCLE?this.type!==c.Physics.Arcade.CIRCLE||a.type!==c.Physics.Arcade.RECT&&a.type!==c.Physics.Arcade.POLYGON||(d=f.testCirclePolygon(this.shape,a.polygon,b)):d=f.testPolygonCircle(this.polygon,a.shape,b):d=f.testPolygonPolygon(this.polygon,a.polygon,b),d||this.removeContact(a),d},inContact:function(a){return-1!=this.contacts.indexOf(a)},addContact:function(a){return this.inContact(a)?!1:(this.contacts.push(a),this.sprite.events.onBeginContact.dispatch(this.sprite,a.sprite,this,a),a.addContact(this),!0)},removeContact:function(a){return this.inContact(a)?(this.contacts.splice(this.contacts.indexOf(a),1),this.sprite.events.onEndContact.dispatch(this.sprite,a.sprite,this,a),a.removeContact(this),!0):!1},separate:function(a,b){if(this.inContact(a))return!1;if(this._distances[0]=a.right-this.x,this._distances[1]=this.right-a.x,this._distances[2]=a.bottom-this.y,this._distances[3]=this.bottom-a.y,!b.overlapN.x||0!==this._distances[0]&&0!==this._distances[1]?!b.overlapN.y||0!==this._distances[2]&&0!==this._distances[3]||(b.overlapN.x=!0,b.overlapN.y=!1):(b.overlapN.x=!1,b.overlapN.y=!0),this.customSeparateCallback)return this.customSeparateCallback.call(this.customSeparateContext,this,b,this._distances);var c=!1;return b.overlapN.x?this._distances[0]0&&!this.blocked.right&&!this.touching.right)&&(this.x+=this._dx,this.velocity.x+=this._temp.x),(this._dy<0&&!this.blocked.up&&!this.touching.up||this._dy>0&&!this.blocked.down&&!this.touching.down)&&(this.y+=this._dy,this.velocity.y+=this._temp.y),this.velocity.x>this.maxVelocity.x?this.velocity.x=this.maxVelocity.x:this.velocity.x<-this.maxVelocity.x&&(this.velocity.x=-this.maxVelocity.x),this.velocity.y>this.maxVelocity.y?this.velocity.y=this.maxVelocity.y:this.velocity.y<-this.maxVelocity.y&&(this.velocity.y=-this.maxVelocity.y)},postUpdate:function(){this.moves&&(this.game.physics.checkBounds(this),this.reboundCheck(!0,!0,!0),this._dx=this.deltaX(),this._dy=this.deltaY(),this._dx<0?this.facing=c.LEFT:this._dx>0&&(this.facing=c.RIGHT),this._dy<0?this.facing=c.UP:this._dy>0&&(this.facing=c.DOWN),(0!==this._dx||0!==this._dy)&&(this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.allowRotation&&0!==this.deltaZ()&&(this.sprite.angle+=this.deltaZ()),(this.sprite.scale.x!==this._sx||this.sprite.scale.y!==this._sy)&&this.updateScale())},reset:function(a){"undefined"==typeof a&&(a=!1),a&&(this.gravity.setTo(0,0),this.bounce.setTo(0,0),this.minVelocity.setTo(5,5),this.maxVelocity.setTo(1e3,1e3),this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.friction=0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0}),this.velocity.setTo(0,0),this.acceleration.setTo(0,0),this.angularVelocity=0,this.angularAcceleration=0,this.blocked={x:0,y:0,up:!1,down:!1,left:!1,right:!1},this.x=this.sprite.world.x-this.sprite.anchor.x*this.sprite.width+this.offset.x,this.y=this.sprite.world.y-this.sprite.anchor.y*this.sprite.height+this.offset.y,this.preX=this.x,this.preY=this.y,this.updateBounds(),this.contacts.length=0},destroy:function(){this.sprite=null,this.collideCallback=null,this.collideCallbackContext=null,this.customSeparateCallback=null,this.customSeparateContext=null,this.contacts.length=0},setCircle:function(a,b,d){"undefined"==typeof b&&(b=this.sprite._cache.halfWidth),"undefined"==typeof d&&(d=this.sprite._cache.halfHeight),this.type=c.Physics.Arcade.CIRCLE,this.shape=new f.Circle(new f.Vector(this.sprite.x,this.sprite.y),a),this.polygon=null,this.offset.setTo(b,d)},setRectangle:function(a,b,d,e){"undefined"==typeof a&&(a=this.sprite.width),"undefined"==typeof b&&(b=this.sprite.height),"undefined"==typeof d&&(d=-this.sprite._cache.halfWidth),"undefined"==typeof e&&(e=-this.sprite._cache.halfHeight),this.type=c.Physics.Arcade.RECT,this.shape=new f.Box(new f.Vector(this.sprite.world.x,this.sprite.world.y),a,b),this.polygon=this.shape.toPolygon(),this.polygon.translate(d,e),this.offset.setTo(0,0)},setPolygon:function(a){if(this.type=c.Physics.Arcade.POLYGON,this.shape=null,Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var b=[],d=0,e=a.length;e>d;d+=2)b.push(new f.Vector(a[d],a[d+1]));a=b}this.polygon=new f.Polygon(new f.Vector(this.sprite.center.x,this.sprite.center.y),a),this.offset.setTo(0,0)},translate:function(a,b){this.polygon&&this.polygon.translate(a,b)},onFloor:function(){return this.blocked.down},onWall:function(){return!this.blocked.down&&(this.blocked.left||this.blocked.right)},deltaX:function(){return this.x-this.preX},deltaY:function(){return this.y-this.preY},deltaZ:function(){return this.rotation-this.preRotation}},c.Physics.Arcade.Body.prototype.constructor=c.Physics.Arcade.Body,Object.defineProperty(c.Physics.Arcade.Body.prototype,"x",{get:function(){return this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.x:this.polygon.pos.x},set:function(a){this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.x=a:this.polygon.pos.x=a}}),Object.defineProperty(c.Physics.Arcade.Body.prototype,"y",{get:function(){return this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.y:this.polygon.pos.y},set:function(a){this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.y=a:this.polygon.pos.y=a}}),c.Particles=function(a){this.game=a,this.emitters={},this.ID=0},c.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()}},c.Particles.prototype.constructor=c.Particles,c.Particles.Arcade={},c.Particles.Arcade.Emitter=function(a,b,d,e){this.maxParticles=e||50,c.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=c.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new c.Point(-100,-100),this.maxParticleSpeed=new c.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=null,this.particleFriction=0,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new c.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this.on=!1,this.exists=!0,this.emitX=b,this.emitY=d},c.Particles.Arcade.Emitter.prototype=Object.create(c.Group.prototype),c.Particles.Arcade.Emitter.prototype.constructor=c.Particles.Arcade.Emitter,c.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)},c.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,d,e,f){"undefined"==typeof b&&(b=0),"undefined"==typeof d&&(d=this.maxParticles),"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1);for(var g,h=0,i=a,j=b;d>h;)null===this.particleClass&&("object"==typeof a&&(i=this.game.rnd.pick(a)),"object"==typeof b&&(j=this.game.rnd.pick(b)),g=new c.Sprite(this.game,0,0,i,j)),e?(g.body.checkCollision.any=!0,g.body.checkCollision.none=!1):g.body.checkCollision.none=!0,g.body.collideWorldBounds=f,g.exists=!1,g.visible=!1,g.anchor.setTo(.5,.5),this.add(g),h++;return this},c.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},c.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},c.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},c.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);if(null!=a){if(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,a.body.gravity.y=this.gravity,a.body.angularVelocity=this.minRotation!=this.maxRotation?this.game.rnd.integerInRange(this.minRotation,this.maxRotation):this.minRotation,1!==this.minParticleScale||1!==this.maxParticleScale){var b=this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale);
-a.scale.setTo(b,b)}a.body.friction=this.particleFriction,a.body.angularDrag=this.angularDrag}},c.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},c.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},c.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},c.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},c.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"alpha",{get:function(){return this._container.alpha},set:function(a){this._container.alpha=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"visible",{get:function(){return this._container.visible},set:function(a){this._container.visible=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),c.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.width=e,this.height=f,this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collides=!1,this.collideNone=!0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.callback=null,this.callbackContext=this},c.Tile.prototype={setCollisionCallback:function(a,b){this.collisionCallbackContext=b,this.collisionCallback=a},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d,this.collideNone=a||b||c||d?!1:!0},resetCollision:function(){this.collideNone=!0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1},copy:function(a){this.index=a.index,this.alpha=a.alpha,this.properties=a.properties,this.collides=a.collides,this.collideNone=a.collideNone,this.collideUp=a.collideUp,this.collideDown=a.collideDown,this.collideLeft=a.collideLeft,this.collideRight=a.collideRight,this.collisionCallback=a.collisionCallback,this.collisionCallbackContext=a.collisionCallbackContext}},c.Tile.prototype.constructor=c.Tile,Object.defineProperty(c.Tile.prototype,"canCollide",{get:function(){return this.collides||this.collisionCallback||this.layer.callbacks[this.index]}}),Object.defineProperty(c.Tile.prototype,"left",{get:function(){return this.x}}),Object.defineProperty(c.Tile.prototype,"right",{get:function(){return this.x+this.width}}),Object.defineProperty(c.Tile.prototype,"top",{get:function(){return this.y}}),Object.defineProperty(c.Tile.prototype,"bottom",{get:function(){return this.y+this.height}}),c.Tilemap=function(a,b){this.game=a,this.key=b;var d=c.TilemapParser.parse(this.game,b);null!==d&&(this.width=d.width,this.height=d.height,this.tileWidth=d.tileWidth,this.tileHeight=d.tileHeight,this.orientation=d.orientation,this.version=d.version,this.properties=d.properties,this.widthInPixels=d.widthInPixels,this.heightInPixels=d.heightInPixels,this.layers=d.layers,this.tilesets=d.tilesets,this.tiles=d.tiles,this.objects=d.objects,this.images=d.images,this.currentLayer=0,this.debugMap=[],this._results=[],this._tempA=0,this._tempB=0)},c.Tilemap.CSV=0,c.Tilemap.TILED_JSON=1,c.Tilemap.prototype={create:function(a,b,d){for(var e=[],f=0;d>f;f++){e[f]=[];for(var g=0;b>g;g++)e[f][g]=0}this.layers.push({name:a,width:b,height:d,alpha:1,visible:!0,tileMargin:0,tileSpacing:0,format:c.Tilemap.CSV,data:e,indexes:[],dirty:!0}),this.currentLayer=this.layers.length-1},addTilesetImage:function(a,b){if("undefined"==typeof b){if("string"!=typeof a)return!1;b=a}return"string"==typeof a&&(a=this.getTilesetIndex(a)),this.tilesets[a]?(this.tilesets[a].image=this.game.cache.getImage(b),!0):!1},createFromTiles:function(a,b,c,d,e){"undefined"==typeof e&&(e=this.game.world)},createFromObjects:function(a,b,c,d,e,f,g){if("undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=this.game.world),!this.objects[a])return console.warn("Tilemap.createFromObjects: Invalid objectgroup name given: "+a),void 0;for(var h,i=0,j=this.objects[a].length;j>i;i++)if(this.objects[a][i].gid===b){h=g.create(this.objects[a][i].x,this.objects[a][i].y,c,d,e),h.anchor.setTo(0,1),h.name=this.objects[a][i].name,h.visible=this.objects[a][i].visible,h.autoCull=f;for(property in this.objects[a][i].properties)g.set(h,property,this.objects[a][i].properties[property],!1,!1,0)}},createLayer:function(a,b,d,e){"undefined"==typeof b&&(b=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?(console.warn("Tilemap.createLayer: Invalid layer ID given: "+f),void 0):e.add(new c.TilemapLayer(this.game,this,f,b,d))},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){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0);for(var e=0;ef;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),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&&b=0&&d=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]]?b.push("background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]):b.push("background: #ffffff"):b.push("background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},c.Tilemap.prototype.constructor=c.Tilemap,c.TilemapLayer=function(a,d,e,f,g){this.game=a,this.map=d,this.index=e,this.layer=d.layers[e],this.canvas=c.Canvas.create(f,g),this.context=this.canvas.getContext("2d"),this.baseTexture=new b.BaseTexture(this.canvas),this.texture=new b.Texture(this.baseTexture),this.textureFrame=new c.Frame(0,0,0,f,g,"tilemapLayer",a.rnd.uuid()),c.Sprite.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=c.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new c.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._cw=d.tileWidth,this._ch=d.tileHeight,this._ga=1,this._dx=0,this._dy=0,this._dw=0,this._dh=0,this._tx=0,this._ty=0,this._tw=0,this._th=0,this._tl=0,this._maxX=0,this._maxY=0,this._startX=0,this._startY=0,this._results=[],this._x=0,this._y=0,this._prevX=0,this._prevY=0,this.updateMax()},c.TilemapLayer.prototype=Object.create(c.Sprite.prototype),c.TilemapLayer.prototype=c.Utils.extend(!0,c.TilemapLayer.prototype,c.Sprite.prototype,b.Sprite.prototype),c.TilemapLayer.prototype.constructor=c.TilemapLayer,c.TilemapLayer.prototype.postUpdate=function(){c.Sprite.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render()},c.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},c.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._x+(a-this._x/this.scrollFactorX)},c.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._x/this.scrollFactorX+(a-this._x)},c.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._y+(a-this._y/this.scrollFactorY)},c.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._y/this.scrollFactorY+(a-this._y)},c.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},c.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},c.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},c.TilemapLayer.prototype.getTiles=function(a,b,c,d,e){"undefined"==typeof e&&(e=!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._tx=this.game.math.snapToFloor(a,this._cw)/this._cw,this._ty=this.game.math.snapToFloor(b,this._ch)/this._ch,this._tw=(this.game.math.snapToCeil(c,this._cw)+this._cw)/this._cw,this._th=(this.game.math.snapToCeil(d,this._ch)+this._ch)/this._ch,this._results.length=0;for(var f=this._ty;fthis.layer.width&&(this._maxX=this.layer.width),this._maxY>this.layer.height&&(this._maxY=this.layer.height)),this.dirty=!0},c.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._prevX=this._dx,this._prevY=this._dy,this._dx=-(this._x-this._startX*this.map.tileWidth),this._dy=-(this._y-this._startY*this.map.tileHeight),this._tx=this._dx,this._ty=this._dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,d;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var e=this._startY,f=this._startY+this._maxY;f>e;e++){this._column=this.layer.data[e];for(var g=this._startX,h=this._startX+this._maxX;h>g;g++)this._column[g]&&(a=this._column[g],this.map.tiles[a.index]&&(d=this.map.tilesets[this.map.tiles[a.index][2]],d.image?(this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),d.tileWidth!==this.map.tileWidth||d.tileHeight!==this.map.tileHeight?this.context.drawImage(this.map.tilesets[this.map.tiles[a.index][2]].image,this.map.tiles[a.index][0],this.map.tiles[a.index][1],d.tileWidth,d.tileHeight,Math.floor(this._tx),Math.floor(this._ty)-(d.tileHeight-this.map.tileHeight),d.tileWidth,d.tileHeight):this.context.drawImage(this.map.tilesets[this.map.tiles[a.index][2]].image,this.map.tiles[a.index][0],this.map.tiles[a.index][1],this.map.tileWidth,this.map.tileHeight,Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight))):this.context.fillRect(Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight))),this._tx+=this.map.tileWidth;this._tx=this._dx,this._ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===c.WEBGL&&b.texturesToUpdate.push(this.baseTexture),this.dirty=!1,this.layer.dirty=!1,!0}},c.TilemapLayer.prototype.renderDebug=function(){this._tx=this._dx,this._ty=this._dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._startY,b=this._startY+this._maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._startX,d=this._startX+this._maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._tx=Math.floor(this._tx),this.debugFill&&this.context.fillRect(this._tx,this._ty,this._cw,this._ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._tx,this._ty),this.context.lineTo(this._tx+this._cw,this._ty)),e.faceBottom&&(this.context.moveTo(this._tx,this._ty+this._ch),this.context.lineTo(this._tx+this._cw,this._ty+this._ch)),e.faceLeft&&(this.context.moveTo(this._tx,this._ty),this.context.lineTo(this._tx,this._ty+this._ch)),e.faceRight&&(this.context.moveTo(this._tx+this._cw,this._ty),this.context.lineTo(this._tx+this._cw,this._ty+this._ch)),this.context.stroke()),e&&(e.collisionCallback||e.layer.callbacks[e.index])&&(this.context.fillStyle=this.debugCallbackColor,this.context.fillRect(this._tx,this._ty,this._cw,this._ch),this.context.fillStyle=this.debugFillColor),this._tx+=this.map.tileWidth}this._tx=this._dx,this._ty+=this.map.tileHeight}},Object.defineProperty(c.TilemapLayer.prototype,"scrollX",{get:function(){return this._x},set:function(a){a!==this._x&&a>=0&&this.layer.widthInPixels>this.width&&(this._x=a,this._x>this.layer.widthInPixels-this.width&&(this._x=this.layer.widthInPixels-this.width),this._startX=this.game.math.floor(this._x/this.map.tileWidth),this._startX<0&&(this._startX=0),this._startX+this._maxX>this.layer.width&&(this._startX=this.layer.width-this._maxX),this.dirty=!0)}}),Object.defineProperty(c.TilemapLayer.prototype,"scrollY",{get:function(){return this._y},set:function(a){a!==this._y&&a>=0&&this.layer.heightInPixels>this.height&&(this._y=a,this._y>this.layer.heightInPixels-this.height&&(this._y=this.layer.heightInPixels-this.height),this._startY=this.game.math.floor(this._y/this.map.tileHeight),this._startY<0&&(this._startY=0),this._startY+this._maxY>this.layer.height&&(this._startY=this.layer.height-this._maxY),this.dirty=!0)}}),Object.defineProperty(c.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._cw},set:function(a){this._cw=a,this.dirty=!0}}),Object.defineProperty(c.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._ch},set:function(a){this._ch=a,this.dirty=!0}}),c.TilemapParser={tileset:function(a,b,d,e,f,g,h,i,j){var k=a.cache.getTilesetImage(b);if(null===k)return console.warn("Phaser.TilemapParser.tileSet: Invalid image key given"),null;var l=k.width,m=k.height;return-1===h&&(h=Math.round(l/d)),-1===i&&(i=Math.round(m/e)),-1===j&&(j=h*i),0===l||0===m||d>l||e>m||0===j?(console.warn("Phaser.TilemapParser.tileSet: width/height zero or width/height < given tileWidth/tileHeight"),null):new c.Tileset(k,b,d,e,f,g,h,i,j)},parse:function(a,b){var d=a.cache.getTilemapData(b);return d?d.format===c.Tilemap.CSV?this.parseCSV(d.data):d.format===c.Tilemap.TILED_JSON?this.parseTiledJSON(d.data):void 0:{layers:[],objects:[],images:[],tilesets:[]}},parseCSV:function(a){a=a.trim();for(var b=[],c=a.split("\n"),d=c.length,e=0,f=0;fj;j++)a.layers[e].data[j]>0?h.push(new c.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight)):h.push(null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}b.layers=d;for(var l=[],e=0;eo;o++)if(a.layers[e].objects[o].gid){var p={gid:a.layers[e].objects[o].gid,name:a.layers[e].objects[o].name,x:a.layers[e].objects[o].x,y:a.layers[e].objects[o].y,visible:a.layers[e].objects[o].visible,properties:a.layers[e].objects[o].properties};n[a.layers[e].name].push(p)}}b.objects=n;for(var q=[],e=0;e0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.renderDisplayObject=function(a,d){var e=a.last._iNext;a=a.first;do if(a.visible||d)if(a.renderable&&0!==a.alpha){if(a instanceof b.Sprite)a.texture.frame&&(this.context.globalAlpha=a.worldAlpha,c.CANVAS_PX_ROUND?this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],Math.floor(a.worldTransform[2]),Math.floor(a.worldTransform[5])):this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),a.texture.trimmed&&this.context.transform(1,0,0,1,a.texture.trim.x,a.texture.trim.y),this.smoothProperty&&this.scaleMode!==a.texture.baseTexture.scaleMode&&(this.scaleMode=a.texture.baseTexture.scaleMode,this.context[this.smoothProperty]=this.scaleMode===b.BaseTexture.SCALE_MODE.LINEAR),this.context.drawImage(a.texture.baseTexture.source,a.texture.frame.x,a.texture.frame.y,a.texture.frame.width,a.texture.frame.height,Math.floor(a.anchor.x*-a.texture.frame.width),Math.floor(a.anchor.y*-a.texture.frame.height),a.texture.frame.width,a.texture.frame.height));else if(a instanceof b.Strip)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),this.renderStrip(a);else if(a instanceof b.TilingSprite)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),this.renderTilingSprite(a);else if(a instanceof b.CustomRenderable)a.renderCanvas(this);else if(a instanceof b.Graphics)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),b.CanvasGraphics.renderGraphics(a,this.context);else if(a instanceof b.FilterBlock)if(a.open){this.context.save();var f=a.mask.alpha,g=a.mask.worldTransform;this.context.setTransform(g[0],g[3],g[1],g[4],g[2],g[5]),a.mask.worldAlpha=.5,this.context.worldAlpha=0,b.CanvasGraphics.renderGraphicsMask(a.mask,this.context),this.context.clip(),a.mask.worldAlpha=f}else this.context.restore();a=a._iNext}else a=a._iNext;else a=a.last._iNext;while(a!=e)},b.WebGLBatch.prototype.update=function(){for(var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=0,s=this.head;s;){if(s.vcount===b.visibleCount){if(c=s.texture.frame.width,d=s.texture.frame.height,e=s.anchor.x,f=s.anchor.y,g=c*(1-e),h=c*-e,i=d*(1-f),j=d*-f,k=8*r,a=s.worldTransform,l=a[0],m=a[3],n=a[1],o=a[4],p=a[2],q=a[5],s.texture.trimmed&&(p+=s.texture.trim.x,q+=s.texture.trim.y),this.verticies[k+0]=l*h+n*j+p,this.verticies[k+1]=o*j+m*h+q,this.verticies[k+2]=l*g+n*j+p,this.verticies[k+3]=o*j+m*g+q,this.verticies[k+4]=l*g+n*i+p,this.verticies[k+5]=o*i+m*g+q,this.verticies[k+6]=l*h+n*i+p,this.verticies[k+7]=o*i+m*h+q,s.updateFrame||s.texture.updateFrame){this.dirtyUVS=!0;var t=s.texture,u=t.frame,v=t.baseTexture.width,w=t.baseTexture.height;this.uvs[k+0]=u.x/v,this.uvs[k+1]=u.y/w,this.uvs[k+2]=(u.x+u.width)/v,this.uvs[k+3]=u.y/w,this.uvs[k+4]=(u.x+u.width)/v,this.uvs[k+5]=(u.y+u.height)/w,this.uvs[k+6]=u.x/v,this.uvs[k+7]=(u.y+u.height)/w,s.updateFrame=!1}if(s.cacheAlpha!=s.worldAlpha){s.cacheAlpha=s.worldAlpha;var x=4*r;this.colors[x]=this.colors[x+1]=this.colors[x+2]=this.colors[x+3]=s.worldAlpha,this.dirtyColors=!0}}else k=8*r,this.verticies[k+0]=0,this.verticies[k+1]=0,this.verticies[k+2]=0,this.verticies[k+3]=0,this.verticies[k+4]=0,this.verticies[k+5]=0,this.verticies[k+6]=0,this.verticies[k+7]=0;r++,s=s.__next}},c});
\ No newline at end of file
+},fuzzyLessThan:function(a,b,c){return"undefined"==typeof c&&(c=1e-4),b+c>a},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(d-b,c-a)},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 180==a%360?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},max:function(){for(var a=1,b=0,c=arguments.length;c>a;a++)arguments[b]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){return this.wrap(a,-180,180)},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},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,b,d,e){return Math.round(c.Math.distance(a,b,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}}()},c.QuadTree=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=[],this.nodes=[]},c.QuadTree.prototype={populate:function(a){a.forEach(this.populateHandler,this,!0)},populateHandler:function(a){a.body&&a.body.checkCollision.none===!1&&a.alive&&this.insert(a.body)},split:function(){this.level++,this.nodes[0]=new c.QuadTree(this.bounds.right,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[1]=new c.QuadTree(this.bounds.x,this.bounds.y,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[2]=new c.QuadTree(this.bounds.x,this.bounds.bottom,this.bounds.subWidth,this.bounds.subHeight,this.maxObjects,this.maxLevels,this.level),this.nodes[3]=new c.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 this.nodes[b].insert(a),void 0;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;return a.body.quadTreeIndex=this.getIndex(a.body),this.nodes[0]&&(-1!==a.body.quadTreeIndex?b=b.concat(this.nodes[a.body.quadTreeIndex].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=[];for(var a=0,b=this.nodes.length;b>a;a++)this.nodes[a]&&(this.nodes[a].clear(),delete this.nodes[a])}},c.QuadTree.prototype.constructor=c.QuadTree,c.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},c.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,b){return"undefined"==typeof b&&(b=!1),b?c.Math.distanceRound(this.x,this.y,a.x,a.y):c.Math.distance(this.x,this.y,a.x,a.y)},clone:function(a){return"undefined"==typeof a&&(a=new c.Circle),a.setTo(this.x,this.y,this.diameter)},contains:function(a,b){return c.Circle.contains(this,a,b)},circumferencePoint:function(a,b,d){return c.Circle.circumferencePoint(this,a,b,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+")}]"}},c.Circle.prototype.constructor=c.Circle,Object.defineProperty(c.Circle.prototype,"diameter",{get:function(){return this._diameter},set:function(a){a>0&&(this._diameter=a,this._radius=.5*a)}}),Object.defineProperty(c.Circle.prototype,"radius",{get:function(){return this._radius},set:function(a){a>0&&(this._radius=a,this._diameter=2*a)}}),Object.defineProperty(c.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(c.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(c.Circle.prototype,"bottom",{get:function(){return this.y+this._radius},set:function(a){a0?Math.PI*this._radius*this._radius:0}}),Object.defineProperty(c.Circle.prototype,"empty",{get:function(){return 0===this._diameter},set:function(a){a===!0&&this.setTo(0,0,0)}}),c.Circle.contains=function(a,b,c){if(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},c.Circle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.diameter==b.diameter},c.Circle.intersects=function(a,b){return c.Math.distance(a.x,a.y,b.x,b.y)<=a.radius+b.radius},c.Circle.circumferencePoint=function(a,b,d,e){return"undefined"==typeof d&&(d=!1),"undefined"==typeof e&&(e=new c.Point),d===!0&&(b=c.Math.radToDeg(b)),e.x=a.x+a.radius*Math.cos(b),e.y=a.y+a.radius*Math.sin(b),e},c.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},c.Point=function(a,b){a=a||0,b=b||0,this.x=a,this.y=b},c.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,this.y=b,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,b){return this.x=c.Math.clamp(this.x,a,b),this},clampY:function(a,b){return this.y=c.Math.clamp(this.y,a,b),this},clamp:function(a,b){return this.x=c.Math.clamp(this.x,a,b),this.y=c.Math.clamp(this.y,a,b),this},clone:function(a){return"undefined"==typeof a&&(a=new c.Point),a.setTo(this.x,this.y)},copyTo:function(a){return a.x=this.x,a.y=this.y,a},distance:function(a,b){return c.Point.distance(this,a,b)},equals:function(a){return a.x==this.x&&a.y==this.y},rotate:function(a,b,d,e,f){return c.Point.rotate(this,a,b,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+")}]"}},c.Point.prototype.constructor=c.Point,c.Point.add=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x+b.x,d.y=a.y+b.y,d},c.Point.subtract=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x-b.x,d.y=a.y-b.y,d},c.Point.multiply=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x*b.x,d.y=a.y*b.y,d},c.Point.divide=function(a,b,d){return"undefined"==typeof d&&(d=new c.Point),d.x=a.x/b.x,d.y=a.y/b.y,d},c.Point.equals=function(a,b){return a.x==b.x&&a.y==b.y},c.Point.distance=function(a,b,d){return"undefined"==typeof d&&(d=!1),d?c.Math.distanceRound(a.x,a.y,b.x,b.y):c.Math.distance(a.x,a.y,b.x,b.y)},c.Point.rotate=function(a,b,d,e,f,g){return f=f||!1,g=g||null,f&&(e=c.Math.degToRad(e)),null===g&&(g=Math.sqrt((b-a.x)*(b-a.x)+(d-a.y)*(d-a.y))),a.setTo(b+g*Math.cos(e),d+g*Math.sin(e))},c.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},c.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,b){return c.Rectangle.inflate(this,a,b)},size:function(a){return c.Rectangle.size(this,a)},clone:function(a){return c.Rectangle.clone(this,a)},contains:function(a,b){return c.Rectangle.contains(this,a,b)},containsRect:function(a){return c.Rectangle.containsRect(this,a)},equals:function(a){return c.Rectangle.equals(this,a)},intersection:function(a,b){return c.Rectangle.intersection(this,a,b)},intersects:function(a,b){return c.Rectangle.intersects(this,a,b)},intersectsRaw:function(a,b,d,e,f){return c.Rectangle.intersectsRaw(this,a,b,d,e,f)},union:function(a,b){return c.Rectangle.union(this,a,b)},toString:function(){return"[{Rectangle (x="+this.x+" y="+this.y+" width="+this.width+" height="+this.height+" empty="+this.empty+")}]"}},c.Rectangle.prototype.constructor=c.Rectangle,Object.defineProperty(c.Rectangle.prototype,"halfWidth",{get:function(){return Math.round(this.width/2)}}),Object.defineProperty(c.Rectangle.prototype,"halfHeight",{get:function(){return Math.round(this.height/2)}}),Object.defineProperty(c.Rectangle.prototype,"bottom",{get:function(){return this.y+this.height},set:function(a){this.height=a<=this.y?0:this.y-a}}),Object.defineProperty(c.Rectangle.prototype,"bottomRight",{get:function(){return new c.Point(this.right,this.bottom)},set:function(a){this.right=a.x,this.bottom=a.y}}),Object.defineProperty(c.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(c.Rectangle.prototype,"right",{get:function(){return this.x+this.width},set:function(a){this.width=a<=this.x?0:this.x+a}}),Object.defineProperty(c.Rectangle.prototype,"volume",{get:function(){return this.width*this.height}}),Object.defineProperty(c.Rectangle.prototype,"perimeter",{get:function(){return 2*this.width+2*this.height}}),Object.defineProperty(c.Rectangle.prototype,"centerX",{get:function(){return this.x+this.halfWidth},set:function(a){this.x=a-this.halfWidth}}),Object.defineProperty(c.Rectangle.prototype,"centerY",{get:function(){return this.y+this.halfHeight},set:function(a){this.y=a-this.halfHeight}}),Object.defineProperty(c.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(c.Rectangle.prototype,"topLeft",{get:function(){return new c.Point(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}}),Object.defineProperty(c.Rectangle.prototype,"empty",{get:function(){return!this.width||!this.height},set:function(a){a===!0&&this.setTo(0,0,0,0)}}),c.Rectangle.inflate=function(a,b,c){return a.x-=b,a.width+=2*b,a.y-=c,a.height+=2*c,a},c.Rectangle.inflatePoint=function(a,b){return c.Rectangle.inflate(a,b.x,b.y)},c.Rectangle.size=function(a,b){return"undefined"==typeof b&&(b=new c.Point),b.setTo(a.width,a.height)},c.Rectangle.clone=function(a,b){return"undefined"==typeof b&&(b=new c.Rectangle),b.setTo(a.x,a.y,a.width,a.height)},c.Rectangle.contains=function(a,b,c){return b>=a.x&&b<=a.right&&c>=a.y&&c<=a.bottom},c.Rectangle.containsRaw=function(a,b,c,d,e,f){return e>=a&&a+c>=e&&f>=b&&b+d>=f},c.Rectangle.containsPoint=function(a,b){return c.Rectangle.contains(a,b.x,b.y)},c.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},c.Rectangle.equals=function(a,b){return a.x==b.x&&a.y==b.y&&a.width==b.width&&a.height==b.height},c.Rectangle.intersection=function(a,b,d){return d=d||new c.Rectangle,c.Rectangle.intersects(a,b)&&(d.x=Math.max(a.x,b.x),d.y=Math.max(a.y,b.y),d.width=Math.min(a.right,b.right)-d.x,d.height=Math.min(a.bottom,b.bottom)-d.y),d},c.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)},c.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}},Object.defineProperty(c.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(c.Line.prototype,"angle",{get:function(){return Math.atan2(this.end.x-this.start.x,this.end.y-this.start.y)}}),Object.defineProperty(c.Line.prototype,"slope",{get:function(){return(this.end.y-this.start.y)/(this.end.x-this.start.x)}}),Object.defineProperty(c.Line.prototype,"perpSlope",{get:function(){return-((this.end.x-this.start.x)/(this.end.y-this.start.y))}}),c.Line.intersectsPoints=function(a,b,d,e,f,g){"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=new c.Point);var h=b.y-a.y,i=e.y-d.y,j=a.x-b.x,k=d.x-e.x,l=b.x*a.y-a.x*b.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-b.x+(g.y-b.y),2)>Math.pow(a.x-b.x+(a.y-b.y),2))return null;if(Math.pow(g.x-a.x+(g.y-a.y),2)>Math.pow(a.x-b.x+(a.y-b.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},c.Line.intersects=function(a,b,d,e){return c.Line.intersectsPoints(a.start,a.end,b.start,b.end,d,e)},c.Net=function(a){this.game=a},c.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?(window.location.href=e,void 0):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," "))}},c.Net.prototype.constructor=c.Net,c.TweenManager=function(a){this.game=a,this._tweens=[],this._add=[],this.game.onPause.add(this.pauseAll,this),this.game.onResume.add(this.resumeAll,this)},c.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()}},c.TweenManager.prototype.constructor=c.TweenManager,c.Tween=function(a,b){this._object=a,this.game=b,this._manager=this.game.tweens,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=c.Easing.Linear.None,this._interpolationFunction=c.Math.linearInterpolation,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onUpdateCallback=null,this._onUpdateCallbackContext=null,this._pausedTime=0,this.pendingDelete=!1;for(var d in a)this._valuesStart[d]=parseFloat(a[d],10);this.onStart=new c.Signal,this.onLoop=new c.Signal,this.onComplete=new c.Signal,this.isRunning=!1},c.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(this._valuesEnd[a]instanceof Array){if(0===this._valuesEnd[a].length)continue;this._valuesEnd[a]=[this._object[a]].concat(this._valuesEnd[a])}this._valuesStart[a]=this._object[a],this._valuesStart[a]instanceof Array==!1&&(this._valuesStart[a]*=1),this._valuesStartRepeat[a]=this._valuesStart[a]||0}return this}},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._paused=!0,this._pausedTime=this.game.time.now},resume:function(){this._paused=!1,this._startTime+=this.game.time.now-this._pausedTime},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}},c.Tween.prototype.constructor=c.Tween,c.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((a-b)*2*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((a-b)*2*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((a-b)*2*Math.PI/d):.5*c*Math.pow(2,-10*(a-=1))*Math.sin((a-b)*2*Math.PI/d)+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-c.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*c.Easing.Bounce.In(2*a):.5*c.Easing.Bounce.Out(2*a-1)+.5}}},c.Time=function(a){this.game=a,this.time=0,this.now=0,this.elapsed=0,this.pausedTime=0,this.fps=0,this.fpsMin=1e3,this.fpsMax=0,this.msMin=1e3,this.msMax=0,this.physicsElapsed=0,this.frames=0,this.pauseDuration=0,this.timeToCall=0,this.lastTime=0,this.events=new c.Timer(this.game,!1),this._started=0,this._timeLastSecond=0,this._pauseStarted=0,this._justResumed=!1,this._timers=[],this._len=0,this._i=0,this.game.onPause.add(this.gamePaused,this),this.game.onResume.add(this.gameResumed,this)},c.Time.prototype={boot:function(){this.events.start()},create:function(a){"undefined"==typeof a&&(a=!0);var b=new c.Timer(this.game,a);return this._timers.push(b),b},removeAll:function(){for(var a=0;athis._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.physicsElapsed=1*(this.elapsed/1e3),this.physicsElapsed>.05&&(this.physicsElapsed=.05),this.game.paused)this.pausedTime=this.now-this._pauseStarted;else 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._started,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;)this.events[this._i].loop===!0?(this.events[this._i].tick+=this.events[this._i].delay-(this._now-this.events[this._i].tick),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+=this.events[this._i].delay-(this._now-this.events[this._i].tick),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)},resume:function(){if(this.running&&!this.expired){for(var a=this.game.time.now-this._pauseStarted,b=0;bthis._now?this.nextTick-this._now:0}}),Object.defineProperty(c.Timer.prototype,"length",{get:function(){return this.events.length}}),Object.defineProperty(c.Timer.prototype,"ms",{get:function(){return this._now}}),Object.defineProperty(c.Timer.prototype,"seconds",{get:function(){return.001*this._now}}),c.Timer.prototype.constructor=c.Timer,c.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},c.TimerEvent.prototype.constructor=c.TimerEvent,c.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=[]},c.AnimationManager.prototype={loadFrameData:function(a){this._frameData=a,this.frame=0,this.isLoaded=!0},add:function(a,d,e,f,g){return null==this._frameData?(console.warn("No FrameData available for Phaser.Animation "+a),void 0):(e=e||60,"undefined"==typeof f&&(f=!1),"undefined"==typeof g&&(g=d&&"number"==typeof d[0]?!0:!1),null==this.sprite.events.onAnimationStart&&(this.sprite.events.onAnimationStart=new c.Signal,this.sprite.events.onAnimationComplete=new c.Signal,this.sprite.events.onAnimationLoop=new c.Signal),this._outputFrames.length=0,this._frameData.getFrameIndexes(d,g,this._outputFrames),this._anims[a]=new c.Animation(this.game,this.sprite,a,this._frameData,this._outputFrames,e,f),this.currentAnim=this._anims[a],this.currentFrame=this.currentAnim.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid]),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?!1:this.currentAnim&&this.currentAnim.update()===!0?(this.currentFrame=this.currentAnim.currentFrame,this.sprite.currentFrame=this.currentFrame,!0):!1},getAnimation:function(a){return"string"==typeof a&&this._anims[a]?this._anims[a]:null},refreshFrame:function(){this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid])},destroy:function(){this._anims={},this._frameData=null,this._frameIndex=0,this.currentAnim=null,this.currentFrame=null}},c.AnimationManager.prototype.constructor=c.AnimationManager,Object.defineProperty(c.AnimationManager.prototype,"frameData",{get:function(){return this._frameData}}),Object.defineProperty(c.AnimationManager.prototype,"frameTotal",{get:function(){return this._frameData?this._frameData.total:-1}}),Object.defineProperty(c.AnimationManager.prototype,"paused",{get:function(){return this.currentAnim.isPaused},set:function(a){this.currentAnim.paused=a}}),Object.defineProperty(c.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._frameIndex=a,this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid]))}}),Object.defineProperty(c.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._frameIndex=this.currentFrame.index,this.sprite.currentFrame=this.currentFrame,this.sprite.setTexture(b.TextureCache[this.currentFrame.uuid])):console.warn("Cannot set frameName: "+a)}}),c.Animation=function(a,b,c,d,e,f,g){this.game=a,this._parent=b,this._frameData=d,this.name=c,this._frames=[],this._frames=this._frames.concat(e),this.delay=1e3/f,this.looped=g,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])},c.Animation.prototype={play:function(a,c,d){return"number"==typeof a&&(this.delay=1e3/a),"boolean"==typeof c&&(this.looped=c),"undefined"!=typeof d&&(this.killOnComplete=d),this.isPlaying=!0,this.isFinished=!1,this.paused=!1,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(b.TextureCache[this.currentFrame.uuid]),this._parent.events&&this._parent.events.onAnimationStart.dispatch(this._parent,this),this},restart:function(){this.isPlaying=!0,this.isFinished=!1,this.paused=!1,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])},stop:function(a){"undefined"==typeof a&&(a=!1),this.isPlaying=!1,this.isFinished=!0,this.paused=!1,a&&(this.currentFrame=this._frameData.getFrame(this._frames[0]))},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.looped?(this._frameIndex%=this._frames.length,this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setTexture(b.TextureCache[this.currentFrame.uuid]),this._parent.events.onAnimationLoop.dispatch(this._parent,this)):this.onComplete():(this.currentFrame=this._frameData.getFrame(this._frames[this._frameIndex]),this.currentFrame&&this._parent.setTexture(b.TextureCache[this.currentFrame.uuid])),!0):!1},destroy:function(){this.game=null,this._parent=null,this._frames=null,this._frameData=null,this.currentFrame=null,this.isPlaying=!1},onComplete:function(){this.isPlaying=!1,this.isFinished=!0,this.paused=!1,this._parent.events&&this._parent.events.onAnimationComplete.dispatch(this._parent,this),this.killOnComplete&&this._parent.kill()}},c.Animation.prototype.constructor=c.Animation,Object.defineProperty(c.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(c.Animation.prototype,"frameTotal",{get:function(){return this._frames.length}}),Object.defineProperty(c.Animation.prototype,"frame",{get:function(){return null!==this.currentFrame?this.currentFrame.index:this._frameIndex},set:function(a){this.currentFrame=this._frameData.getFrame(a),null!==this.currentFrame&&(this._frameIndex=a,this._parent.setTexture(b.TextureCache[this.currentFrame.uuid]))}}),c.Animation.generateFrameNames=function(a,b,d,e,f){"undefined"==typeof e&&(e="");var g=[],h="";if(d>b)for(var i=b;d>=i;i++)h="number"==typeof f?c.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);else for(var i=b;i>=d;i--)h="number"==typeof f?c.Utils.pad(i.toString(),f,"0",1):i.toString(),h=a+h+e,g.push(h);return g},c.Frame=function(a,b,d,e,f,g,h){this.index=a,this.x=b,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=c.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},c.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)}},c.Frame.prototype.constructor=c.Frame,c.FrameData=function(){this._frames=[],this._frameNames=[]},c.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 this._frames.length>a?this._frames[a]:null},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++)b?c.push(this.getFrame(a[d])):c.push(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}},c.FrameData.prototype.constructor=c.FrameData,Object.defineProperty(c.FrameData.prototype,"total",{get:function(){return this._frames.length}}),c.AnimationParser={spriteSheet:function(a,d,e,f,g,h,i){var j=a.cache.getImage(d);if(null==j)return null;var k=j.width,l=j.height;0>=e&&(e=Math.floor(-k/Math.min(-1,e))),0>=f&&(f=Math.floor(-l/Math.min(-1,f)));var m=Math.round(k/e),n=Math.round(l/f),o=m*n;if(-1!==g&&(o=g),0===k||0===l||e>k||f>l||0===o)return console.warn("Phaser.AnimationParser.spriteSheet: width/height zero or width/height < given frameWidth/frameHeight"),null;for(var p=new c.FrameData,q=h,r=h,s=0;o>s;s++){var t=a.rnd.uuid();p.addFrame(new c.Frame(s,q,r,e,f,"",t)),b.TextureCache[t]=new b.Texture(b.BaseTextureCache[d],{x:q,y:r,width:e,height:f}),q+=e+i,q===k&&(q=h,r+=f+i)}return p},JSONData:function(a,d,e){if(!d.frames)return console.warn("Phaser.AnimationParser.JSONData: Invalid Texture Atlas JSON given, missing 'frames' array"),console.log(d),void 0;for(var f,g=new c.FrameData,h=d.frames,i=0;i tag"),void 0;for(var f,g,h,i,j,k,l,m,n,o,p,q,r=new c.FrameData,s=d.getElementsByTagName("SubTexture"),t=0;t0)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 console.warn("Phaser.Loader loadFile invalid index "+this._fileIndex),void 0;var a=this._fileList[this._fileIndex],b=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 b.fileComplete(b._fileIndex)},a.data.onerror=function(){return b.fileError(b._fileIndex)},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 b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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 b.fileError(b._fileIndex)},a.data.preload="auto",a.data.src=this.baseURL+a.url,a.data.addEventListener("canplaythrough",c.GAMES[this.game.id].load.fileComplete(this._fileIndex),!1),a.data.load())):this.fileError(this._fileIndex);break;case"tilemap":if(this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",a.format===c.Tilemap.TILED_JSON)this._xhr.onload=function(){return b.jsonLoadComplete(b._fileIndex)};else{if(a.format!==c.Tilemap.CSV)throw new Error("Phaser.Loader. Invalid Tilemap format: "+a.format);this._xhr.onload=function(){return b.csvLoadComplete(b._fileIndex)}}this._xhr.onerror=function(){return b.dataLoadError(b._fileIndex)},this._xhr.send();break;case"text":case"script":this._xhr.open("GET",this.baseURL+a.url,!0),this._xhr.responseType="text",this._xhr.onload=function(){return b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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 b.fileComplete(b._fileIndex)},this._xhr.onerror=function(){return b.fileError(b._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.crop.width=Math.floor(this.preloadSprite.width/100*this.progress):this.preloadSprite.crop.height=Math.floor(this.preloadSprite.height/100*this.progress),this.preloadSprite.sprite.crop=this.preloadSprite.crop),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 tag"),void 0;var e=b.TextureCache[d],f={},g=c.getElementsByTagName("info")[0],h=c.getElementsByTagName("common")[0];f.font=g.attributes.getNamedItem("face").nodeValue,f.size=parseInt(g.attributes.getNamedItem("size").nodeValue,10),f.lineHeight=parseInt(h.attributes.getNamedItem("lineHeight").nodeValue,10),f.chars={};for(var i=c.getElementsByTagName("char"),j=0;j=this.durationMS&&(this.usingWebAudio?this.loop?(this.onLoop.dispatch(this),""===this.currentMarker?(this.currentTime=0,this.startTime=this.game.time.now):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(a=a||"",b=b||0,"undefined"==typeof c&&(c=this._volume),"undefined"==typeof d&&(d=!1),"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 console.warn("Phaser.Sound.play: audio marker "+a+" doesn't exist"),void 0;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,this._tempMarker=a,this._tempPosition=this.position,this._tempVolume=this.volume,this._tempLoop=this.loop}else 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.externalNode?this._sound.connect(this.externalNode.input):this._sound.connect(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.externalNode?this._sound.connect(this.externalNode.input):this._sound.connect(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.onStop.dispatch(this,a)}},c.Sound.prototype.constructor=c.Sound,Object.defineProperty(c.Sound.prototype,"isDecoding",{get:function(){return this.game.cache.getSound(this.key).isDecoding}}),Object.defineProperty(c.Sound.prototype,"isDecoded",{get:function(){return this.game.cache.isSoundDecoded(this.key)}}),Object.defineProperty(c.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(c.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)}}),c.SoundManager=function(a){this.game=a,this.onSoundDecode=new c.Signal,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},c.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,this.noAudio=!0,void 0;if(window.PhaserGlobal.disableWebAudio===!0)return this.usingWebAudio=!1,this.usingAudioTag=!0,this.noAudio=!1,void 0}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 c.Color.getColor(255,255,255);if(a>b)return c.Color.getColor(255,255,255);var e=a+Math.round(Math.random()*(b-a)),f=a+Math.round(Math.random()*(b-a)),g=a+Math.round(Math.random()*(b-a));return c.Color.getColor32(d,e,f,g)},getRGB:function(a){return{alpha:a>>>24,red:255&a>>16,green:255&a>>8,blue:255&a}},getWebRGB:function(a){var b=(a>>>24)/255,c=255&a>>16,d=255&a>>8,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 255&a>>16},getGreen:function(a){return 255&a>>8},getBlue:function(a){return 255&a}};var f=function(){"use strict";function a(a,b){this.x=a||0,this.y=b||0}function b(b,c){this.pos=b||new a,this.r=c||0}function c(b,c){this.pos=b||new a,this.points=c||[],this.recalc()}function d(b,c,d){this.pos=b||new a,this.w=c||0,this.h=d||0}function e(){this.a=null,this.b=null,this.overlapN=new a,this.overlapV=new a,this.clear()}function f(a,b,c){for(var d=Number.MAX_VALUE,e=-Number.MAX_VALUE,f=a.length,g=0;f>g;g++){var h=a[g].dot(b);d>h&&(d=h),h>e&&(e=h)}c[0]=d,c[1]=e}function g(a,b,c,d,e,g){var h=p.pop(),i=p.pop(),j=n.pop().copy(b).sub(a),k=j.dot(e);if(f(c,e,h),f(d,e,i),i[0]+=k,i[1]+=k,h[0]>i[1]||i[0]>h[1])return n.push(j),p.push(h),p.push(i),!0;if(g){var l=0;if(h[0]m?m:-o}else if(g.bInA=!1,h[1]>i[1])l=h[0]-i[1],g.aInB=!1;else{var m=h[1]-i[0],o=i[1]-h[0];l=o>m?m:-o}var q=Math.abs(l);ql&&g.overlapN.reverse())}return n.push(j),p.push(h),p.push(i),!1}function h(a,b){var c=a.len2(),d=b.dot(a);return 0>d?q:d>c?s:r}function i(a,b,c){var d=n.pop().copy(b.pos).sub(a.pos),e=a.r+b.r,f=e*e,g=d.len2();if(g>f)return n.push(d),!1;if(c){var h=Math.sqrt(g);c.a=a,c.b=b,c.overlap=e-h,c.overlapN.copy(d.normalize()),c.overlapV.copy(d).scale(c.overlap),c.aInB=a.r<=b.r&&h<=b.r-a.r,c.bInA=b.r<=a.r&&h<=a.r-b.r}return n.push(d),!0}function j(a,b,c){for(var d=n.pop().copy(b.pos).sub(a.pos),e=b.r,f=e*e,g=a.points,i=g.length,j=n.pop(),k=n.pop(),l=0;i>l;l++){var m=l===i-1?0:l+1,o=0===l?i-1:l-1,p=0,r=null;j.copy(a.edges[l]),k.copy(d).sub(g[l]),c&&k.len2()>f&&(c.aInB=!1);var t=h(j,k);if(t===q){j.copy(a.edges[o]);var u=n.pop().copy(d).sub(g[o]);if(t=h(j,u),t===s){var v=k.len();if(v>e)return n.push(d),n.push(j),n.push(k),n.push(u),!1;c&&(c.bInA=!1,r=k.normalize(),p=e-v)}n.push(u)}else if(t===s){if(j.copy(a.edges[m]),k.copy(d).sub(g[m]),t=h(j,k),t===q){var v=k.len();if(v>e)return n.push(d),n.push(j),n.push(k),!1;c&&(c.bInA=!1,r=k.normalize(),p=e-v)}}else{var w=j.perp().normalize(),v=k.dot(w),x=Math.abs(v);if(v>0&&x>e)return n.push(d),n.push(w),n.push(k),!1;
+c&&(r=w,p=e-v,(v>=0||2*e>p)&&(c.bInA=!1))}r&&c&&Math.abs(p)i;i++)if(g(a.pos,b.pos,d,f,a.normals[i],c))return!1;for(var i=0;h>i;i++)if(g(a.pos,b.pos,d,f,b.normals[i],c))return!1;return c&&(c.a=a,c.b=b,c.overlapV.copy(c.overlapN).scale(c.overlap)),!0}var m={};m.Vector=a,m.V=a,a.prototype.copy=a.prototype.copy=function(a){return this.x=a.x,this.y=a.y,this},a.prototype.perp=a.prototype.perp=function(){var a=this.x;return this.x=this.y,this.y=-a,this},a.prototype.rotate=a.prototype.rotate=function(a){var b=this.x,c=this.y;return this.x=b*Math.cos(a)-c*Math.sin(a),this.y=b*Math.sin(a)+c*Math.cos(a),this},a.prototype.rotatePrecalc=a.prototype.rotatePrecalc=function(a,b){var c=this.x,d=this.y;return this.x=c*b-d*a,this.y=c*a+d*b,this},a.prototype.reverse=a.prototype.reverse=function(){return this.x=-this.x,this.y=-this.y,this},a.prototype.normalize=a.prototype.normalize=function(){var a=this.len();return a>0&&(this.x=this.x/a,this.y=this.y/a),this},a.prototype.add=a.prototype.add=function(a){return this.x+=a.x,this.y+=a.y,this},a.prototype.sub=a.prototype.sub=function(a){return this.x-=a.x,this.y-=a.y,this},a.prototype.scale=a.prototype.scale=function(a,b){return this.x*=a,this.y*=b||a,this},a.prototype.project=a.prototype.project=function(a){var b=this.dot(a)/a.len2();return this.x=b*a.x,this.y=b*a.y,this},a.prototype.projectN=a.prototype.projectN=function(a){var b=this.dot(a);return this.x=b*a.x,this.y=b*a.y,this},a.prototype.reflect=a.prototype.reflect=function(a){var b=this.x,c=this.y;return this.project(a).scale(2),this.x-=b,this.y-=c,this},a.prototype.reflectN=a.prototype.reflectN=function(a){var b=this.x,c=this.y;return this.projectN(a).scale(2),this.x-=b,this.y-=c,this},a.prototype.dot=a.prototype.dot=function(a){return this.x*a.x+this.y*a.y},a.prototype.len2=a.prototype.len2=function(){return this.dot(this)},a.prototype.len=a.prototype.len=function(){return Math.sqrt(this.len2())},m.Circle=b,m.Polygon=c,c.prototype.recalc=c.prototype.recalc=function(){this.edges=[],this.normals=[];for(var b=this.points,c=b.length,d=0;c>d;d++){var e=b[d],f=c-1>d?b[d+1]:b[0],g=(new a).copy(f).sub(e),h=(new a).copy(g).perp().normalize();this.edges.push(g),this.normals.push(h)}return this},c.prototype.rotate=c.prototype.rotate=function(a){var b,c=this.points,d=this.edges,e=this.normals,f=c.length,g=Math.cos(a),h=Math.sin(a);for(b=0;f>b;b++)c[b].rotatePrecalc(h,g),d[b].rotatePrecalc(h,g),e[b].rotatePrecalc(h,g);return this},c.prototype.scale=c.prototype.scale=function(a,b){var c,d=this.points,e=this.edges,f=this.normals,g=d.length;for(c=0;g>c;c++)d[c].scale(a,b),e[c].scale(a,b),f[c].scale(a,b);return this},c.prototype.translate=c.prototype.translate=function(a,b){var c,d=this.points,e=d.length;for(c=0;e>c;c++)d[c].x+=a,d[c].y+=b;return this},m.Box=d,d.prototype.toPolygon=d.prototype.toPolygon=function(){var b=this.pos,d=this.w,e=this.h;return new c(new a(b.x,b.y),[new a,new a(d,0),new a(d,e),new a(0,e)])},m.Response=e,e.prototype.clear=e.prototype.clear=function(){return this.aInB=!0,this.bInA=!0,this.overlap=Number.MAX_VALUE,this};for(var n=[],o=0;10>o;o++)n.push(new a);for(var p=[],o=0;5>o;o++)p.push([]);var q=-1,r=0,s=1;return m.testCircleCircle=i,m.testPolygonCircle=j,m.testCirclePolygon=k,m.testPolygonPolygon=l,m}();return c.Physics={},c.Physics.Arcade=function(a){this.game=a,this.gravity=new c.Point,this.worldLeft=null,this.worldRight=null,this.worldTop=null,this.worldBottom=null,this.worldPolys=[null,null,null,null],this.quadTree=new c.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.maxObjects=10,this.maxLevels=4,this._mapData=[],this._mapTiles=0,this._result=!1,this._total=0,this._angle=0,this._drag=0,this._dx=0,this._dy=0,this._p=new c.Point(0,0),this._intersection=[0,0,0,0],this._gravityX=0,this._gravityY=0,this._response=new f.Response,this.setBoundsToWorld(!0,!0,!0,!0)},c.Physics.Arcade.RECT=0,c.Physics.Arcade.CIRCLE=1,c.Physics.Arcade.POLYGON=2,c.Physics.Arcade.prototype={checkBounds:function(a){if(!a.collideWorldBounds||!this.worldLeft&&!this.worldRight&&!this.worldTop&&!this.worldBottom)return!1;this._response.clear();var b=f.testPolygonPolygon,d=a.polygon,e=!1;return a.type===c.Physics.Arcade.CIRCLE&&(b=f.testPolygonCircle,d=a.shape),this.worldLeft&&b(this.worldPolys[0],d,this._response)?(a.blocked.left=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0):this.worldRight&&b(this.worldPolys[1],d,this._response)&&(a.blocked.right=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0),this._response.clear(),this.worldTop&&b(this.worldPolys[2],d,this._response)?(a.blocked.up=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0):this.worldBottom&&b(this.worldPolys[3],d,this._response)&&(a.blocked.down=!0,d.pos.add(this._response.overlapV),a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),e=!0),e},setBoundsToWorld:function(a,b,c,d){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)},setBounds:function(a,b,c,d,e,g,h,i){"undefined"==typeof e&&(e=!0),"undefined"==typeof g&&(g=!0),"undefined"==typeof h&&(h=!0),"undefined"==typeof i&&(i=!0);var j=100;e?(this.worldLeft=new f.Box(new f.Vector(a-j,b),j,d),this.worldPolys[0]=this.worldLeft.toPolygon()):(this.worldLeft=null,this.worldPolys[0]=null),g?(this.worldRight=new f.Box(new f.Vector(a+c,b),j,d),this.worldPolys[1]=this.worldRight.toPolygon()):(this.worldRight=null,this.worldPolys[1]=null),h?(this.worldTop=new f.Box(new f.Vector(a,b-j),c,j),this.worldPolys[2]=this.worldTop.toPolygon()):(this.worldTop=null,this.worldPolys[2]=null),i?(this.worldBottom=new f.Box(new f.Vector(a,b+d),c,j),this.worldPolys[3]=this.worldBottom.toPolygon()):(this.worldBottom=null,this.worldPolys[3]=null)},updateMotion:function(a){return a.allowGravity?(this._gravityX=this.gravity.x+a.gravity.x,this._gravityY=this.gravity.y+a.gravity.y):(this._gravityX=a.gravity.x,this._gravityY=a.gravity.y),(this._gravityX<0&&a.blocked.left||this._gravityX>0&&a.blocked.right)&&(this._gravityX=0),(this._gravityY<0&&a.blocked.up||this._gravityY>0&&a.blocked.down)&&(this._gravityY=0),a.allowRotation&&(this._velocityDelta=a.angularAcceleration*this.game.time.physicsElapsed,0!==a.angularDrag&&0===a.angularAcceleration&&(this._drag=a.angularDrag*this.game.time.physicsElapsed,a.angularVelocity>0?a.angularVelocity-=this._drag:a.angularVelocity<0&&(a.angularVelocity+=this._drag)),a.rotation+=this.game.time.physicsElapsed*(a.angularVelocity+this._velocityDelta/2),a.angularVelocity+=this._velocityDelta,a.angularVelocity>a.maxAngular?a.angularVelocity=a.maxAngular:a.angularVelocity<-a.maxAngular&&(a.angularVelocity=-a.maxAngular)),this._p.setTo((a.acceleration.x+this._gravityX)*this.game.time.physicsElapsed,(a.acceleration.y+this._gravityY)*this.game.time.physicsElapsed),this._p},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,d,e,f,g){return"undefined"!=typeof b||a.type!==c.GROUP&&a.type!==c.EMITTER?(a&&b&&a.exists&&b.exists&&(a.type==c.SPRITE||a.type==c.TILESPRITE?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsSprite(a,b,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideSpriteVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideSpriteVsTilemapLayer(a,b,d,e,f):a.type==c.GROUP?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsGroup(b,a,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideGroupVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,d,e,f):a.type==c.TILEMAPLAYER?b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsTilemapLayer(b,a,d,e,f):(b.type==c.GROUP||b.type==c.EMITTER)&&this.collideGroupVsTilemapLayer(b,a,d,e,f):a.type==c.EMITTER&&(b.type==c.SPRITE||b.type==c.TILESPRITE?this.collideSpriteVsGroup(b,a,d,e,f,g):b.type==c.GROUP||b.type==c.EMITTER?this.collideGroupVsGroup(a,b,d,e,f,g):b.type==c.TILEMAPLAYER&&this.collideGroupVsTilemapLayer(a,b,d,e,f))),void 0):(this.collideGroupVsSelf(a,d,e,f,g),void 0)},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,d,e,f,g){if(0!==b.length){this.quadTree.clear(),this.quadTree=new c.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.quadTree.populate(b),this._potentials=this.quadTree.retrieve(a);for(var h=0,i=this._potentials.length;i>h;h++)this.separate(a.body,this._potentials[h],e,f,g)&&(d&&d.call(f,a,this._potentials[h].sprite),this._total++)}},collideGroupVsSelf:function(a,b,c,d,e){if(0!==a.length)for(var f=a._container.children.length,g=0;f>g;g++)for(var h=g+1;f>=h;h++)a._container.children[g]&&a._container.children[h]&&a._container.children[g].exists&&a._container.children[h].exists&&this.collideSpriteVsSprite(a._container.children[g],a._container.children[h],b,c,d,e)},collideGroupVsGroup:function(a,b,c,d,e,f){if(0!==a.length&&0!==b.length&&a._container.first._iNext){var g=a._container.first._iNext;do g.exists&&this.collideSpriteVsGroup(g,b,c,d,e,f),g=g._iNext;while(g!=a._container.last._iNext)}},collideSpriteVsTilemapLayer:function(a,b,c,d,e){if(this._mapData=b.getTiles(a.body.left,a.body.top,a.body.width,a.body.height,!0),0!==this._mapData.length)if(this._mapData.length>1)this.separateTiles(a.body,this._mapData);else{var f=0;this.separateTile(a.body,this._mapData[f])&&(d?d.call(e,a,this._mapData[f])&&(this._total++,c&&c.call(e,a,this._mapData[f])):(this._total++,c&&c.call(e,a,this._mapData[f])))}},collideGroupVsTilemapLayer:function(a,b,c,d,e){if(0!==a.length&&a._container.first._iNext){var f=a._container.first._iNext;do f.exists&&this.collideSpriteVsTilemapLayer(f,b,c,d,e),f=f._iNext;while(f!=a._container.last._iNext)}},separate:function(a,b,c,d,e){return a===b||this.intersects(a,b)===!1?!1:c&&c.call(d,a.sprite,b.sprite)===!1?!1:(this._response.clear(),e?a.overlap(b,this._response):a.overlap(b,this._response)?a.separate(b,this._response):!1)},intersects:function(a,b){var c=!1;(a.width<=0||a.height<=0||b.width<=0||b.height<=0)&&(c=!1),c=!(a.rightb.right||a.top>b.bottom),!c&&a.inContact(b)&&a.removeContact(b)},tileIntersects:function(a,b){return a.width<=0||a.height<=0||b.width<=0||b.height<=0?(this._intersection[4]=0,this._intersection):a.rightb.right||a.top>b.bottom?(this._intersection[4]=0,this._intersection):(this._intersection[0]=Math.max(a.left,b.x),this._intersection[1]=Math.max(a.top,b.y),this._intersection[2]=Math.min(a.right,b.right)-this._intersection[0],this._intersection[3]=Math.min(a.bottom,b.bottom)-this._intersection[1],this._intersection[4]=1,this._intersection)},separateTiles:function(a,b){for(var c,d=!1,e=0;e0&&a.checkCollision.right&&b.tile.faceLeft&&!a.blocked.right&&(a.overlapX=a.right-b.x,a.overlapX>0?c=!0:a.overlapX=0),a.deltaY()<0&&a.checkCollision.up&&b.tile.faceBottom&&!a.blocked.up?(a.overlapY=a.top-b.bottom,a.overlapY<0?c=!0:a.overlapY=0):a.deltaY()>0&&a.checkCollision.down&&b.tile.faceTop&&!a.blocked.down&&(a.overlapY=a.bottom-b.y,a.overlapY>0?c=!0:a.overlapY=0),0!==a.overlapX&&0!==a.overlapY&&(Math.abs(a.overlapX)>Math.abs(a.overlapY)?a.overlapX=0:a.overlapY=0),c?this.processTileSeparation(a):!1},processTileSeparation:function(a){return a.overlapX<0?(a.x-=a.overlapX,a.left-=a.overlapX,a.right-=a.overlapX,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.left=!0):a.overlapX>0&&(a.x-=a.overlapX,a.left-=a.overlapX,a.right-=a.overlapX,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.right=!0),a.overlapY<0?(a.y-=a.overlapY,a.top-=a.overlapY,a.bottom-=a.overlapY,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.up=!0):a.overlapY>0&&(a.y-=a.overlapY,a.top-=a.overlapY,a.bottom-=a.overlapY,a.blocked.x=Math.floor(a.x),a.blocked.y=Math.floor(a.y),a.blocked.down=!0),a.reboundCheck(a.overlapX,a.overlapY,!0),!0},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,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(this.game.math.degToRad(a))*b,Math.sin(this.game.math.degToRad(a))*b)},velocityFromRotation:function(a,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(a)*b,Math.sin(a)*b)},accelerationFromRotation:function(a,b,d){return"undefined"==typeof b&&(b=60),d=d||new c.Point,d.setTo(Math.cos(a)*b,Math.sin(a)*b)},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)}},c.Physics.Arcade.prototype.constructor=c.Physics.Arcade,c.Physics.Arcade.Body=function(a){this.sprite=a,this.game=a.game,this.offset=new c.Point,this.preX=a.world.x,this.preY=a.world.y,this.preRotation=a.angle,this.velocity=new c.Point,this.acceleration=new c.Point,this.speed=0,this.angle=0,this.gravity=new c.Point,this.bounce=new c.Point,this.minVelocity=new c.Point,this.maxVelocity=new c.Point(1e3,1e3),this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.linearDamping=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.blocked={x:0,y:0,up:!1,down:!1,left:!1,right:!1},this.facing=c.NONE,this.rebound=!0,this.immovable=!1,this.moves=!0,this.rotation=0,this.allowRotation=!0,this.allowGravity=!0,this.customSeparateCallback=null,this.customSeparateContext=null,this.collideCallback=null,this.collideCallbackContext=null,this.collideWorldBounds=!1,this.type=c.Physics.Arcade.RECT,this.shape=null,this.polygon=null,this.left=0,this.right=0,this.top=0,this.bottom=0,this.width=0,this.height=0,this.contacts=[],this.overlapX=0,this.overlapY=0,this._temp=null,this._dx=0,this._dy=0,this._sx=a.scale.x,this._sy=a.scale.y,this._distances=[0,0,0,0],this._vx=0,this._vy=0,this.setRectangle(a.width,a.height,0,0),this.sprite.events.onBeginContact=new c.Signal,this.sprite.events.onEndContact=new c.Signal},c.Physics.Arcade.Body.prototype={updateScale:function(){this.polygon?this.polygon.scale(this.sprite.scale.x/this._sx,this.sprite.scale.y/this._sy):this.shape.r*=Math.max(this.sprite.scale.x,this.sprite.scale.y),this._sx=this.sprite.scale.x,this._sy=this.sprite.scale.y},preUpdate:function(){this.x=this.sprite.world.x-this.sprite.anchor.x*this.sprite.width+this.offset.x,this.y=this.sprite.world.y-this.sprite.anchor.y*this.sprite.height+this.offset.y,this.preX=this.x,this.preY=this.y,this.preRotation=this.sprite.angle,this.rotation=this.preRotation,(this.sprite.scale.x!==this._sx||this.sprite.scale.y!==this._sy)&&this.updateScale(),this.checkBlocked(),this.touching.none=!0,this.touching.up=!1,this.touching.down=!1,this.touching.left=!1,this.touching.right=!1,this.moves?((this._vx!==this.velocity.x||this._vy!==this.velocity.y)&&(this._vx=this.velocity.x,this._vy=this.velocity.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.game.physics.checkBounds(this)&&this.reboundCheck(!0,!0,!0),this.applyDamping(),this.integrateVelocity(),this.updateBounds(),this.checkBlocked()):this.updateBounds()},checkBlocked:function(){!this.blocked.left&&!this.blocked.right||Math.floor(this.x)===this.blocked.x&&Math.floor(this.y)===this.blocked.y||(this.blocked.left=!1,this.blocked.right=!1),!this.blocked.up&&!this.blocked.down||Math.floor(this.x)===this.blocked.x&&Math.floor(this.y)===this.blocked.y||(this.blocked.up=!1,this.blocked.down=!1)},updateBounds:function(){this.type===c.Physics.Arcade.CIRCLE?(this.left=this.shape.pos.x-this.shape.r,this.right=this.shape.pos.x+this.shape.r,this.top=this.shape.pos.y-this.shape.r,this.bottom=this.shape.pos.y+this.shape.r):(this.left=c.Math.minProperty("x",this.polygon.points)+this.polygon.pos.x,this.right=c.Math.maxProperty("x",this.polygon.points)+this.polygon.pos.x,this.top=c.Math.minProperty("y",this.polygon.points)+this.polygon.pos.y,this.bottom=c.Math.maxProperty("y",this.polygon.points)+this.polygon.pos.y),this.width=this.right-this.left,this.height=this.bottom-this.top},applyDamping:function(){this.linearDamping>0&&this.acceleration.isZero()&&(this.speed>this.linearDamping?this.speed-=this.linearDamping:this.speed=0,this.speed>0&&(this.velocity.x=Math.cos(this.angle)*this.speed,this.velocity.y=Math.sin(this.angle)*this.speed,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)))},reboundCheck:function(a,b,c){if(a&&(c&&0!==this.bounce.x&&(this.blocked.left||this.blocked.right||this.touching.left||this.touching.right)&&(this._vx<=0&&this.velocity.x>0||this._vx>=0&&this.velocity.x<0||(this.velocity.x*=-this.bounce.x,this.angle=Math.atan2(this.velocity.y,this.velocity.x))),0===this.bounce.x||Math.abs(this.velocity.x)d||this.velocity.x<0)||(this.blocked.right||this.touching.right)&&(d>0||this.velocity.x>0))&&(this.velocity.x=0)}if(b&&(c&&0!==this.bounce.y&&(this.blocked.up||this.blocked.down||this.touching.up||this.touching.down)&&(this._vy<=0&&this.velocity.y>0||this._vy>=0&&this.velocity.y<0||(this.velocity.y*=-this.bounce.y,this.angle=Math.atan2(this.velocity.y,this.velocity.x))),0===this.bounce.y||Math.abs(this.velocity.y)e||this.velocity.y<0)||(this.blocked.down||this.touching.down)&&(e>0||this.velocity.y>0))&&(this.velocity.y=0)}},getUpwardForce:function(){return this.allowGravity?this.gravity.x+this.game.physics.gravity.x+this.velocity.x:this.gravity.x+this.velocity.x},getDownwardForce:function(){return this.allowGravity?this.gravity.y+this.game.physics.gravity.y+this.velocity.y:this.gravity.y+this.velocity.y},sub:function(a){this.x-=a.x,this.y-=a.y},add:function(a){this.x+=a.x,this.y+=a.y},give:function(a,b){this.add(b.overlapV),this.rebound&&(this.processRebound(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},take:function(a,b){this.sub(b.overlapV),this.rebound&&(this.processRebound(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},split:function(a,b){b.overlapV.scale(.5),this.sub(b.overlapV),a.add(b.overlapV),this.rebound&&(this.exchange(a),this.reboundCheck(!0,!0,!1),a.reboundCheck(!0,!0,!1))},exchange:function(a){if(this.mass===a.mass&&this.speed>0&&a.speed>0)this._dx=a.velocity.x,this._dy=a.velocity.y,a.velocity.x=this.velocity.x*a.bounce.x,a.velocity.y=this.velocity.y*a.bounce.x,this.velocity.x=this._dx*this.bounce.x,this.velocity.y=this._dy*this.bounce.y;else{var b=Math.sqrt(a.velocity.x*a.velocity.x*a.mass/this.mass)*(a.velocity.x>0?1:-1),c=Math.sqrt(this.velocity.x*this.velocity.x*this.mass/a.mass)*(this.velocity.x>0?1:-1),d=.5*(b+c);b-=d,c-=d,this.velocity.x=b,a.velocity.x=c,b=Math.sqrt(a.velocity.y*a.velocity.y*a.mass/this.mass)*(a.velocity.y>0?1:-1),c=Math.sqrt(this.velocity.y*this.velocity.y*this.mass/a.mass)*(this.velocity.y>0?1:-1),d=.5*(b+c),b-=d,c-=d,this.velocity.y=b,a.velocity.y=c}},processRebound:function(a){this._vx<=0&&this.velocity.x>0||this._vx>=0&&this.velocity.x<0||(this.velocity.x=a.velocity.x-this.velocity.x*this.bounce.x),this._vy<=0&&this.velocity.y>0||this._vy>=0&&this.velocity.y<0||(this.velocity.y=a.velocity.y-this.velocity.y*this.bounce.y),this.angle=Math.atan2(this.velocity.y,this.velocity.x),this.reboundCheck(!0,!0,!1)},overlap:function(a,b){var d=!1;return this.type!==c.Physics.Arcade.RECT&&this.type!==c.Physics.Arcade.POLYGON||a.type!==c.Physics.Arcade.RECT&&a.type!==c.Physics.Arcade.POLYGON?this.type===c.Physics.Arcade.CIRCLE&&a.type===c.Physics.Arcade.CIRCLE?d=f.testCircleCircle(this.shape,a.shape,b):this.type!==c.Physics.Arcade.RECT&&this.type!==c.Physics.Arcade.POLYGON||a.type!==c.Physics.Arcade.CIRCLE?this.type!==c.Physics.Arcade.CIRCLE||a.type!==c.Physics.Arcade.RECT&&a.type!==c.Physics.Arcade.POLYGON||(d=f.testCirclePolygon(this.shape,a.polygon,b)):d=f.testPolygonCircle(this.polygon,a.shape,b):d=f.testPolygonPolygon(this.polygon,a.polygon,b),d||this.removeContact(a),d},inContact:function(a){return-1!=this.contacts.indexOf(a)},addContact:function(a){return this.inContact(a)?!1:(this.contacts.push(a),this.sprite.events.onBeginContact.dispatch(this.sprite,a.sprite,this,a),a.addContact(this),!0)},removeContact:function(a){return this.inContact(a)?(this.contacts.splice(this.contacts.indexOf(a),1),this.sprite.events.onEndContact.dispatch(this.sprite,a.sprite,this,a),a.removeContact(this),!0):!1},separate:function(a,b){if(this._distances[0]=a.right-this.x,this._distances[1]=this.right-a.x,this._distances[2]=a.bottom-this.y,this._distances[3]=this.bottom-a.y,!b.overlapN.x||0!==this._distances[0]&&0!==this._distances[1]?!b.overlapN.y||0!==this._distances[2]&&0!==this._distances[3]||(b.overlapN.x=!0,b.overlapN.y=!1):(b.overlapN.x=!1,b.overlapN.y=!0),this.customSeparateCallback)return this.customSeparateCallback.call(this.customSeparateContext,this,b,this._distances);var c=!1;return b.overlapN.x?this._distances[0]0&&!this.blocked.right&&!this.touching.right)&&(this.x+=this._dx,this.velocity.x+=this._temp.x),(this._dy<0&&!this.blocked.up&&!this.touching.up||this._dy>0&&!this.blocked.down&&!this.touching.down)&&(this.y+=this._dy,this.velocity.y+=this._temp.y),this.velocity.x>this.maxVelocity.x?this.velocity.x=this.maxVelocity.x:this.velocity.x<-this.maxVelocity.x&&(this.velocity.x=-this.maxVelocity.x),this.velocity.y>this.maxVelocity.y?this.velocity.y=this.maxVelocity.y:this.velocity.y<-this.maxVelocity.y&&(this.velocity.y=-this.maxVelocity.y)},postUpdate:function(){this.moves&&(this.game.physics.checkBounds(this),this.reboundCheck(!0,!0,!0),this._dx=this.deltaX(),this._dy=this.deltaY(),this._dx<0?this.facing=c.LEFT:this._dx>0&&(this.facing=c.RIGHT),this._dy<0?this.facing=c.UP:this._dy>0&&(this.facing=c.DOWN),(0!==this._dx||0!==this._dy)&&(this.sprite.x+=this._dx,this.sprite.y+=this._dy),this.allowRotation&&0!==this.deltaZ()&&(this.sprite.angle+=this.deltaZ()),(this.sprite.scale.x!==this._sx||this.sprite.scale.y!==this._sy)&&this.updateScale())},reset:function(a){"undefined"==typeof a&&(a=!1),a&&(this.gravity.setTo(0,0),this.bounce.setTo(0,0),this.minVelocity.setTo(5,5),this.maxVelocity.setTo(1e3,1e3),this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.friction=0,this.checkCollision={none:!1,any:!0,up:!0,down:!0,left:!0,right:!0}),this.velocity.setTo(0,0),this.acceleration.setTo(0,0),this.angularVelocity=0,this.angularAcceleration=0,this.blocked={x:0,y:0,up:!1,down:!1,left:!1,right:!1},this.x=this.sprite.world.x-this.sprite.anchor.x*this.sprite.width+this.offset.x,this.y=this.sprite.world.y-this.sprite.anchor.y*this.sprite.height+this.offset.y,this.preX=this.x,this.preY=this.y,this.updateBounds(),this.contacts.length=0},destroy:function(){this.sprite=null,this.collideCallback=null,this.collideCallbackContext=null,this.customSeparateCallback=null,this.customSeparateContext=null,this.contacts.length=0},setCircle:function(a,b,d){"undefined"==typeof b&&(b=this.sprite._cache.halfWidth),"undefined"==typeof d&&(d=this.sprite._cache.halfHeight),this.type=c.Physics.Arcade.CIRCLE,this.shape=new f.Circle(new f.Vector(this.sprite.x,this.sprite.y),a),this.polygon=null,this.offset.setTo(b,d)},setRectangle:function(a,b,d,e){"undefined"==typeof a&&(a=this.sprite.width),"undefined"==typeof b&&(b=this.sprite.height),"undefined"==typeof d&&(d=-this.sprite._cache.halfWidth),"undefined"==typeof e&&(e=-this.sprite._cache.halfHeight),this.type=c.Physics.Arcade.RECT,this.shape=new f.Box(new f.Vector(this.sprite.world.x,this.sprite.world.y),a,b),this.polygon=this.shape.toPolygon(),this.polygon.translate(d,e),this.offset.setTo(0,0)},setPolygon:function(a){if(this.type=c.Physics.Arcade.POLYGON,this.shape=null,Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),"number"==typeof a[0]){for(var b=[],d=0,e=a.length;e>d;d+=2)b.push(new f.Vector(a[d],a[d+1]));a=b}this.polygon=new f.Polygon(new f.Vector(this.sprite.center.x,this.sprite.center.y),a),this.offset.setTo(0,0)},translate:function(a,b){this.polygon&&this.polygon.translate(a,b)},onFloor:function(){return this.blocked.down},onWall:function(){return!this.blocked.down&&(this.blocked.left||this.blocked.right)},deltaX:function(){return this.x-this.preX},deltaY:function(){return this.y-this.preY},deltaZ:function(){return this.rotation-this.preRotation}},c.Physics.Arcade.Body.prototype.constructor=c.Physics.Arcade.Body,Object.defineProperty(c.Physics.Arcade.Body.prototype,"x",{get:function(){return this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.x:this.polygon.pos.x},set:function(a){this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.x=a:this.polygon.pos.x=a}}),Object.defineProperty(c.Physics.Arcade.Body.prototype,"y",{get:function(){return this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.y:this.polygon.pos.y},set:function(a){this.type===c.Physics.Arcade.CIRCLE?this.shape.pos.y=a:this.polygon.pos.y=a}}),c.Particles=function(a){this.game=a,this.emitters={},this.ID=0},c.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()}},c.Particles.prototype.constructor=c.Particles,c.Particles.Arcade={},c.Particles.Arcade.Emitter=function(a,b,d,e){this.maxParticles=e||50,c.Group.call(this,a),this.name="emitter"+this.game.particles.ID++,this.type=c.EMITTER,this.x=0,this.y=0,this.width=1,this.height=1,this.minParticleSpeed=new c.Point(-100,-100),this.maxParticleSpeed=new c.Point(100,100),this.minParticleScale=1,this.maxParticleScale=1,this.minRotation=-360,this.maxRotation=360,this.gravity=100,this.particleClass=null,this.particleFriction=0,this.angularDrag=0,this.frequency=100,this.lifespan=2e3,this.bounce=new c.Point,this._quantity=0,this._timer=0,this._counter=0,this._explode=!0,this.on=!1,this.exists=!0,this.emitX=b,this.emitY=d
+},c.Particles.Arcade.Emitter.prototype=Object.create(c.Group.prototype),c.Particles.Arcade.Emitter.prototype.constructor=c.Particles.Arcade.Emitter,c.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)},c.Particles.Arcade.Emitter.prototype.makeParticles=function(a,b,d,e,f){"undefined"==typeof b&&(b=0),"undefined"==typeof d&&(d=this.maxParticles),"undefined"==typeof e&&(e=!1),"undefined"==typeof f&&(f=!1);for(var g,h=0,i=a,j=b;d>h;)null===this.particleClass&&("object"==typeof a&&(i=this.game.rnd.pick(a)),"object"==typeof b&&(j=this.game.rnd.pick(b)),g=new c.Sprite(this.game,0,0,i,j)),e?(g.body.checkCollision.any=!0,g.body.checkCollision.none=!1):g.body.checkCollision.none=!0,g.body.collideWorldBounds=f,g.exists=!1,g.visible=!1,g.anchor.setTo(.5,.5),this.add(g),h++;return this},c.Particles.Arcade.Emitter.prototype.kill=function(){this.on=!1,this.alive=!1,this.exists=!1},c.Particles.Arcade.Emitter.prototype.revive=function(){this.alive=!0,this.exists=!0},c.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},c.Particles.Arcade.Emitter.prototype.emitParticle=function(){var a=this.getFirstExists(!1);if(null!=a){if(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,a.body.gravity.y=this.gravity,a.body.angularVelocity=this.minRotation!=this.maxRotation?this.game.rnd.integerInRange(this.minRotation,this.maxRotation):this.minRotation,1!==this.minParticleScale||1!==this.maxParticleScale){var b=this.game.rnd.realInRange(this.minParticleScale,this.maxParticleScale);a.scale.setTo(b,b)}a.body.friction=this.particleFriction,a.body.angularDrag=this.angularDrag}},c.Particles.Arcade.Emitter.prototype.setSize=function(a,b){this.width=a,this.height=b},c.Particles.Arcade.Emitter.prototype.setXSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.x=a,this.maxParticleSpeed.x=b},c.Particles.Arcade.Emitter.prototype.setYSpeed=function(a,b){a=a||0,b=b||0,this.minParticleSpeed.y=a,this.maxParticleSpeed.y=b},c.Particles.Arcade.Emitter.prototype.setRotation=function(a,b){a=a||0,b=b||0,this.minRotation=a,this.maxRotation=b},c.Particles.Arcade.Emitter.prototype.at=function(a){a.center&&(this.emitX=a.center.x,this.emitY=a.center.y)},Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"alpha",{get:function(){return this._container.alpha},set:function(a){this._container.alpha=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"visible",{get:function(){return this._container.visible},set:function(a){this._container.visible=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"x",{get:function(){return this.emitX},set:function(a){this.emitX=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"y",{get:function(){return this.emitY},set:function(a){this.emitY=a}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"left",{get:function(){return Math.floor(this.x-this.width/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"right",{get:function(){return Math.floor(this.x+this.width/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"top",{get:function(){return Math.floor(this.y-this.height/2)}}),Object.defineProperty(c.Particles.Arcade.Emitter.prototype,"bottom",{get:function(){return Math.floor(this.y+this.height/2)}}),c.Tile=function(a,b,c,d,e,f){this.layer=a,this.index=b,this.x=c,this.y=d,this.width=e,this.height=f,this.alpha=1,this.properties={},this.scanned=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this.collides=!1,this.collideNone=!0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.callback=null,this.callbackContext=this},c.Tile.prototype={setCollisionCallback:function(a,b){this.collisionCallbackContext=b,this.collisionCallback=a},destroy:function(){this.collisionCallback=null,this.collisionCallbackContext=null,this.properties=null},setCollision:function(a,b,c,d){this.collideLeft=a,this.collideRight=b,this.collideUp=c,this.collideDown=d,this.collideNone=a||b||c||d?!1:!0},resetCollision:function(){this.collideNone=!0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1},copy:function(a){this.index=a.index,this.alpha=a.alpha,this.properties=a.properties,this.collides=a.collides,this.collideNone=a.collideNone,this.collideUp=a.collideUp,this.collideDown=a.collideDown,this.collideLeft=a.collideLeft,this.collideRight=a.collideRight,this.collisionCallback=a.collisionCallback,this.collisionCallbackContext=a.collisionCallbackContext}},c.Tile.prototype.constructor=c.Tile,Object.defineProperty(c.Tile.prototype,"canCollide",{get:function(){return this.collides||this.collisionCallback||this.layer.callbacks[this.index]}}),Object.defineProperty(c.Tile.prototype,"left",{get:function(){return this.x}}),Object.defineProperty(c.Tile.prototype,"right",{get:function(){return this.x+this.width}}),Object.defineProperty(c.Tile.prototype,"top",{get:function(){return this.y}}),Object.defineProperty(c.Tile.prototype,"bottom",{get:function(){return this.y+this.height}}),c.Tilemap=function(a,b){this.game=a,this.key=b;var d=c.TilemapParser.parse(this.game,b);null!==d&&(this.width=d.width,this.height=d.height,this.tileWidth=d.tileWidth,this.tileHeight=d.tileHeight,this.orientation=d.orientation,this.version=d.version,this.properties=d.properties,this.widthInPixels=d.widthInPixels,this.heightInPixels=d.heightInPixels,this.layers=d.layers,this.tilesets=d.tilesets,this.tiles=d.tiles,this.objects=d.objects,this.images=d.images,this.currentLayer=0,this.debugMap=[],this._results=[],this._tempA=0,this._tempB=0)},c.Tilemap.CSV=0,c.Tilemap.TILED_JSON=1,c.Tilemap.prototype={create:function(a,b,d){for(var e=[],f=0;d>f;f++){e[f]=[];for(var g=0;b>g;g++)e[f][g]=0}this.layers.push({name:a,width:b,height:d,alpha:1,visible:!0,tileMargin:0,tileSpacing:0,format:c.Tilemap.CSV,data:e,indexes:[],dirty:!0}),this.currentLayer=this.layers.length-1},addTilesetImage:function(a,b){if("undefined"==typeof b){if("string"!=typeof a)return!1;b=a}return"string"==typeof a&&(a=this.getTilesetIndex(a)),this.tilesets[a]?(this.tilesets[a].image=this.game.cache.getImage(b),!0):!1},createFromTiles:function(a,b,c,d,e){"undefined"==typeof e&&(e=this.game.world)},createFromObjects:function(a,b,c,d,e,f,g){if("undefined"==typeof e&&(e=!0),"undefined"==typeof f&&(f=!0),"undefined"==typeof g&&(g=this.game.world),!this.objects[a])return console.warn("Tilemap.createFromObjects: Invalid objectgroup name given: "+a),void 0;for(var h,i=0,j=this.objects[a].length;j>i;i++)if(this.objects[a][i].gid===b){h=g.create(this.objects[a][i].x,this.objects[a][i].y,c,d,e),h.anchor.setTo(0,1),h.name=this.objects[a][i].name,h.visible=this.objects[a][i].visible,h.autoCull=f;for(property in this.objects[a][i].properties)g.set(h,property,this.objects[a][i].properties[property],!1,!1,0)}},createLayer:function(a,b,d,e){"undefined"==typeof b&&(b=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?(console.warn("Tilemap.createLayer: Invalid layer ID given: "+f),void 0):e.add(new c.TilemapLayer(this.game,this,f,b,d))},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){"undefined"==typeof b&&(b=!0),"undefined"==typeof c&&(c=this.currentLayer),"undefined"==typeof d&&(d=!0);for(var e=0;ef;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),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&&b=0&&d=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=a-c[1].x,f=b-c[1].y,g=1;g1?this.debugMap[this.layers[this.currentLayer].data[c][d]]?b.push("background: "+this.debugMap[this.layers[this.currentLayer].data[c][d]]):b.push("background: #ffffff"):b.push("background: rgb(0, 0, 0)");a+="\n"}b[0]=a,console.log.apply(console,b)},destroy:function(){this.removeAllLayers(),this.data=[],this.game=null}},c.Tilemap.prototype.constructor=c.Tilemap,c.TilemapLayer=function(a,d,e,f,g){this.game=a,this.map=d,this.index=e,this.layer=d.layers[e],this.canvas=c.Canvas.create(f,g),this.context=this.canvas.getContext("2d"),this.baseTexture=new b.BaseTexture(this.canvas),this.texture=new b.Texture(this.baseTexture),this.textureFrame=new c.Frame(0,0,0,f,g,"tilemapLayer",a.rnd.uuid()),c.Sprite.call(this,this.game,0,0,this.texture,this.textureFrame),this.name="",this.type=c.TILEMAPLAYER,this.fixedToCamera=!0,this.cameraOffset=new c.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._cw=d.tileWidth,this._ch=d.tileHeight,this._ga=1,this._dx=0,this._dy=0,this._dw=0,this._dh=0,this._tx=0,this._ty=0,this._tw=0,this._th=0,this._tl=0,this._maxX=0,this._maxY=0,this._startX=0,this._startY=0,this._results=[],this._x=0,this._y=0,this._prevX=0,this._prevY=0,this.updateMax()},c.TilemapLayer.prototype=Object.create(c.Sprite.prototype),c.TilemapLayer.prototype=c.Utils.extend(!0,c.TilemapLayer.prototype,c.Sprite.prototype,b.Sprite.prototype),c.TilemapLayer.prototype.constructor=c.TilemapLayer,c.TilemapLayer.prototype.postUpdate=function(){c.Sprite.prototype.postUpdate.call(this),this.scrollX=this.game.camera.x*this.scrollFactorX,this.scrollY=this.game.camera.y*this.scrollFactorY,this.render()},c.TilemapLayer.prototype.resizeWorld=function(){this.game.world.setBounds(0,0,this.layer.widthInPixels,this.layer.heightInPixels)},c.TilemapLayer.prototype._fixX=function(a){return 0>a&&(a=0),1===this.scrollFactorX?a:this._x+(a-this._x/this.scrollFactorX)},c.TilemapLayer.prototype._unfixX=function(a){return 1===this.scrollFactorX?a:this._x/this.scrollFactorX+(a-this._x)},c.TilemapLayer.prototype._fixY=function(a){return 0>a&&(a=0),1===this.scrollFactorY?a:this._y+(a-this._y/this.scrollFactorY)},c.TilemapLayer.prototype._unfixY=function(a){return 1===this.scrollFactorY?a:this._y/this.scrollFactorY+(a-this._y)},c.TilemapLayer.prototype.getTileX=function(a){return this.game.math.snapToFloor(this._fixX(a),this.map.tileWidth)/this.map.tileWidth},c.TilemapLayer.prototype.getTileY=function(a){return this.game.math.snapToFloor(this._fixY(a),this.map.tileHeight)/this.map.tileHeight},c.TilemapLayer.prototype.getTileXY=function(a,b,c){return c.x=this.getTileX(a),c.y=this.getTileY(b),c},c.TilemapLayer.prototype.getTiles=function(a,b,c,d,e){"undefined"==typeof e&&(e=!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._tx=this.game.math.snapToFloor(a,this._cw)/this._cw,this._ty=this.game.math.snapToFloor(b,this._ch)/this._ch,this._tw=(this.game.math.snapToCeil(c,this._cw)+this._cw)/this._cw,this._th=(this.game.math.snapToCeil(d,this._ch)+this._ch)/this._ch,this._results.length=0;for(var f=this._ty;fthis.layer.width&&(this._maxX=this.layer.width),this._maxY>this.layer.height&&(this._maxY=this.layer.height)),this.dirty=!0},c.TilemapLayer.prototype.render=function(){if(this.layer.dirty&&(this.dirty=!0),this.dirty&&this.visible){this._prevX=this._dx,this._prevY=this._dy,this._dx=-(this._x-this._startX*this.map.tileWidth),this._dy=-(this._y-this._startY*this.map.tileHeight),this._tx=this._dx,this._ty=this._dy,this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.context.fillStyle=this.tileColor;var a,d;this.debug&&(this.context.globalAlpha=this.debugAlpha);for(var e=this._startY,f=this._startY+this._maxY;f>e;e++){this._column=this.layer.data[e];for(var g=this._startX,h=this._startX+this._maxX;h>g;g++)this._column[g]&&(a=this._column[g],this.map.tiles[a.index]&&(d=this.map.tilesets[this.map.tiles[a.index][2]],d.image?(this.debug===!1&&a.alpha!==this.context.globalAlpha&&(this.context.globalAlpha=a.alpha),d.tileWidth!==this.map.tileWidth||d.tileHeight!==this.map.tileHeight?this.context.drawImage(this.map.tilesets[this.map.tiles[a.index][2]].image,this.map.tiles[a.index][0],this.map.tiles[a.index][1],d.tileWidth,d.tileHeight,Math.floor(this._tx),Math.floor(this._ty)-(d.tileHeight-this.map.tileHeight),d.tileWidth,d.tileHeight):this.context.drawImage(this.map.tilesets[this.map.tiles[a.index][2]].image,this.map.tiles[a.index][0],this.map.tiles[a.index][1],this.map.tileWidth,this.map.tileHeight,Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight),a.debug&&(this.context.fillStyle="rgba(0, 255, 0, 0.4)",this.context.fillRect(Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight))):this.context.fillRect(Math.floor(this._tx),Math.floor(this._ty),this.map.tileWidth,this.map.tileHeight))),this._tx+=this.map.tileWidth;this._tx=this._dx,this._ty+=this.map.tileHeight}return this.debug&&(this.context.globalAlpha=1,this.renderDebug()),this.game.renderType===c.WEBGL&&b.texturesToUpdate.push(this.baseTexture),this.dirty=!1,this.layer.dirty=!1,!0}},c.TilemapLayer.prototype.renderDebug=function(){this._tx=this._dx,this._ty=this._dy,this.context.strokeStyle=this.debugColor,this.context.fillStyle=this.debugFillColor;for(var a=this._startY,b=this._startY+this._maxY;b>a;a++){this._column=this.layer.data[a];for(var c=this._startX,d=this._startX+this._maxX;d>c;c++){var e=this._column[c];e&&(e.faceTop||e.faceBottom||e.faceLeft||e.faceRight)&&(this._tx=Math.floor(this._tx),this.debugFill&&this.context.fillRect(this._tx,this._ty,this._cw,this._ch),this.context.beginPath(),e.faceTop&&(this.context.moveTo(this._tx,this._ty),this.context.lineTo(this._tx+this._cw,this._ty)),e.faceBottom&&(this.context.moveTo(this._tx,this._ty+this._ch),this.context.lineTo(this._tx+this._cw,this._ty+this._ch)),e.faceLeft&&(this.context.moveTo(this._tx,this._ty),this.context.lineTo(this._tx,this._ty+this._ch)),e.faceRight&&(this.context.moveTo(this._tx+this._cw,this._ty),this.context.lineTo(this._tx+this._cw,this._ty+this._ch)),this.context.stroke()),e&&(e.collisionCallback||e.layer.callbacks[e.index])&&(this.context.fillStyle=this.debugCallbackColor,this.context.fillRect(this._tx,this._ty,this._cw,this._ch),this.context.fillStyle=this.debugFillColor),this._tx+=this.map.tileWidth}this._tx=this._dx,this._ty+=this.map.tileHeight}},Object.defineProperty(c.TilemapLayer.prototype,"scrollX",{get:function(){return this._x},set:function(a){a!==this._x&&a>=0&&this.layer.widthInPixels>this.width&&(this._x=a,this._x>this.layer.widthInPixels-this.width&&(this._x=this.layer.widthInPixels-this.width),this._startX=this.game.math.floor(this._x/this.map.tileWidth),this._startX<0&&(this._startX=0),this._startX+this._maxX>this.layer.width&&(this._startX=this.layer.width-this._maxX),this.dirty=!0)}}),Object.defineProperty(c.TilemapLayer.prototype,"scrollY",{get:function(){return this._y},set:function(a){a!==this._y&&a>=0&&this.layer.heightInPixels>this.height&&(this._y=a,this._y>this.layer.heightInPixels-this.height&&(this._y=this.layer.heightInPixels-this.height),this._startY=this.game.math.floor(this._y/this.map.tileHeight),this._startY<0&&(this._startY=0),this._startY+this._maxY>this.layer.height&&(this._startY=this.layer.height-this._maxY),this.dirty=!0)}}),Object.defineProperty(c.TilemapLayer.prototype,"collisionWidth",{get:function(){return this._cw},set:function(a){this._cw=a,this.dirty=!0}}),Object.defineProperty(c.TilemapLayer.prototype,"collisionHeight",{get:function(){return this._ch},set:function(a){this._ch=a,this.dirty=!0}}),c.TilemapParser={tileset:function(a,b,d,e,f,g,h,i,j){var k=a.cache.getTilesetImage(b);if(null===k)return console.warn("Phaser.TilemapParser.tileSet: Invalid image key given"),null;var l=k.width,m=k.height;return-1===h&&(h=Math.round(l/d)),-1===i&&(i=Math.round(m/e)),-1===j&&(j=h*i),0===l||0===m||d>l||e>m||0===j?(console.warn("Phaser.TilemapParser.tileSet: width/height zero or width/height < given tileWidth/tileHeight"),null):new c.Tileset(k,b,d,e,f,g,h,i,j)},parse:function(a,b){var d=a.cache.getTilemapData(b);return d?d.format===c.Tilemap.CSV?this.parseCSV(d.data):d.format===c.Tilemap.TILED_JSON?this.parseTiledJSON(d.data):void 0:{layers:[],objects:[],images:[],tilesets:[]}},parseCSV:function(a){a=a.trim();for(var b=[],c=a.split("\n"),d=c.length,e=0,f=0;fj;j++)a.layers[e].data[j]>0?h.push(new c.Tile(f,a.layers[e].data[j],g,i.length,a.tilewidth,a.tileheight)):h.push(null),g++,g===a.layers[e].width&&(i.push(h),g=0,h=[]);f.data=i,d.push(f)}b.layers=d;for(var l=[],e=0;eo;o++)if(a.layers[e].objects[o].gid){var p={gid:a.layers[e].objects[o].gid,name:a.layers[e].objects[o].name,x:a.layers[e].objects[o].x,y:a.layers[e].objects[o].y,visible:a.layers[e].objects[o].visible,properties:a.layers[e].objects[o].properties};n[a.layers[e].name].push(p)}}b.objects=n;for(var q=[],e=0;e0&&(b.Texture.frameUpdates.length=0)},b.CanvasRenderer.prototype.renderDisplayObject=function(a,d){var e=a.last._iNext;a=a.first;do if(a.visible||d)if(a.renderable&&0!==a.alpha){if(a instanceof b.Sprite)a.texture.frame&&(this.context.globalAlpha=a.worldAlpha,c.CANVAS_PX_ROUND?this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],Math.floor(a.worldTransform[2]),Math.floor(a.worldTransform[5])):this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),a.texture.trimmed&&this.context.transform(1,0,0,1,a.texture.trim.x,a.texture.trim.y),this.smoothProperty&&this.scaleMode!==a.texture.baseTexture.scaleMode&&(this.scaleMode=a.texture.baseTexture.scaleMode,this.context[this.smoothProperty]=this.scaleMode===b.BaseTexture.SCALE_MODE.LINEAR),this.context.drawImage(a.texture.baseTexture.source,a.texture.frame.x,a.texture.frame.y,a.texture.frame.width,a.texture.frame.height,Math.floor(a.anchor.x*-a.texture.frame.width),Math.floor(a.anchor.y*-a.texture.frame.height),a.texture.frame.width,a.texture.frame.height));else if(a instanceof b.Strip)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),this.renderStrip(a);else if(a instanceof b.TilingSprite)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),this.renderTilingSprite(a);else if(a instanceof b.CustomRenderable)a.renderCanvas(this);else if(a instanceof b.Graphics)this.context.setTransform(a.worldTransform[0],a.worldTransform[3],a.worldTransform[1],a.worldTransform[4],a.worldTransform[2],a.worldTransform[5]),b.CanvasGraphics.renderGraphics(a,this.context);else if(a instanceof b.FilterBlock)if(a.open){this.context.save();var f=a.mask.alpha,g=a.mask.worldTransform;this.context.setTransform(g[0],g[3],g[1],g[4],g[2],g[5]),a.mask.worldAlpha=.5,this.context.worldAlpha=0,b.CanvasGraphics.renderGraphicsMask(a.mask,this.context),this.context.clip(),a.mask.worldAlpha=f}else this.context.restore();a=a._iNext}else a=a._iNext;else a=a.last._iNext;while(a!=e)},b.WebGLBatch.prototype.update=function(){for(var a,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r=0,s=this.head;s;){if(s.vcount===b.visibleCount){if(c=s.texture.frame.width,d=s.texture.frame.height,e=s.anchor.x,f=s.anchor.y,g=c*(1-e),h=c*-e,i=d*(1-f),j=d*-f,k=8*r,a=s.worldTransform,l=a[0],m=a[3],n=a[1],o=a[4],p=a[2],q=a[5],s.texture.trimmed&&(p+=s.texture.trim.x,q+=s.texture.trim.y),this.verticies[k+0]=l*h+n*j+p,this.verticies[k+1]=o*j+m*h+q,this.verticies[k+2]=l*g+n*j+p,this.verticies[k+3]=o*j+m*g+q,this.verticies[k+4]=l*g+n*i+p,this.verticies[k+5]=o*i+m*g+q,this.verticies[k+6]=l*h+n*i+p,this.verticies[k+7]=o*i+m*h+q,s.updateFrame||s.texture.updateFrame){this.dirtyUVS=!0;var t=s.texture,u=t.frame,v=t.baseTexture.width,w=t.baseTexture.height;this.uvs[k+0]=u.x/v,this.uvs[k+1]=u.y/w,this.uvs[k+2]=(u.x+u.width)/v,this.uvs[k+3]=u.y/w,this.uvs[k+4]=(u.x+u.width)/v,this.uvs[k+5]=(u.y+u.height)/w,this.uvs[k+6]=u.x/v,this.uvs[k+7]=(u.y+u.height)/w,s.updateFrame=!1}if(s.cacheAlpha!=s.worldAlpha){s.cacheAlpha=s.worldAlpha;var x=4*r;this.colors[x]=this.colors[x+1]=this.colors[x+2]=this.colors[x+3]=s.worldAlpha,this.dirtyColors=!0}}else k=8*r,this.verticies[k+0]=0,this.verticies[k+1]=0,this.verticies[k+2]=0,this.verticies[k+3]=0,this.verticies[k+4]=0,this.verticies[k+5]=0,this.verticies[k+6]=0,this.verticies[k+7]=0;r++,s=s.__next}},c});
\ No newline at end of file
diff --git a/docs/Animation.js.html b/docs/Animation.js.html
index b367005b..04471bfd 100644
--- a/docs/Animation.js.html
+++ b/docs/Animation.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -909,7 +923,7 @@ Phaser.Animation.generateFrameNames = function (prefix, start, stop, suffix, zer
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/AnimationManager.js.html b/docs/AnimationManager.js.html
index 7361a183..8f6abbbf 100644
--- a/docs/AnimationManager.js.html
+++ b/docs/AnimationManager.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -683,7 +697,7 @@ Phaser.AnimationManager.prototype = {
*
* @method Phaser.AnimationManager#getAnimation
* @param {string} name - The name of the animation to be returned, e.g. "fire".
- * @return {Phaser.Animation|boolean} The Animation instance, if found, otherwise false.
+ * @return {Phaser.Animation} The Animation instance, if found, otherwise null.
*/
getAnimation: function (name) {
@@ -695,7 +709,7 @@ Phaser.AnimationManager.prototype = {
}
}
- return false;
+ return null;
},
@@ -865,7 +879,7 @@ Object.defineProperty(Phaser.AnimationManager.prototype, 'frameName', {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/AnimationParser.js.html b/docs/AnimationParser.js.html
index 63062ca5..ef968e66 100644
--- a/docs/AnimationParser.js.html
+++ b/docs/AnimationParser.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -763,7 +777,7 @@ Phaser.AnimationParser = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/ArcadePhysics.js.html b/docs/ArcadePhysics.js.html
index f1d2775b..52ea1b12 100644
--- a/docs/ArcadePhysics.js.html
+++ b/docs/ArcadePhysics.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1473,6 +1487,8 @@ Phaser.Physics.Arcade.prototype = {
body.blocked.down = true;
}
+ body.reboundCheck(body.overlapX, body.overlapY, true);
+
return true;
},
@@ -1865,7 +1881,7 @@ Phaser.Physics.Arcade.prototype.constructor = Phaser.Physics.Arcade;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/BitmapData.js.html b/docs/BitmapData.js.html
index f1e849a9..f79e0edc 100644
--- a/docs/BitmapData.js.html
+++ b/docs/BitmapData.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1556,7 +1570,7 @@ Phaser.BitmapData.prototype.de = Phaser.BitmapData.prototype.ellipse;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/BitmapText.js.html b/docs/BitmapText.js.html
index 3f69ce4e..168c0d81 100644
--- a/docs/BitmapText.js.html
+++ b/docs/BitmapText.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -669,7 +683,7 @@ Object.defineProperty(Phaser.BitmapText.prototype, 'y', {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Body.js.html b/docs/Body.js.html
index 0168e9ab..a8ee0511 100644
--- a/docs/Body.js.html
+++ b/docs/Body.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1304,10 +1318,10 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
separate: function (body, response) {
- if (this.inContact(body))
- {
- return false;
- }
+ // if (this.inContact(body))
+ // {
+ // return false;
+ // }
this._distances[0] = body.right - this.x; // Distance of B to face on left side of A
this._distances[1] = this.right - body.x; // Distance of B to face on right side of A
@@ -1336,11 +1350,11 @@ Phaser.Physics.Arcade.Body.prototype = {
if (response.overlapN.x)
{
// Which is smaller? Left or Right?
- if (this._distances[0] < this._distances[1] && (body.checkCollision.right || this.checkCollision.left))
+ if (this._distances[0] < this._distances[1])
{
hasSeparated = this.hitLeft(body, response);
}
- else if (this._distances[1] < this._distances[0] && (body.checkCollision.left || this.checkCollision.right))
+ else if (this._distances[1] < this._distances[0])
{
hasSeparated = this.hitRight(body, response);
}
@@ -1348,11 +1362,11 @@ Phaser.Physics.Arcade.Body.prototype = {
else if (response.overlapN.y)
{
// Which is smaller? Top or Bottom?
- if (this._distances[2] < this._distances[3] && (body.checkCollision.down || this.checkCollision.up))
+ if (this._distances[2] < this._distances[3])
{
hasSeparated = this.hitTop(body, response);
}
- else if (this._distances[3] < this._distances[2] && (body.checkCollision.up || this.checkCollision.down))
+ else if (this._distances[3] < this._distances[2])
{
hasSeparated = this.hitBottom(body, response);
}
@@ -1390,9 +1404,14 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
hitLeft: function (body, response) {
+ if (!this.checkCollision.left || !body.checkCollision.right)
+ {
+ return false;
+ }
+
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.LEFT, this, body, response))
{
- return;
+ return false;
}
if (!this.moves || this.immovable || this.blocked.right || this.touching.right)
@@ -1416,6 +1435,8 @@ Phaser.Physics.Arcade.Body.prototype = {
this.touching.left = true;
body.touching.right = true;
+ return true;
+
},
/**
@@ -1432,9 +1453,14 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
hitRight: function (body, response) {
+ if (!this.checkCollision.right || !body.checkCollision.left)
+ {
+ return false;
+ }
+
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.RIGHT, this, body))
{
- return;
+ return false;
}
if (!this.moves || this.immovable || this.blocked.left || this.touching.left)
@@ -1458,6 +1484,8 @@ Phaser.Physics.Arcade.Body.prototype = {
this.touching.right = true;
body.touching.left = true;
+ return true;
+
},
/**
@@ -1474,6 +1502,11 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
hitTop: function (body, response) {
+ if (!this.checkCollision.up || !body.checkCollision.down)
+ {
+ return false;
+ }
+
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.UP, this, body))
{
return false;
@@ -1518,6 +1551,11 @@ Phaser.Physics.Arcade.Body.prototype = {
*/
hitBottom: function (body, response) {
+ if (!this.checkCollision.down || !body.checkCollision.up)
+ {
+ return false;
+ }
+
if (this.collideCallback && !this.collideCallback.call(this.collideCallbackContext, Phaser.DOWN, this, body))
{
return false;
@@ -1605,10 +1643,10 @@ Phaser.Physics.Arcade.Body.prototype = {
if (this.moves)
{
- this.reboundCheck(true, true, true);
-
this.game.physics.checkBounds(this);
+ this.reboundCheck(true, true, true);
+
this._dx = this.deltaX();
this._dy = this.deltaY();
@@ -1645,7 +1683,6 @@ Phaser.Physics.Arcade.Body.prototype = {
{
this.updateScale();
}
-
}
},
@@ -1954,7 +1991,7 @@ Object.defineProperty(Phaser.Physics.Arcade.Body.prototype, "y", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Button.js.html b/docs/Button.js.html
index 50feb1cd..e4849396 100644
--- a/docs/Button.js.html
+++ b/docs/Button.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1071,7 +1085,7 @@ Phaser.Button.prototype.setState = function (newState) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Cache.js.html b/docs/Cache.js.html
index bc00d8b4..4e6cf044 100644
--- a/docs/Cache.js.html
+++ b/docs/Cache.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1285,7 +1299,7 @@ Phaser.Cache.prototype.constructor = Phaser.Cache;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Camera.js.html b/docs/Camera.js.html
index c91ddc80..23c35a11 100644
--- a/docs/Camera.js.html
+++ b/docs/Camera.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -853,7 +867,7 @@ Object.defineProperty(Phaser.Camera.prototype, "height", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Canvas.js.html b/docs/Canvas.js.html
index a5a6e341..39d54a49 100644
--- a/docs/Canvas.js.html
+++ b/docs/Canvas.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -722,7 +736,7 @@ Phaser.Canvas = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Circle.js.html b/docs/Circle.js.html
index b66a23cb..ff3bf89c 100644
--- a/docs/Circle.js.html
+++ b/docs/Circle.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -913,7 +927,7 @@ Phaser.Circle.intersectsRectangle = function (c, r) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Color.js.html b/docs/Color.js.html
index ed3362bd..b77c0d4a 100644
--- a/docs/Color.js.html
+++ b/docs/Color.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -787,7 +801,7 @@ Phaser.Color = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/DOMSprite.js.html b/docs/DOMSprite.js.html
index 9bd6f200..280e7846 100644
--- a/docs/DOMSprite.js.html
+++ b/docs/DOMSprite.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -524,7 +538,7 @@ Phaser.DOMSprite = function (game, element, x, y, style) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Debug.js.html b/docs/Debug.js.html
index 3db78003..0d79de7a 100644
--- a/docs/Debug.js.html
+++ b/docs/Debug.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1357,7 +1371,7 @@ Phaser.Utils.Debug.prototype.constructor = Phaser.Utils.Debug;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Device.js.html b/docs/Device.js.html
index b5182378..5dc8ea61 100644
--- a/docs/Device.js.html
+++ b/docs/Device.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1115,7 +1129,7 @@ Phaser.Device.prototype.constructor = Phaser.Device;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Easing.js.html b/docs/Easing.js.html
index 4c9ee5bf..fd3c9954 100644
--- a/docs/Easing.js.html
+++ b/docs/Easing.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -999,7 +1013,7 @@ Phaser.Easing = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Emitter.js.html b/docs/Emitter.js.html
index f12e2643..ffced60a 100644
--- a/docs/Emitter.js.html
+++ b/docs/Emitter.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1070,7 +1084,7 @@ Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "bottom", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Events.js.html b/docs/Events.js.html
index 0e77e3f9..7f5b0ddd 100644
--- a/docs/Events.js.html
+++ b/docs/Events.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -518,7 +532,7 @@ Phaser.Events.prototype.constructor = Phaser.Events;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Filter.js.html b/docs/Filter.js.html
index b187003d..24f2ded5 100644
--- a/docs/Filter.js.html
+++ b/docs/Filter.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -595,7 +609,7 @@ Object.defineProperty(Phaser.Filter.prototype, 'height', {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Frame.js.html b/docs/Frame.js.html
index 56b5e93c..72409cec 100644
--- a/docs/Frame.js.html
+++ b/docs/Frame.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -598,7 +612,7 @@ Phaser.Frame.prototype.constructor = Phaser.Frame;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/FrameData.js.html b/docs/FrameData.js.html
index a25b6514..76721313 100644
--- a/docs/FrameData.js.html
+++ b/docs/FrameData.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -675,7 +689,7 @@ Object.defineProperty(Phaser.FrameData.prototype, "total", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Game.js.html b/docs/Game.js.html
index b075f156..a353dfff 100644
--- a/docs/Game.js.html
+++ b/docs/Game.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1180,7 +1194,7 @@ Object.defineProperty(Phaser.Game.prototype, "paused", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/GameObjectFactory.js.html b/docs/GameObjectFactory.js.html
index 8665cdb7..d4836198 100644
--- a/docs/GameObjectFactory.js.html
+++ b/docs/GameObjectFactory.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -759,7 +773,7 @@ Phaser.GameObjectFactory.prototype.constructor = Phaser.GameObjectFactory;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Gamepad.js.html b/docs/Gamepad.js.html
index 54da0f92..ba480d0d 100644
--- a/docs/Gamepad.js.html
+++ b/docs/Gamepad.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1014,7 +1028,7 @@ Phaser.Gamepad.XBOX360_STICK_RIGHT_Y = 3;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/GamepadButton.js.html b/docs/GamepadButton.js.html
index e4982105..822fdafa 100644
--- a/docs/GamepadButton.js.html
+++ b/docs/GamepadButton.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -611,7 +625,7 @@ Phaser.GamepadButton.prototype.constructor = Phaser.GamepadButton;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Graphics.js.html b/docs/Graphics.js.html
index 4c11d8b7..264be416 100644
--- a/docs/Graphics.js.html
+++ b/docs/Graphics.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -540,7 +554,7 @@ Object.defineProperty(Phaser.Graphics.prototype, 'y', {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Group.js.html b/docs/Group.js.html
index 55d13f2c..5bddfa85 100644
--- a/docs/Group.js.html
+++ b/docs/Group.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2043,7 +2057,7 @@ Object.defineProperty(Phaser.Group.prototype, "alpha", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Input.js.html b/docs/Input.js.html
index 962827b9..d01fb7a1 100644
--- a/docs/Input.js.html
+++ b/docs/Input.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1280,7 +1294,7 @@ Object.defineProperty(Phaser.Input.prototype, "worldY", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/InputHandler.js.html b/docs/InputHandler.js.html
index 592d86d6..b2fa978b 100644
--- a/docs/InputHandler.js.html
+++ b/docs/InputHandler.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1614,7 +1628,7 @@ Phaser.InputHandler.prototype.constructor = Phaser.InputHandler;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Key.js.html b/docs/Key.js.html
index 49ba93aa..da455462 100644
--- a/docs/Key.js.html
+++ b/docs/Key.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -609,7 +623,7 @@ Phaser.Key.prototype.constructor = Phaser.Key;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Keyboard.js.html b/docs/Keyboard.js.html
index 4b428a4c..c59ae5d4 100644
--- a/docs/Keyboard.js.html
+++ b/docs/Keyboard.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -933,7 +947,7 @@ Phaser.Keyboard.NUM_LOCK = 144;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Line.js.html b/docs/Line.js.html
index aa41210f..5bc257ba 100644
--- a/docs/Line.js.html
+++ b/docs/Line.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -700,7 +714,7 @@ Phaser.Line.intersects = function (a, b, asSegment, result) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/LinkedList.js.html b/docs/LinkedList.js.html
index dce1bbe0..18a2d13b 100644
--- a/docs/LinkedList.js.html
+++ b/docs/LinkedList.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -592,7 +606,7 @@ Phaser.LinkedList.prototype.constructor = Phaser.LinkedList;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Loader.js.html b/docs/Loader.js.html
index 6dde3054..64627875 100644
--- a/docs/Loader.js.html
+++ b/docs/Loader.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1749,7 +1763,7 @@ Phaser.Loader.prototype.constructor = Phaser.Loader;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/LoaderParser.js.html b/docs/LoaderParser.js.html
index bd280b4c..08d3d53d 100644
--- a/docs/LoaderParser.js.html
+++ b/docs/LoaderParser.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -518,7 +532,7 @@ Phaser.LoaderParser = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/MSPointer.js.html b/docs/MSPointer.js.html
index 014729ff..bda5f9f6 100644
--- a/docs/MSPointer.js.html
+++ b/docs/MSPointer.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -606,7 +620,7 @@ Phaser.MSPointer.prototype.constructor = Phaser.MSPointer;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Math.js.html b/docs/Math.js.html
index 166ea58e..7881a87c 100644
--- a/docs/Math.js.html
+++ b/docs/Math.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1755,7 +1769,7 @@ Phaser.Math = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Mouse.js.html b/docs/Mouse.js.html
index c1518e11..bc3918f1 100644
--- a/docs/Mouse.js.html
+++ b/docs/Mouse.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -767,7 +781,7 @@ Phaser.Mouse.prototype.constructor = Phaser.Mouse;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Net.js.html b/docs/Net.js.html
index b9b79823..05b445ac 100644
--- a/docs/Net.js.html
+++ b/docs/Net.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -602,7 +616,7 @@ Phaser.Net.prototype.constructor = Phaser.Net;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Particles.js.html b/docs/Particles.js.html
index 89d16184..4616af87 100644
--- a/docs/Particles.js.html
+++ b/docs/Particles.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -517,7 +531,7 @@ Phaser.Particles.prototype.constructor = Phaser.Particles;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Animation.html b/docs/Phaser.Animation.html
index 3ea9c67e..eeaea794 100644
--- a/docs/Phaser.Animation.html
+++ b/docs/Phaser.Animation.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2912,7 +2926,7 @@ You could use this function to generate those by doing: Phaser.Animation.generat
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.AnimationManager.html b/docs/Phaser.AnimationManager.html
index 4609bb4a..17b56378 100644
--- a/docs/Phaser.AnimationManager.html
+++ b/docs/Phaser.AnimationManager.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1985,7 +1999,7 @@ Animations added in this way are played back with the play function.
-
+
@@ -2100,7 +2114,7 @@ Animations added in this way are played back with the play function.
-
The Animation instance, if found, otherwise false.
+
The Animation instance, if found, otherwise null.
@@ -2112,9 +2126,6 @@ Animations added in this way are played back with the play function.
Phaser.Animation
-|
-
-boolean
@@ -2962,7 +2973,7 @@ The currentAnim property of the AnimationManager is automatically set to the ani
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.AnimationParser.html b/docs/Phaser.AnimationParser.html
index ca5b0c11..c4f2c13d 100644
--- a/docs/Phaser.AnimationParser.html
+++ b/docs/Phaser.AnimationParser.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1480,7 +1494,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.BitmapData.html b/docs/Phaser.BitmapData.html
index b1f396be..8d277a14 100644
--- a/docs/Phaser.BitmapData.html
+++ b/docs/Phaser.BitmapData.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -11939,7 +11953,7 @@ the stroke style and color in a single line of code like so:
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.BitmapText.html b/docs/Phaser.BitmapText.html
index 46ef4655..c29dc7e6 100644
--- a/docs/Phaser.BitmapText.html
+++ b/docs/Phaser.BitmapText.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1907,7 +1921,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Button.html b/docs/Phaser.Button.html
index ac34735f..61b45d45 100644
--- a/docs/Phaser.Button.html
+++ b/docs/Phaser.Button.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4511,7 +4525,7 @@ Call this function with no parameters at all to reset all sounds on this Button.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Cache.html b/docs/Phaser.Cache.html
index ac9a8804..7385e6ef 100644
--- a/docs/Phaser.Cache.html
+++ b/docs/Phaser.Cache.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7052,7 +7066,7 @@ Normally you don't call this directly but instead use getImageKeys, getSoundKeys
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Camera.html b/docs/Phaser.Camera.html
index 9c78271a..95dc6864 100644
--- a/docs/Phaser.Camera.html
+++ b/docs/Phaser.Camera.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3429,7 +3443,7 @@ without having to use game.camera.x and game.camera.y.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:38 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Canvas.html b/docs/Phaser.Canvas.html
index 06f8a7ad..1855047e 100644
--- a/docs/Phaser.Canvas.html
+++ b/docs/Phaser.Canvas.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2624,7 +2638,7 @@ patchy on earlier browsers, especially on mobile.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Circle.html b/docs/Phaser.Circle.html
index 9f4ff06b..fb1fd9ec 100644
--- a/docs/Phaser.Circle.html
+++ b/docs/Phaser.Circle.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4302,7 +4316,7 @@ This method checks the radius distances between the two Circle objects to see if
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Color.html b/docs/Phaser.Color.html
index 8db79737..9d2fea8d 100644
--- a/docs/Phaser.Color.html
+++ b/docs/Phaser.Color.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3611,7 +3625,7 @@ Set the max value to restrict the maximum color used per channel.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:26 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.DOMSprite.html b/docs/Phaser.DOMSprite.html
index c7f3269d..f5fbc88b 100644
--- a/docs/Phaser.DOMSprite.html
+++ b/docs/Phaser.DOMSprite.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1429,7 +1443,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Device.html b/docs/Phaser.Device.html
index 7d231d36..5da32c64 100644
--- a/docs/Phaser.Device.html
+++ b/docs/Phaser.Device.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -6037,7 +6051,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Back.html b/docs/Phaser.Easing.Back.html
index 5cd5ceb8..cff8df87 100644
--- a/docs/Phaser.Easing.Back.html
+++ b/docs/Phaser.Easing.Back.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Bounce.html b/docs/Phaser.Easing.Bounce.html
index 559da0c6..82520e9b 100644
--- a/docs/Phaser.Easing.Bounce.html
+++ b/docs/Phaser.Easing.Bounce.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Circular.html b/docs/Phaser.Easing.Circular.html
index 423e8058..759e7bf0 100644
--- a/docs/Phaser.Easing.Circular.html
+++ b/docs/Phaser.Easing.Circular.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Cubic.html b/docs/Phaser.Easing.Cubic.html
index 56b6e2f3..c65da4c7 100644
--- a/docs/Phaser.Easing.Cubic.html
+++ b/docs/Phaser.Easing.Cubic.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Elastic.html b/docs/Phaser.Easing.Elastic.html
index 445528fa..7ba1cf15 100644
--- a/docs/Phaser.Easing.Elastic.html
+++ b/docs/Phaser.Easing.Elastic.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Exponential.html b/docs/Phaser.Easing.Exponential.html
index 2bec6a2d..8b3e8f29 100644
--- a/docs/Phaser.Easing.Exponential.html
+++ b/docs/Phaser.Easing.Exponential.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Linear.html b/docs/Phaser.Easing.Linear.html
index efd870b1..8ae137d0 100644
--- a/docs/Phaser.Easing.Linear.html
+++ b/docs/Phaser.Easing.Linear.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -681,7 +695,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Quadratic.html b/docs/Phaser.Easing.Quadratic.html
index 97dd1fb8..91bddf18 100644
--- a/docs/Phaser.Easing.Quadratic.html
+++ b/docs/Phaser.Easing.Quadratic.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Quartic.html b/docs/Phaser.Easing.Quartic.html
index d605c617..e8de6809 100644
--- a/docs/Phaser.Easing.Quartic.html
+++ b/docs/Phaser.Easing.Quartic.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Quintic.html b/docs/Phaser.Easing.Quintic.html
index cae49a2f..44f87a2a 100644
--- a/docs/Phaser.Easing.Quintic.html
+++ b/docs/Phaser.Easing.Quintic.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.Sinusoidal.html b/docs/Phaser.Easing.Sinusoidal.html
index 876ace73..aafa704c 100644
--- a/docs/Phaser.Easing.Sinusoidal.html
+++ b/docs/Phaser.Easing.Sinusoidal.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -963,7 +977,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Easing.html b/docs/Phaser.Easing.html
index 76cf08c7..db985b57 100644
--- a/docs/Phaser.Easing.html
+++ b/docs/Phaser.Easing.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -573,7 +587,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:27 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:39 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Events.html b/docs/Phaser.Events.html
index a3c813c2..7cc8730c 100644
--- a/docs/Phaser.Events.html
+++ b/docs/Phaser.Events.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -587,7 +601,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:40 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Filter.html b/docs/Phaser.Filter.html
index 20026212..334545ac 100644
--- a/docs/Phaser.Filter.html
+++ b/docs/Phaser.Filter.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1872,7 +1886,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Frame.html b/docs/Phaser.Frame.html
index a7dd759c..68494aa6 100644
--- a/docs/Phaser.Frame.html
+++ b/docs/Phaser.Frame.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2948,7 +2962,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.FrameData.html b/docs/Phaser.FrameData.html
index e8a64653..ee5af43a 100644
--- a/docs/Phaser.FrameData.html
+++ b/docs/Phaser.FrameData.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1895,7 +1909,7 @@ The frames are returned in the output array, or if none is provided in a new Arr
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:28 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Game.html b/docs/Phaser.Game.html
index 5290e6ce..12c91c71 100644
--- a/docs/Phaser.Game.html
+++ b/docs/Phaser.Game.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -5430,7 +5444,7 @@ This is extremely useful to hard to track down errors! Use the internal stepCoun
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.GameObjectFactory.html b/docs/Phaser.GameObjectFactory.html
index 336b5ec6..38c5b694 100644
--- a/docs/Phaser.GameObjectFactory.html
+++ b/docs/Phaser.GameObjectFactory.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4905,7 +4919,7 @@ at set intervals, and fixes their positions and velocities accorindgly.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Gamepad.html b/docs/Phaser.Gamepad.html
index aeae4f64..ed3a2f52 100644
--- a/docs/Phaser.Gamepad.html
+++ b/docs/Phaser.Gamepad.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3362,7 +3376,7 @@ This MUST be called manually before Phaser will start polling the Gamepad API.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.GamepadButton.html b/docs/Phaser.GamepadButton.html
index 8a741cdf..d43c8d6b 100644
--- a/docs/Phaser.GamepadButton.html
+++ b/docs/Phaser.GamepadButton.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2540,7 +2554,7 @@ If the button is up it holds the duration of the previous down session.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:41 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Graphics.html b/docs/Phaser.Graphics.html
index 75ae9f33..27281eeb 100644
--- a/docs/Phaser.Graphics.html
+++ b/docs/Phaser.Graphics.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -739,7 +753,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Group.html b/docs/Phaser.Group.html
index 79bcc812..0c7ffc9b 100644
--- a/docs/Phaser.Group.html
+++ b/docs/Phaser.Group.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -9084,7 +9098,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:29 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Input.html b/docs/Phaser.Input.html
index 66d143c8..29f07bda 100644
--- a/docs/Phaser.Input.html
+++ b/docs/Phaser.Input.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7648,7 +7662,7 @@ to only use if you've limited input to a single pointer (i.e. mouse or touch)
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.InputHandler.html b/docs/Phaser.InputHandler.html
index d9e43038..83b0f5e5 100644
--- a/docs/Phaser.InputHandler.html
+++ b/docs/Phaser.InputHandler.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7651,7 +7665,7 @@ This value is only set when the pointer is over this Sprite.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Key.html b/docs/Phaser.Key.html
index 1f8e66e1..d5997f9c 100644
--- a/docs/Phaser.Key.html
+++ b/docs/Phaser.Key.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2530,7 +2544,7 @@ If the key is up it holds the duration of the previous down session.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Keyboard.html b/docs/Phaser.Keyboard.html
index 3e720486..bb01f29d 100644
--- a/docs/Phaser.Keyboard.html
+++ b/docs/Phaser.Keyboard.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2957,7 +2971,7 @@ This is called automatically by Phaser.Input and should not normally be invoked
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Line.html b/docs/Phaser.Line.html
index 5f974cbf..90a4d127 100644
--- a/docs/Phaser.Line.html
+++ b/docs/Phaser.Line.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3053,7 +3067,7 @@ Returns the intersection segment of AB and EF as a Point, or null if there is no
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:42 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.LinkedList.html b/docs/Phaser.LinkedList.html
index 8f1018e0..8df83cf2 100644
--- a/docs/Phaser.LinkedList.html
+++ b/docs/Phaser.LinkedList.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1449,7 +1463,7 @@ The function must exist on the member.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Loader.html b/docs/Phaser.Loader.html
index eca96ed4..21a37187 100644
--- a/docs/Phaser.Loader.html
+++ b/docs/Phaser.Loader.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7133,7 +7147,7 @@ This allows you to easily make loading bars for games.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:30 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.LoaderParser.html b/docs/Phaser.LoaderParser.html
index e5052246..59f86bb4 100644
--- a/docs/Phaser.LoaderParser.html
+++ b/docs/Phaser.LoaderParser.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -681,7 +695,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.MSPointer.html b/docs/Phaser.MSPointer.html
index 1726c1aa..71a61f9a 100644
--- a/docs/Phaser.MSPointer.html
+++ b/docs/Phaser.MSPointer.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1399,7 +1413,7 @@ It will work only in Internet Explorer 10 and Windows Store or Windows Phone 8 a
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Math.html b/docs/Phaser.Math.html
index 41f67fbc..cd9097b5 100644
--- a/docs/Phaser.Math.html
+++ b/docs/Phaser.Math.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -11177,7 +11191,7 @@ Should be called whenever the angle is updated on the Sprite to stop it from goi
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Mouse.html b/docs/Phaser.Mouse.html
index 03806212..8c945bbf 100644
--- a/docs/Phaser.Mouse.html
+++ b/docs/Phaser.Mouse.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2716,7 +2730,7 @@ If the browser successfully enters a locked state the event Phaser.Mouse.pointer
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Net.html b/docs/Phaser.Net.html
index 5c69959d..906f15a3 100644
--- a/docs/Phaser.Net.html
+++ b/docs/Phaser.Net.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1343,7 +1357,7 @@ Optionally you can redirect to the new url, or just return it as a string.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Particles.Arcade.Emitter.html b/docs/Phaser.Particles.Arcade.Emitter.html
index bc65c282..6470af8a 100644
--- a/docs/Phaser.Particles.Arcade.Emitter.html
+++ b/docs/Phaser.Particles.Arcade.Emitter.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -13276,7 +13290,7 @@ You cannot swap a child with itself, or swap un-parented children, doing so will
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Particles.html b/docs/Phaser.Particles.html
index 293c88e1..961ffb3a 100644
--- a/docs/Phaser.Particles.html
+++ b/docs/Phaser.Particles.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1232,7 +1246,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:31 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:43 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Physics.Arcade.Body.html b/docs/Phaser.Physics.Arcade.Body.html
index fb9cd106..500a16e3 100644
--- a/docs/Phaser.Physics.Arcade.Body.html
+++ b/docs/Phaser.Physics.Arcade.Body.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -5522,7 +5536,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -5624,7 +5638,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -6086,7 +6100,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -6178,7 +6192,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -6270,7 +6284,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -6362,7 +6376,7 @@ touching.up = true means the collision happened to the top of this Body for exam
Source:
@@ -6950,7 +6964,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -7240,7 +7254,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -7385,7 +7399,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -7595,7 +7609,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -7664,7 +7678,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -7756,7 +7770,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -8012,7 +8026,7 @@ If it returns false this will be skipped and must be handled manually.
Source:
@@ -8643,7 +8657,7 @@ Also resets the forces to defaults: gravity, bounce, minVelocity,maxVelocity, an
Source:
@@ -9021,7 +9035,7 @@ The Circle will be centered on the center of the Sprite by default, but can be a
Source:
@@ -9153,7 +9167,7 @@ Use Body.translate and/or Body.offset to re-position the polygon from the Sprite
Source:
@@ -9383,7 +9397,7 @@ If you don't specify any parameters it will be sized to match the parent Sprites
Source:
@@ -9925,7 +9939,7 @@ See also the Body.offset property.
Source:
@@ -10114,7 +10128,7 @@ See also the Body.offset property.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Physics.Arcade.html b/docs/Phaser.Physics.Arcade.html
index b048804c..ad40c8e4 100644
--- a/docs/Phaser.Physics.Arcade.html
+++ b/docs/Phaser.Physics.Arcade.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2040,7 +2054,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
Source:
@@ -2354,7 +2368,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
Source:
@@ -2701,7 +2715,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
Source:
@@ -2938,7 +2952,7 @@ One way to use this is: accelerationFromRotation(rotation, 200, sprite.accelerat
Source:
@@ -3104,7 +3118,7 @@ One way to use this is: accelerationFromRotation(rotation, 200, sprite.accelerat
Source:
@@ -3288,7 +3302,7 @@ One way to use this is: accelerationFromRotation(rotation, 200, sprite.accelerat
Source:
@@ -3475,7 +3489,7 @@ One way to use this is: accelerationFromRotation(rotation, 200, sprite.accelerat
Source:
@@ -4113,7 +4127,7 @@ The collideCallback is an optional function that is only called if two sprites c
Source:
@@ -4299,7 +4313,7 @@ If you need to calculate from the center of a display object instead use the met
Source:
@@ -4488,7 +4502,7 @@ If you need to calculate from the center of a display object instead use the met
Source:
@@ -4928,7 +4942,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
Source:
@@ -5204,7 +5218,7 @@ Note: The display object doesn't stop moving once it reaches the destination coo
Source:
@@ -5514,7 +5528,7 @@ Note: Doesn't take into account acceleration, maxVelocity or drag (if you've set
Source:
@@ -7748,7 +7762,7 @@ One way to use this is: velocityFromAngle(angle, 200, sprite.velocity) which wil
Source:
@@ -7987,7 +8001,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
Source:
@@ -8063,7 +8077,7 @@ One way to use this is: velocityFromRotation(rotation, 200, sprite.velocity) whi
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Physics.html b/docs/Phaser.Physics.html
index 9379c4c4..cfa8b8d6 100644
--- a/docs/Phaser.Physics.html
+++ b/docs/Phaser.Physics.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -539,7 +553,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Plugin.html b/docs/Phaser.Plugin.html
index 4816bc54..6eb74e05 100644
--- a/docs/Phaser.Plugin.html
+++ b/docs/Phaser.Plugin.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1906,7 +1920,7 @@ It is only called if active is set to true.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.PluginManager.html b/docs/Phaser.PluginManager.html
index 8e608895..c52f8840 100644
--- a/docs/Phaser.PluginManager.html
+++ b/docs/Phaser.PluginManager.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1571,7 +1585,7 @@ It only calls plugins who have active=true.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Point.html b/docs/Phaser.Point.html
index 3290f887..bea8469b 100644
--- a/docs/Phaser.Point.html
+++ b/docs/Phaser.Point.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -5267,7 +5281,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:44 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Pointer.html b/docs/Phaser.Pointer.html
index 260e519c..63bde056 100644
--- a/docs/Phaser.Pointer.html
+++ b/docs/Phaser.Pointer.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4354,7 +4368,7 @@ If you wish to check if the Pointer was released just once then see the Sprite.e
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:32 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Polygon.html b/docs/Phaser.Polygon.html
index 026558c8..ec5c0be6 100644
--- a/docs/Phaser.Polygon.html
+++ b/docs/Phaser.Polygon.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -699,7 +713,7 @@ arguments passed can be flat x,y values e.g. new PIXI.Polygon(x,y, x,y, x,
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.QuadTree.html b/docs/Phaser.QuadTree.html
index 83f23cd6..f97069a0 100644
--- a/docs/Phaser.QuadTree.html
+++ b/docs/Phaser.QuadTree.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1620,7 +1634,7 @@ Split the node into 4 subnodes
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.RandomDataGenerator.html b/docs/Phaser.RandomDataGenerator.html
index 6e2c5b66..6df624e0 100644
--- a/docs/Phaser.RandomDataGenerator.html
+++ b/docs/Phaser.RandomDataGenerator.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2037,7 +2051,7 @@ Random number generator from
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Rectangle.html b/docs/Phaser.Rectangle.html
index 0472e0e8..69d98a4a 100644
--- a/docs/Phaser.Rectangle.html
+++ b/docs/Phaser.Rectangle.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7378,7 +7392,7 @@ This method checks the x, y, width, and height properties of the Rectangles.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.RenderTexture.html b/docs/Phaser.RenderTexture.html
index d3854fb4..e2944bc7 100644
--- a/docs/Phaser.RenderTexture.html
+++ b/docs/Phaser.RenderTexture.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1980,7 +1994,7 @@ If the display object is a Group or has children it will draw all children as we
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.RequestAnimationFrame.html b/docs/Phaser.RequestAnimationFrame.html
index 724525ad..8a713f23 100644
--- a/docs/Phaser.RequestAnimationFrame.html
+++ b/docs/Phaser.RequestAnimationFrame.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1303,7 +1317,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Signal.html b/docs/Phaser.Signal.html
index 176d68b9..f7acc3d6 100644
--- a/docs/Phaser.Signal.html
+++ b/docs/Phaser.Signal.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2288,7 +2302,7 @@ IMPORTANT: should be called only during signal dispatch, calling it before/after
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:45 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.SinglePad.html b/docs/Phaser.SinglePad.html
index 5452d373..9a383f20 100644
--- a/docs/Phaser.SinglePad.html
+++ b/docs/Phaser.SinglePad.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3775,7 +3789,7 @@ analog trigger buttons on the XBOX 360 controller
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:33 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Sound.html b/docs/Phaser.Sound.html
index c8bf2e3f..f4a5f875 100644
--- a/docs/Phaser.Sound.html
+++ b/docs/Phaser.Sound.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -5799,7 +5813,7 @@ This allows you to bundle multiple sounds together into a single audio file and
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.SoundManager.html b/docs/Phaser.SoundManager.html
index 4c50e2f2..61baf5f0 100644
--- a/docs/Phaser.SoundManager.html
+++ b/docs/Phaser.SoundManager.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2857,7 +2871,7 @@ Note: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:conf
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Sprite.html b/docs/Phaser.Sprite.html
index 8338ac67..00cfdf67 100644
--- a/docs/Phaser.Sprite.html
+++ b/docs/Phaser.Sprite.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -7941,7 +7955,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Stage.html b/docs/Phaser.Stage.html
index bace5b63..387e2f15 100644
--- a/docs/Phaser.Stage.html
+++ b/docs/Phaser.Stage.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1930,7 +1944,7 @@ focus handling, game resizing, scaling and the pause, boot and orientation scree
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.StageScaleMode.html b/docs/Phaser.StageScaleMode.html
index 72ea2c10..a1a18bc7 100644
--- a/docs/Phaser.StageScaleMode.html
+++ b/docs/Phaser.StageScaleMode.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4904,7 +4918,7 @@ Please note that this needs to be supported by the web browser and isn't the sam
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.State.html b/docs/Phaser.State.html
index d0a995ce..abab9677 100644
--- a/docs/Phaser.State.html
+++ b/docs/Phaser.State.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2568,7 +2582,7 @@ If you need to use the loader, you may need to use them here.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:46 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.StateManager.html b/docs/Phaser.StateManager.html
index bd5daaaf..b55fde6e 100644
--- a/docs/Phaser.StateManager.html
+++ b/docs/Phaser.StateManager.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3254,7 +3268,7 @@ State must exist and have at least one callback function registered..
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:34 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Text.html b/docs/Phaser.Text.html
index ea84a034..7146feb1 100644
--- a/docs/Phaser.Text.html
+++ b/docs/Phaser.Text.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2560,7 +2574,7 @@ If you wish to work in radians instead of degrees use the property Sprite.rotati
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Tile.html b/docs/Phaser.Tile.html
index c6710c82..27e6086b 100644
--- a/docs/Phaser.Tile.html
+++ b/docs/Phaser.Tile.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3965,7 +3979,7 @@ The callback must true true for collision processing to take place.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.TileSprite.html b/docs/Phaser.TileSprite.html
index 04e6138a..27152725 100644
--- a/docs/Phaser.TileSprite.html
+++ b/docs/Phaser.TileSprite.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -8576,7 +8590,7 @@ It will dispatch the onRevived event, you can listen to Sprite.events.onRevived
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Tilemap.html b/docs/Phaser.Tilemap.html
index feae7e2e..2bcf4b59 100644
--- a/docs/Phaser.Tilemap.html
+++ b/docs/Phaser.Tilemap.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -5591,7 +5605,7 @@ Note that the tileset name can be found in the JSON file exported from Tiled, or
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.TilemapLayer.html b/docs/Phaser.TilemapLayer.html
index 6324e83e..7a4cdb29 100644
--- a/docs/Phaser.TilemapLayer.html
+++ b/docs/Phaser.TilemapLayer.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -4600,7 +4614,7 @@ half as quickly as the 'normal' camera-locked layers do)
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.TilemapParser.html b/docs/Phaser.TilemapParser.html
index 8da89b64..53528640 100644
--- a/docs/Phaser.TilemapParser.html
+++ b/docs/Phaser.TilemapParser.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1443,7 +1457,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Tileset.html b/docs/Phaser.Tileset.html
index 2a1cd745..b54bc3f3 100644
--- a/docs/Phaser.Tileset.html
+++ b/docs/Phaser.Tileset.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -6368,7 +6382,7 @@ If you want to set a callback for a tile at a specific location on the map then
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:35 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:47 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Time.html b/docs/Phaser.Time.html
index 8daece68..9de6001b 100644
--- a/docs/Phaser.Time.html
+++ b/docs/Phaser.Time.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3082,7 +3096,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Timer.html b/docs/Phaser.Timer.html
index 0457fc84..f46ff4f8 100644
--- a/docs/Phaser.Timer.html
+++ b/docs/Phaser.Timer.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1049,7 +1063,7 @@ So if you want to fire an event every quarter of a second you'd need to set the
Source:
@@ -1460,7 +1474,7 @@ So if you want to fire an event every quarter of a second you'd need to set the
Source:
@@ -1562,7 +1576,7 @@ So if you want to fire an event every quarter of a second you'd need to set the
Source:
@@ -1664,7 +1678,7 @@ So if you want to fire an event every quarter of a second you'd need to set the
Source:
@@ -2180,7 +2194,7 @@ So if you want to fire an event every quarter of a second you'd need to set the
Source:
@@ -2493,7 +2507,7 @@ If the Timer is already running the delay will be calculated based on the timers
Source:
@@ -2880,7 +2894,7 @@ If the Timer is already running the delay will be calculated based on the timers
Source:
@@ -3347,7 +3361,7 @@ If the Timer is already running the delay will be calculated based on the timers
Source:
@@ -3746,7 +3760,7 @@ If the Timer is already running the delay will be calculated based on the timers
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.TimerEvent.html b/docs/Phaser.TimerEvent.html
index ca35f0e0..ba802973 100644
--- a/docs/Phaser.TimerEvent.html
+++ b/docs/Phaser.TimerEvent.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1229,6 +1243,108 @@ It can call a specific callback, passing in optional parameters.
+
+
+
+
+
+
+
+
+
+ <protected> pendingDelete
+
+
+
+
+
+
+
+
+
+
+
+
+ Properties:
+
+
+
+
+
+
+
+ Name
+
+
+ Type
+
+
+
+
+
+ Description
+
+
+
+
+
+
+
+
+ pendingDelete
+
+
+
+
+
+boolean
+
+
+
+
+
+
+
+
+
+ A flag that controls if the TimerEvent is pending deletion.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Source:
+
+
+
+
+
+
+
+
@@ -1569,7 +1685,7 @@ It can call a specific callback, passing in optional parameters.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Touch.html b/docs/Phaser.Touch.html
index 0bcca464..85a02e2d 100644
--- a/docs/Phaser.Touch.html
+++ b/docs/Phaser.Touch.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -2641,7 +2655,7 @@ Doesn't appear to be supported by most browsers on a canvas element yet.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Tween.html b/docs/Phaser.Tween.html
index 1730684c..80083f20 100644
--- a/docs/Phaser.Tween.html
+++ b/docs/Phaser.Tween.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -3130,7 +3144,7 @@ Used in combination with repeat you can create endless loops.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.TweenManager.html b/docs/Phaser.TweenManager.html
index 93737650..d0f8503d 100644
--- a/docs/Phaser.TweenManager.html
+++ b/docs/Phaser.TweenManager.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1634,7 +1648,7 @@ Please see https://github.com/sole/tw
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Utils.Debug.html b/docs/Phaser.Utils.Debug.html
index f4c4033c..50b2d0d3 100644
--- a/docs/Phaser.Utils.Debug.html
+++ b/docs/Phaser.Utils.Debug.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -6856,7 +6870,7 @@ your game set to use Phaser.AUTO then swap it for Phaser.CANVAS to ensure WebGL
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.Utils.html b/docs/Phaser.Utils.html
index 840f9c11..a59f9f41 100644
--- a/docs/Phaser.Utils.html
+++ b/docs/Phaser.Utils.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -938,7 +952,7 @@ dir = 1 (left), 2 (right), 3 (both)
- Description.
+ The number of characters to be added.
@@ -973,7 +987,7 @@ dir = 1 (left), 2 (right), 3 (both)
- the string to pad it out with (defaults to a space).
+ The string to pad it out with (defaults to a space).
@@ -1012,7 +1026,7 @@ dir = 1 (left), 2 (right), 3 (both)
- the direction dir = 1 (left), 2 (right), 3 (both).
+ The direction dir = 1 (left), 2 (right), 3 (both).
@@ -1259,7 +1273,7 @@ dir = 1 (left), 2 (right), 3 (both)
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:36 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:48 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.World.html b/docs/Phaser.World.html
index 2328e0fa..ba727649 100644
--- a/docs/Phaser.World.html
+++ b/docs/Phaser.World.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -10258,7 +10272,7 @@ Most objects won't have an update method set unless explicitly given one.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:37 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:49 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.html b/docs/Phaser.html
index ecf95de5..86e365d9 100644
--- a/docs/Phaser.html
+++ b/docs/Phaser.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -724,7 +738,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:25 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Phaser.js.html b/docs/Phaser.js.html
index 0c5ebf0e..0e8d10a6 100644
--- a/docs/Phaser.js.html
+++ b/docs/Phaser.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -427,7 +441,7 @@
var Phaser = Phaser || {
VERSION: '<%= version %>',
- DEV_VERSION: '1.1.4',
+ DEV_VERSION: '1.1.5',
GAMES: [],
AUTO: 0,
@@ -488,7 +502,7 @@ PIXI.InteractionManager = function (dummy) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Plugin.js.html b/docs/Plugin.js.html
index 8302d705..89b47326 100644
--- a/docs/Plugin.js.html
+++ b/docs/Plugin.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -559,7 +573,7 @@ Phaser.Plugin.prototype.constructor = Phaser.Plugin;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/PluginManager.js.html b/docs/PluginManager.js.html
index b2bd4a46..04fd0f73 100644
--- a/docs/PluginManager.js.html
+++ b/docs/PluginManager.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -735,7 +749,7 @@ Phaser.PluginManager.prototype.constructor = Phaser.PluginManager;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Point.js.html b/docs/Point.js.html
index 34a3fe53..cef3ca7e 100644
--- a/docs/Point.js.html
+++ b/docs/Point.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -868,7 +882,7 @@ Phaser.Point.rotate = function (a, x, y, angle, asDegrees, distance) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Pointer.js.html b/docs/Pointer.js.html
index 12357a84..b8f70557 100644
--- a/docs/Pointer.js.html
+++ b/docs/Pointer.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1080,7 +1094,7 @@ Object.defineProperty(Phaser.Pointer.prototype, "worldY", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Polygon.js.html b/docs/Polygon.js.html
index 2a9440c0..dbe1fdb6 100644
--- a/docs/Polygon.js.html
+++ b/docs/Polygon.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -465,7 +479,7 @@ Phaser.Polygon.prototype.constructor = Phaser.Polygon;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/QuadTree.js.html b/docs/QuadTree.js.html
index 856ca076..c0c3a4fe 100644
--- a/docs/QuadTree.js.html
+++ b/docs/QuadTree.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -723,7 +737,7 @@ Phaser.QuadTree.prototype.constructor = Phaser.QuadTree;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/RandomDataGenerator.js.html b/docs/RandomDataGenerator.js.html
index 20d38246..e86d11b9 100644
--- a/docs/RandomDataGenerator.js.html
+++ b/docs/RandomDataGenerator.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -685,7 +699,7 @@ Phaser.RandomDataGenerator.prototype.constructor = Phaser.RandomDataGenerator;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Rectangle.js.html b/docs/Rectangle.js.html
index 4b5a9635..7e06e39a 100644
--- a/docs/Rectangle.js.html
+++ b/docs/Rectangle.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1126,7 +1140,7 @@ Phaser.Rectangle.union = function (a, b, out) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/RenderTexture.js.html b/docs/RenderTexture.js.html
index b85fcadd..b694dc4a 100644
--- a/docs/RenderTexture.js.html
+++ b/docs/RenderTexture.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -768,7 +782,7 @@ Phaser.RenderTexture.prototype.renderCanvas = function(displayObject, position,
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/RequestAnimationFrame.js.html b/docs/RequestAnimationFrame.js.html
index c47f23db..1b7e0e24 100644
--- a/docs/RequestAnimationFrame.js.html
+++ b/docs/RequestAnimationFrame.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -595,7 +609,7 @@ Phaser.RequestAnimationFrame.prototype.constructor = Phaser.RequestAnimationFram
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/SAT.js.html b/docs/SAT.js.html
index daffcd9a..34e90c31 100644
--- a/docs/SAT.js.html
+++ b/docs/SAT.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -423,33 +437,7 @@
// polygons using the Separating Axis Theorem.
/** @preserve SAT.js - Version 0.2 - Copyright 2013 - Jim Riecken <jimr@jimr.ca> - released under the MIT License. https://github.com/jriecken/sat-js */
-/*global define: false, module: false*/
-/*jshint shadow:true, sub:true, forin:true, noarg:true, noempty:true,
- eqeqeq:true, bitwise:true, strict:true, undef:true,
- curly:true, browser:true */
-
-// Create a UMD wrapper for SAT. Works in:
-//
-// - Plain browser via global SAT variable
-// - AMD loader (like require.js)
-// - Node.js
-//
-// The quoted properties all over the place are used so that the Closure Compiler
-// does not mangle the exposed API in advanced mode.
-/**
- * @param {*} root - The global scope
- * @param {Function} factory - Factory that creates SAT module
- */
-(function (root, factory) {
- "use strict";
- if (typeof define === 'function' && define['amd']) {
- define(factory);
- } else if (typeof exports === 'object') {
- module['exports'] = factory();
- } else {
- root['SAT'] = factory();
- }
-}(this, function () {
+var SAT = (function () {
"use strict";
var SAT = {};
@@ -462,7 +450,7 @@
// Create a new Vector, optionally passing in the `x` and `y` coordinates. If
// a coordinate is not specified, it will be set to `0`
- /**
+ /**
* @param {?number=} x The x position.
* @param {?number=} y The y position.
* @constructor
@@ -535,7 +523,7 @@
this['y'] = -this['y'];
return this;
};
-
+
// Normalize this vector. (make it have length of `1`)
/**
@@ -549,7 +537,7 @@
}
return this;
};
-
+
// Add another vector to this one.
/**
* @param {Vector} other The other Vector.
@@ -560,7 +548,7 @@
this['y'] += other['y'];
return this;
};
-
+
// Subtract another vector from this one.
/**
* @param {Vector} other The other Vector.
@@ -571,7 +559,7 @@
this['y'] -= other['y'];
return this;
};
-
+
// Scale this vector. An independant scaling factor can be provided
// for each axis, or a single scaling factor that will scale both `x` and `y`.
/**
@@ -583,9 +571,9 @@
Vector.prototype['scale'] = Vector.prototype.scale = function(x,y) {
this['x'] *= x;
this['y'] *= y || x;
- return this;
+ return this;
};
-
+
// Project this vector on to another vector.
/**
* @param {Vector} other The vector to project onto.
@@ -597,7 +585,7 @@
this['y'] = amt * other['y'];
return this;
};
-
+
// Project this vector onto a vector of unit length. This is slightly more efficient
// than `project` when dealing with unit vectors.
/**
@@ -610,7 +598,7 @@
this['y'] = amt * other['y'];
return this;
};
-
+
// Reflect this vector on an arbitrary axis.
/**
* @param {Vector} axis The vector representing the axis.
@@ -624,7 +612,7 @@
this['y'] -= y;
return this;
};
-
+
// Reflect this vector on an arbitrary axis (represented by a unit vector). This is
// slightly more efficient than `reflect` when dealing with an axis that is a unit vector.
/**
@@ -639,7 +627,7 @@
this['y'] -= y;
return this;
};
-
+
// Get the dot product of this vector and another.
/**
* @param {Vector} other The vector to dot this one against.
@@ -648,7 +636,7 @@
Vector.prototype['dot'] = Vector.prototype.dot = function(other) {
return this['x'] * other['x'] + this['y'] * other['y'];
};
-
+
// Get the squared length of this vector.
/**
* @return {number} The length^2 of this vector.
@@ -656,7 +644,7 @@
Vector.prototype['len2'] = Vector.prototype.len2 = function() {
return this.dot(this);
};
-
+
// Get the length of this vector.
/**
* @return {number} The length of this vector.
@@ -664,7 +652,7 @@
Vector.prototype['len'] = Vector.prototype.len = function() {
return Math.sqrt(this.len2());
};
-
+
// ## Circle
//
// Represents a circle with a position and a radius.
@@ -707,7 +695,7 @@
this.recalc();
}
SAT['Polygon'] = Polygon;
-
+
// Recalculates the edges and normals of the polygon. This **must** be called
// if the `points` array is modified at all and the edges or normals are to be
// accessed.
@@ -726,7 +714,7 @@
var points = this['points'];
var len = points.length;
for (var i = 0; i < len; i++) {
- var p1 = points[i];
+ var p1 = points[i];
var p2 = i < len - 1 ? points[i + 1] : points[0];
var e = new Vector().copy(p2).sub(p1);
var n = new Vector().copy(e).perp().normalize();
@@ -835,11 +823,11 @@
var w = this['w'];
var h = this['h'];
return new Polygon(new Vector(pos['x'], pos['y']), [
- new Vector(), new Vector(w, 0),
+ new Vector(), new Vector(w, 0),
new Vector(w,h), new Vector(0,h)
]);
};
-
+
// ## Response
//
// An object representing the result of an intersection. Contains:
@@ -850,7 +838,7 @@
// - Whether the first object is entirely inside the second, and vice versa.
/**
* @constructor
- */
+ */
function Response() {
this['a'] = null;
this['b'] = null;
@@ -882,7 +870,7 @@
*/
var T_VECTORS = [];
for (var i = 0; i < 10; i++) { T_VECTORS.push(new Vector()); }
-
+
// A pool of arrays of numbers used in calculations to avoid allocating
// memory.
/**
@@ -915,7 +903,7 @@
}
result[0] = min; result[1] = max;
}
-
+
// Check whether two convex polygons are separated by the specified
// axis (must be a unit vector).
/**
@@ -945,8 +933,8 @@
rangeB[1] += projectedOffset;
// Check if there is a gap. If there is, this is a separating axis and we can stop
if (rangeA[0] > rangeB[1] || rangeB[0] > rangeA[1]) {
- T_VECTORS.push(offsetV);
- T_ARRAYS.push(rangeA);
+ T_VECTORS.push(offsetV);
+ T_ARRAYS.push(rangeA);
T_ARRAYS.push(rangeB);
return true;
}
@@ -957,7 +945,7 @@
if (rangeA[0] < rangeB[0]) {
response['aInB'] = false;
// A ends before B does. We have to pull A out of B
- if (rangeA[1] < rangeB[1]) {
+ if (rangeA[1] < rangeB[1]) {
overlap = rangeA[1] - rangeB[0];
response['bInA'] = false;
// B is fully inside A. Pick the shortest way out.
@@ -970,7 +958,7 @@
} else {
response['bInA'] = false;
// B ends before A ends. We have to push A out of B
- if (rangeA[1] > rangeB[1]) {
+ if (rangeA[1] > rangeB[1]) {
overlap = rangeA[0] - rangeB[1];
response['aInB'] = false;
// A is fully inside B. Pick the shortest way out.
@@ -988,14 +976,14 @@
if (overlap < 0) {
response['overlapN'].reverse();
}
- }
+ }
}
- T_VECTORS.push(offsetV);
- T_ARRAYS.push(rangeA);
+ T_VECTORS.push(offsetV);
+ T_ARRAYS.push(rangeA);
T_ARRAYS.push(rangeB);
return false;
}
-
+
// Calculates which Vornoi region a point is on a line segment.
// It is assumed that both the line and the point are relative to `(0,0)`
//
@@ -1005,8 +993,8 @@
/**
* @param {Vector} line The line segment.
* @param {Vector} point The point.
- * @return {number} LEFT_VORNOI_REGION (-1) if it is the left region,
- * MIDDLE_VORNOI_REGION (0) if it is the middle region,
+ * @return {number} LEFT_VORNOI_REGION (-1) if it is the left region,
+ * MIDDLE_VORNOI_REGION (0) if it is the middle region,
* RIGHT_VORNOI_REGION (1) if it is the right region.
*/
function vornoiRegion(line, point) {
@@ -1034,7 +1022,7 @@
* @const
*/
var RIGHT_VORNOI_REGION = 1;
-
+
// ## Collision Tests
// Check if two circles collide.
@@ -1043,7 +1031,7 @@
* @param {Circle} b The second circle.
* @param {Response=} response Response object (optional) that will be populated if
* the circles intersect.
- * @return {boolean} true if the circles intersect, false if they don't.
+ * @return {boolean} true if the circles intersect, false if they don't.
*/
function testCircleCircle(a, b, response) {
// Check if the distance between the centers of the two
@@ -1058,7 +1046,7 @@
return false;
}
// They intersect. If we're calculating a response, calculate the overlap.
- if (response) {
+ if (response) {
var dist = Math.sqrt(distanceSq);
response['a'] = a;
response['b'] = b;
@@ -1072,7 +1060,7 @@
return true;
}
SAT['testCircleCircle'] = testCircleCircle;
-
+
// Check if a polygon and a circle collide.
/**
* @param {Polygon} polygon The polygon.
@@ -1090,30 +1078,30 @@
var len = points.length;
var edge = T_VECTORS.pop();
var point = T_VECTORS.pop();
-
+
// For each edge in the polygon:
for (var i = 0; i < len; i++) {
var next = i === len - 1 ? 0 : i + 1;
var prev = i === 0 ? len - 1 : i - 1;
var overlap = 0;
var overlapN = null;
-
+
// Get the edge.
edge.copy(polygon['edges'][i]);
// Calculate the center of the circle relative to the starting point of the edge.
point.copy(circlePos).sub(points[i]);
-
+
// If the distance between the center of the circle and the point
// is bigger than the radius, the polygon is definitely not fully in
// the circle.
if (response && point.len2() > radius2) {
response['aInB'] = false;
}
-
+
// Calculate which Vornoi region the center of the circle is in.
var region = vornoiRegion(edge, point);
// If it's the left region:
- if (region === LEFT_VORNOI_REGION) {
+ if (region === LEFT_VORNOI_REGION) {
// We need to make sure we're in the RIGHT_VORNOI_REGION of the previous edge.
edge.copy(polygon['edges'][prev]);
// Calculate the center of the circle relative the starting point of the previous edge
@@ -1124,9 +1112,9 @@
var dist = point.len();
if (dist > radius) {
// No intersection
- T_VECTORS.push(circlePos);
+ T_VECTORS.push(circlePos);
T_VECTORS.push(edge);
- T_VECTORS.push(point);
+ T_VECTORS.push(point);
T_VECTORS.push(point2);
return false;
} else if (response) {
@@ -1149,10 +1137,10 @@
var dist = point.len();
if (dist > radius) {
// No intersection
- T_VECTORS.push(circlePos);
- T_VECTORS.push(edge);
+ T_VECTORS.push(circlePos);
+ T_VECTORS.push(edge);
T_VECTORS.push(point);
- return false;
+ return false;
} else if (response) {
// It intersects, calculate the overlap.
response['bInA'] = false;
@@ -1165,15 +1153,15 @@
// Need to check if the circle is intersecting the edge,
// Change the edge into its "edge normal".
var normal = edge.perp().normalize();
- // Find the perpendicular distance between the center of the
+ // Find the perpendicular distance between the center of the
// circle and the edge.
var dist = point.dot(normal);
var distAbs = Math.abs(dist);
// If the circle is on the outside of the edge, there is no intersection.
if (dist > 0 && distAbs > radius) {
// No intersection
- T_VECTORS.push(circlePos);
- T_VECTORS.push(normal);
+ T_VECTORS.push(circlePos);
+ T_VECTORS.push(normal);
T_VECTORS.push(point);
return false;
} else if (response) {
@@ -1187,28 +1175,28 @@
}
}
}
-
- // If this is the smallest overlap we've seen, keep it.
+
+ // If this is the smallest overlap we've seen, keep it.
// (overlapN may be null if the circle was in the wrong Vornoi region).
if (overlapN && response && Math.abs(overlap) < Math.abs(response['overlap'])) {
response['overlap'] = overlap;
response['overlapN'].copy(overlapN);
}
}
-
+
// Calculate the final overlap vector - based on the smallest overlap.
if (response) {
response['a'] = polygon;
response['b'] = circle;
response['overlapV'].copy(response['overlapN']).scale(response['overlap']);
}
- T_VECTORS.push(circlePos);
- T_VECTORS.push(edge);
+ T_VECTORS.push(circlePos);
+ T_VECTORS.push(edge);
T_VECTORS.push(point);
return true;
}
SAT['testPolygonCircle'] = testPolygonCircle;
-
+
// Check if a circle and a polygon collide.
//
// **NOTE:** This is slightly less efficient than polygonCircle as it just
@@ -1237,7 +1225,7 @@
return result;
}
SAT['testCirclePolygon'] = testCirclePolygon;
-
+
// Checks whether polygons collide.
/**
* @param {Polygon} a The first polygon.
@@ -1276,7 +1264,8 @@
SAT['testPolygonPolygon'] = testPolygonPolygon;
return SAT;
-}));
+})();
+
@@ -1297,7 +1286,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Signal.js.html b/docs/Signal.js.html
index 02fe379b..57addc32 100644
--- a/docs/Signal.js.html
+++ b/docs/Signal.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -740,7 +754,7 @@ Phaser.Signal.prototype.constructor = Phaser.Signal;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/SignalBinding.html b/docs/SignalBinding.html
index b3c0f540..6c955d8b 100644
--- a/docs/SignalBinding.html
+++ b/docs/SignalBinding.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -733,7 +747,7 @@ Inspired by Joa Ebert AS3 SignalBinding and Robert Penner's Slot classes.
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:37 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:49 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/SignalBinding.js.html b/docs/SignalBinding.js.html
index 8bc0854f..14dc3c35 100644
--- a/docs/SignalBinding.js.html
+++ b/docs/SignalBinding.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -600,7 +614,7 @@ Phaser.SignalBinding.prototype.constructor = Phaser.SignalBinding;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/SinglePad.js.html b/docs/SinglePad.js.html
index af2fdfca..0ac1b770 100644
--- a/docs/SinglePad.js.html
+++ b/docs/SinglePad.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1005,7 +1019,7 @@ Object.defineProperty(Phaser.SinglePad.prototype, "index", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Sound.js.html b/docs/Sound.js.html
index 03167d6d..d0ced835 100644
--- a/docs/Sound.js.html
+++ b/docs/Sound.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1261,7 +1275,7 @@ Object.defineProperty(Phaser.Sound.prototype, "volume", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/SoundManager.js.html b/docs/SoundManager.js.html
index 6fa385c5..6ec0c4a6 100644
--- a/docs/SoundManager.js.html
+++ b/docs/SoundManager.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -918,7 +932,7 @@ Object.defineProperty(Phaser.SoundManager.prototype, "volume", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Sprite.js.html b/docs/Sprite.js.html
index cce3609a..c41d9864 100644
--- a/docs/Sprite.js.html
+++ b/docs/Sprite.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1648,7 +1662,7 @@ Object.defineProperty(Phaser.Sprite.prototype, "inputEnabled", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Stage.js.html b/docs/Stage.js.html
index 61e45c67..90c80344 100644
--- a/docs/Stage.js.html
+++ b/docs/Stage.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -706,7 +720,7 @@ Object.defineProperty(Phaser.Stage.prototype, "backgroundColor", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/StageScaleMode.js.html b/docs/StageScaleMode.js.html
index 156a13d6..1a9b1cbd 100644
--- a/docs/StageScaleMode.js.html
+++ b/docs/StageScaleMode.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1212,7 +1226,7 @@ Object.defineProperty(Phaser.StageScaleMode.prototype, "isLandscape", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/State.js.html b/docs/State.js.html
index b20515cf..023f223d 100644
--- a/docs/State.js.html
+++ b/docs/State.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -607,7 +621,7 @@ Phaser.State.prototype.constructor = Phaser.State;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/StateManager.js.html b/docs/StateManager.js.html
index e3b8a73f..581e15d3 100644
--- a/docs/StateManager.js.html
+++ b/docs/StateManager.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -964,7 +978,7 @@ Phaser.StateManager.prototype.constructor = Phaser.StateManager;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Text.js.html b/docs/Text.js.html
index 9376f7f1..37796f74 100644
--- a/docs/Text.js.html
+++ b/docs/Text.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -737,7 +751,7 @@ Object.defineProperty(Phaser.Text.prototype, 'font', {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Tile.js.html b/docs/Tile.js.html
index 0dc8af7a..882d1317 100644
--- a/docs/Tile.js.html
+++ b/docs/Tile.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -729,7 +743,7 @@ Object.defineProperty(Phaser.Tile.prototype, "bottom", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/TileSprite.js.html b/docs/TileSprite.js.html
index a9fdfd0d..af432470 100644
--- a/docs/TileSprite.js.html
+++ b/docs/TileSprite.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -594,7 +608,7 @@ Object.defineProperty(Phaser.TileSprite.prototype, "inputEnabled", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Tilemap.js.html b/docs/Tilemap.js.html
index ed75f137..ab9825f4 100644
--- a/docs/Tilemap.js.html
+++ b/docs/Tilemap.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1335,8 +1349,8 @@ Phaser.Tilemap.prototype = {
}
// Find out the difference between tileblock[1].x/y and x/y and use it as an offset, as it's the top left of the block to paste
- var diffX = tileblock[1].x - x;
- var diffY = tileblock[1].y - y;
+ var diffX = x - tileblock[1].x;
+ var diffY = y - tileblock[1].y;
for (var i = 1; i < tileblock.length; i++)
{
@@ -1673,7 +1687,7 @@ Phaser.Tilemap.prototype.constructor = Phaser.Tilemap;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/TilemapLayer.js.html b/docs/TilemapLayer.js.html
index e92aa009..55dbec3d 100644
--- a/docs/TilemapLayer.js.html
+++ b/docs/TilemapLayer.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1316,7 +1330,7 @@ Object.defineProperty(Phaser.TilemapLayer.prototype, "collisionHeight", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/TilemapParser.js.html b/docs/TilemapParser.js.html
index 8bd6058b..baca8969 100644
--- a/docs/TilemapParser.js.html
+++ b/docs/TilemapParser.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -814,7 +828,7 @@ Phaser.TilemapParser = {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Tileset.js.html b/docs/Tileset.js.html
index 56d573a1..b2ed4d1c 100644
--- a/docs/Tileset.js.html
+++ b/docs/Tileset.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -592,7 +606,7 @@ Phaser.Tileset.prototype.constructor = Phaser.Tileset;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Time.js.html b/docs/Time.js.html
index 91ac8c29..cabeeb5a 100644
--- a/docs/Time.js.html
+++ b/docs/Time.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -783,7 +797,7 @@ Phaser.Time.prototype.constructor = Phaser.Time;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Timer.js.html b/docs/Timer.js.html
index fd8151d7..e225733f 100644
--- a/docs/Timer.js.html
+++ b/docs/Timer.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -662,7 +676,7 @@ Phaser.Timer.prototype = {
{
if (this.events[i] === event)
{
- this.events.splice(i, 1);
+ this.events[i].pendingDelete = true;
return true;
}
}
@@ -725,6 +739,21 @@ Phaser.Timer.prototype = {
this._len = this.events.length;
+ this._i = 0;
+
+ while (this._i < this._len)
+ {
+ if (this.events[this._i].pendingDelete)
+ {
+ this.events.splice(this._i, 1);
+ this._len--;
+ }
+
+ this._i++;
+ }
+
+ this._len = this.events.length;
+
if (this.running && this._now >= this.nextTick && this._len > 0)
{
this._i = 0;
@@ -788,9 +817,12 @@ Phaser.Timer.prototype = {
*/
pause: function () {
- this._pauseStarted = this.game.time.now;
+ if (this.running && !this.expired)
+ {
+ this._pauseStarted = this.game.time.now;
- this.paused = true;
+ this.paused = true;
+ }
},
@@ -800,17 +832,20 @@ Phaser.Timer.prototype = {
*/
resume: function () {
- var pauseDuration = this.game.time.now - this._pauseStarted;
-
- for (var i = 0; i < this.events.length; i++)
+ if (this.running && !this.expired)
{
- this.events[i].tick += pauseDuration;
+ var pauseDuration = this.game.time.now - this._pauseStarted;
+
+ for (var i = 0; i < this.events.length; i++)
+ {
+ this.events[i].tick += pauseDuration;
+ }
+
+ this.nextTick += pauseDuration;
+
+ this.paused = false;
}
- this.nextTick += pauseDuration;
-
- this.paused = false;
-
},
/**
@@ -822,6 +857,7 @@ Phaser.Timer.prototype = {
this.onComplete.removeAll();
this.running = false;
this.events = [];
+ this._i = this._len;
}
@@ -923,7 +959,7 @@ Phaser.Timer.prototype.constructor = Phaser.Timer;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/TimerEvent.js.html b/docs/TimerEvent.js.html
index d0a9f1e5..6d610604 100644
--- a/docs/TimerEvent.js.html
+++ b/docs/TimerEvent.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -479,6 +493,12 @@ Phaser.TimerEvent = function (timer, delay, tick, repeatCount, loop, callback, c
*/
this.args = args;
+ /**
+ * @property {boolean} pendingDelete - A flag that controls if the TimerEvent is pending deletion.
+ * @protected
+ */
+ this.pendingDelete = false;
+
};
Phaser.TimerEvent.prototype.constructor = Phaser.TimerEvent;
@@ -503,7 +523,7 @@ Phaser.TimerEvent.prototype.constructor = Phaser.TimerEvent;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Touch.js.html b/docs/Touch.js.html
index 3c6bfc6b..33e9adef 100644
--- a/docs/Touch.js.html
+++ b/docs/Touch.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -807,7 +821,7 @@ Phaser.Touch.prototype.constructor = Phaser.Touch;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Tween.js.html b/docs/Tween.js.html
index 9b4e0de5..fc64b2b7 100644
--- a/docs/Tween.js.html
+++ b/docs/Tween.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -1015,7 +1029,7 @@ Phaser.Tween.prototype.constructor = Phaser.Tween;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/TweenManager.js.html b/docs/TweenManager.js.html
index 07e47e17..bec02b88 100644
--- a/docs/TweenManager.js.html
+++ b/docs/TweenManager.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -640,7 +654,7 @@ Phaser.TweenManager.prototype.constructor = Phaser.TweenManager;
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/Utils.js.html b/docs/Utils.js.html
index abbfff1f..28d3ece2 100644
--- a/docs/Utils.js.html
+++ b/docs/Utils.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -455,9 +469,9 @@ Phaser.Utils = {
* dir = 1 (left), 2 (right), 3 (both)
* @method Phaser.Utils.pad
* @param {string} str - The target string.
- * @param {number} len - Description.
- * @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).
+ * @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).
* @return {string} The padded string
*/
pad: function (str, len, pad, dir) {
@@ -689,7 +703,7 @@ if (!Array.isArray) {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:36 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/World.js.html b/docs/World.js.html
index dc04dbad..bbb398a7 100644
--- a/docs/World.js.html
+++ b/docs/World.js.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -780,7 +794,7 @@ Object.defineProperty(Phaser.World.prototype, "visible", {
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/classes.list.html b/docs/classes.list.html
index 411a0665..632608d5 100644
--- a/docs/classes.list.html
+++ b/docs/classes.list.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -774,7 +788,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/global.html b/docs/global.html
index 36df3ad4..2f5e07fa 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -405,19 +405,7 @@
+
+ Global
+
+
+
+
@@ -436,9 +450,9 @@
-Phaser 1.1.4
+Phaser 1.1.5
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: 1.1.4 "Kandor" - Released: February 5th 2014
+Version: 1.1.5 "Saldaea" - Released: 12th February 2014
By Richard Davey, Photon Storm
View the Official Website
@@ -450,6 +464,7 @@
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.
Welcome to Phaser
+This 1.1.5 release is released to address issues in 1.1.4 that we didn't want you to have to wait too long for.
As you may know we had planned to release 1.1.4 at the end of 2013. For various reasons this didn't quite happen, but we're happy to announce it's finally out! There have been some dramatic changes internally, and if you make use of either the physics systems or tilemaps then you are going to need to update your code. Hopefully only a little bit, but there have been a number of core API changes which we detail below. There are also a host of new features, the headliners being:
New Physics system. Uses SAT.js internally so physics bodies can now be rectangles, circles or polygons and support rotation.
@@ -464,181 +479,28 @@
As always we offer a heart-felt "Thank you!" to everyone who has encouraged us along the way. To those of you who worked with Phaser during its various incarnations. The number of games being released that were made with Phaser is staggering and we really love to see how you use it! You are our heroes. It's your kind words and enthusiasm that has keeps us going.
Phaser is everything we ever wanted from an HTML5 game framework. It powers all of our client work in build today and remains our single most important product, and we've still only just scratched the surface of what we have planned for it.
+Help Test 1.2
+You'll notice a new 1.2 branch on github. Please help test out 1.2 as much as you can. It features the brand new Pixi 1.5 internally as well as nearly complete integration with p2.js for all physics (dropping ArcadePhysics entirely). New versions are being pushed several times a day, so be sure to update and pull often. Don't expect to just run old games right under it yet, but please do check out the new tests, experiment and poke it around as much as you can - thank you!
Getting Started Guides
We have a new Getting Started Guide which covers all you need to begin developing games with Phaser. From setting up a web server to picking an IDE. If you're new to HTML5 game development, or are coming from another language like AS3, then we recommend starting there.
There is a comprehensive How to Learn Phaser guide on the GameDevTuts+ site which is a great place to learn where to find tutorials, examples and support.
There is also an un-official Getting Started Guide .
Change Log
-Version 1.1.4 - "Kandor" - February 5th 2014
-Significant API changes:
-
-Loader.tileset has been removed as it's no longer required, this was as part of the Tilemap system overhaul.
-TilemapLayers are now created via the Tilemap object itself: map.createLayer(x, y, width, height, tileset, layer, group) and no longer via the GameObjectFactory.
-Tilemap.createFromObjects can now turn a bunch of Tiled objects into Sprites in one single call, and copies across all properties as well.
-Tween.onStartCallback and onCompleteCallback have been removed to avoid confusion. You should use the onStart, onLoop and onComplete events instead.
-Button.forceOut default value has changed from true to false, so Buttons will revert to an Up state (if set) when pressed and released.
-The way the collision process callback works has changed significantly and now works as originally intended.
-The World level quadtree is no longer created, they are now built and ripped down each time you collide a Group, this helps collision accuracy.
-A SAT system has been integrated for Body collision and separation.
-Bodies are no longer added to a world quadtree, so have had all of their quadtree properties removed such as skipQuadtree, quadTreeIndex, etc.
-Body.drag has been removed. Please use the new Body.linearDamping value instead (which is a number value, not a Point object)
-Body.embedded and Body.wasTouching have been removed as they are no longer required.
-Body.customSeparateX/Y have been removed as you should now use Body.customSeparateCallback.
-Body.maxVelocity defaults have been removed from 10,000 to 2000.
-Body.customSeparateCallback allows you to set your own callback when two Bodies need to separate rather than using the built-in method.
-Body.collideCallback allows you to set a callback that is fired whenever the Body is hit on any of its active faces.
-Body.allowCollision has been renamed to Body.checkCollision.
-Body.rebound is a boolean that controls if a body will exchange velocity on collision. Set to false to allow it to be 'pushed' (see new examples).
-Removed Body.deltaAbsX and deltaAbsY as they are no longer used internally.
-Body.screenX and screenY moved to getters, no longer calculated every frame.
-ArcadePhysics now has setBounds and setBoundsToWorld, and you can specify which walls are created or not (left, right, up, down)
-Removed: Debug.renderSpriteTouching, Debug.renderLocalTransformInfo, Debug.renderWorldTransformInfo, Debug.renderSpriteCollision and Debug.dumpLinkedList.
-Body.setSize has been removed. Please use Body.setCircle, setRectangle or setPolygon instead.
-
-New features:
-
-Phaser.Timer is now feature complete and fully documented. You can create Phaser.TimerEvents on a Timer and lots of new examples have been provided.
-Gamepad API support has been added with lots of new examples (thanks Karl Macklin)
-Phaser.Game constructor can now be passed a single object containing all of your game settings + Stage settings. Useful for advanced configurations.
-The width/height given to Phaser.Game can now be percentages, i.e. "100%" will set the width to the maximum window innerWidth.
-Added a stage.fullScreenScaleMode property to determine scaling when fullscreen (thanks oysterCrusher)
-Added support for margin and spacing around a frame in Loader.spritesheet.
-Added Device.vibration to check if the Vibration API is available or not.
-Added Device.trident and Device.tridentVersion for testing IE11.
-Added Device.silk for detecting a Kindle Fire and updated desktop OS check to exclude Kindles (thanks LuckieLordie)
-TilemapLayers now have debug and debugAlpha values, this turns on the drawing of the collision edges (very handy for debugging, as the name implies!)
-Tweens have a new event: onLoop.
-You can now load any binary file via the Loader: game.load.binary(key, url, callback) - the optional callback allows for post-load processing before entering the Cache.
-Group.set will let you deep set a new propery on a single child of the Group.
-Stage.display property added. A direct reference to the root Pixi Stage object (very useful for RenderTexture manipulation)
-Added Ejecta detection to Device (thanks endel)
-Tweens can now work with relative + and - values. You can do: tween(sprite).to( { x: '+400' }) and it will add 400 to the current sprite.x value.
-Buttons now properly use their upFrame if set.
-InputHandler now has snapOffsetX and snapOffsetY properties so your snap grid doesn't have to be 0,0 aligned (thanks srmeier)
-Loader.progressFloat contains the actual non-rounded progress value, where-as Loader.progress contains a rounded value. Use progressFloat if you've > 100 files to load.
-Groups can now be added to other Groups as children via group.add() and group.addAt()
-Groups now have an 'alive' property, which can be useful when iterating through child groups with functions like forEachAlive.
-Added a new Project Template "Full Screen Mobile" which you can find in the resources folder. Contains html / css / layout needed for a deployed Phaser game.
-Body.speed - the current speed of the body.
-Body.angle - the current angle the Body is facing based on its velocity. This is not the same as the Sprite angle that may own the body.
-Body.linearDamping - This now replaces Body.drag and provides for a much smoother damping (friction) experience.
-Body.minBounceVelocity - If a Body has bounce set, this threshold controls if it should rebound or not. Use it to stop 'jittering' on bounds/tiles with super-low velocities.
-QuadTree.populate - you can pass it a Group and it'll automatically insert all of the children ready for inspection.
-Input.setMoveCallback allows you to set a callback that will be fired each time the activePointer receives a DOM move event.
-Math.distancePow(x1,y1,x2,y2,power) returns the distance between two coordinates at the given power.
-Physics.collide now supports the 2nd parameter as an array, for when you want to collide an object against a number of sprites that aren't all in the same Group.
-Physics.overlap now supports the 2nd parameter as an array, for when you want to overlap test an object against a number of sprites that aren't all in the same Group.
-Math.reverseAngle - reverses an angle (in radians).
-Math.normalizeAngle - normalises an angle, now in radians only.
-Math.normalizeLatitude - Normalizes a latitude to the [-90,90] range.
-Math.normalizeLongitude - Normalizes a longitude to the [-180,180] range.
-Phaser.Line added to the geometry classes, with full point on line/segment and intersection tests (see new examples)
-Phaser.CANVAS_PX_ROUND is a boolean. If 'true' the Canvas renderer will Math.floor() all coordinates before drawImage, stopping pixel interpolation. Defaults to false.
-Phaser.CANVAS_CLEAR_RECT is a boolean. If 'true' (the default) it will context.clearRect() every frame. If false this is skipped (useful if you know you don't need it)
-Collision now works between Sprites positioned via sprite.x/y, sprite.body.x/y or sprite.body.velocity.
-If you are tweening a sprite and still want physics collision, set sprite.body.moves = false otherwise it will fight against the tween motion.
-Game.enableStep will enable core game loop stepping. When enabled you must call game.step() directly (perhaps via a DOM button?), very useful for debugging!
-Game.disableStep turns core update loop stepping off.
-Debug.renderPhysicsBody(body, color) is extremely useful for debugging the new physics bodies. Will draw the outline + points in the color given.
-Debug.renderBodyInfo(sprite, x, y, color) will display lots of Sprite body data.
-Sprite.events.onBeginContact will be fired when a Body makes contact with another Body. Once contact is over an onEndContact event will be dispatched.
-
-New Examples:
-
-Physics - Bounce by Patrick OReilly.
-Physics - Bounce with gravity by Patrick OReilly.
-Physics - Bounce accelerator (use the keyboard) by Patrick OReilly.
-Physics - Bounce knock (use the keyboard) by Patrick OReilly.
-Physics - Snake (use the keyboard to control the snake like creature) by Patrick OReilly and Richard Davey.
-Physics - Launcher - Angry Birds style ball launcher demo by Patrick OReilly.
-Physics - Launcher Follow - throw the sprite anywhere in the world by Patrick OReilly.
-Physics - Launcher Follow World - an advanced version of the Launcher Follow example by Patrick OReilly.
-Input - Touch Joystick example showing how to use the clay.io virtual game controller (thanks gabehollombe)
-Games - Matching Pairs by Patrick OReilly.
-Games - Simon Says by Patrick OReilly.
-Games - Wabbits by Patrick OReilly.
-Tweens - Example showing how to use the tween events, onStart, onLoop and onComplete.
-Display - Pixi Render Texture. A Phaser conversion of the Pixi.js Render Texture example.
-Input - 5 new examples showing how to use the Gamepad API (thanks Karl Macklin)
-Animation - Group Creation, showing how to create animations across all Group children in one call.
-Particles - Rain by Jens Anders Bakke.
-Particles - Snow by Jens Anders Bakke.
-Groups - Nested Groups - showing how to embed one Group into another Group.
-Time - Lots of new examples showing how to use the updated Phaser.Timer class.
-
-Updates:
-
-Updated to latest Pixi.js dev branch build (pre 1.4 release)
-When a Sprite is destroyed any active filters are removed at the same time.
-Updated Pixi.js so that removing filters now works correctly without breaking the display list.
-Phaser.Canvas.create updated so it can be given an ID as the 3rd parameter (can also be set via new Game configuration object).
-Updated display/fullscreen example to reflect new full screen change.
-Loads of updates to the TypeScript definitions files - games fully compile now and lots of missing classes added :) (thanks Niondir)
-Removed 'null parent' check from Group constructor. Will parent to game.world only if parent value is undefined.
-The tutorials have now been translated into Spanish - thanks feiss :)
-separateY updated to re-implement the 'riding platforms' special condition (thanks cocoademon)
-SoundManager.onSoundDecode now dispatches the key followed by the sound object, also now dispatched by the Cache when doing an auto-decode on load.
-Switch method of using trimmed sprites to support scaling and rotation (thanks cocoademon)
-Most of the GameObjectFactory functions now have a group parameter, so you can do: game.add.sprite(x, y, frame, frameName, group) rather than defaulting to the World group.
-Group.countLiving and countDead used to return -1 if the Group was empty, but now return 0.
-Text can now be fixedToCamera, updated world/fixed to camera example to show this.
-ArcadePhysics.overlap and collide now recognise TileSprites in the collision checks.
-Lots of documentation fixes in the Tween class.
-Tweens fire an onLoop event if they are set to repeat. onComplete is now only fired for the final repeat (or never if the repeat is infinite)
-Pointer used to un-pause a paused game every time it was clicked/touched (this avoided some rogue browser plugins). Now only happens if Stage.disableVisibilityChange is true.
-Input doesn't set the cursor to default if it's already set to none.
-You can now collide a group against itself. This will check all children against each other, but not themselves (thanks cocoademon)
-RenderTexture.render / renderXY has a new parameter: renderHidden, a boolean which will allow you to render Sprites even if their visible is set to false.
-Added in prototype.constructor definitions to every class (thanks darkoverlordofdata)
-Group.destroy has a new parameter: destroyChildren (boolean) which will optionally call the destroy method of all Group children.
-Button.clearFrames method has been added.
-Device.quirksMode is a boolean that informs you if the page is in strict (false) or quirks (true) mode.
-Canvas.getOffset now runs a strict/quirks check and uses document.documentElement when calculating scrollTop and scrollLeft to avoid Chrome console warnings.
-The Time class now has its own Phaser.Timer which you can access through game.time.events. See the new Timer examples to show how to use them.
-Added StateManager.getCurrentState to return the currently running State object (thanks Niondir)
-Removed the console.log redirect from Utils as it was messing with Firefox.
-Body.acceleration is now much smoother and less eratic at high speeds.
-Removed ArcadePhysics binding to the QuadTree, so it can now be used independantly of the physics system.
-Removed ArcadePhysics.preUpdate and postUpdate as neither are needed any more.
-Body.bottom and Body.right are no longer rounded, so will give accurate sub-pixel values.
-Fixed lots of documentation in the Emitter class.
-The delta timer value used for physics calculations has had its cap limit modified from 1.0 to 0.05 in line with the core updates.
-Phaser.Math.min enhanced so you can now pass in either an array of numbers or lots of numbers as parameters to get the lowest.
-Phaser.Math.max added as the opposite of Math.min.
-Phaser.Math.minProperty and maxProperty added. Like Math.min/max but can be given a property an an array or list of objects to inspect.
-Added 'full' paramter to Body.reset, allowing you to control if motion or all data is reset or not.
-Exposed Group.pivot and Sprite.pivot to allow you to directly set the pivot points for rotation.
-Swapped to using the native and faster Array.isArray check.
-Added callback context parameter to Tween.onUpdateCallback(callback, context) to avoid having to bind or create anonymous functions.
-Updated TweenManager.removeAll so it flags all tweens as pendingDelete rather than nuking the array, to avoid tween callback array size errors (thanks DarkDev)
-
+Version 1.1.5 - "Saldaea" - 12th February 2014
Bug Fixes:
-Cache.getImageKeys returned __missing in the array, now excluded.
-Fixed Group.scale so you can now scale a Group directly.
-Removed World.scale as it was preventing Group.scale from working - you can still scale the world, but you'll need to factor in Input changes yourself.
-Moved 'dirty' flag for Tilemap to a per-layer flag. Fixes #242
-Group.length now returns the number of children in the Group regardless of their exists/alive state, or 0 if the Group has no children.
-Switch Camera.setBoundsToWorld to match world.bounds instead of world (thanks cocoademon)
-Fixed an issue where passing null as the Group parent wouldn't set it to game.world as it should have (thanks tito100)
-Fixed Pixi bug (#425) incorrect width property for multi-line BitmapText (thanks jcd-as)
-Tween.onStart is now called when the tween starts AFTER the delay value, if given (thanks stevenbouma)
-Sprites that are fixedToCamera can now be input dragged regardless of world position (thanks RafaelOliveira)
-RenderTexture now displays correctly in Canvas games.
-Canvas.addToDOM is now more robust when applying the overflowHidden style.
-Fixed Pixi.StripShader which should stop the weird TileSprite GPU issues some were reporting (thanks GoodboyDigital)
-Patched desyrel.xml so it doesn't contain any zero width/height characters, as they broke Firefox 25.
-Cache.addSound now implements a locked attribute (thanks haden)
-Sound now checks for CocoonJS during playback to avoid readyState clash (thanks haden)
-Buttons now clear previously set frames correctly if you call setFrames.
-Sounds will now loop correctly if they are paused and resumed (thanks haden)
-InputHandler.checkBoundsRect and checkBoundsSprite now take into account if the Sprite is fixedToCamera or not.
-Removed the frame property from TileSprites as it cannot use them, it tiles the whole image only, not just a section of it.
-Fixed WebGLRenderer updateGraphics bug (thanks theadam)
-Removed duplicate Timer.create line (thanks hstolte)
-Fixed issue with the camera being slightly out of sync with 'fixedToCamera' sprites.
-1px camera jitter issue fixed where map is same size, or smaller than the game size.
+Explicitly paused Timer continues if you un-focus and focus the browser window (thanks georgiee)
+Added TimerEvent.pendingDelete and checks in Timer.update, so that removing an event in a callback no longer throws an exception (thanks georgiee)
+Fixed TypeScript defs on lines 1741-1748 (thanks wombatbuddy)
+Added SAT.js to TypeScript definition. Now compiles properly.
+Added missing Line.js to the Grunt file.
+Tilemap#paste diffX and diffY equations changed, fixed issue #393 (thanks brejep)
+Added missing return value in Body.hitLeft and hitRight, fixes issue #398 (thanks ram64).
+Fixed easing tween example case. Issue #379 (thanks wesleywerner)
+Removed SAT.js UMD wrapped, fixes issue #361 (thanks luizbills)
+Removed inContact check from Body.separate.
+See the full Change Log for all the 1.1.4 updates and API changes (as there were a lot of them!)
You can view the Change Log for all previous versions at https://github.com/photonstorm/phaser/changelog.md
How to Build
We provide a fully compiled version of Phaser in the build directory, in both plain and minified formats.
@@ -653,9 +515,9 @@
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/1.1.3/phaser.min.js
+http://cdnjs.cloudflare.com/ajax/libs/phaser/1.1.4/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/1.1.3/phaser.min.js
+//cdnjs.cloudflare.com/ajax/libs/phaser/1.1.4/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.
For developing with Phaser you can use either a plain-vanilla JavaScript approach or TypeScript using the provided TypeScript definitions file. We made no assumptions about how you like to code your games, and were careful not to impose any form of class/inheritance/structure upon you.
@@ -705,13 +567,9 @@ Sprites also have full Input support: click them, touch them, drag them around,
Road Map
Here is what's on our road map for the coming months:
-Version 1.1.5 ("Saldaea")
-
-A fast turn-around point release that will focus on addressing any bugs that occured as a result of the large changes that took place in 1.1.4.
-
Version 1.2 ("Shienar")
-Update to Pixi 1.4 - this newly released build has lots of internal changes and new features we want to take advantage of.
+Update to Pixi 1.5 - this newly released build has lots of internal changes and new features we want to take advantage of.
Version 1.3 ("Tarabon")
@@ -778,7 +636,7 @@ Sprites also have full Input support: click them, touch them, drag them around,
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/namespaces.list.html b/docs/namespaces.list.html
index f5a3ebbe..473458f5 100644
--- a/docs/namespaces.list.html
+++ b/docs/namespaces.list.html
@@ -398,6 +398,20 @@
+
+ Global
+
+
+
+
@@ -774,7 +788,7 @@
Documentation generated by JSDoc 3.3.0-dev
- on Wed Feb 05 2014 06:28:24 GMT-0000 (GMT) using the DocStrap template .
+ on Wed Feb 12 2014 15:23:37 GMT-0000 (GMT) using the DocStrap template .
diff --git a/docs/old_RenderTexture.js.html b/docs/old_RenderTexture.js.html
new file mode 100644
index 00000000..97a6b9fb
--- /dev/null
+++ b/docs/old_RenderTexture.js.html
@@ -0,0 +1,840 @@
+
+
+
+
+
+ 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
new file mode 100644
index 00000000..5ae38744
--- /dev/null
+++ b/docs/old_Sprite.js.html
@@ -0,0 +1,1724 @@
+
+
+
+
+
+ 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/examples/_site/js/phaser-examples.js b/examples/_site/js/phaser-examples.js
index d82363e0..b2b7de44 100644
--- a/examples/_site/js/phaser-examples.js
+++ b/examples/_site/js/phaser-examples.js
@@ -95,7 +95,7 @@ $(document).ready(function(){
.done(function(data) {
- if (data.version !== '1.1.4')
+ if (data.version !== '1.1.5')
{
$("#upgrade").append(data.version);
$("#upgrade").css('display', 'inline-block');
diff --git a/examples/_site/js/phaser-viewer.js b/examples/_site/js/phaser-viewer.js
index bc57fe0a..41ded9c0 100644
--- a/examples/_site/js/phaser-viewer.js
+++ b/examples/_site/js/phaser-viewer.js
@@ -58,7 +58,7 @@ $(document).ready(function(){
.done(function(data) {
- if (data.version !== '1.1.4')
+ if (data.version !== '1.1.5')
{
$("#upgrade").append(data.version);
$("#upgrade").css('display', 'inline-block');
diff --git a/examples/_site/view_full.html b/examples/_site/view_full.html
index 6e1a2d57..9b179e50 100644
--- a/examples/_site/view_full.html
+++ b/examples/_site/view_full.html
@@ -163,7 +163,7 @@