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(). --- pac.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pac.c') diff --git a/pac.c b/pac.c index 6579e14..97c3833 100644 --- a/pac.c +++ b/pac.c @@ -177,3 +177,13 @@ void make_pac_move(game_space field, struct pacman *pac, change_point_if_outside_tunnel(&pac->position); eat_energizer(field, pac); } + +void catch_pac(struct pacman *pac) +{ + --pac->lives; + if(pac->lives >= 1) { + pac->position.y = pac_y; + pac->position.x = pac_x; + pac->direction = none; + } +} -- cgit v1.2.3