-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
68 lines (58 loc) · 1.19 KB
/
game.h
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
/* General Settings */
#define NUM_RECS 24
#define RECWIDTH 10
#define RECHEIGHT 20
/* Game States */
#define TITLE 0
#define NORMAL 1
#define GAMEOVER 2
/* Structure representing the red wall
where thee rectangles are 10 x 10 */
typedef struct {
u16 color;
int xPos;
int yPos;
int width;
int height;
} WALL;
/* Structure representing Gary the Ghost */
typedef struct {
int xPos;
int yPos;
int width;
int height;
const u16* image;
} GARY;
/* External Variables */
extern int state;
extern int playedOnce;
extern float upCount;
extern int goingUp;
extern int speed;
extern int acceleration;
extern WALL nextWall;
extern WALL currentWall;
extern WALL walls[NUM_RECS];
extern WALL topWall[NUM_RECS];
extern WALL bottomWall[NUM_RECS];
extern WALL middleWall[3];
extern WALL oldMidWall[3];
extern WALL oldTopWall[NUM_RECS];
extern WALL oldBottomWall[NUM_RECS];
extern GARY gary;
extern GARY oldGary;
void startGame();
void endGame();
void initiate();
int randomMidHeight();
void runGame();
void updateBarriers();
void lastRec();
void moveDown();
void moveUp();
void animator(int destination_row, int destination_col);
void updateGary();
int isHit();
int isInMidRange(int n);
void jump();
void goScreen();