app/scripts/characters/ghost.js
/**
   * Updates the css position, hides if there is a stutter, and animates the spritesheet
   * @param {number} interp - The animation accuracy as a percentage
   */
Updates the css position, hides if there is a stutter, and animates the spritesheet
@param {number} interp - The animation accuracy as a percentage
Updates the css position hides if there is a stutter and animates the spritesheet @param { number } interp - The animation accuracy as a percentage
draw(interp) {
    const newTop = this.characterUtil.calculateNewDrawValue(
      interp, 'top', this.oldPosition, this.position,
    );
    const newLeft = this.characterUtil.calculateNewDrawValue(
      interp, 'left', this.oldPosition, this.position,
    );
    this.animationTarget.style.top = `${newTop}px`;
    this.animationTarget.style.left = `${newLeft}px`;
    this.animationTarget.style.visibility = this.display
      ? this.characterUtil.checkForStutter(this.position, this.oldPosition)
      : 'hidden';
    const updatedProperties = this.characterUtil.advanceSpriteSheet(this);
    this.msSinceLastSprite = updatedProperties.msSinceLastSprite;
    this.animationTarget = updatedProperties.animationTarget;
    this.backgroundOffsetPixels = updatedProperties.backgroundOffsetPixels;
  }
draw ( interp ) { const newTop = this . characterUtil . calculateNewDrawValue ( interp , 'top' , this . oldPosition , this . position , ) ; const newLeft = this . characterUtil . calculateNewDrawValue ( interp , 'left' , this . oldPosition , this . position , ) ; this . animationTarget . style . top = ` ${ newTop } ` ; this . animationTarget . style . left = ` ${ newLeft } ` ; this . animationTarget . style . visibility = this . display ? this . characterUtil . checkForStutter ( this . position , this . oldPosition ) : 'hidden' ; const updatedProperties = this . characterUtil . advanceSpriteSheet ( this ) ; this . msSinceLastSprite = updatedProperties . msSinceLastSprite ; this . animationTarget = updatedProperties . animationTarget ; this . backgroundOffsetPixels = updatedProperties . backgroundOffsetPixels ; }
Updates the css position, hides if there is a stutter, and animates the spritesheet
 @param {number} interp - The animation accuracy as a percentage
Updates the css position hides if there is a stutter and animates the spritesheet @param { number } interp - The animation accuracy as a percentage