Sokoban
Chargement...
Recherche...
Aucune correspondance
function.h
1#ifndef FONCTION_H
2#define FONCTION_H
3
4#include <SDL2/SDL.h>
5#include <SDL2/SDL_render.h>
6#include <SDL2/SDL_video.h>
7#include <stdbool.h>
8#include <stdlib.h>
9#include <time.h>
10
11#define EMPTY 0
12#define WALL 1
13#define BOX 2
14#define TARGET 3
15#define BOX_ON_TARGET 4
16#define PLAYER 5
17#define PLAYER_ON_TARGET 6
18
19typedef struct Vecteur
20{
21 int x;
22 int y;
23} vect;
24
25typedef struct Score
26{
27 time_t before;
28 time_t after;
29 unsigned int move_player;
30 unsigned int move_box;
31} score;
32
33typedef struct essential_sdl
34{
35 SDL_Window *window;
36 SDL_Renderer *renderer;
37 unsigned int size_window;
38 unsigned int size_box;
39 unsigned int size_menu;
40} dis;
41
42char **creatArea2D (const unsigned int N);
43void free2D (char **tab, int N);
44void screenDisplay (char **tab, int size);
45bool isWin (char **tab2d, vect *targets, int nbr_targets);
46bool islose (char **tab2d, const int N);
47bool blockBox (char **tab2d, vect box_coor);
48vect plusVect (vect one, vect two);
49void inGameLoop (char **tab2d, int N, vect *playerPos,
50 vect *targets, int nbr_targets, dis *display_user, score *score_user);
51char *timeToText(time_t time);
52
53#endif // FONCTION_H
Definition function.h:26
Definition function.h:20
Definition function.h:34