Skip to content

Commit

Permalink
Merge branch 'main' of github.com:DanieleMerighi/OOP23-bombardero
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaVentu03 committed Jul 5, 2024
2 parents 4be8c0c + 23a61fe commit 04fff02
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public BasicBombarderoGameManager(
* <ul>
* <li>The map
* <li>The main character
* <li>The enemies
* <li>The bombs
* <li>The flames
* <li>The enemies
* </ul>
* The argument passed can be passed to the synchronous entities
* to synchronize them to the game's time.
Expand Down Expand Up @@ -106,6 +106,18 @@ public void updateGame(final long elapsed) {
ce.checkFlameAndPowerUpCollision(enemy, this.getGameMap());
}
});
if (!boombs.isEmpty()) {
boombs.entrySet().forEach(entry -> entry.getKey().update());
placeBombExplosion();
}
if (!flames.isEmpty()) {
flames.forEach(f -> f.update(elapsed));
List.copyOf(flames)
.stream()
.filter(f -> f.isExpired())
.peek(f -> flames.remove(f))
.forEach(f -> map.removeFlame(f.getPos()));
}
}

private void addCharacterBombsToMap(final Character character) {
Expand Down

0 comments on commit 04fff02

Please sign in to comment.