From e42ac35110b1819bf9762fbb4504ab920a17e207 Mon Sep 17 00:00:00 2001 From: scratko Date: Mon, 15 Apr 2024 20:40:14 +0300 Subject: Game over and restart Game over screen. Corrected coordinates in is_liberation_zone(). The capture of pacman. Changed the function name from caughting_stage() to catching_stage(). --- ghosts.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ghosts.c') diff --git a/ghosts.c b/ghosts.c index 20d19dd..d558ba5 100644 --- a/ghosts.c +++ b/ghosts.c @@ -19,8 +19,8 @@ void initialize_ghost(struct ghost_type *ghost, enum ghost_color color) ghost->color = red; ghost->frightened_status = 0; ghost->direction = none; - ghost->prison_params.position.x = red_home_x; - ghost->prison_params.position.y = red_home_y; + ghost->prison_params.position.x = red_prison_x; + ghost->prison_params.position.y = red_prison_y; ghost->prison_params.prison_counter = 0; ghost->prison_params.active = 0; ghost->capture_info.status = 0; @@ -33,8 +33,8 @@ void initialize_ghost(struct ghost_type *ghost, enum ghost_color color) ghost->color = pink; ghost->frightened_status = 0; ghost->direction = none; - ghost->prison_params.position.x = pink_home_x; - ghost->prison_params.position.y = pink_home_y; + ghost->prison_params.position.x = pink_prison_x; + ghost->prison_params.position.y = pink_prison_y; ghost->prison_params.prison_counter = 0; ghost->prison_params.active = 0; ghost->capture_info.status = 0; @@ -47,8 +47,8 @@ void initialize_ghost(struct ghost_type *ghost, enum ghost_color color) ghost->color = blue; ghost->frightened_status = 0; ghost->direction = none; - ghost->prison_params.position.x = blue_home_x; - ghost->prison_params.position.y = blue_home_y; + ghost->prison_params.position.x = blue_prison_x; + ghost->prison_params.position.y = blue_prison_y; ghost->prison_params.prison_counter = 0; ghost->prison_params.active = 0; ghost->capture_info.status = 0; @@ -61,8 +61,8 @@ void initialize_ghost(struct ghost_type *ghost, enum ghost_color color) ghost->color = orange; ghost->frightened_status = 0; ghost->direction = none; - ghost->prison_params.position.x = orange_home_x; - ghost->prison_params.position.y = orange_home_y; + ghost->prison_params.position.x = orange_prison_x; + ghost->prison_params.position.y = orange_prison_y; ghost->prison_params.prison_counter = 0; ghost->prison_params.active = 0; ghost->capture_info.status = 0; @@ -429,7 +429,7 @@ void random_redirect(game_space field, struct ghost_type *ghost) static int is_liberation_zone(const struct ghost_type *ghost) { return ghost->position.y == liberation_y && - (ghost->position.x == 14 || ghost->position.x == 15) && + (ghost->position.x == 13 || ghost->position.x == 14) && ghost->direction == up; } -- cgit v1.2.3