aboutsummaryrefslogtreecommitdiff
path: root/progress/src/gameprogress.c
diff options
context:
space:
mode:
Diffstat (limited to 'progress/src/gameprogress.c')
-rw-r--r--progress/src/gameprogress.c24
1 files changed, 24 insertions, 0 deletions
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);
+ }
+}