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 1
12#define WALL 0
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#define BUTTON 7
19#define PLAYER_ON_BUTTON 8
20
21typedef struct Vecteur
22{
23 int x;
24 int y;
25} vect;
26
27typedef struct Score
28{
29 time_t before;
30 time_t after;
31 unsigned int move_player;
32 unsigned int move_box;
33} score;
34
35typedef struct essential_sdl
36{
37 SDL_Window *window;
38 SDL_Renderer *renderer;
39 unsigned int size_window;
40 unsigned int size_box;
41 unsigned int size_menu;
42} dis;
43
44char **creatArea2D (const int x, const int y);
45void free2D (char **tab, int x);
46bool isWin (char **tab2d, vect *targets, int nbr_targets);
47bool islose (char **tab2d, const int N);
48bool blockBox (char **tab2d, vect box_coor);
49vect plusVect (vect one, vect two);
50
51int inGameLoop (char **tab2d, vect *dim_tab, vect *playerPos, vect *targets,
52 int nbr_targets, dis *display_user, score *score_user, bool menu);
53char *timeToText(time_t time);
54void nullScore(score *player_score);
55void winOrLoseLoop(dis *display_user,score *score_user, bool win);
56unsigned int scoreCalculator(score *score_user, bool win);
57
58#endif // FONCTION_H
Definition function.h:28
Definition function.h:22
Definition function.h:36