mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-09 08:35:53 +00:00
Door link
This commit is contained in:
parent
700be1e207
commit
d4b9a928db
6 changed files with 21 additions and 34 deletions
|
|
@ -186,28 +186,6 @@ public partial class RogueliteRoomManager : Node2D
|
|||
//CallDeferred(MethodName.OpenStartDoorsDeferred, spawnedBeginRoom);
|
||||
}
|
||||
|
||||
private Vector2I? FindValidBossRoomLocation(Vector2I from, int maxSteps = 10)
|
||||
{
|
||||
var directions = new List<Vector2I> { Vector2I.Right, Vector2I.Left, Vector2I.Up, Vector2I.Down };
|
||||
|
||||
for (int step = 0; step < maxSteps; step++)
|
||||
{
|
||||
directions = directions.OrderBy(_ => GD.Randi()).ToList();
|
||||
|
||||
foreach (var dir in directions)
|
||||
{
|
||||
var pos = from + dir;
|
||||
var bossRoom = Rooms.FirstOrDefault(r => r.Type == RoomType.Boss);
|
||||
if (bossRoom != null && CanPlaceRoom(pos, bossRoom.Size))
|
||||
return pos;
|
||||
|
||||
from += dir;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Vector2I GetNextPosition(Vector2I current, Vector2I target)
|
||||
{
|
||||
var possibleDirs = new List<Vector2I>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue