mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-08 18:55:54 +00:00
Automatic doors
This commit is contained in:
parent
c3107fbce9
commit
3fc39f63c4
29 changed files with 401 additions and 525 deletions
|
|
@ -1,21 +1,22 @@
|
|||
using Godot;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Controllers;
|
||||
|
||||
// [Tool]
|
||||
[Tool]
|
||||
public partial class DoorMarker : Marker2D
|
||||
{
|
||||
[Export] public RoomDirection Direction { get; set; } = RoomDirection.North;
|
||||
[Export] public DoorDirections Direction { get; set; } = DoorDirections.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),
|
||||
DoorDirections.North => new Vector2I(0, -1),
|
||||
DoorDirections.South => new Vector2I(0, 1),
|
||||
DoorDirections.East => new Vector2I(1, 0),
|
||||
DoorDirections.West => new Vector2I(-1, 0),
|
||||
_ => Vector2I.Zero
|
||||
};
|
||||
}
|
||||
|
|
@ -28,11 +29,3 @@ public partial class DoorMarker : Marker2D
|
|||
// 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