mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 17:55:54 +00:00
room positioning and door generator
This commit is contained in:
parent
59f98ebf0e
commit
5bfffc22ad
19 changed files with 571 additions and 17 deletions
38
Scripts/Controllers/DoorMarker.cs
Normal file
38
Scripts/Controllers/DoorMarker.cs
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Controllers;
|
||||
|
||||
// [Tool]
|
||||
public partial class DoorMarker : Marker2D
|
||||
{
|
||||
[Export] public RoomDirection Direction { get; set; } = RoomDirection.North;
|
||||
[Export] public int WallIndex { get; set; } = 0; // Useful if there are multiple along a wall
|
||||
|
||||
public Vector2I GetWorldDirection()
|
||||
{
|
||||
return Direction switch
|
||||
{
|
||||
RoomDirection.North => new Vector2I(0, -1),
|
||||
RoomDirection.South => new Vector2I(0, 1),
|
||||
RoomDirection.East => new Vector2I(1, 0),
|
||||
RoomDirection.West => new Vector2I(-1, 0),
|
||||
_ => Vector2I.Zero
|
||||
};
|
||||
}
|
||||
|
||||
// public override void _Draw()
|
||||
// {
|
||||
// if (!Engine.IsEditorHint()) return;
|
||||
//
|
||||
// DrawLine(Vector2.Zero, Vector2.Up * 16, Colors.Orange, 2);
|
||||
// DrawString(GetFont("font", "Label"), new Vector2(10, -10), Direction.ToString(), HAlign.Left);
|
||||
// }
|
||||
}
|
||||
|
||||
public enum RoomDirection
|
||||
{
|
||||
North,
|
||||
South,
|
||||
East,
|
||||
West
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue