Pacman  1.0
Pacman game
constants.h
Aller à la documentation de ce fichier.
1 
7 #ifndef CONSTANTS_H
8 #define CONSTANTS_H
9 
10 #include <SDL2/SDL.h>
11 
12 #define CELL_SIZE 16
13 #define X_CELLS 28
14 #define Y_CELLS 36
15 
16 #define CELL_CENTER ((CELL_SIZE / 2) + 1)
17 
18 #define SCREEN_WIDTH (X_CELLS * CELL_SIZE)
19 #define SCREEN_HEIGHT (Y_CELLS * CELL_SIZE)
20 
21 #define FPS 60
22 
23 const SDL_Rect SRC_BG = {228, 0, 224, 248};
24 const SDL_Rect BG = {0, 3 * CELL_SIZE, X_CELLS *CELL_SIZE, (Y_CELLS - 5) * CELL_SIZE};
25 
26 const SDL_Rect SRC_GUM = {8, 8, 8, 8};
27 const SDL_Rect SRC_PACGUM = {8, 24, 8, 8};
28 
29 #define STARTING 0
30 #define PLAYING 1
31 #define WIN 2
32 #define LOSE 3
33 
34 #define GAMEOVER 0
35 #define CONTINUE 1
36 
37 #define RIGHT 0
38 #define LEFT 1
39 #define UP 2
40 #define DOWN 3
41 #define STOP 4
42 
43 #define CHASE 0
44 #define SCATTER 1
45 #define FRIGHTENED 2
46 #define EYES 3
47 
48 #define GUM 0
49 #define PACGUM 1
50 #define FRUIT 2
51 #define UNDEFINED 3
52 
53 #endif
const SDL_Rect SRC_GUM
Definition: constants.h:26
#define Y_CELLS
Definition: constants.h:14
const SDL_Rect SRC_PACGUM
Definition: constants.h:27
#define X_CELLS
Definition: constants.h:13
#define CELL_SIZE
Constants used in the game.
Definition: constants.h:12
const SDL_Rect BG
Definition: constants.h:24
const SDL_Rect SRC_BG
Definition: constants.h:23