-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoard.h
More file actions
71 lines (56 loc) · 1.41 KB
/
Board.h
File metadata and controls
71 lines (56 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#ifndef BOARD_H_INCLUDED
#define BOARD_H_INCLUDED
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "raylib.h"
#define HRESOLUTION 768
#define WRESOLUTION 1024
#define WIDTH_GAP 50
#define HEIGHT_GAP 10
#define MAX_CARDS 16 // Doit etre multiple de 2
typedef enum
{
PORTRAIT = 1,
PAYSAGE = 2,
} Orientation;
typedef enum KEY_STATE
{
PRESSED,
RELEASED,
DOWN,
} KEY_STATE;
typedef enum GameState
{
Revealed,
Playing,
Win,
} GameState;
typedef struct Card
{
Rectangle hitbox;
Vector2 pos;
Texture2D texture;
bool revealed;
bool found;
int index; // La frame dans le sprite
} Card;
typedef struct SaveData
{
int bestScore;
int bestTime;
char userName[32];
} SaveData;
// Cr�er la fenetre, charge les ressources et initialize le plateau.
void board_load(int width, int height, const char* title);
// Gere les entr�es souris/clavier et evenements fenetre
// Execute la logique de la partie et les graphismes.
void board_loop(void);
// D�truit la fenetre et decharge les ressources.
void board_unload(void);
// Appelle le callback pour chaque touche press�, relach� ou enfonc�.
void board_keyboardCallback(void (*func)(int, KEY_STATE));
// Si Oui est true, la taille gardera le m�me ratio en fonction de l'orientation.
// Sinon orientation peut �tre ommis.
void board_keepRatio(bool oui, Orientation);
#endif // BOARD_H_INCLUDED