diff --git a/src/animation/Animation.js b/src/animation/Animation.js index 9aaf5c1de..7ed8227cc 100644 --- a/src/animation/Animation.js +++ b/src/animation/Animation.js @@ -252,6 +252,19 @@ Phaser.Animation.prototype = { this.reversed = !this.reversed; }, + /** + * Reverses the animation direction for the current/next animation only + * Once the onComplete event is called this method will be called again and revert + * the reversed state. + * + * @method Phaser.Animation#reverseOnce + * */ + reverseOnce: function () { + this.reverse(); + + this.onComplete.addOnce(this.reverse.bind(this)) + }, + /** * Sets this animations playback to a given frame with the given ID. *