Display winning message
This commit is contained in:
parent
d6a8aead1d
commit
818b90703a
1 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,14 @@ pub const Game = struct {
|
||||||
// draw the net
|
// draw the net
|
||||||
w4.DRAW_COLORS.* = 0x42;
|
w4.DRAW_COLORS.* = 0x42;
|
||||||
w4.rect(78, 100, 4, 61);
|
w4.rect(78, 100, 4, 61);
|
||||||
|
// Did someone win?
|
||||||
|
if (self.ball.y >= 160 - ball.ball_height) {
|
||||||
|
if (self.ball.x >= 80) {
|
||||||
|
w4.text("Scored!", 8, 64);
|
||||||
|
} else {
|
||||||
|
w4.text("Scored!", 160 - 56 - 8, 64);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn reset(self: *Game) void {
|
pub fn reset(self: *Game) void {
|
||||||
self.brothers[0].reset(.left);
|
self.brothers[0].reset(.left);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue