From 76b875e095d8b9ca3f6058fbfc0ab2669eed852d Mon Sep 17 00:00:00 2001 From: scratko Date: Wed, 10 Apr 2024 22:01:48 +0300 Subject: Searching for all ghosts --- ghosts.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'ghosts.h') diff --git a/ghosts.h b/ghosts.h index 7830a97..f407839 100644 --- a/ghosts.h +++ b/ghosts.h @@ -20,6 +20,9 @@ enum { orange_x = red_x - 3, orange_home_y = blue_home_y, orange_home_x = 0, + pink_shift = 4, + blue_shift = 2, + orange_search_limit = 8 }; enum ghost_color { red, pink, blue, orange }; @@ -57,11 +60,18 @@ void make_ghost_moves(game_space field, struct pacman; void redirect(game_space field, enum intersection_type paths, - struct ghost_type *ghost, struct pacman pac, + struct ghost_type *ghost, struct coordinates target_point, void (*pathfinder)(game_space, struct ghost_type*, - struct pacman pac)); + struct coordinates target_point)); void breadth_first_search(game_space field, struct ghost_type *ghost, - struct pacman pac); + struct coordinates target_point); + +void compute_distance_between_points(game_space field, struct ghost_type *ghost, + struct coordinates target_point); + +struct coordinates identify_target_in_front(struct pacman pac, int shift); +struct coordinates identify_blue_target(struct pacman pac, + const struct ghost_type *red_ghost); #endif -- cgit v1.2.3