SolarLune / dngn

A Golang library for random map generation for games.
MIT License
135 stars 18 forks source link

Minimum Hallway Width #6

Open Noofbiz opened 3 months ago

Noofbiz commented 3 months ago

Hello! I'm building a random dungeon with GenerateRandomRooms, but when it connects the rooms it uses a width of only one tile. With the wall tiles forming corners, this causes the hallways to be impassable. Is there a way to control the width of the connections? This could be fixed by passing a number other than one to the DrawLine call on this line. I can do the PR for the fix, I'm just wondering how you'd like it done. If I add a parameter to GenerateRandomRooms that would change the API, so if you want to avoid that I can add a separate function like GenerateRandomRoomsMinHallwayConnections or something so other people won't need to update their code upon updating dngn.

SolarLune commented 1 month ago

Hello! Sure, a PR would be fine - it might be good to move all of the arguments to a struct to simplify things and make certain things optional (like defaulting to an emptyRune of ). I feel like corners should be passable, though, unless I'm misunderstanding what the issue is? Also, sorry for getting back to you so late!