Files
GMTK25/damageable/damageable.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

14 lines
268 B
GDScript

extends Node
class_name Damageable
@export var health = 3
@export var hitback_velocity: float = 500
signal got_hit
func damage(value: int = 0, direction: Vector2 = Vector2.UP):
health -= value
get_parent().velocity = hitback_velocity * direction
got_hit.emit()