2023-07-08 15:55:06 +02:00
|
|
|
#ifndef GAME_H
|
|
|
|
#define GAME_H
|
|
|
|
|
|
|
|
#include "mapstruct.h"
|
|
|
|
#include "player.h"
|
|
|
|
|
|
|
|
/* This struct will contain all the data of the game. It will make it possible
|
|
|
|
* to pass it to the NPCs to let them interact with the player and the rest of
|
|
|
|
* the world. */
|
|
|
|
typedef struct {
|
|
|
|
Map *map_level; /* The level that the player is currently playing */
|
|
|
|
Player player; /* The player data (see player.h). */
|
2023-07-08 20:07:34 +02:00
|
|
|
/* Some global variables */
|
|
|
|
/* Set to true when asked for exit */
|
|
|
|
bool exittoOS;
|
|
|
|
/* Set to true when screenshot is required */
|
|
|
|
bool screenshot;
|
|
|
|
/* Set to true when recording a video of the screen is required */
|
|
|
|
bool record;
|
|
|
|
/* How many ms the frame already took. */
|
|
|
|
long int frame_duration;
|
2023-07-08 15:55:06 +02:00
|
|
|
} Game;
|
|
|
|
|
|
|
|
/* (Mibi88) TODO: Describe what this function is doing. */
|
|
|
|
void game_logic(Game *game);
|
|
|
|
|
|
|
|
/* Draws everything on screen. */
|
|
|
|
void draw(Game *game);
|
|
|
|
|
2023-07-08 20:07:34 +02:00
|
|
|
/* Handle key presses. */
|
|
|
|
void get_inputs(Game *game);
|
|
|
|
|
2023-07-08 15:55:06 +02:00
|
|
|
#endif
|
|
|
|
|