From a90db3b7b6e87e24c789b5db222f1cef92809bde Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Fri, 16 Jan 2026 19:38:33 +0100 Subject: Initial commit --- progress/src/gameprogress.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 progress/src/gameprogress.c (limited to 'progress/src/gameprogress.c') diff --git a/progress/src/gameprogress.c b/progress/src/gameprogress.c new file mode 100644 index 0000000..2fe614a --- /dev/null +++ b/progress/src/gameprogress.c @@ -0,0 +1,24 @@ +#include "main.h" + +void loadGame(GameState *gameState) +{ + FILE *fp; + fp = fopen ("duel.map", "r"); + int x; + int y; + int w; + int h; + fscanf(fp,"%d", &gameState->maxE); + for(int i = 0; i < gameState->maxE; i++) + { + fscanf(fp,"%d", &x); + fscanf(fp,"%d", &y); + fscanf(fp,"%d", &w); + fscanf(fp,"%d", &h); + gameState->entidades[i].x = x; + gameState->entidades[i].y = y; + gameState->entidades[i].w = w; + gameState->entidades[i].h = h; + printf("%d\n", gameState->entidades[i].x); + } +} -- cgit v1.2.3