summaryrefslogtreecommitdiff
path: root/src/game.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.rs')
-rw-r--r--src/game.rs19
1 files changed, 6 insertions, 13 deletions
diff --git a/src/game.rs b/src/game.rs
index dbf02e5..c9f9b56 100644
--- a/src/game.rs
+++ b/src/game.rs
@@ -116,8 +116,6 @@ impl GameBoard {
}
pub fn update(&mut self, json: json::State) {
- // Much of this becomes easier if this issue is implemented: https://github.com/EntelectChallenge/2019-Worms/issues/44
-
for w in &json.my_player.worms {
if let Some(worm) = self.players[0].find_worm_mut(w.id) {
worm.health = w.health;
@@ -129,17 +127,7 @@ impl GameBoard {
if let Some(worm) = self.players[1].find_worm_mut(w.id) {
worm.health = w.health;
worm.position = Point2d::new(w.position.x, w.position.y);
- // TODO: How to update opponent worm bombs? One idea:
- // start the update by passing in the move that I did,
- // and doing a simulation where the opponent did
- // nothing. Then, looking at the points that the
- // opponent actually got, determine if they did a
- // simple walk / dig / shoot or if they hit multiple
- // worms, hit worms with bomb levels of damage, or
- // destroyed a dirt not next to them. I can further
- // tell if they used a select (number of selects), and
- // who their new active worm is, and if that worm
- // could have bombed.
+ // TODO: Update number of bombs / snowballs based on previous move
}
}
self.players[0].moves_score = json.my_player.score - json.my_player.health_score();
@@ -186,10 +174,15 @@ impl GameBoard {
pub fn simulate(&mut self, moves: [Command; 2]) {
let actions = [moves[0].action, moves[1].action];
+ // TODO: move lava in
+ // TODO: hurt worms that are standing on lava
+ // TODO: tick frozen timers
+
self.simulate_select(moves);
self.simulate_moves(actions);
self.simulate_digs(actions);
self.simulate_bombs(actions);
+ // TODO: simulalte snowballs (question order on forums?)
self.simulate_shoots(actions);
for player in &mut self.players {