add damage and health component

This commit is contained in:
2024-12-25 13:04:21 +01:00
parent 4aacaa34bc
commit 7fd0f3a5a1
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
class_name DamageComponent
extends Node2D
@export var damage: float = 0.25
func deal_damage(target: HealthComponent):
target.decrease_health(damage)