Exemple #1
0
  @Override
  public void update(double t) {

    { // UPDATE TOWERS
      for (Tile[] tiles : getTiles())
        for (Tile tile : tiles) if (tile.hasTower()) tile.getTower().update(t);
    }

    { // UPDATE BULLETS
      final Iterator<Bullet> it = getBullets().iterator();

      while (it.hasNext()) {

        final Bullet b = it.next();

        if (b.update(t)) it.remove();
      }
    }

    { // UPDATE MOBS
      final Iterator<Mob> it = getMobs().iterator();

      while (it.hasNext()) {

        final Mob m = it.next();

        m.update(t);

        if (m.shouldBeRemoved()) {
          m.onRemove(getGame());
          it.remove();
        }
      }
    }
  }