connections

This commit is contained in:
2026-05-20 16:34:39 +02:00
parent 70bba45b8a
commit 661e62e8b8
35 changed files with 1039 additions and 258 deletions

22
scripts/Damager.cs Normal file
View File

@@ -0,0 +1,22 @@
using System;
using Godot;
using NodeWar.scripts.components;
public partial class Damager : Timer
{
[Export]
public float Damage { get; set; } = 1;
public override void _Ready()
{
Timeout += OnTimeout;
}
private void OnTimeout()
{
var healthComponent = GetParent().GetNode<HealthComponent>("HealthComponent");
healthComponent?.TakeDamage(Damage);
}
public override void _Process(double delta) { }
}