back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/field.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 /field.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 'field.c')
-rw-r--r--field.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/field.c b/field.c
index 340e380..560cae9 100644
--- a/field.c
+++ b/field.c
@@ -53,6 +53,12 @@ game_space get_new_field()
return field;
}
+void clear_field(game_space field)
+{
+ free(field);
+ field = NULL;
+}
+
int field_has_coin(int x, int y)
{
return !((x == 9 && y == 12)|| (x == 18 && y == 12) ||
@@ -107,6 +113,9 @@ void print_field(game_space field)
case door:
addch('#');
break;
+ case ' ':
+ addch(' ');
+ break;
}
refresh();
}