-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.h
53 lines (42 loc) · 1.04 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
/**
Game module header file
@team 128
@author Ambrose Ledbrook - 79172462
@author Josh Jarvis - 28803714
@date 12-oct-2018
@brief This module header provides the constants and types used by the game
module.
*/
// Defining constants and typedefs used by the game module
#ifndef GAME_H
#define GAME_H
// Defining constant values used
#define PACER_RATE 300
#define MESSAGE_RATE 15
#define BUTTON_RATE 300
#define BALL_RATE 70
#define EASY 90
#define MEDIUM 75
#define HARD 45
#define BLUE_LED 0
#define LED_ON 1
#define LED_OFF 0
#define NUM_DIFFICULTIES 3
/**
This enum holds all possible states that the game can be in
*/
typedef enum {
// Game is either over or hasn't started
NOT_STARTED,
// When in game menu
MENU,
// Game is being played
PLAYING,
// Waiting for the ball to be sent back from the other board
WAITING
} Game_states;
// Static variable holding values used to run the game
static Game_states game_state;
static uint8_t speed_index = 0;
static uint8_t ball_speed = EASY;
#endif