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

38
Assets/lua/door.lua Normal file
View File

@@ -0,0 +1,38 @@
-- ============================================================================
-- door.lua - Interactable door that plays an open cutscene
-- ============================================================================
-- Tests: onInteract, Cutscene.Play with onComplete, Entity.Find,
-- Entity.SetActive, Controls, Audio
local isOpen = false
function onCreate(self)
isOpen = false
Debug.Log("Door created")
end
function onInteract(self)
if isOpen then
setStatus("Door is already open")
return
end
if Cutscene.IsPlaying() then return end
isOpen = true
Audio.Play("door_open", 100, 64)
Controls.SetEnabled(false)
setStatus("Opening door...")
Cutscene.Play("door_open", {
onComplete = function()
Controls.SetEnabled(true)
setStatus("Door opened! Path is clear.")
-- Disable the door blocker object
local blocker = Entity.Find("DoorBlocker")
if blocker then
Entity.SetActive(blocker, false)
end
end
})
end