mirror of
https://github.com/wassname/phaser.git
synced 2026-07-05 17:30:19 +08:00
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:
@@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user