The central pipeline lints where the old inline one did not, and it aborts on any warning. Nothing here was actually wrong: 166 of the 243 warnings were the TIC-80 API and the game's own globals being undeclared, which is what .luacheckrc is for — the same shape impostor already uses. The rest was trailing whitespace on 14 lines, now stripped. INPUT_KEY_X is unused but kept: it belongs to the LEFT/RIGHT/A/B/X/Y set and removing it would leave a gap in the mapping, so luacheck is told to allow the family. Verified locally by merging the sources the way the pipeline does and running luacheck over the result: 0 warnings, 0 errors. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
26 lines
660 B
Lua
26 lines
660 B
Lua
function IntroWindow.draw()
|
|
local x = (Config.screen.width - 132) / 2 -- Centered text
|
|
Print.text(Context.intro.text, x, Context.intro.y, Config.colors.green)
|
|
end
|
|
|
|
function IntroWindow.update()
|
|
Context.intro.y = Context.intro.y - Context.intro.speed
|
|
|
|
-- Count lines in intro text to determine when scrolling is done
|
|
local lines = 1
|
|
for _ in string.gmatch(Context.intro.text, "\n") do
|
|
lines = lines + 1
|
|
end
|
|
|
|
-- When text is off-screen, go to menu
|
|
if Context.intro.y < -lines * 8 then
|
|
GameWindow.set_state(WINDOW_MENU)
|
|
end
|
|
|
|
-- Skip intro by pressing A
|
|
if Input.menu_confirm() then
|
|
GameWindow.set_state(WINDOW_MENU)
|
|
end
|
|
end
|
|
|