aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--field.c15
-rw-r--r--worm.c3
2 files changed, 15 insertions, 3 deletions
diff --git a/field.c b/field.c
index 287aa95..fee076b 100644
--- a/field.c
+++ b/field.c
@@ -48,7 +48,7 @@
char field[CELLW][CELLH];
#define CELLBLANK 0
-#define CELLPLAYER 1
+#define CELLPLAYER 1
#define CELLWALL 2
#define CELLFOOD 3
@@ -65,8 +65,17 @@ void empty_field(char celltype)
{
char i,j;
- for(i=0;i<CELLW-1;i++) {
- for(j=0;j<CELLH-1;j++) {
+ for(i=0;i<CELLW;i++) {
+ field[i][0] = CELLWALL;
+ field[i][CELLH-1] = CELLWALL;
+ }
+ for(j=0;j<CELLH;j++) {
+ field[0][j] = CELLWALL;
+ field[CELLW-1][j] = CELLWALL;
+ }
+
+ for(i=1;i<CELLW-1;i++) {
+ for(j=1;j<CELLH-1;j++) {
if(field[i][j] == celltype)
field[i][j] = CELLBLANK;
}
diff --git a/worm.c b/worm.c
index ebe6089..cc0e51a 100644
--- a/worm.c
+++ b/worm.c
@@ -564,9 +564,12 @@ EVMULT_OUT evout;
save_scores(argv[0]);
} else
form_alert(1,"[3][You've Died!|Good try, though...][Reset]");
+
reset_player(player);
playing = 0;
menu_ienable(app_menu, MPAUSE, 0);
+ update_field(player);
+ do_redraw(player, playing, NULL);
}
}