From d43dbfea61c230498023df8fe5350b67db746cdc Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Sun, 2 Oct 2022 20:07:05 +0200 Subject: Change who serves on each round --- src/game.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game.zig b/src/game.zig index 9b8086d..ce98eef 100644 --- a/src/game.zig +++ b/src/game.zig @@ -33,7 +33,11 @@ pub const Game = struct { self.resetRound(); } pub fn resetRound(self: *Game) void { - self.ball.resetRound(.left); + if ((self.brothers[0].score + self.brothers[1].score) % 2 == 0) { + self.ball.resetRound(.left); + } else { + self.ball.resetRound(.right); + } self.brothers[0].resetRound(); self.brothers[1].resetRound(); } -- cgit v1.2.3