-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame.h
37 lines (28 loc) · 836 Bytes
/
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
#ifndef GAME_H
#define GAME_H
#include <stdbool.h>
#include "types.h"
#include "enemy.h"
#define MAX_ENEMIES 2
// Holds the current app state
typedef struct {
Dino dino;
Enemy enemies[MAX_ENEMIES];
uint_t score;
uint_t tick;
} AppState;
AppState initialAppState();
void resetAppState(AppState *appState);
void updateAppState(AppState *appState, uint_t previousButtons, uint_t currentButtons);
// void drawGame(Dino *dino, Enemy enemies[], uint_t previousButtons, uint_t currentButtons);
// void drawScore();
// void drawGround();
void resetGame();
void updateEnemies(Enemy *enemies);
// void drawEnemies(Enemy *enemies);
bool didLose(Dino *dino, Enemy *enemies);
Enemy getRandomEnemy();
void updateLocationOfEnemies(Enemy *enemies);
// void clearOldEnemies(Enemy *enemies);
extern volatile unsigned int counter;
#endif