aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-02-15 12:53:35 -0500
committerJeffrey Armstrong <jeff@approximatrix.com>2020-02-15 12:53:35 -0500
commitec5e20c1ac12213ce543c3eefa1eec1032ebbd1a (patch)
treef049890bbf8c74818fbc3c31003b9b4319b53a00
parent950dccf203a561a2748941a3addc5cca25b77b99 (diff)
downloadgemworm-ec5e20c1ac12213ce543c3eefa1eec1032ebbd1a.zip
gemworm-ec5e20c1ac12213ce543c3eefa1eec1032ebbd1a.tar.gz
Added a score to the game that redraws nicely!
-rw-r--r--field.c237
-rw-r--r--field.h3
-rw-r--r--player.c159
-rw-r--r--player.h1
-rw-r--r--worm.c140
5 files changed, 327 insertions, 213 deletions
diff --git a/field.c b/field.c
index 41c68e2..ea7ed77 100644
--- a/field.c
+++ b/field.c
@@ -45,101 +45,100 @@
/* Defines the play field */
char field[CELLW][CELLH];
-#define CELLBLANK 0
-#define CELLPLAYER 1
-#define CELLWALL 2
-#define CELLFOOD 3
+#define CELLBLANK 0
+#define CELLPLAYER 1
+#define CELLWALL 2
+#define CELLFOOD 3
-#define max(x,y) x>y ? x : y
-#define min(x,y) x<y ? x : y
-
-#define FOODRESETCOUNT 30
+#define max(x,y) x>y ? x : y
+#define min(x,y) x<y ? x : y
struct _food{
- WORD c_x;
- WORD c_y;
- int count;
+ WORD c_x;
+ WORD c_y;
+ int count;
} food;
void empty_field(char celltype)
{
char i,j;
- for(i=0;i<CELLW-1;i++) {
- for(j=0;j<CELLH-1;j++) {
- if(field[i][j] == celltype)
- field[i][j] = CELLBLANK;
- }
- }
-
+ for(i=0;i<CELLW-1;i++) {
+ for(j=0;j<CELLH-1;j++) {
+ if(field[i][j] == celltype)
+ field[i][j] = CELLBLANK;
+ }
+ }
+
}
void food_reset()
{
-
- field[food.c_x][food.c_y] = CELLBLANK;
- food.c_x = rand() % CELLW;
- food.c_y = rand() % CELLH;
- while(field[food.c_x][food.c_y] != CELLBLANK) {
- food.c_x = rand() % CELLW;
- food.c_y = rand() % CELLH;
- }
- food.count = 0;
- field[food.c_x][food.c_y] = CELLFOOD;
+
+ field[food.c_x][food.c_y] = CELLBLANK;
+ food.c_x = rand() % CELLW;
+ food.c_y = rand() % CELLH;
+ while(field[food.c_x][food.c_y] != CELLBLANK) {
+ food.c_x = rand() % CELLW;
+ food.c_y = rand() % CELLH;
+ }
+ food.count = 0;
+ field[food.c_x][food.c_y] = CELLFOOD;
}
void food_init()
{
- food.c_x = 10;
- food.c_y = 10;
- food_reset();
- field[food.c_x][food.c_y] = CELLFOOD;
+ food.c_x = 10;
+ food.c_y = 10;
+ food_reset();
+ field[food.c_x][food.c_y] = CELLFOOD;
}
int food_check(WORD h_vdi, GRECT *play, WPLAYER *player)
{
int oldx,oldy;
- if(player->head->c_x == food.c_x && player->head->c_y == food.c_y) {
- player->grow += FOODADDITION;
+ if(player->head->c_x == food.c_x && player->head->c_y == food.c_y) {
+ player->grow += FOODADDITION;
oldx = food.c_x; oldy = food.c_y;
- food_reset();
+ food_reset();
incremental_draw(h_vdi, play, food.c_x, food.c_y);
field[oldx][oldy] = CELLPLAYER;
- return FOODADDITION;
- }
-
- food.count++;
- if(food.count > FOODRESETCOUNT) {
+ return FOODADDITION;
+ }
+
+ food.count++;
+ if(food.count > FOODRESETCOUNT) {
oldx = food.c_x; oldy = food.c_y;
- food_reset();
+ food_reset();
incremental_draw(h_vdi, play, food.c_x, food.c_y);
incremental_draw(h_vdi, play, oldx, oldy);
+ return FOODRESETCOUNT;
}
- return 0;
+ return 0;
}
void field_init()
{
char i,j;
- for(j=0;j<CELLH;j++) {
- field[0][j] = CELLWALL;
- field[CELLW-1][j] = CELLWALL;
- }
+ for(j=0;j<CELLH;j++) {
+ field[0][j] = CELLWALL;
+ field[CELLW-1][j] = CELLWALL;
+ }
- for(i=1;i<CELLW-1;i++) {
- field[i][0] = CELLWALL;
- field[i][CELLH-1] = CELLWALL;
- for(j=1;j<CELLH-2;j++)
- field[i][j] = CELLBLANK;
- }
+ for(i=1;i<CELLW-1;i++) {
+ field[i][0] = CELLWALL;
+ field[i][CELLH-1] = CELLWALL;
+ for(j=1;j<CELLH-2;j++)
+ field[i][j] = CELLBLANK;
+ }
}
int check_wall(WPLAYER *player)
{
- return field[player->head->c_x][player->head->c_y] == CELLWALL ? DEAD : ALIVE;
+ return field[player->head->c_x][player->head->c_y] == CELLWALL ? DEAD : ALIVE;
}
void drawcell(WORD h_vdi, int type, char cx, char cy,
@@ -148,44 +147,44 @@ void drawcell(WORD h_vdi, int type, char cx, char cy,
WORD pts[4];
int vx,vy;
- vx = xoffset + cx*cellwidth;
- vy = yoffset + cy*cellheight;
+ vx = xoffset + cx*cellwidth;
+ vy = yoffset + cy*cellheight;
- switch(type) {
- case CELLWALL:
- vsf_color(h_vdi, (WORD)RED);
- pts[0] = vx; pts[1] = vy;
- pts[2] = vx+cellwidth; pts[3] = vy+cellheight;
- v_bar(h_vdi,pts);
- break;
+ switch(type) {
+ case CELLWALL:
+ vsf_color(h_vdi, (WORD)RED);
+ pts[0] = vx; pts[1] = vy;
+ pts[2] = vx+cellwidth; pts[3] = vy+cellheight;
+ v_bar(h_vdi,pts);
+ break;
case CELLBLANK:
- vsf_color(h_vdi, (WORD)WHITE);
- pts[0] = vx; pts[1] = vy;
- pts[2] = vx+cellwidth; pts[3] = vy+cellheight;
- v_bar(h_vdi,pts);
- break;
- case CELLPLAYER:
- vsf_color(h_vdi,(WORD)BLACK);
- v_ellipse(h_vdi,(WORD)(vx+cellwidth/2),
- (WORD)(vy+cellheight/2),
- (WORD)(max(cellwidth/2-1,1)),
- (WORD)(max(cellheight/2-1,1)));
- break;
- case CELLFOOD:
- vsf_color(h_vdi,(WORD)GREEN);
- v_ellipse(h_vdi,(WORD)(vx+cellwidth/2),
- (WORD)(vy+2*cellheight/3),
- (WORD)(cellwidth/2),
- (WORD)(cellheight/3));
- vsf_color(h_vdi,(WORD)BLACK);
- v_pieslice(h_vdi,(WORD)(vx+cellwidth/2),
- (WORD)(vy+cellheight/2),
- (WORD)(cellheight/2),
- (WORD)(500),
- (WORD)(1300));
- break;
- }
-
+ vsf_color(h_vdi, (WORD)WHITE);
+ pts[0] = vx; pts[1] = vy;
+ pts[2] = vx+cellwidth; pts[3] = vy+cellheight;
+ v_bar(h_vdi,pts);
+ break;
+ case CELLPLAYER:
+ vsf_color(h_vdi,(WORD)BLACK);
+ v_ellipse(h_vdi,(WORD)(vx+cellwidth/2),
+ (WORD)(vy+cellheight/2),
+ (WORD)(max(cellwidth/2-1,1)),
+ (WORD)(max(cellheight/2-1,1)));
+ break;
+ case CELLFOOD:
+ vsf_color(h_vdi,(WORD)GREEN);
+ v_ellipse(h_vdi,(WORD)(vx+cellwidth/2),
+ (WORD)(vy+2*cellheight/3),
+ (WORD)(cellwidth/2),
+ (WORD)(cellheight/3));
+ vsf_color(h_vdi,(WORD)BLACK);
+ v_pieslice(h_vdi,(WORD)(vx+cellwidth/2),
+ (WORD)(vy+cellheight/2),
+ (WORD)(cellheight/2),
+ (WORD)(500),
+ (WORD)(1300));
+ break;
+ }
+
}
void incremental_draw(WORD h_vdi, GRECT *play, int x, int y)
@@ -195,7 +194,7 @@ int cellwidth, cellheight;
WUNIT *walker;
cellwidth = max(1,play->g_w/CELLW);
- cellheight = max(1,play->g_h/CELLH);
+ cellheight = max(1,play->g_h/CELLH);
drawcell(h_vdi, field[x][y],
x, y,
@@ -210,31 +209,31 @@ WORD pts[4];
int cellwidth, cellheight;
#ifdef VDEBUG
- printf("%d: %d %d %d %d\n",h_vdi,play->g_x,play->g_y,play->g_w,play->g_h);
+ printf("%d: %d %d %d %d\n",h_vdi,play->g_x,play->g_y,play->g_w,play->g_h);
#endif
vsf_interior(h_vdi, 1);
- /* Fill background */
- vsf_color(h_vdi, (WORD)WHITE);
- pts[0] = play->g_x; pts[1] = play->g_y;
- pts[2] = play->g_x+play->g_w; pts[3] = play->g_y+play->g_h;
- v_bar(h_vdi,pts);
-
- cellwidth = max(1,play->g_w/CELLW);
- cellheight = max(1,play->g_h/CELLH);
-
- /* Draw all cells */
- for(i=0;i<CELLW;i++) {
- for(j=0;j<CELLH;j++) {
+ /* Fill background */
+ vsf_color(h_vdi, (WORD)WHITE);
+ pts[0] = play->g_x; pts[1] = play->g_y;
+ pts[2] = play->g_x+play->g_w; pts[3] = play->g_y+play->g_h;
+ v_bar(h_vdi,pts);
+
+ cellwidth = max(1,play->g_w/CELLW);
+ cellheight = max(1,play->g_h/CELLH);
+
+ /* Draw all cells */
+ for(i=0;i<CELLW;i++) {
+ for(j=0;j<CELLH;j++) {
if(field[i][j] != CELLBLANK)
drawcell(h_vdi, field[i][j], i, j,
play->g_x, play->g_y,
cellwidth, cellheight);
}
- }
+ }
- /* Done! */
+ /* Done! */
}
@@ -243,18 +242,18 @@ int update_field(WPLAYER *player)
{
WUNIT *walker;
int da;
-
- /* Check the wall now */
- da = check_wall(player);
-
- /* First empty the player from the field */
- empty_field(CELLPLAYER);
-
- /* Now reinsert all player values */
- walker = player->head;
- while(walker != NULL) {
- field[walker->c_x][walker->c_y] = CELLPLAYER;
- walker = (WUNIT *)walker->next;
- }
- return da;
+
+ /* Check the wall now */
+ da = check_wall(player);
+
+ /* First empty the player from the field */
+ empty_field(CELLPLAYER);
+
+ /* Now reinsert all player values */
+ walker = player->head;
+ while(walker != NULL) {
+ field[walker->c_x][walker->c_y] = CELLPLAYER;
+ walker = (WUNIT *)walker->next;
+ }
+ return da;
}
diff --git a/field.h b/field.h
index f40029c..4cd7bad 100644
--- a/field.h
+++ b/field.h
@@ -57,6 +57,7 @@ int food_check(WORD h_vdi, GRECT *play, WPLAYER *player);
void incremental_draw(WORD h_vdi, GRECT *play, int x, int y);
-#define FOODADDITION 5
+#define FOODADDITION 5
+#define FOODRESETCOUNT 30
#endif /* __FIELD_HEADERS */ \ No newline at end of file
diff --git a/player.c b/player.c
index 5ba510e..40ef003 100644
--- a/player.c
+++ b/player.c
@@ -25,21 +25,21 @@
void move_player(WPLAYER *player, char dir)
{
- player->dir = dir;
+ player->dir = dir;
}
void swap(char *i, char *j)
{
char s;
- s = *i;
- *i = *j;
- *j = s;
+ s = *i;
+ *i = *j;
+ *j = s;
}
void grow(WPLAYER *player, int count)
{
- player->grow += count;
+ player->grow += count;
}
int update_player(WPLAYER *player, int *tailx, int *taily)
@@ -48,53 +48,53 @@ WUNIT *walker;
char lastx, lasty;
int alive;
- walker = player->head;
- lastx = walker->c_x;
- lasty = walker->c_y;
-
- switch(player->dir) {
- case WUP:
- lasty--;
- break;
- case WDOWN:
- lasty++;
- break;
- case WLEFT:
- lastx--;
- break;
- case WRIGHT:
- lastx++;
- break;
- }
-
- while(walker != NULL) {
- swap(&lastx, &walker->c_x);
- swap(&lasty, &walker->c_y);
-
- if(walker->next == NULL && player->grow > 0) {
- walker->next =(WUNIT *)malloc(sizeof(WUNIT));
- ((WUNIT *)walker->next)->next = NULL;
- ((WUNIT *)walker->next)->c_x = lastx;
- ((WUNIT *)walker->next)->c_y = lasty;
- player->grow--;
- }
-
- walker = (WUNIT *)walker->next;
- }
-
+ walker = player->head;
+ lastx = walker->c_x;
+ lasty = walker->c_y;
+
+ switch(player->dir) {
+ case WUP:
+ lasty--;
+ break;
+ case WDOWN:
+ lasty++;
+ break;
+ case WLEFT:
+ lastx--;
+ break;
+ case WRIGHT:
+ lastx++;
+ break;
+ }
+
+ while(walker != NULL) {
+ swap(&lastx, &walker->c_x);
+ swap(&lasty, &walker->c_y);
+
+ if(walker->next == NULL && player->grow > 0) {
+ walker->next =(WUNIT *)malloc(sizeof(WUNIT));
+ ((WUNIT *)walker->next)->next = NULL;
+ ((WUNIT *)walker->next)->c_x = lastx;
+ ((WUNIT *)walker->next)->c_y = lasty;
+ player->grow--;
+ }
+
+ walker = (WUNIT *)walker->next;
+ }
+
*tailx = lastx;
*taily = lasty;
- walker = (WUNIT *)player->head->next;
- alive = ALIVE;
- while(walker != NULL) {
- if(walker->c_x == player->head->c_x && walker->c_y == player->head->c_y) {
- alive = DEAD;
- break;
- }
- walker = (WUNIT *)walker->next;
- }
- return alive;
+ walker = (WUNIT *)player->head->next;
+ alive = ALIVE;
+ while(walker != NULL) {
+ if(walker->c_x == player->head->c_x && walker->c_y == player->head->c_y) {
+ alive = DEAD;
+ break;
+ }
+ walker = (WUNIT *)walker->next;
+ }
+ return alive;
}
WUNIT *reset_body(WUNIT *head)
@@ -104,45 +104,46 @@ WUNIT *tmp;
int i;
char lastx;
- walker = head;
- while(walker != NULL) {
- tmp = walker;
- walker = (WUNIT *)walker->next;
- tmp->next = NULL;
- free(tmp);
- }
-
- walker = (WUNIT *)malloc(sizeof(WUNIT));
- walker->c_x = CELLW/3*2;
- walker->c_y = CELLH/2;
- tmp = walker;
- for(i=1;i<STARTLENGTH;i++) {
- lastx = walker->c_x;
- walker->next = (WUNIT *)malloc(sizeof(WUNIT));
- walker = (WUNIT *)walker->next;
- walker->c_y = CELLH/2;
- walker->c_x = lastx+1;
- walker->next = NULL;
- }
-
- return tmp;
+ walker = head;
+ while(walker != NULL) {
+ tmp = walker;
+ walker = (WUNIT *)walker->next;
+ tmp->next = NULL;
+ free(tmp);
+ }
+
+ walker = (WUNIT *)malloc(sizeof(WUNIT));
+ walker->c_x = CELLW/3*2;
+ walker->c_y = CELLH/2;
+ tmp = walker;
+ for(i=1;i<STARTLENGTH;i++) {
+ lastx = walker->c_x;
+ walker->next = (WUNIT *)malloc(sizeof(WUNIT));
+ walker = (WUNIT *)walker->next;
+ walker->c_y = CELLH/2;
+ walker->c_x = lastx+1;
+ walker->next = NULL;
+ }
+
+ return tmp;
}
void reset_player(WPLAYER *player)
{
- player->length = STARTLENGTH;
- player->dir = WLEFT;
- player->head = reset_body(player->head);
+ player->length = STARTLENGTH;
+ player->dir = WLEFT;
+ player->head = reset_body(player->head);
}
WPLAYER *init_player()
{
WPLAYER *player;
- player = (WPLAYER *)malloc(sizeof(WPLAYER));
- player->head = NULL;
- reset_player(player);
- player->grow = 0;
- return player;
+ player = (WPLAYER *)malloc(sizeof(WPLAYER));
+ player->head = NULL;
+ reset_player(player);
+ player->grow = 0;
+ player->score = 0;
+ return player;
}
diff --git a/player.h b/player.h
index acf8030..f9381d0 100644
--- a/player.h
+++ b/player.h
@@ -31,6 +31,7 @@ typedef struct {
WUNIT *head;
char dir;
int grow;
+ int score;
} WPLAYER;
#define WUP 0
diff --git a/worm.c b/worm.c
index dca4294..e7bbb37 100644
--- a/worm.c
+++ b/worm.c
@@ -101,7 +101,7 @@ OBJECT FAR *about_box;
#define STARTHEIGHT 480
#ifndef MGEMLIB
-int rc_intersect(GRECT *one, GRECT *two)
+int rc_intersect(const GRECT *one, GRECT *two)
{
WORD tx,ty,tw,th;
@@ -154,9 +154,9 @@ int open_window(int new)
if(new == 1) {
/* Get the desktop */
wind_get(0, WF_WXYWH, &app_wdw.g_x,
- &app_wdw.g_y,
- &app_wdw.g_w,
- &app_wdw.g_h);
+ &app_wdw.g_y,
+ &app_wdw.g_w,
+ &app_wdw.g_h);
app_wdw.g_w = min(STARTWIDTH,app_wdw.g_w);
app_wdw.g_h = min(STARTHEIGHT,app_wdw.g_h);
@@ -211,11 +211,65 @@ WORD txtwidth,txtheight;
return open_window(1);
}
-/* Not necessary yet... */
-void do_redraw()
+int get_score_height()
+{
+WORD attrib[10];
+
+ vqt_attributes(app_vh, attrib);
+ return attrib[9];
+}
+
+void do_redraw_score(WPLAYER *player, GRECT *update)
+{
+WORD pts[4];
+char score_str[128];
+
+ vsf_interior(app_vh, 1);
+
+ /* Fill background */
+ vsf_color(app_vh, (WORD)WHITE);
+ pts[0] = update->g_x; pts[1] = update->g_y;
+ pts[2] = update->g_x+update->g_w; pts[3] = update->g_y+update->g_h;
+ v_bar(app_vh, pts);
+
+ /* Text */
+ sprintf(score_str, "Score: %d", player->score);
+ vst_color(app_vh, (WORD)BLACK);
+ v_gtext(app_vh, update->g_x+5, update->g_y + update->g_h - 2, score_str);
+}
+
+void force_redraw_score(WPLAYER *player)
+{
+GRECT score;
+
+ graf_mouse(M_OFF,NULL);
+ wind_update(BEG_UPDATE);
+
+ wind_get(app_wh, WF_WXYWH, &score.g_x, &score.g_y, &score.g_w, &score.g_h);
+ score.g_h = get_score_height();
+
+ do_redraw_score(player, &score);
+
+ wind_update(END_UPDATE);
+ graf_mouse(M_ON,NULL);
+}
+
+void window_to_field_rect(GRECT *rc)
{
-GRECT box, me;
+int sh;
+
+ sh = get_score_height() + 1;
+ rc->g_y += sh;
+ rc->g_h -= sh;
+}
+
+#define PRINTRC(n,r) printf("%s -> x=%d y=%d w=%d h=%d\n", n, r.g_x, r.g_y, r.g_w, r.g_h)
+/* Not necessary yet... */
+void do_redraw(WPLAYER *player)
+{
+GRECT box, me, field, score, rc;
+int updated_score;
WORD pts[4];
#ifdef DEBUG
@@ -226,19 +280,56 @@ WORD pts[4];
wind_update(BEG_UPDATE);
wind_get(app_wh, WF_WXYWH, &me.g_x, &me.g_y, &me.g_w, &me.g_h);
+
+ memcpy(&field, &me, sizeof(GRECT));
+ memcpy(&score, &me, sizeof(GRECT));
+
+ score.g_h = get_score_height();
+ window_to_field_rect(&field);
+
wind_get(app_wh, WF_FIRSTXYWH, &box.g_x,
&box.g_y,
&box.g_w,
&box.g_h);
+ updated_score = 0;
while(box.g_w || box.g_h) {
- if(rc_intersect(&me, &box)) {
+
+#ifdef DEBUG
+ PRINTRC("box", box);
+ PRINTRC("field", field);
+#endif
+
+ memcpy(&rc, &field, sizeof(GRECT));
+ if(rc_intersect(&box, &rc)) {
+#ifdef DEBUG
+ printf("Field draw\n");
+#endif
+ pts[0] = box.g_x;
+ pts[1] = box.g_y;
+ pts[2] = box.g_w+box.g_x-1;
+ pts[3] = box.g_h+box.g_y-1;
+ vs_clip(app_vh, 1, pts);
+ draw_field(app_vh, &field);
+ }
+
+#ifdef DEBUG
+ PRINTRC("box", box);
+ PRINTRC("score", score);
+#endif
+
+ memcpy(&rc, &score, sizeof(GRECT));
+ if(rc_intersect(&box, &rc)) {
+#ifdef DEBUG
+ printf("Score draw\n");
+#endif
pts[0] = box.g_x;
pts[1] = box.g_y;
pts[2] = box.g_w+box.g_x-1;
pts[3] = box.g_h+box.g_y-1;
vs_clip(app_vh, 1, pts);
- draw_field(app_vh, &app_wdw);
+ do_redraw_score(player, &score);
+ /* updated_score = 1; */
}
wind_get(app_wh, WF_NEXTXYWH, &box.g_x,
&box.g_y,
@@ -296,6 +387,7 @@ WORD special_keys;
WORD key;
WPLAYER *player;
+GRECT field;
int playing = 0;
int palive, falive;
@@ -329,6 +421,10 @@ EVMULT_OUT evout;
evin.emi_tlow = (int16_t)MOVEDELAY;
#endif
+ /* Set up the "field" rectangle */
+ memcpy(&field, &app_wdw, sizeof(GRECT));
+ window_to_field_rect(&field);
+
msg[0] = AC_OPEN;
msg[4] = app_accid;
ret = MU_MESAG;
@@ -368,12 +464,22 @@ EVMULT_OUT evout;
palive = update_player(player, &tailx, &taily);
falive = update_field(player);
- food_check(app_vh, &app_wdw, player);
+ switch(food_check(app_vh, &field, player)) {
+ case FOODADDITION:
+ player->score += 100;
+ force_redraw_score(player);
+ break;
+ case FOODRESETCOUNT:
+ player->score -= 10;
+ if(player->score < 0) player->score = 0;
+ force_redraw_score(player);
+ break;
+ }
/* form_alert(1,"[1][Update][Ok]"); */
/* draw_field(app_vh, &app_wdw); */
- incremental_draw(app_vh, &app_wdw, player->head->c_x, player->head->c_y);
- incremental_draw(app_vh, &app_wdw, tailx, taily);
+ incremental_draw(app_vh, &field, player->head->c_x, player->head->c_y);
+ incremental_draw(app_vh, &field, tailx, taily);
wind_update(END_UPDATE);
@@ -426,9 +532,13 @@ EVMULT_OUT evout;
case WM_MOVED:
case WM_SIZED:
do_window_change((GRECT *)&msg[4]);
+ memcpy(&field, &app_wdw, sizeof(GRECT));
+ window_to_field_rect(&field);
+ /* Fall through */
+
case WM_REDRAW:
update_field(player);
- do_redraw();
+ do_redraw(player);
break;
case MN_SELECTED:
@@ -439,8 +549,10 @@ EVMULT_OUT evout;
appl_write(app_accid,sizeof(msg),msg);
break;
case MNEW:
+ player->score = 0;
+ force_redraw_score(player);
update_field(player);
- draw_field(app_vh, &app_wdw);
+ draw_field(app_vh, &field);
playing = 1;
break;
case MABOUT: