feat: integrated some assets and made a hitbox and damage reaction system
This commit is contained in:
9
damageable/hitbox.gd
Normal file
9
damageable/hitbox.gd
Normal file
@ -0,0 +1,9 @@
|
||||
extends Area2D
|
||||
|
||||
@export var damage = 0
|
||||
@export var hitback_direction = Vector2.UP
|
||||
|
||||
func _on_body_entered(body: Node2D) -> void:
|
||||
for child in body.get_children():
|
||||
if is_instance_of(child, Damageable):
|
||||
child.damage(damage, hitback_direction)
|
Reference in New Issue
Block a user