示例#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());
      }
    }
  }