display SDL

This commit is contained in:
2024-12-14 13:05:38 +01:00
parent 19a05574ab
commit 54e7f38ff2
14 changed files with 182 additions and 10 deletions

View File

@@ -1,9 +1,12 @@
#ifndef FONCTION_H
#define FONCTION_H
#include <SDL2/SDL_render.h>
#include <SDL2/SDL_video.h>
#include <stdbool.h>
#include <stdlib.h>
#include <time.h>
#include <SDL2/SDL.h>
#define EMPTY 0
#define WALL 1
@@ -27,14 +30,23 @@ typedef struct Score
unsigned int move_box;
} score;
typedef struct essential_sdl
{
SDL_Window *window ;
SDL_Renderer *renderer;
unsigned int size_window;
unsigned int size_box;
}dis;
unsigned short int **creatArea2D (const unsigned int N);
void free2D (unsigned short int **tab, int N);
void screenDisplay (unsigned short int **tab, int size);
void inGameLoop (unsigned short int **tab2d, int N, vect *playerPos,
vect *targets, int nbr_targets);
bool isWin (unsigned short int **tab2d, vect *targets, int nbr_targets);
bool islose (unsigned short int **tab2d, const int N);
bool blockBox (unsigned short int **tab2d, vect box_coor);
vect plusVect (vect one, vect two);
void
inGameLoop (unsigned short int **tab2d, int N, vect *playerPos, vect *targets,
int nbr_targets, dis *display_user);
#endif // FONCTION_H