more stuff

This commit is contained in:
2026-05-13 19:30:02 +02:00
parent 2bb1acbece
commit 37f4ea3b4e
9 changed files with 148 additions and 16 deletions

22
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) { }
}