1
0

Création d'un fichier dédié à la gestion des cartes et modification de la structure card

This commit is contained in:
Lyanis SOUIDI 2022-12-01 23:45:25 +01:00
parent 82a5c54e0c
commit 085d28f842
3 changed files with 30 additions and 11 deletions

12
include/card.h Normal file
View File

@ -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

17
src/card.c Normal file
View File

@ -0,0 +1,17 @@
#include<stdio.h>
#include<stdlib.h>
#include<graph.h>
#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;
}

View File

@ -4,6 +4,7 @@
#include<time.h>
#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;