Merge pull request #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.
This commit is contained in:
Richard Davey
2013-09-30 03:16:33 -07:00
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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)
@@ -401,4 +401,4 @@ Phaser.Animation.generateFrameNames = function (prefix, min, max, suffix, zeroPa
return output;
}
}
+1 -1
View File
@@ -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
{