dungeon-generator | procedural javascript dungeon generator | Generator Utils library
kandi X-RAY | dungeon-generator Summary
kandi X-RAY | dungeon-generator Summary
This is a procedural dungeon generator written in javascript.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of dungeon-generator
dungeon-generator Key Features
dungeon-generator Examples and Code Snippets
Community Discussions
Trending Discussions on dungeon-generator
QUESTION
I have this function that connects two rooms with a hallway. It seems really inefficient but I can't find a better way to do it. It is part of my BSP algorithm for generating dungeons. You can find the full algorithm here.
...ANSWER
Answered 2018-Oct-06 at 12:44If I understand your problem correctly, you
- first choose two random points
point1
,point2
in the left (resp. right) room, and - then connect the rooms with two “corridors” from
point1
topoint2
, either going horizontally first and then vertically, or vice versa.
Apart from the random choice you don't need if-statements if you use
min
and abs
to compute the corridor coordinates.
Something like (more explanations inline):
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dungeon-generator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page