Improvements

This commit is contained in:
2024-01-21 18:18:15 +01:00
parent 9e3deaf3b0
commit 3f465a708c
9 changed files with 101 additions and 30 deletions

View File

@@ -5,6 +5,7 @@ signal damaged(amount)
signal healed(amount)
signal death()
@export_category("Creature")
@export
var max_hp: int = 1
@@ -33,6 +34,8 @@ var hp: int :
func _ready() -> void:
self.hp = self.max_hp
self.death.connect(self._creature_on_death)
if self.has_method("_on_ready"):
self.call("_on_ready")
func take_damage(damage: int) -> void:
self.hp -= damage