Vast improvement in the world generation, with more reliable pathing, cleaner generation code, and an ability to do a random or direct walk to create paths. This also works with enemies if I want.
This commit is contained in:
parent
c7607533ce
commit
0b4392dbcc
7 changed files with 151 additions and 77 deletions
|
@ -9,25 +9,29 @@ using namespace fmt;
|
|||
using namespace nlohmann;
|
||||
using std::string;
|
||||
|
||||
TEST_CASE("bsp algo test", "[map]") {
|
||||
TEST_CASE("bsp algo test", "[builder]") {
|
||||
Map map(20, 20);
|
||||
WorldBuilder builder(map);
|
||||
builder.generate();
|
||||
REQUIRE(map.$rooms.size() >= 2);
|
||||
}
|
||||
|
||||
TEST_CASE("dumping and debugging", "[map]") {
|
||||
TEST_CASE("dumping and debugging", "[builder]") {
|
||||
Map map(20, 20);
|
||||
WorldBuilder builder(map);
|
||||
builder.generate();
|
||||
|
||||
REQUIRE(map.$rooms.size() >= 2);
|
||||
|
||||
dump_map("GENERATED", map.paths());
|
||||
map.dump();
|
||||
}
|
||||
|
||||
TEST_CASE("pathing", "[map]") {
|
||||
TEST_CASE("pathing", "[builder]") {
|
||||
Map map(20, 20);
|
||||
WorldBuilder builder(map);
|
||||
builder.generate();
|
||||
REQUIRE(map.$rooms.size() >= 2);
|
||||
|
||||
REQUIRE(map.can_move({0,0}) == false);
|
||||
REQUIRE(map.iswall(0,0) == true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue