debug struct serpent
This commit is contained in:
6
main.c
6
main.c
@@ -95,9 +95,9 @@ int main()
|
||||
int n = 0;
|
||||
int m = 0;
|
||||
|
||||
size_t longueur_serpent = 20;
|
||||
size_t longueur_serpent = 10;
|
||||
size_t longueur_pastilles = 10;
|
||||
int *serpent = (int *)malloc(longueur_serpent * sizeof(int));
|
||||
PIXELS *serpent = (PIXELS *)malloc(longueur_serpent * sizeof(PIXELS));
|
||||
PIXELS *pastilles = (PIXELS *)malloc(longueur_pastilles * sizeof(PIXELS));
|
||||
|
||||
int direction = 0;
|
||||
@@ -186,7 +186,7 @@ int main()
|
||||
if(MangerPastille(serpent,pastilles,&score) == 1)
|
||||
{
|
||||
longueur_serpent+=2;
|
||||
serpent = (int*) realloc(serpent,longueur_serpent * sizeof(int));
|
||||
serpent = (PIXELS*) realloc(serpent,longueur_serpent * sizeof(PIXELS));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user