-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.h
57 lines (51 loc) · 1.48 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
/**
* @file game.h
* @author Lukas Nejezchleb ([email protected]), Petr Kucera ([email protected])
* @brief Module where the game is taking place
* @version 0.1
* @date 2021-05-04
*
* @copyright Copyright (c) 2021
*
*/
#ifndef GAME_H
#define GAME_H
#include "data_structures.h"
#include "pacman.h"
#include "ghost.h"
/**
* @brief Initialises all necessary data structures and loops the game tick and refreshing screen while the player has not won, lost or pressed the q key
*
* @param game_data
* @param peripherals
* @return int pac-man game score
*/
int run_game(game_init_data_t* game_data, peripherals_data_t* peripherals);
/**
* @brief Internal functions for setting the color of RGB leds according to the game state
*
* @param led_mem_base
* @param scare_countdown
* @param pacman_score
*/
void led_blink(unsigned char *led_mem_base, int scare_countdown, int pacman_score);
/**
* @brief displays the pause message and waits for user to press the pause of quit key
*
* @param fb
* @param peripherals
*/
void pause_game(fb_data *fb, peripherals_data_t *peripherals);
/**
* @brief moves pacman and each ghost one step, checking for collisions and user input
*
* @param map
* @param pacman
* @param ghost_arr
* @param num_ghosts
* @param scare
* @return true
* @return false
*/
bool game_tick(map_data *map, pacman_type *pacman, ghost_type *ghost_arr, int num_ghosts, int *scare);
#endif