"In the SpaceInvadersGame class's removeDeadBullets() method, you need to remove all projectiles from the playerBullets list if the projectile is "dead" OR the sum of the y coordinate and the projectile's height field is less than zero."
private void removeDeadBullets() {
ListIterator<Bullet> it = enemyBullets.listIterator();
while (it.hasNext()) {
Bullet bullet = it.next();
if ((!bullet.isAlive) || (bullet.y >= (HEIGHT -1)) || ((bullet.height + bullet.y) < 0)) {
it.remove();
}
}
}
Why does the validation not satisfy? I can't find my error.
Under discussion
Comments
- Popular
- New
- Old
You must be signed in to leave a comment
This page doesn't have any comments yet