I can make a map with one room 'randomly' generated and calculate paths.

This commit is contained in:
Zed A. Shaw 2024-09-27 00:10:41 -04:00
parent 8b67a25732
commit 6cb3366912
5 changed files with 58 additions and 14 deletions

View file

@ -39,7 +39,7 @@ int main() {
using namespace ftxui;
std::string reset_position;
auto c = Canvas(100, 100);
auto c = Canvas(150, 100);
Map game_map = Map(input, walls, 1000);
@ -53,13 +53,13 @@ int main() {
const string tile = val == 1000 ? "#" : fmt::format("{}", result[y][x]);
c.DrawText(22+x*2, 24+y*4, tile);
c.DrawText(x*2, y*4, tile);
}
}
c.DrawText(20+4*2, 20+3*4, "@", Color::Blue);
c.DrawText(4*2, 3*4, "@", Color::Blue);
return canvas(c);
return canvas(c) | border;
});
while (true) {
@ -71,7 +71,7 @@ int main() {
) | xflex_grow
),
separator(),
hflow(map->Render()),
hbox(map->Render()),
}) | border;
auto screen = Screen::Create(Dimension::Full());