1
0
Fork 0

Fixed game reset

This commit is contained in:
Julien Dessaux 2022-08-29 21:01:02 +02:00
parent 2c027e787a
commit a9378b5785
Signed by: adyxax
GPG key ID: F92E51B86E07177E

View file

@ -33,12 +33,14 @@ pub const Game = struct {
}
pub fn reset(self: *Game, side: brothers.Side) void {
self.side = side;
self.brothers[0].reset(.left);
self.brothers[1].reset(.right);
self.resetRound();
}
pub fn resetRound(self: *Game) void {
self.ball.reset(.left);
self.brothers[0].reset(.left);
self.brothers[1].reset(.right);
self.brothers[0].resetRound();
self.brothers[1].resetRound();
}
pub fn step(self: *Game) void {
self.ball.step();