back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/field.h
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-04-02 17:43:35 +0300
committerscratko <m@scratko.xyz>2024-04-02 17:43:35 +0300
commitbdee2852c13f6b02ec5207ded584839a3118233e (patch)
tree39f1c14be91fb848ce0f94a64532e48a7667e5de /field.h
downloadpacman-bdee2852c13f6b02ec5207ded584839a3118233e.tar.gz
pacman-bdee2852c13f6b02ec5207ded584839a3118233e.tar.bz2
pacman-bdee2852c13f6b02ec5207ded584839a3118233e.zip
Initial commit
Diffstat (limited to 'field.h')
-rw-r--r--field.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/field.h b/field.h
new file mode 100644
index 0000000..42992aa
--- /dev/null
+++ b/field.h
@@ -0,0 +1,46 @@
+#ifndef FIELD_H_SENTRY
+#define FIELD_H_SENTRY
+
+enum intersection_type {
+ one_path = '1',
+ two_paths = '2',
+ three_paths = '3',
+ direct_path
+};
+
+enum {
+ field_width = 29,
+ field_height = 29
+};
+
+enum select_character { ghost_char, pac_char };
+
+typedef char (*game_space)[field_width];
+game_space get_new_field();
+
+struct free_directions {
+ int left;
+ int right;
+ int up;
+ int down;
+};
+
+void print_field(game_space field);
+
+void display_character(int y, int x, int symbol);
+
+struct ghost_type;
+void display_ghosts_on_field(struct ghost_type *red_ghost,
+ struct ghost_type *pink_ghost,
+ struct ghost_type *blue_ghost,
+ struct ghost_type *orange_ghost);
+
+void clear_symbol(game_space field, int y, int x,
+ enum select_character character);
+
+enum intersection_type get_intersection(const game_space field,
+ struct ghost_type *ghost);
+
+struct free_directions find_free_directions(game_space field, int y, int x);
+
+#endif