Files
GMTK25/damageable/hitbox.gd
Minimata 6e017197f6
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 5s
Create tag and build when new code gets to main / Export (push) Successful in 2m5s
feat: integrated some assets and made a hitbox and damage reaction system
2025-08-01 17:17:00 +02:00

10 lines
246 B
GDScript

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)