diff options
author | scratko <m@scratko.xyz> | 2024-04-15 20:40:14 +0300 |
---|---|---|
committer | scratko <m@scratko.xyz> | 2024-04-15 20:40:14 +0300 |
commit | e42ac35110b1819bf9762fbb4504ab920a17e207 (patch) | |
tree | 8d5465dc0251f392883dc8e01dcae1fba7ec715b /pac.c | |
parent | 0cf5dfed3e492608d044a5fc90c1815fab506fd7 (diff) | |
download | pacman-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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; + } +} |