ft: improved npc spawning logic

This commit is contained in:
djaidjai committed 2026-01-17 13:00:54 +01:00
1 parent 1a532a5afb
commit e4b3919b81
10 files changed
+75 -33

No files matched your search

+3
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.
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.