ft: made sprite behaviour consistent across entities

This commit is contained in:
2026-03-07 13:12:18 +01:00
parent da15fb77a2
commit 1fbc2f6637
9 changed files with 21 additions and 16 deletions

View File

@@ -2,6 +2,7 @@ extends Node
class_name NPC
@export var maxHealth: int = 0
@export var idle_sprite: String = "Healthy"
var health: int = maxHealth
signal died
@@ -29,4 +30,9 @@ func die() -> void:
func move(destination: Vector3) -> void:
push_error("Function move() not implemented.")
func play_sprite(anim: String) -> void:
if "sprite" in self:
self.sprite.play(anim)
if "wrapper" in self:
self.wrapper.play_sprite(anim)