code: function setCurrentAnimation(name, resetAnim, _preserve_dt) {
           if (this.anim[name]) {
             this.current.name = name;
             this.current.length = this.anim[this.current.name].length;
  
             if (typeof resetAnim === "string") {
               this.resetAnim = this.setCurrentAnimation.bind(this, resetAnim, null, true);
             } else if (typeof resetAnim === "function") {
               this.resetAnim = resetAnim;
             } else {
               this.resetAnim = undefined;
             }
  
             this.setAnimationFrame(this.current.idx);
  
             if (!_preserve_dt) {
               this.dt = 0;
             }
           } else {
             throw new Error("animation id '" + name + "' not defined");
           }
  
           return this;
         }
docs: set the current animation
  this will always change the animation & set the frame to zero
  @name setCurrentAnimation
  @memberOf me.Sprite.prototype
  @function
  @param {String} name animation id
  @param {String|Function} [onComplete] animation id to switch to when complete, or callback
  @return {me.Sprite} Reference to this object for method chaining
  @example
  // set "walk" animation
  this.setCurrentAnimation("walk");
  
  // set "walk" animation if it is not the current animation
  if (this.isCurrentAnimation("walk")) {
  this.setCurrentAnimation("walk");
  }
  
  // set "eat" animation, and switch to "walk" when complete
  this.setCurrentAnimation("eat", "walk");
  
  // set "die" animation, and remove the object when finished
  this.setCurrentAnimation("die", (function () {
  me.game.world.removeChild(this);
  return false; // do not reset to first frame
  }).bind(this));
  
  // set "attack" animation, and pause for a short duration
  this.setCurrentAnimation("die", (function () {
  this.animationpause = true;
  
  // back to "standing" animation after 1 second
  setTimeout(function () {
  this.setCurrentAnimation("standing");
  }, 1000);
  
  return false; // do not reset to first frame
  }).bind(this));