split source

This commit is contained in:
2025-12-10 22:33:36 +01:00
parent 94931d3651
commit 9dfbdcd052
24 changed files with 1086 additions and 935 deletions

23
inc/menu_actions.lua Normal file
View File

@@ -0,0 +1,23 @@
--------------------------------------------------------------------------------
-- Menu Actions
--------------------------------------------------------------------------------
function MenuActions.play()
-- Reset player state and screen for a new game
Context.player.x = Config.player.start_x
Context.player.y = Config.player.start_y
Context.player.vx = 0
Context.player.vy = 0
Context.player.jumps = 0
Context.current_screen = 1
GameWindow.set_state(WINDOW_GAME)
end
function MenuActions.exit()
exit()
end
-- Initialize menu items after actions are defined
Context.menu_items = {
{label = "Play", action = MenuActions.play},
{label = "Exit", action = MenuActions.exit}
}