singe/testScripts/scene53.singe
2026-09-13 22:06:39 -05:00

51 lines
1.5 KiB
Text

-- Authoring tools (PLAN section 58), genre two: the QTE description, played over the disc.
--
-- Scene 52 plays the platformer. This one shares no vocabulary with it beyond the three nouns --
-- no physics, no character, no gravity, and every rule is about disc frames -- which is what makes
-- the pair a test of the core rather than of either genre.
dofile("Forge/AuthorCompile.singe")
local font = fontLoad("Singe/FreeSansBold.ttf", 18)
fontSelect(font)
fontQuality(FONT_QUALITY_BLENDED)
dofile(authorBuild("testScripts/author/qte.game", singeGetDataPath() .. "qte.singe"))
local gameUpdate = onOverlayUpdate
local frames = 0
local answered = false
local shots = 0
function onOverlayUpdate()
local disc = discGetFrame()
frames = frames + 1
-- Answer inside the window, the way a player would: hold the button for a few frames.
if (disc >= 215) and (disc < 225) and not answered then
authorSwitchDown(SWITCH_BUTTON1)
answered = true
end
if answered and (disc >= 230) then
authorSwitchUp(SWITCH_BUTTON1)
end
local r = gameUpdate()
colorForeground(255, 255, 255, 255)
fontPrint(12, 450, "authored QTE, disc frame " .. disc)
-- On the disc's clock, not the frame count: the window is what is being shown.
if (shots == 0 and disc >= 205) or (shots == 1 and disc >= 230) or (shots == 2 and disc >= 280) then
shots = shots + 1
singeScreenshot()
end
if disc >= 310 or frames > 1200 then
debugPrint("AUTHOR QTE RESULT score=" .. AUTHOR_SCORE .. " hit=" .. tostring(AUTHOR_FLAG["hit"]))
singeQuit()
end
return r
end