back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/field.h
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-04-07 22:40:47 +0300
committerscratko <m@scratko.xyz>2024-04-07 22:40:47 +0300
commit155a3c5f91c7a3bd89febfeb9927478961f5ee28 (patch)
tree1953cd610d4a06c51aaedb728edd6131a4fa426a /field.h
parent2c2448cc94b8f17ac699814a75110411d57f3bea (diff)
downloadpacman-155a3c5f91c7a3bd89febfeb9927478961f5ee28.tar.gz
pacman-155a3c5f91c7a3bd89febfeb9927478961f5ee28.tar.bz2
pacman-155a3c5f91c7a3bd89febfeb9927478961f5ee28.zip
Tracking coins eaten
The initialization of ncurses parameters and ghosts was put into functions. The order of movements has been changed: now pacman moves first. Accounting for eaten coins. Correct coin erasure.
Diffstat (limited to 'field.h')
-rw-r--r--field.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/field.h b/field.h
index 7ac53e8..4681267 100644
--- a/field.h
+++ b/field.h
@@ -5,7 +5,8 @@ enum {
field_width = 28,
field_height = 29,
door = '#',
- block = '/'
+ block = '/',
+ coin = '.'
};
enum intersection_type {
@@ -40,14 +41,18 @@ void display_ghosts_on_field(struct ghost_type *red_ghost,
struct ghost_type *blue_ghost,
struct ghost_type *orange_ghost);
-void eat_or_revert_symbol(game_space field, int y, int x,
- enum select_character character);
+struct queue;
+struct coordinates;
+void clear_or_revert_symbol(game_space field, struct coordinates position,
+ enum select_character character,
+ struct queue *eaten_coins);
enum intersection_type get_intersection(const game_space field,
- struct ghost_type *ghost);
+ struct ghost_type *ghost);
struct free_directions find_free_directions(game_space field, int y, int x);
int is_obstacle(game_space field, int x, int y);
+int field_has_coin(int x, int y);
#endif