public void fadeIn(double duration) {
    // Fade in the main sprite and blob shadow.
    SKAction fadeAction = SKAction.fadeIn(duration);

    setAlpha(0.0);
    runAction(fadeAction);

    shadowBlob.setAlpha(0.0);
    shadowBlob.runAction(fadeAction);
  }
  private void animationHasCompleted(APAAnimationState animationState) {
    if (dying) {
      animated = false;
      shadowBlob.runAction(SKAction.fadeOut(1.5));
    }

    animationDidComplete(animationState);

    if (attacking) {
      attacking = false;
    }

    activeAnimationKey = null;
  }