19 lines
467 B
GDScript
19 lines
467 B
GDScript
class_name HitBox extends Area2D
|
|
|
|
@export var damage:float = 10
|
|
@export_flags("player","enemy") var damage_type:int = 0
|
|
|
|
# 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 hit():
|
|
for i in get_overlapping_areas():
|
|
if i is HurtBox:
|
|
i.on_damage_receieved(self)
|