back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/pac.c
diff options
context:
space:
mode:
authorscratko <m@scratko.xyz>2024-04-15 20:40:14 +0300
committerscratko <m@scratko.xyz>2024-04-15 20:40:14 +0300
commite42ac35110b1819bf9762fbb4504ab920a17e207 (patch)
tree8d5465dc0251f392883dc8e01dcae1fba7ec715b /pac.c
parent0cf5dfed3e492608d044a5fc90c1815fab506fd7 (diff)
downloadpacman-e42ac35110b1819bf9762fbb4504ab920a17e207.tar.gz
pacman-e42ac35110b1819bf9762fbb4504ab920a17e207.tar.bz2
pacman-e42ac35110b1819bf9762fbb4504ab920a17e207.zip
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().
Diffstat (limited to 'pac.c')
-rw-r--r--pac.c10
1 files changed, 10 insertions, 0 deletions
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;
+ }
+}