From 432a4c76cf6168df63bf3642d868470b17ec5c42 Mon Sep 17 00:00:00 2001 From: stiti Date: Sun, 10 Dec 2023 18:38:56 +0100 Subject: [PATCH] Correction de bugs --- .vscode/settings.json | 6 ++++++ include/main.h | 1 + src/main.c | 24 +++++++++++++++++------- src/menu.c | 2 +- 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0afafe1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.associations": { + "timer.h": "c", + "limits": "c" + } +} \ No newline at end of file diff --git a/include/main.h b/include/main.h index ef730be..6b9ced4 100644 --- a/include/main.h +++ b/include/main.h @@ -2,5 +2,6 @@ #define MAIN_H int main(void); +int menus(void); #endif /*MAIN_H*/ diff --git a/src/main.c b/src/main.c index 0c40d77..808eb8e 100644 --- a/src/main.c +++ b/src/main.c @@ -4,14 +4,12 @@ #include "../include/jeu.h" #include "../include/menu.h" -int main(void) { + + + +int menus(void) { int choixMenuPrincipal = 0; int choixModesDeJeu = 0; - InitialiserGraphique(); - CreerFenetre(0, 0, 1200, 1000); - ChoisirTitreFenetre("Snake By Moncef & Marco"); - - while (1) { if (choixMenuPrincipal == 0) { afficherMenuPrincipal(); @@ -40,5 +38,17 @@ int main(void) { return EXIT_SUCCESS; } } - return EXIT_SUCCESS; } + + +int main(void){ + int choixMenuPrincipal = 0; + int choixModesDeJeu = 0; + InitialiserGraphique(); + CreerFenetre(0, 0, 1200, 1000); + ChoisirTitreFenetre("Snake By Moncef & Marco"); + + menus(); + return EXIT_SUCCESS; + +} \ No newline at end of file diff --git a/src/menu.c b/src/menu.c index 050c730..f2cfb95 100644 --- a/src/menu.c +++ b/src/menu.c @@ -50,7 +50,7 @@ int attendreChoixGameOver() { /* Vérifie si le bouton "Menu Principal" est cliqué */ if (x >= 379 && x <= 830.7 && y >= 530.3 && y <= 670.1) { EffacerEcran(CouleurParNom("white")); - main(); /* Renvoie vers le menu principal" */ + menus(); /* Renvoie vers le menu principal" */ } }