Esempio n. 1
0
 private void clear() {
   for (int i = 0; i < level.getProjectiles().size(); i++) {
     Projectile p = level.getProjectiles().get(i);
     if (p.isRemoved()) {
       level.getProjectiles().remove(i);
     }
   }
 }
Esempio n. 2
0
File: AI.java Progetto: ABB1203/Kack
  protected void tickShooting() {
    cleanProjectiles();

    Player player = game.getPlayer();

    for (Projectile p : projectiles) {
      if (p.getCollisionBox().intersects(player.getCollisionBox())) {
        p.remove();
        player.damage(p.getDamage());
      }
    }
  }