Fix missing check

This commit is contained in:
2025-05-20 14:24:41 +02:00
parent f16b505965
commit 112139bafd
3 changed files with 12 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
# Jeu Snake 2025
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README.md)
[![fr](https://img.shields.io/badge/lang-fr-green.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README-fr.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp4/README.md)
[![fr](https://img.shields.io/badge/lang-fr-green.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp4/README-fr.md)
Ce projet est un jeu snake basé sur une grille utilisant la bibliothèque graphique MLV. La grille représente un plateau de jeu avec des murs, des espaces vides, des fruits et un serpent. Le programme affiche la grille dans une fenêtre graphique et attend une interaction de l'utilisateur.

View File

@@ -1,6 +1,6 @@
# Snake 2025 Game
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README.md)
[![fr](https://img.shields.io/badge/lang-fr-green.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README-fr.md)
[![en](https://img.shields.io/badge/lang-en-red.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp4/README.md)
[![fr](https://img.shields.io/badge/lang-fr-green.svg)](https://git.esiee.fr/frequela/snake2025/-/blob/tp4/README-fr.md)
This project is a simple grid-based snake game using the MLV graphics library. The grid represents a game board with walls, empty spaces, fruits, and a snake. The program displays the grid in a graphical window and waits for user interaction.

12
game.c
View File

@@ -304,10 +304,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;