This commit is contained in:
2026-06-26 02:04:50 +07:00
parent 4fa3fb2c15
commit e0d2b83bd1
16 changed files with 94725 additions and 66906 deletions

View File

@@ -25,6 +25,7 @@ namespace Hallucinate.GameSetup.Maze
private void GenerateRecursive(MazeGrid grid, int x, int z)
{
if (grid.GetCell(x, z) != MazeCellType.Wall) return;
if (grid.CountSquareNeighbours(x, z, MazeCellType.Corridor) >= DeadEndNeighbourThreshold) return;
grid.SetCell(x, z, MazeCellType.Corridor);
@@ -45,6 +46,7 @@ namespace Hallucinate.GameSetup.Maze
private IEnumerator GenerateRecursiveStepByStep(MazeGrid grid, int x, int z, int cellsPerFrame)
{
if (grid.GetCell(x, z) != MazeCellType.Wall) yield break;
if (grid.CountSquareNeighbours(x, z, MazeCellType.Corridor) >= DeadEndNeighbourThreshold) yield break;
grid.SetCell(x, z, MazeCellType.Processing);