Files

20 lines
434 B
GDScript

extends Area2D
class_name HurtboxComponent
signal on_damaged(hitbox: HitboxComponent)
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_area_entered(area: Area2D) -> void:
if area is HitboxComponent:
on_damaged.emit(area)