-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
49 lines (41 loc) · 915 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
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef GAME_H_
#define GAME_H_
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
#include "oled.h"
#include "elements.h"
#include "timers.h"
#define CAR_HEIGHT 28
#define CAR_WIDTH 2
#define ROAD_1 0
#define ROAD_2 3
#define ROAD_3 6
#define PLAYER_CAR_COLUMN 100
#define TRUE 1
#define FALSE 0
#define MAX 8
typedef struct {
uint8_t column;
uint8_t page;
uint8_t* image;
} Car;
typedef struct {
int first;
int last;
int length;
Car cars[MAX];
} CarsQueue;
enum STATE {
INITIAL,
PLAYING,
LOST
};
extern enum STATE state;
void show_start_game_screen();
void show_game_over_scene();
void move_player_car_right();
void move_player_car_left();
void move_cars_forward();
void start_game();
#endif // GAME_H_