summaryrefslogtreecommitdiff
path: root/src/game/player.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/player.rs')
-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)]