This commit is contained in:
Scove
2026-03-30 12:15:19 +07:00
parent 1fb9c78adb
commit 4174d5122a
104 changed files with 247 additions and 1869 deletions

View File

@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Recursive : Maze
{
public override void Generate()
{
Generate(5, 5);
}
void Generate(int x, int z)
{
if (CountSquareNeighbours(x, z) >= 2) return;
map[x, z] = 0;
directions.Shuffle();
Generate(x + directions[0].x, z + directions[0].z);
Generate(x + directions[1].x, z + directions[1].z);
Generate(x + directions[2].x, z + directions[2].z);
Generate(x + directions[3].x, z + directions[3].z);
}
}