We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29dbbca commit 80e80ddCopy full SHA for 80e80dd
1 file changed
src/animation/Animation.js
@@ -208,7 +208,7 @@ Phaser.Animation.prototype = {
208
{
209
if (this.looped)
210
211
- this._frameIndex = this._frameIndex - this._frames.length;
+ this._frameIndex = this._frameIndex %= this._frames.length;
212
this.currentFrame = this._frameData.getFrame(this._frames[this._frameIndex]);
213
this._parent.setTexture(PIXI.TextureCache[this.currentFrame.uuid]);
214
this._parent.events.onAnimationLoop.dispatch(this._parent, this);
0 commit comments