aboutsummaryrefslogtreecommitdiff
path: root/progress/src/gameprogress.c
blob: 2fe614a25d682916ec3f598788e94a12851d7b3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
    }
}