Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b23fd11f2f |
@@ -1,6 +1,6 @@
|
||||
# Jeu Snake 2025
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README-fr.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp5/README.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp5/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.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Snake 2025 Game
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp2/README-fr.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp5/README.md)
|
||||
[](https://git.esiee.fr/frequela/snake2025/-/blob/tp5/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
12
game.c
@@ -146,10 +146,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;
|
||||
|
||||
Reference in New Issue
Block a user