Add a terrible maze generation algorithm to test if a maze style map looks/feels better. The walls are disabled so you can walk around.
This commit is contained in:
parent
6cbfcf993e
commit
7a0b2f988d
9 changed files with 207 additions and 52 deletions
23
tests/mazes.cpp
Normal file
23
tests/mazes.cpp
Normal file
|
@ -0,0 +1,23 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
#include "matrix.hpp"
|
||||
#include "rand.hpp"
|
||||
#include "constants.hpp"
|
||||
#include "maze.hpp"
|
||||
|
||||
using std::string;
|
||||
using matrix::Matrix;
|
||||
|
||||
TEST_CASE("simple maze first attempt", "[maze-gen]") {
|
||||
auto map = matrix::make(21, 21);
|
||||
std::vector<Room> rooms;
|
||||
|
||||
maze::recursive_div(map, rooms);
|
||||
matrix::dump("MAZE?", map);
|
||||
|
||||
for(auto& room : rooms) {
|
||||
fmt::println("room: {},{}; {},{}",
|
||||
room.x, room.y, room.width, room.height);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue