add character contorller and damage handling

This commit is contained in:
2026-05-20 18:50:52 +01:00
parent 579413d20a
commit bceb6c6df8
12 changed files with 223 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
class_name HurtBox extends Area2D
signal damage_recieved(damage:float)
@export_flags("player","enemy") var type
# 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_damage_receieved(hitbox:HitBox):
if hitbox.affect & type:
damage_recieved.emit(hitbox.damage)
#if type