feat: add user interaction with the task zones

This commit is contained in:
Rijad Zuzo
2026-06-20 18:55:09 +02:00
parent 852d10f7ae
commit bdc1f88b6f
4 changed files with 63 additions and 8 deletions
+7 -4
View File
@@ -8,13 +8,12 @@ var village := SimVillage.new()
const DEBUG_LOGS := true
var npcs: Array[SimNPC] = []
var tick_interval := 1.0
var tick_interval := 1.2
var tick_timer := 0.0
var tick_count := 0
var names := [
"Rafi", "Mira", "Adem", "Nura", "Sahin",
"Lejla", "Tarik", "Hana", "Idris", "Zejd"
"Amina", "Tarik", "Jasmin"
]
var professions := [
@@ -38,7 +37,7 @@ func _process(delta: float) -> void:
simulate_tick()
func generate_npcs() -> void:
for i in range(10):
for i in range(names.size()):
var npc := SimNPC.new(
i,
names[i],
@@ -78,6 +77,10 @@ func simulate_tick() -> void:
village_changed.emit(village)
if DEBUG_LOGS:
print(village.get_summary())
func eat_food(amount: float) -> void:
village.food -= amount
village_changed.emit(village)
func add_food(amount: float) -> void:
village.food += amount