add character contorller and damage handling
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user