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