public void tick() {
    if ((this.runOnTick) && (isVisible()))
    {
      ImageComponent[] arrayOfImageComponent = getImageComponents();
      int i = 0; int j = 0;
      for (int k = 0; k < arrayOfImageComponent.length; k++)
      {
        if (!(arrayOfImageComponent[k] instanceof AnimationComponent))
          continue;
        i++;
        if (!((AnimationComponent)arrayOfImageComponent[k]).nextImage()) {
          j++;
        }
      }
      if ((j == i) && (i != 0))
      {
        getEnvironment().removeObject(this);
      }
    }
  }