diff --git a/src/game.c b/src/game.c index 44af72b..d3f30ae 100644 --- a/src/game.c +++ b/src/game.c @@ -8,6 +8,17 @@ #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}; + + return carte; +} + void game(int colonnes, int lignes) { EffacerEcran(CouleurParComposante(54, 57, 63)); ChoisirCouleurDessin(CouleurParNom("white")); @@ -23,10 +34,11 @@ void game(int colonnes, int lignes) { } unsigned int case_margin = case_max_dimensions * 0.05; + card cards[lignes][colonnes]; for (unsigned int l = 0; l < lignes; l += 1) { for (unsigned int c = 0; c < colonnes; c += 1) { - DessinerRectangle(GAME_MARGIN_RIGHT + (c * case_max_dimensions), GAME_MARGIN_TOP + (l * case_max_dimensions), case_max_dimensions - (2 * case_margin), case_max_dimensions - (2 * case_margin)); + cards[l][c] = create_card(GAME_MARGIN_RIGHT + (c * case_max_dimensions), GAME_MARGIN_TOP + (l * case_max_dimensions), case_max_dimensions - (2 * case_margin), case_max_dimensions - (2 * case_margin)); } }