menu affichage fonctionne et modification de la loop pour rectangle

This commit is contained in:
2024-12-25 16:49:31 +01:00
parent c50388def9
commit cabdc9b3de
10 changed files with 56 additions and 30 deletions

View File

@@ -31,17 +31,23 @@ int main ()
score score_user = {0, 0, 0,0};
int x,y;
vect *pos = malloc(sizeof(vect));
char**menu = generatorMenu("maps", &x, &y, pos);
screenDisplay(menu, x, y);
vect dim_menu = {0, 0};
vect pos = {4, 1};
char**menu = generatorMenu("maps", &dim_menu, &pos);
printf("x %d, y %d\n", dim_menu.x, dim_menu.y);
screenDisplay(menu, dim_menu.x, dim_menu.y);
targets
= fileToTab2D ("maps/original_1.txt", tab2d, SIZE_PLAY, playerPos, &nbr_targets);
screenDisplayGameSDL (tab2d, &display_user, NULL, -1);
inGameLoop (tab2d, SIZE_PLAY, playerPos, targets, nbr_targets,
&display_user, &score_user);
inGameLoop (menu, &dim_menu, &pos, targets, nbr_targets,
&display_user, &score_user, true);
vect dim = {SIZE_PLAY, SIZE_PLAY};
inGameLoop (tab2d, &dim, playerPos, targets, nbr_targets,
&display_user, &score_user, false);
//screenDisplay(tab2d, SIZE_PLAY, SIZE_PLAY);
SDL_DestroyWindow (display_user.window);