Cleaned up the map for more work.

This commit is contained in:
Zed A. Shaw 2024-09-26 23:14:42 -04:00
parent 4f863c2635
commit 8b67a25732
5 changed files with 46 additions and 20 deletions

View file

@ -41,14 +41,18 @@ int main() {
auto c = Canvas(100, 100);
// A triangle following the mouse, using braille characters.
Map game_map = Map(input, walls, 1000);
auto map = Renderer([&] {
Matrix result = dijkstra_map(input, walls, 1000);
game_map.make_paths();
Matrix &result = game_map.paths();
for(size_t x = 0; x < result[0].size(); ++x) {
for(size_t y = 0; y < result.size(); ++y) {
auto val = result[y][x];
const string tile = val == 1000 ? "#" : fmt::format("{}", result[y][x]);
c.DrawText(22+x*2, 24+y*4, tile);
}
}