Création d'une fonction pour afficher la carte retournée et implémentation dans game
This commit is contained in:
parent
31086e7dd7
commit
0fabe562ba
@ -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 create_card(int x, int y, int L, int H, int id, char *file);
|
||||||
|
|
||||||
|
card hide_card(zone carte0, card carte);
|
||||||
|
|
||||||
#endif
|
#endif
|
@ -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};
|
card carte = {zone, 0, 0, 0, id, filename};
|
||||||
DessinerRectangle(carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H);
|
DessinerRectangle(carte.zone.x, carte.zone.y, carte.zone.L, carte.zone.H);
|
||||||
return carte;
|
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);
|
||||||
}
|
}
|
13
src/game.c
13
src/game.c
@ -96,9 +96,22 @@ int game(int colonnes, int lignes) {
|
|||||||
}
|
}
|
||||||
free(file);
|
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);
|
timer = start_timer(0);
|
||||||
coups = update_coups(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;
|
boucle = 1;
|
||||||
while (boucle) {
|
while (boucle) {
|
||||||
update_timer(timer);
|
update_timer(timer);
|
||||||
|
Loading…
Reference in New Issue
Block a user