feat: integrated some assets and made a hitbox and damage reaction system
This commit is contained in:
13
damageable/damageable.gd
Normal file
13
damageable/damageable.gd
Normal file
@ -0,0 +1,13 @@
|
||||
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()
|
Reference in New Issue
Block a user