From 36a53c30c2f233977c1444a68a93a347dbd4093f Mon Sep 17 00:00:00 2001 From: brigitte Date: Mon, 18 Dec 2023 17:05:44 +0100 Subject: [PATCH] enlevment des extern 2 --- JEUX_SERPENT/Jeux | Bin 22168 -> 21920 bytes JEUX_SERPENT/fonction.h | 2 +- JEUX_SERPENT/main.c | 6 +++--- JEUX_SERPENT/scene.c | 6 +++--- JEUX_SERPENT/serpent.c | 11 ++++++----- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/JEUX_SERPENT/Jeux b/JEUX_SERPENT/Jeux index 0a5d2043bd48bc6237bbaebcc5f2de4d34dddd7e..d0653ad90f65c1ca0bee0bf2745ca67352636518 100755 GIT binary patch delta 5767 zcmZu#3tW^{7Qf%Xg&7_W!)s;)8HTiclsqI|QeG-KnkHbFX0Dp{(q0&(7C0p0GW%uX z-Zrguf70d_m70cIKn94}Shg-@n))k6%lgP?ng&Wcd(OT0LmKz{{kZ4c|NoqG&$-`y ze9ZbSO6@yJjV&_ALim#-1WCMm?a((&DIubpvi3-_>8(i7d5c+;WYd`d(L2K?D#;;T z2GMJOg{@GoSaMQDw^uTc!51A{GxE;3r;p_~?I?a|iTcuj{U7c56Wb85iOmSCQ_`72 zmng%TCD6)hs7*=cnlZ@64$~Bt6KJbX46-V0Oz>=~5Cc)zYr(??6)1#6h@r@iwJ!$| z5&@Qyxc6x(8KQNq~crZ<&n785eM{+pzB`d&ni!tyOnnu42n#GP- z1`Iuz1;I*36uBxhPiBJZ@|-FOcd3~#0`7}x2S}Um^Z7oZn^|JybbBZzK(ic3Si z^ynDOn~)k|_Ii)c2LV1;=^h|J(**tw;9Q%%y9lO3rTt-~%xW0G9jelBo^zBt#7kGn zcq(1`01gthJY1!ZgPK_fi*Y$vEEvOPM?2kBV5rhcXmdU7o?Wihl*Qpxw>9Idgl-8? zE{|7?|L!%PuL(vY%`2d3fntfa2yy}gZ8va@7`+MeX^ut%Y_x^w=#ga7T%v(?sd@WdA! z?3UmP4z>&M3J2X@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r$aQ&KAFoW7ivD5ncxs4wfsc3!u{7KXFdN~ z({ib$_UfaomecfRVDzj=m-X`^O|`z=e>N-VK9yps_4V^AO*>f79zWgw@3He`?d$_u-oA=bl>L?*HSguj6mu_t9Zi_d&GF>$0YALbt@Cub=nsrw2|*T27S) z${MHVAJlhr{rWkS-q-RN$B+6yC9S9X!Es&NguVork{gj)z{C9 z6Rf`@t*J6vPtyV@TlMwxvTYSger67R4HrY1Y-#_G)F{sW3Pq35gD*>RTJn?~&h?ku zaIH_{yET!ol&sX&MU+6LBIW#`o5tax_~~}*@q^gfccr0@<%<-3(Z(z!S_6 diff --git a/JEUX_SERPENT/fonction.h b/JEUX_SERPENT/fonction.h index ef23482..bc28ce2 100644 --- a/JEUX_SERPENT/fonction.h +++ b/JEUX_SERPENT/fonction.h @@ -9,7 +9,7 @@ extern char timer[6]; extern unsigned long int suivant; extern int serpent, tete_up, tete_down, tete_right, tete_left; -extern int x, y, direction,segment; +extern int direction,segment; extern int pos_x[2400], pos_y[2400], old_x[2400], old_y[2400]; extern long int vitesse; diff --git a/JEUX_SERPENT/main.c b/JEUX_SERPENT/main.c index 0819965..60c6d97 100644 --- a/JEUX_SERPENT/main.c +++ b/JEUX_SERPENT/main.c @@ -11,9 +11,9 @@ unsigned long int suivant; long int vitesse=100000; int serpent; -int x=500, y=360, direction=4 /*1 : vers le haut, 2 : vers le bas, 3 vers la gauche, 4 vers la droite*/, t, segment=10, i=0; +int direction=4 /*1 : vers le haut, 2 : vers le bas, 3 vers la gauche, 4 vers la droite*/, segment=10, i=0; int pos_x[2400], pos_y[2400], old_x[2400], old_y[2400]; -int tete_up, tete_down, tete_right, tete_left, queue_up, queue_down, queue_left, queue_right; +int tete_up, tete_down, tete_right, tete_left; int pomme, pommex[5], pommey[5]; int fond, Nbr; @@ -24,6 +24,7 @@ int go_menu=1; int pause=1; int imageMenu; int go_menu2=1; +int t; int t2; int t3; @@ -60,7 +61,6 @@ int main(){ while(go_on){ Controle(); if (pause==1){ - printf("test\n"); Timer(); Score(); Collision(); diff --git a/JEUX_SERPENT/scene.c b/JEUX_SERPENT/scene.c index f7ea919..9e88fc0 100644 --- a/JEUX_SERPENT/scene.c +++ b/JEUX_SERPENT/scene.c @@ -27,9 +27,9 @@ void DessinerScene(){ tete_right = ChargerSprite("IMG/tete_right.png"); for (i = 0; i < segment; i++){ - AfficherSprite(serpent, x-(i*20), y); - pos_x[i]=x-(i*20); - pos_y[i]=y; + AfficherSprite(serpent, 500-(i*20), 360); + pos_x[i]=500-(i*20); + pos_y[i]=360; old_y[i]=pos_y[i]; old_x[i]=pos_x[i]; } diff --git a/JEUX_SERPENT/serpent.c b/JEUX_SERPENT/serpent.c index 6f9ff87..c825d85 100644 --- a/JEUX_SERPENT/serpent.c +++ b/JEUX_SERPENT/serpent.c @@ -12,27 +12,27 @@ void Controle(){ case XK_Left : if (direction != 4){ direction=3; - break; } + break; case XK_Right: if (direction != 3){ direction=4; - break; } + break; case XK_Up: if(direction !=2){ direction=1; - break; } + break; case XK_Down: if (direction !=1){ direction=2; - break; } + break; case XK_Escape: go_on=0; go_menu=0; - + break; case XK_space: if (pause==0){ pause=1; @@ -41,6 +41,7 @@ void Controle(){ ChoisirCouleurDessin(CouleurParComposante(255,255,255)); EcrireTexte(500,750,"Jeu en Pause",2); } + break; } } }