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 hide_card(zone carte0, card carte);
|
||||
|
||||
#endif
|
@ -35,3 +35,7 @@ card create_card(int x, int y, int L, int H, int id, char *file) {
|
||||
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);
|
||||
}
|
13
src/game.c
13
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);
|
||||
|
Loading…
Reference in New Issue
Block a user