summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorJustin Worthe <justin@worthe-it.co.za>2019-05-21 13:27:25 +0200
committerJustin Worthe <justin@worthe-it.co.za>2019-05-21 13:27:25 +0200
commit63da94f7f1b25eddeb9ffd379f37c1a32e750fdb (patch)
tree83bd2670e948b16b37890e3ee9785f3672e0d32d /src/game
parentb93a9c643485c720a0711ddaf90872b7c6f006c8 (diff)
More robust game logic and reasoning
Diffstat (limited to 'src/game')
-rw-r--r--src/game/player.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/player.rs b/src/game/player.rs
index 3a9d36c..e083a7a 100644
--- a/src/game/player.rs
+++ b/src/game/player.rs
@@ -60,7 +60,10 @@ impl Player {
}
}
}
- // TODO: Cycle to next worm
+
+ pub fn next_active_worm(&mut self) {
+ self.active_worm = (self.active_worm + 1).checked_rem(self.worms.len()).unwrap_or(0);
+ }
}
#[cfg(test)]