diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-08-06 10:25:06 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-08-06 10:25:06 +0200 |
commit | 90e93249a57ac9347440c09424383bd43e497135 (patch) | |
tree | 22b86f592e1230870db83e9cd2b082d5a5febf9c /src/game.rs | |
parent | 8da292fa587a06deabb377af18498f9cec10c79d (diff) |
New statefile changes
Diffstat (limited to 'src/game.rs')
-rw-r--r-- | src/game.rs | 19 |
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 { |