Improved component system
This commit is contained in:
@ -2,10 +2,11 @@ class_name HealthComponent
|
||||
extends Node
|
||||
|
||||
@export var max_health: float
|
||||
|
||||
var health: float
|
||||
|
||||
func _ready():
|
||||
pass
|
||||
health = max_health
|
||||
|
||||
func take_damage(attack: Attack):
|
||||
health -= attack.damage
|
||||
|
Reference in New Issue
Block a user