rm findplayer but add it in read, + get all targets

This commit is contained in:
2024-12-12 18:47:59 +01:00
parent 5274a135d6
commit ee26a60a09
5 changed files with 33 additions and 28 deletions

16
main.c
View File

@@ -5,12 +5,18 @@
int main()
{
unsigned short int **tab2d = creatArea2D(32);
fileToTab2D("test.txt", tab2d, 32);
screenDisplay(tab2d, 32);
printf("main\n");
vect *playerPos = (vect *)malloc(sizeof(vect));
getStartPlayerPos(tab2d,32,playerPos);
vect *targets = malloc(sizeof(vect));
int nbr_targets;
unsigned short int **tab2d = creatArea2D(32);
targets = fileToTab2D("test.txt", tab2d, 32, playerPos, &nbr_targets);
screenDisplay(tab2d, 32);
printf("%d, %d\n", playerPos->x, playerPos->y);
for (int i = 0;i < nbr_targets; ++i) {
printf("%d, %d\n", targets[i].x, targets[i].y);
}
inGameLoop(tab2d,playerPos);
free(playerPos);
return 0;