Cleaned up the map for more work.
This commit is contained in:
parent
4f863c2635
commit
8b67a25732
5 changed files with 46 additions and 20 deletions
8
main.cpp
8
main.cpp
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue