Skip to content

Commit b0a9c64

Browse files
committed
Merge pull request phaserjs#76 from XekeDeath/dev
Fix for particles emitting in the wrong area when using emitter.width/height. And small change to make animation looping more robust.
2 parents 31bbf05 + 62b5aa9 commit b0a9c64

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/animation/Animation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ Phaser.Animation.prototype = {
223223
{
224224
if (this.looped)
225225
{
226-
this._frameIndex = this._frameIndex - this._frames.length;
226+
this._frameIndex %= this._frames.length;
227227
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
228228

229229
if (this.currentFrame)
@@ -401,4 +401,4 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
401401

402402
return output;
403403

404-
}
404+
}

src/particles/arcade/Emitter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Phaser.Particles.Arcade.Emitter.prototype.emitParticle = function () {
358358

359359
if (this.width > 1 || this.height > 1)
360360
{
361-
particle.reset(this.emiteX - this.game.rnd.integerInRange(this.left, this.right), this.emiteY - this.game.rnd.integerInRange(this.top, this.bottom));
361+
particle.reset(this.game.rnd.integerInRange(this.left, this.right), this.game.rnd.integerInRange(this.top, this.bottom));
362362
}
363363
else
364364
{

0 commit comments

Comments
 (0)