ft: improved npc spawning logic

This commit is contained in:
2026-01-17 13:00:54 +01:00
parent 1a532a5afb
commit e4b3919b81
10 changed files with 75 additions and 33 deletions

View File

@@ -4,6 +4,8 @@ class_name NPC2D
@export var maxHealth: int = 0
var health: int = maxHealth
signal died
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
spawn()
@@ -30,6 +32,7 @@ func feed(source ) -> void:
push_error("Function feed() not implemented.")
func die() -> void:
died.emit()
queue_free()
# TODO: should associate this class with a loot table (or equivalent), and can then implement logic for dying in parent class here.