feat: added intro sequence, fixed norman's sprite, placed him in various places
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed

This commit is contained in:
Zoltan Timar
2026-03-12 18:10:50 +01:00
parent c897cdcbd5
commit b349ded281
14 changed files with 211 additions and 80 deletions

View File

@@ -2,9 +2,7 @@
local _available_decisions = {}
local _selected_decision_index = 1
--- Draws the game window.
--- @within GameWindow
function GameWindow.draw()
local function draw_game_scene(underlay_draw)
local screen = Screen.get_by_id(Context.game.current_screen)
if not screen then return end
if screen.background then
@@ -12,6 +10,9 @@ function GameWindow.draw()
elseif screen.background_color then
rect(0, 0, Config.screen.width, Config.screen.height, screen.background_color)
end
if underlay_draw then
underlay_draw()
end
if not Context.stat_screen_active and #_available_decisions > 0 then
Decision.draw(_available_decisions, _selected_decision_index)
end
@@ -20,6 +21,19 @@ function GameWindow.draw()
screen.draw()
end
--- Draws the game window.
--- @within GameWindow
function GameWindow.draw()
draw_game_scene()
end
--- Draws the game window with a custom underlay.
--- @within GameWindow
--- @param underlay_draw function A draw callback rendered after the background but before overlays.<br/>
function GameWindow.draw_with_underlay(underlay_draw)
draw_game_scene(underlay_draw)
end
--- Updates the game window logic.
--- @within GameWindow
function GameWindow.update()
@@ -31,12 +45,13 @@ function GameWindow.update()
end
local screen = Screen.get_by_id(Context.game.current_screen)
if not screen or not screen.update then return end
screen.update()
-- Handle current situation updates
if Context.game.current_situation then
local current_situation_obj = Situation.get_by_id(Context.game.current_situation)
if current_situation_obj and current_situation_obj.update then
if current_situation_obj and type(current_situation_obj.update) == "function" then
current_situation_obj.update()
end
end