encore meilleur

This commit is contained in:
2024-12-14 15:26:00 +01:00
parent af546b8440
commit fa7d5ce51a
5 changed files with 456 additions and 450 deletions

50
main.c
View File

@@ -11,34 +11,34 @@
int main ()
{
dis display_user;
display_user.size_window = getMaxSize ();
display_user.size_box = SIZE_PLAY;
initSDL (&display_user);
dis display_user;
display_user.size_window = getMaxSize ();
display_user.size_box = SIZE_PLAY;
initSDL (&display_user);
vect *playerPos = (vect *)malloc (sizeof (vect));
vect *targets;
int nbr_targets;
score playerScore;
unsigned short int **tab2d = creatArea2D (SIZE_PLAY);
vect *playerPos = (vect *)malloc (sizeof (vect));
vect *targets;
int nbr_targets;
score playerScore;
unsigned short int **tab2d = creatArea2D (SIZE_PLAY);
playerScore.before = time (NULL);
playerScore.before = time (NULL);
targets
= fileToTab2D ("test.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets);
screenDisplaySDL (tab2d, &display_user);
screenDisplay (tab2d, SIZE_PLAY);
inGameLoop (tab2d, SIZE_PLAY, playerPos, targets, nbr_targets,
&display_user);
targets
= fileToTab2D ("test.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets);
screenDisplaySDL (tab2d, &display_user);
screenDisplay (tab2d, SIZE_PLAY);
inGameLoop (tab2d, SIZE_PLAY, playerPos, targets, nbr_targets,
&display_user);
playerScore.after = time (NULL);
printf ("%ld\n", playerScore.after - playerScore.before);
playerScore.after = time (NULL);
printf ("%ld\n", playerScore.after - playerScore.before);
SDL_DestroyWindow (display_user.window);
SDL_DestroyRenderer (display_user.renderer);
free2D (tab2d, SIZE_PLAY);
free (playerPos);
free (targets);
SDL_Quit ();
return 0;
SDL_DestroyWindow (display_user.window);
SDL_DestroyRenderer (display_user.renderer);
free2D (tab2d, SIZE_PLAY);
free (playerPos);
free (targets);
SDL_Quit ();
return 0;
}