From d3742d73eaa4aa4e8e2b1febc60680eea4bb1c51 Mon Sep 17 00:00:00 2001 From: Alex Frequelin Date: Tue, 20 May 2025 14:28:08 +0200 Subject: [PATCH] Fixed missing check --- game.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/game.c b/game.c index 64fc881..b585be9 100644 --- a/game.c +++ b/game.c @@ -144,10 +144,14 @@ int main(int argc, char *argv[]) if (result == WALL || result == SNAKE) { - MLV_draw_text( - width / 2 - 75, height / 2, - "Game Over! You hit something.", - MLV_COLOR_RED); + if (result == WALL) + { + MLV_draw_text(width / 2 - 75, height / 2, "Game Over! You hit a wall.", MLV_COLOR_RED); + } + else if (result == SNAKE) + { + MLV_draw_text(width / 2 - 75, height / 2, "Game Over! You hit yourself.", MLV_COLOR_RED); + } MLV_actualise_window(); MLV_wait_seconds(3); break;