Improvements
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user