time-of-day + creature spawns in spawn zones

This commit is contained in:
anonoe 2026-02-10 17:21:54 +01:00
parent c5d89c898a
commit 246f3c0840
Signed by: anonoe
SSH key fingerprint: SHA256:OnAs6gNQelOnDiY5tBpDYKQiuTgBvnmIdMo5P09cdqg
8 changed files with 148 additions and 2 deletions

View file

@ -0,0 +1,30 @@
using Godot;
public partial class WorldClock : Node
{
public enum TimeOfDay { Morning, Day, Night }
[Export] public TimeOfDay Current { get; private set; } = TimeOfDay.Day;
public override void _Process(double delta)
{
// Debug toggle: press T to cycle
if (Input.IsActionJustPressed("debug_cycle_time"))
{
Current = Current switch
{
TimeOfDay.Morning => TimeOfDay.Day,
TimeOfDay.Day => TimeOfDay.Night,
_ => TimeOfDay.Morning
};
GD.Print($"TimeOfDay -> {Current}");
}
}
public static string ToPackString(TimeOfDay t) => t switch
{
TimeOfDay.Morning => "morning",
TimeOfDay.Day => "day",
_ => "night"
};
}