diff --git a/JEUX_SERPENT/Jeux b/JEUX_SERPENT/Jeux index 69f9f7d..ce0df46 100755 Binary files a/JEUX_SERPENT/Jeux and b/JEUX_SERPENT/Jeux differ diff --git a/JEUX_SERPENT/fonction.h b/JEUX_SERPENT/fonction.h index eff296e..c57c78d 100644 --- a/JEUX_SERPENT/fonction.h +++ b/JEUX_SERPENT/fonction.h @@ -3,7 +3,7 @@ #include #include #include -#include + extern long int attendre; @@ -12,7 +12,7 @@ extern char timer[6]; extern unsigned long int suivant; extern int serpent, tete_up, tete_down, tete_right, tete_left, queue_up, queue_down, queue_left, queue_right; -extern int x, y, direction, t, segment, i; +extern int x, y, direction, t, t4, segment, i; extern int pos_x[2400], pos_y[2400], old_x[2400], old_y[2400]; extern long int vitesse; @@ -21,6 +21,8 @@ extern int fond, Nbr; extern char score[4]; extern int go_on; +extern int go_menu; +extern int pause; extern int imageMenu; void Pomme(); diff --git a/JEUX_SERPENT/main.c b/JEUX_SERPENT/main.c index 96ff829..6060de0 100644 --- a/JEUX_SERPENT/main.c +++ b/JEUX_SERPENT/main.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "fonction.h" #define CYCLE 10000L @@ -22,10 +21,12 @@ char score[4]; int go_on=1; int go_menu=1; +int pause=1; int imageMenu; int go_menu2=1; int t2; int t3; +int t4; /*Fonction Principale*/ int main(){ @@ -57,12 +58,15 @@ int main(){ /*Boucle Principale du Programme*/ while(go_on){ - Timer(); - Score(); - Collision(); - Controle(); - Serpent(); - Pomme(); + Controle(); + if (pause==1){ + printf("test\n"); + Timer(); + Score(); + Collision(); + Serpent(); + Pomme(); + } } /* fermeture de la fenĂȘtre si ECHAP pressĂ© + Menu de Fin*/ diff --git a/JEUX_SERPENT/scene.c b/JEUX_SERPENT/scene.c index 77d0780..588266a 100644 --- a/JEUX_SERPENT/scene.c +++ b/JEUX_SERPENT/scene.c @@ -1,8 +1,6 @@ #include #include #include -#include -#include #include "fonction.h" void Terrain(){ diff --git a/JEUX_SERPENT/score.c b/JEUX_SERPENT/score.c index bf84718..692de19 100644 --- a/JEUX_SERPENT/score.c +++ b/JEUX_SERPENT/score.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "fonction.h" void Score(){ diff --git a/JEUX_SERPENT/serpent.c b/JEUX_SERPENT/serpent.c index eda18e6..28f0d3a 100644 --- a/JEUX_SERPENT/serpent.c +++ b/JEUX_SERPENT/serpent.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "fonction.h" /*Input Serpent*/ @@ -29,6 +28,18 @@ void Controle(){ direction=2; break; } + case XK_Escape: + go_on=0; + go_menu=0; + + case XK_space: + if (pause==0){ + pause=1; + }else{ + pause=0; + ChoisirCouleurDessin(CouleurParComposante(255,255,255)); + EcrireTexte(500,750,"Jeu en Pause",2); + } } } } diff --git a/JEUX_SERPENT/timer.c b/JEUX_SERPENT/timer.c index 113c623..cb81b3a 100644 --- a/JEUX_SERPENT/timer.c +++ b/JEUX_SERPENT/timer.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "fonction.h" #define CYCLE 100000L