1
0
Fork 0

Change who serves on each round

This commit is contained in:
Julien Dessaux 2022-10-02 20:07:05 +02:00
parent 2f76bca8dc
commit d43dbfea61
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -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();
}