diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-07-12 21:53:46 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-07-12 21:53:46 +0200 |
commit | f4c4a2953c20a7083c4671057d6f8464f20a4c10 (patch) | |
tree | f3a58dbabefc6289fc47695d688e890539e839d3 /src/game.rs | |
parent | 627ddc31b34ceb283ed062be5ef09d1ca9d40378 (diff) |
Had bombs destroy health packs
Diffstat (limited to 'src/game.rs')
-rw-r--r-- | src/game.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/game.rs b/src/game.rs index 2158b8b..2a6aebb 100644 --- a/src/game.rs +++ b/src/game.rs @@ -319,11 +319,8 @@ impl GameBoard { fn simulate_bombs(&mut self, actions: [Action; 2]) { // NB: Damage radius has the cell distance rounded UP, throwing range has the cell distance rounded DOWN - // TODO: Destroy health packs - let map_clone = self.map.clone(); - // TODO: iter, filter_map, filter, filter_map... flatten this block down a smidge. for player_index in 0..actions.len() { if let Action::Bomb(p) = actions[player_index] { if self.map.at(p).is_some() { @@ -340,6 +337,7 @@ impl GameBoard { self.map.clear(target); self.players[player_index].moves_score += DIG_SCORE; } + self.powerups.retain(|powerup| powerup.position != target); let target_own_worm: Option<&mut Worm> = self.players[player_index] .worms |