more modular menu
This commit is contained in:
parent
d091f3a6bc
commit
7df0478890
6 changed files with 178 additions and 117 deletions
40
menu/start.lua
Normal file
40
menu/start.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
require 'menu.state'
|
||||
require 'button'
|
||||
require 'text'
|
||||
|
||||
local common = require 'menu.common'
|
||||
|
||||
local startButton = Button:new(
|
||||
common.buttonTopPos,
|
||||
common.buttonSize,
|
||||
'Start',
|
||||
nil,
|
||||
nil,
|
||||
function()
|
||||
Menu.current_state = MenuStateIndex.hidden
|
||||
GameGrid = LevelHandler:first()
|
||||
Menu.updateCellSize()
|
||||
end
|
||||
)
|
||||
|
||||
local exitGameButton = Button:new(
|
||||
common.buttonBotPos,
|
||||
common.buttonSize,
|
||||
'Exit',
|
||||
nil,
|
||||
nil,
|
||||
function()
|
||||
love.event.quit()
|
||||
end
|
||||
)
|
||||
|
||||
local title = Text:new(
|
||||
common.titlePos,
|
||||
common.buttonSize,
|
||||
'Lines'
|
||||
)
|
||||
|
||||
return MenuState:new(
|
||||
{ startButton, exitGameButton },
|
||||
{ title }
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue