Création d'un fichier dédié à la gestion des cartes et modification de la structure card
This commit is contained in:
parent
82a5c54e0c
commit
085d28f842
12
include/card.h
Normal file
12
include/card.h
Normal 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
17
src/card.c
Normal 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;
|
||||
}
|
12
src/game.c
12
src/game.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user