4 ** 2021-12, markus schnalke <meillo@marmaro.de>
9 static void draw(void);
10 static void wboxborder(WINDOW *);
18 struct map *map, *fow;
20 char *title = "**** DUNGEON1 ****";
27 w_title = newwin(1, COLS-1, 0, 0);
28 mvwprintw(w_title, 0, MAPW/2 - strlen(title)/2, "%s", title);
30 w_mapborder = newwin(MAPH+2*BORDER, MAPW+2*BORDER, 1, 0);
31 wboxborder(w_mapborder);
32 w_map = subwin(w_mapborder, MAPH, MAPW, 2, 1);
34 w_info = newwin(4, MAPW+2*BORDER, MAPH+2*BORDER+1, 0);
36 w_gold = subwin(w_info, 1, 10, MAPH+2*BORDER+1+2, 50);
37 w_pos = subwin(w_info, 1, 20, MAPH+2*BORDER+1+2, 10);
44 map = readmap("map1");
46 findchar(map, '>', &y, &x);
51 while ((c = getch()) != ERR) {
76 if (y2 < 0 || y2 > H || x2 < 0 || x2 > W) {
80 c2 = map->map[y2][x2];
84 map->map[y2][x2] = ' ';
85 mvwaddch(w_map, y2, x2, ' ');
86 mvwprintw(w_gold, 0, 0, "gold:%d", gold);
89 mvwprintw(w_pos, 0, 0, "pos: %d,%d", x2, y2);
94 mvwprintw(w_map, H-5, 10, "AUSGANG gefunden!");
100 mvwprintw(w_pos, 0, 10, "<%c>", c2);
101 wmove(w_map, y2, x2);
108 mvprintw(H, 0, "press key to exit...");
124 overlay(w_gold, w_info);
125 overlay(w_pos, w_info);
127 wrefresh(w_mapborder);
128 overlay(w_map, w_mapborder);
133 wboxborder(WINDOW *win)
135 wborder(win, '|', '|', '-', '-', '+', '+', '+', '+');