Add overworld

This commit is contained in:
2025-06-28 17:18:54 -07:00
parent 3efab7e233
commit 0880b74695
185 changed files with 10598 additions and 1510 deletions

View File

@@ -2,6 +2,7 @@
using Chickensoft.Introspection;
using Godot;
using System.Collections.Immutable;
using Zennysoft.Ma.Adapter;
namespace Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
@@ -9,9 +10,11 @@ public partial class Overworld : Node3D, IDungeonFloor
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] protected IGame Game => this.DependOn<IGame>();
[Node] public Marker3D PlayerSpawnPoint { get; set; } = default!;
[Node] public Marker3D ExitSpawnPoint { get; set; } = default!;
[Node] private Area3D Exit { get; set; } = default!;
public ImmutableList<IDungeonRoom> Rooms => [];
@@ -20,16 +23,20 @@ public partial class Overworld : Node3D, IDungeonFloor
public void InitializeDungeon()
{
Show();
Exit.AreaEntered += Exit_AreaEntered;
FloorIsLoaded = true;
}
private void Exit_AreaEntered(Area3D area)
{
if (area.GetOwner() is IPlayer)
ExitReached();
}
public void ExitReached() => Game.FloorExitReached();
public Transform3D GetPlayerSpawnPoint()
{
return PlayerSpawnPoint.GlobalTransform;
}
public Vector3 GetTeleportSpawnPoint()
{
return ExitSpawnPoint.GlobalPosition;
}
}