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); } } }
protected void tickShooting() { cleanProjectiles(); Player player = game.getPlayer(); for (Projectile p : projectiles) { if (p.getCollisionBox().intersects(player.getCollisionBox())) { p.remove(); player.damage(p.getDamage()); } } }