a bit more stuff

This commit is contained in:
2026-05-31 19:14:19 +02:00
parent 69c941b0e1
commit c9ec6c6c55
14 changed files with 180 additions and 81 deletions

28
EnergyProducer.cs Normal file
View File

@@ -0,0 +1,28 @@
using Godot;
using NodeWar.scripts;
using NodeWar.Scripts;
namespace NodeWar;
public partial class EnergyProducer : Node
{
[Export]
public float EnergyCapacity = 100;
[Export]
public float EnergyStored = 0;
[Export]
public float EnergyGenerationRate = 1.0f;
public override void _Ready()
{
EnergyManager.Instance.EnergyProducers.Add(this);
}
public override void _Process(double delta)
{
EnergyStored += EnergyGenerationRate * delta.ToFloat();
EnergyStored = Mathf.Clamp(EnergyStored, 0, EnergyCapacity);
}
}