ft: made sprite behaviour consistent across entities

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

No files matched your search

+7 -1
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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.