Files
impostor/inc/system/system.main.lua
Zoltan Timar 66af47c483
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/pull_request_closed/woodpecker Pipeline was successful
feat: ring timer drawn at top-left of screen, Meter.set_timer_duration(f) controls speed, Meter.set_timer_decay(a) controls decay amount, all decay pauses during any minigame window
2026-02-26 15:43:39 +01:00

29 lines
648 B
Lua

--- @section Main
local initialized_game = false
--- Initializes game state.
--- @within Main
local function init_game()
if initialized_game then return end
Context.reset()
Window.set_current("splash") -- Set initial window using new manager
MenuWindow.refresh_menu_items()
initialized_game = true
end
--- Main game loop (TIC-80 callback).
--- @within Main
function TIC()
init_game()
cls(Config.colors.black)
local handler = Window.get_current_handler() -- Get handler from Window manager
if handler then
handler()
end
Meter.update()
if Context.game_in_progress then
UI.draw_meters()
UI.draw_timer()
end
end