diff --git a/include/card.h b/include/card.h new file mode 100644 index 0000000..a5ec203 --- /dev/null +++ b/include/card.h @@ -0,0 +1,12 @@ +#ifndef CARD_H +#define CARD_H + +typedef struct { + zone zone; + int displayed, found; + char *file; +} card; + +card create_card(int x, int y, int L, int H, char *file); + +#endif \ No newline at end of file diff --git a/src/card.c b/src/card.c new file mode 100644 index 0000000..04edc4d --- /dev/null +++ b/src/card.c @@ -0,0 +1,17 @@ +#include +#include +#include +#include"../include/main.h" + +typedef struct { + zone zone; + int displayed, found; + char *file; +} card; + +card create_card(int x, int y, int L, int H, char *file) { + zone zone = {x, y, L, H}; + card carte = {zone, 0, 0, file}; + DessinerRectangle(carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H); + return carte; +} \ No newline at end of file diff --git a/src/game.c b/src/game.c index 64fc6d4..c810cf9 100644 --- a/src/game.c +++ b/src/game.c @@ -4,6 +4,7 @@ #include #include"../include/main.h" #include"../include/timer.h" +#include"../include/card.h" #include"../include/fin.h" #define GAME_MARGIN_RIGHT 20 @@ -11,17 +12,6 @@ #define GAME_MARGIN_TOP 35 #define GAME_MARGIN_BOTTOM 20 -typedef struct { - int x, y, L, H, displayed, found; - char *file; -} card; - -card create_card(int x, int y, int L, int H, char *file) { - card carte = {x, y, L, H, 0, 0, file}; - DessinerRectangle(x, y, L, H); - return carte; -} - int game(int colonnes, int lignes) { int i, j, t, used, r, l, c, case_max_width, case_max_height, case_max_dimensions, case_margin, boucle; unsigned long int timer;