From 0fabe562ba8ed661b77d6045eaad0344fcf5b23d Mon Sep 17 00:00:00 2001 From: Tom Moguljak Date: Thu, 8 Dec 2022 09:06:43 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20d'une=20fonction=20pour=20affic?= =?UTF-8?q?her=20la=20carte=20retourn=C3=A9e=20et=20impl=C3=A9mentation=20?= =?UTF-8?q?dans=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/card.h | 2 ++ src/card.c | 4 ++++ src/game.c | 13 +++++++++++++ 3 files changed, 19 insertions(+) diff --git a/include/card.h b/include/card.h index f5c2d15..bd0fdec 100644 --- a/include/card.h +++ b/include/card.h @@ -13,4 +13,6 @@ card show_card(card carte); card create_card(int x, int y, int L, int H, int id, char *file); +card hide_card(zone carte0, card carte); + #endif \ No newline at end of file diff --git a/src/card.c b/src/card.c index 9ce36b7..4ff91d1 100644 --- a/src/card.c +++ b/src/card.c @@ -34,4 +34,8 @@ card create_card(int x, int y, int L, int H, int id, char *file) { card carte = {zone, 0, 0, 0, id, filename}; DessinerRectangle(carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H); return carte; +} + +card hide_card(zone carte0, card carte){ + CopierZone(4, 0, carte0.x, carte0.y, carte0.L, carte0.H, carte.zone.x, carte.zone.y); } \ No newline at end of file diff --git a/src/game.c b/src/game.c index a57bea5..7768486 100644 --- a/src/game.c +++ b/src/game.c @@ -96,9 +96,22 @@ int game(int colonnes, int lignes) { } free(file); + zone carte0 = {cards[0][0].zone.x, cards[0][0].zone.y, cards[0][0].zone.L, cards[0][0].zone.H}; + + ChoisirEcran(4); + sprintf(file, "img/cards/%dx%d/0.jpg", colonnes, lignes); + ChargerImage(file, cards[0][0].zone.x, cards[0][0].zone.y, 0, 0, cards[0][0].zone.L, cards[0][0].zone.H); + ChoisirEcran(0); + timer = start_timer(0); coups = update_coups(0); + for (l = 0; l < lignes; l++) { + for (c = 0; c < colonnes; c++) { + hide_card(carte0, cards[l][c]); + } + } + boucle = 1; while (boucle) { update_timer(timer);