ft: made sprite behaviour consistent across entities
This commit is contained in:
@@ -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