changement organisation
This commit is contained in:
17
include/display.h
Normal file
17
include/display.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef DISPLAY_H
|
||||
#define DISPLAY_H
|
||||
|
||||
#include "../include/function.h"
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_ttf.h>
|
||||
|
||||
void screenDisplay (char **tab, int size);
|
||||
int getMaxSize (dis display_user);
|
||||
void displayImage (SDL_Renderer *renderer, SDL_Texture *texture, vect pos,
|
||||
int size);
|
||||
void initSDL (dis *display_user);
|
||||
void screenDisplayGameSDL (char **tab, dis *display_user);
|
||||
void displayTextSDL(dis *display_user,char *text, vect coor, vect size, int font_size);
|
||||
|
||||
|
||||
#endif // !DISPLAY_H
|
||||
53
include/function.h
Normal file
53
include/function.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef FONCTION_H
|
||||
#define FONCTION_H
|
||||
|
||||
#include <SDL2/SDL.h>
|
||||
#include <SDL2/SDL_render.h>
|
||||
#include <SDL2/SDL_video.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#define EMPTY 0
|
||||
#define WALL 1
|
||||
#define BOX 2
|
||||
#define TARGET 3
|
||||
#define BOX_ON_TARGET 4
|
||||
#define PLAYER 5
|
||||
#define PLAYER_ON_TARGET 6
|
||||
|
||||
typedef struct Vecteur
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} vect;
|
||||
|
||||
typedef struct Score
|
||||
{
|
||||
time_t before;
|
||||
time_t after;
|
||||
unsigned int move_player;
|
||||
unsigned int move_box;
|
||||
} score;
|
||||
|
||||
typedef struct essential_sdl
|
||||
{
|
||||
SDL_Window *window;
|
||||
SDL_Renderer *renderer;
|
||||
unsigned int size_window;
|
||||
unsigned int size_box;
|
||||
unsigned int size_menu;
|
||||
} dis;
|
||||
|
||||
char **creatArea2D (const unsigned int N);
|
||||
void free2D (char **tab, int N);
|
||||
void screenDisplay (char **tab, int size);
|
||||
bool isWin (char **tab2d, vect *targets, int nbr_targets);
|
||||
bool islose (char **tab2d, const int N);
|
||||
bool blockBox (char **tab2d, vect box_coor);
|
||||
vect plusVect (vect one, vect two);
|
||||
void inGameLoop (char **tab2d, int N, vect *playerPos,
|
||||
vect *targets, int nbr_targets, dis *display_user, score *score_user);
|
||||
char *timeToText(time_t time);
|
||||
|
||||
#endif // FONCTION_H
|
||||
6
include/read.h
Normal file
6
include/read.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef READ_H
|
||||
#define READ_H
|
||||
#include "function.h"
|
||||
vect *fileToTab2D (const char *name_file, char **tab,
|
||||
const unsigned N, vect *player, int *nbr_targets);
|
||||
#endif // !READ_H
|
||||
Reference in New Issue
Block a user