diff options
author | Julien Dessaux | 2022-09-27 20:21:08 +0200 |
---|---|---|
committer | Julien Dessaux | 2022-09-27 20:21:08 +0200 |
commit | 818b90703a558dc2d7e2bb3d3e2e2f7ca7d341fb (patch) | |
tree | b45dc25e7597f8e11f0f7a0e130fcc0b927081c5 /src | |
parent | Display scores (diff) | |
download | grenade-brothers-818b90703a558dc2d7e2bb3d3e2e2f7ca7d341fb.tar.gz grenade-brothers-818b90703a558dc2d7e2bb3d3e2e2f7ca7d341fb.tar.bz2 grenade-brothers-818b90703a558dc2d7e2bb3d3e2e2f7ca7d341fb.zip |
Display winning message
Diffstat (limited to 'src')
-rw-r--r-- | src/game.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game.zig b/src/game.zig index d0395a0..9597a83 100644 --- a/src/game.zig +++ b/src/game.zig @@ -18,6 +18,14 @@ pub const Game = struct { // draw the net w4.DRAW_COLORS.* = 0x42; 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 { self.brothers[0].reset(.left); |