From f7ecb4d475b155550e92df6bb65013fd87156225 Mon Sep 17 00:00:00 2001 From: rognant Date: Thu, 21 Dec 2023 14:52:55 +0100 Subject: [PATCH] ajout couleur pour la tete du serpent --- serpent.c | 5 ++++- serpent.h | 1 - snake | Bin 21608 -> 0 bytes 3 files changed, 4 insertions(+), 2 deletions(-) delete mode 100755 snake diff --git a/serpent.c b/serpent.c index ef1d52b..0c6988c 100644 --- a/serpent.c +++ b/serpent.c @@ -4,6 +4,7 @@ void DeplacerSerpent(Serpent* serpent, int* direction) { couleur couleurFond = CouleurParComposante(0, 0, 0); couleur couleurSerpent = CouleurParComposante(255, 255, 0); couleur couleurTerrain = CouleurParComposante(111, 255, 94); + couleur couleurTete = CouleurParComposante(168,65,38); // Clear the previous positions of the snake for (int i = 0; i < serpent->longueur; i++) { ChoisirCouleurDessin(couleurTerrain); @@ -24,7 +25,9 @@ void DeplacerSerpent(Serpent* serpent, int* direction) { serpent->corps[0].y += TAILLE_CASE; } // Draw the updated snake - for (int i = 0; i < serpent->longueur; i++) { + ChoisirCouleurDessin(couleurTete); + RemplirRectangle(serpent->corps[0].x,serpent->corps[0].y,TAILLE_CASE, TAILLE_CASE); + for (int i = 1; i < serpent->longueur; i++) { ChoisirCouleurDessin(couleurSerpent); RemplirRectangle(serpent->corps[i].x, serpent->corps[i].y, TAILLE_CASE, TAILLE_CASE); } diff --git a/serpent.h b/serpent.h index bdb356e..1553d2a 100644 --- a/serpent.h +++ b/serpent.h @@ -22,4 +22,3 @@ extern int EstDirectionOpposee(int directionActuelle, int nouvelleDirection); extern int CollisionAvecBordures(Serpent* serpent); int CollisionAvecPomme(Serpent* serpent, Pommes* pommes, int* score); #endif // SERPENT_H - diff --git a/snake b/snake deleted file mode 100755 index 4c674567dce7ae03000e4281d56bde258221de22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21608 zcmeHPeRP!7nZJ_+j31DIpeRgC_*~KnLZOgWFkF_qxo@HHYk@dg?tO?d_XB&*|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