diff options
author | Justin Worthe <justin@worthe-it.co.za> | 2019-05-21 13:27:25 +0200 |
---|---|---|
committer | Justin Worthe <justin@worthe-it.co.za> | 2019-05-21 13:27:25 +0200 |
commit | 63da94f7f1b25eddeb9ffd379f37c1a32e750fdb (patch) | |
tree | 83bd2670e948b16b37890e3ee9785f3672e0d32d /src/game | |
parent | b93a9c643485c720a0711ddaf90872b7c6f006c8 (diff) |
More robust game logic and reasoning
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/player.rs | 5 |
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)] |