From 29dbbcae52f1f044102aeedf7c829c7bb494316d Mon Sep 17 00:00:00 2001 From: XekeDeath Date: Mon, 30 Sep 2013 13:01:51 +1000 Subject: [PATCH 1/3] Fix Particle Emitters when using Emitter width/height --- src/particles/arcade/Emitter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/particles/arcade/Emitter.js b/src/particles/arcade/Emitter.js index d8d886f3..c3fb007c 100644 --- a/src/particles/arcade/Emitter.js +++ b/src/particles/arcade/Emitter.js @@ -358,7 +358,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () { if (this.width > 1 || this.height > 1) { - particle.reset(this.emiteX - this.game.rnd.integerInRange(this.left, this.right), this.emiteY - this.game.rnd.integerInRange(this.top, this.bottom)); + particle.reset(this.game.rnd.integerInRange(this.left, this.right), this.game.rnd.integerInRange(this.top, this.bottom)); } else { From 80e80ddccb640ea5ffc3a2826eb57b4c26ab83e4 Mon Sep 17 00:00:00 2001 From: XekeDeath Date: Mon, 30 Sep 2013 13:04:22 +1000 Subject: [PATCH 2/3] Make animation looping robust when skipping frames. --- src/animation/Animation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/animation/Animation.js b/src/animation/Animation.js index a5e8d271..da486f01 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -208,7 +208,7 @@ Phaser.Animation.prototype = { { if (this.looped) { - this._frameIndex = this._frameIndex - this._frames.length; + this._frameIndex = this._frameIndex %= this._frames.length; this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]); this._parent.events.onAnimationLoop.dispatch(this._parent, this); From 62b5aa9bd996182e65d89b15bd6101248eb705c8 Mon Sep 17 00:00:00 2001 From: XekeDeath Date: Mon, 30 Sep 2013 13:28:17 +1000 Subject: [PATCH 3/3] Removed redundant assignment. --- src/animation/Animation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/animation/Animation.js b/src/animation/Animation.js index e59b3dff..90f456cf 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -223,7 +223,7 @@ Phaser.Animation.prototype = { { if (this.looped) { - this._frameIndex = this._frameIndex %= this._frames.length; + this._frameIndex %= this._frames.length; this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]); if (this.currentFrame)