debug struct serpent

This commit is contained in:
2023-12-12 16:03:47 +01:00
parent ee032fe2e9
commit 15a99a4583
6 changed files with 22 additions and 30 deletions

View File

@@ -80,7 +80,6 @@ void DeplacementSerpent(int direction ,PIXELS *serpent, int longueur)
int tempX = serpent[0].x;
int tempY = serpent[0].y;
int i;
int compteur;
couleur g;
couleur j;
ChoisirEcran(2);
@@ -88,7 +87,7 @@ void DeplacementSerpent(int direction ,PIXELS *serpent, int longueur)
g=CouleurParNom("lightgreen");
for (i = 2; i < longueur; i += 2) {
for (i = 1; i < longueur; i++) {
int tempX2 = serpent[i].x;
int tempY2 = serpent[i].y;
@@ -98,15 +97,8 @@ void DeplacementSerpent(int direction ,PIXELS *serpent, int longueur)
tempX = tempX2;
tempY = tempY2;
}
for(i=0;i< longueur; i++)
{
if(serpent[i].x != NULL && serpent[i].y != NULL)
{
compteur++;
}
}
ChoisirCouleurDessin(g);
RemplirRectangle(serpent[compteur].x,serpent[compteur].y,T_PIXEL,T_PIXEL);
RemplirRectangle(serpent[longueur-1].x,serpent[longueur-1].y,T_PIXEL,T_PIXEL);
ChoisirCouleurDessin(j);