From db76c24bafaafa1ebf51c5a5ed70bf4eee999e90 Mon Sep 17 00:00:00 2001 From: rohaut Date: Mon, 27 Nov 2023 17:29:15 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20des=20pommes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JEUX_SERPENT/main.c | 12 ++++++------ JEUX_SERPENT/pomme.png | Bin 608 -> 4324 bytes 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/JEUX_SERPENT/main.c b/JEUX_SERPENT/main.c index 7dd5e7e..3b12454 100644 --- a/JEUX_SERPENT/main.c +++ b/JEUX_SERPENT/main.c @@ -44,7 +44,6 @@ void DessinerScene(){ ChoisirCouleurDessin(CouleurParComposante(255,255,255)); EcrireTexte(10,760,timer,2); serpent=ChargerSprite("serpent.png"); - pomme=ChargerSprite("pomme.png"); for (i = 0; i < segment; i++){ AfficherSprite(serpent, x-(i*20), y); @@ -53,12 +52,13 @@ void DessinerScene(){ old_y[i]=pos_y[i]; old_x[i]=pos_x[i]; } - + srand(time(NULL)); + pomme=ChargerSprite("pomme.png"); for (p = 0; p < 5; p++) { - srand(time(NULL)); - pommex = (rand() % (58)); - pommey = (rand() % (35)); - AfficherSprite(pomme, pommex*20, pommey*20); + pommex = ((rand() % (58)+1)*20); + pommey = ((rand() % (35)+1)*20); + AfficherSprite(pomme, pommex, pommey); + printf("%d %d\n", pommex, pommey); } } diff --git a/JEUX_SERPENT/pomme.png b/JEUX_SERPENT/pomme.png index a806056d207781f8d0992c4f20c7795ff01972a1..5978dce7af8077c9d143fc9809f36757e0bdee93 100644 GIT binary patch literal 4324 zcmeHKeQ*@z8Q;q%24g`8MM&$q;3&|&+uhsy*d<2_cL#UM#SpF%#ZlkeeK+hRcYEw@ za+_GEF&aX!Ixs~*hA9k9l%Wk`t<{k#VW^$qQ$G9{J5+5-3+;@c)tYn=+h_MKU#&Bp z%+&vKckk`9&-*;T=Xrnc^FDXmU0buFylhS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