This commit is contained in:
Jan Racek
2026-03-29 09:34:46 +02:00
commit 1fdb223f5d
113 changed files with 17499 additions and 0 deletions

40
Assets/lua/npc.lua Normal file
View File

@@ -0,0 +1,40 @@
-- ============================================================================
-- npc.lua - NPC with multi-line dialogue
-- ============================================================================
-- Tests: onInteract, onButtonPress, Controls, UI text,
-- scene-level dialogue system, Input constants
local talked = false
function onCreate(self)
talked = false
end
function onInteract(self)
if isInDialogue() then return end
if not talked then
talked = true
startDialogue({
"Hello, traveler!",
"Welcome to the test scene.",
"There are collectibles, a door,",
"triggers, and a portal here.",
"Press CROSS to advance dialogue.",
"Good luck exploring!"
})
else
startDialogue({
"You again?",
"Go find the collectibles!",
"There should be three of them."
})
end
end
function onButtonPress(self, button)
if not isInDialogue() then return end
if button == Input.CROSS then
advanceDialogue()
end
end