예제 #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);
     }
   }
 }
예제 #2
0
파일: AI.java 프로젝트: 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());
      }
    }
  }