2019-05-22 22:57:34 -05:00
|
|
|
local TitleScene = Scene:extend()
|
|
|
|
|
|
|
|
local main_menu_screens = {
|
|
|
|
ModeSelectScene,
|
|
|
|
InputConfigScene,
|
2020-10-10 18:42:56 -05:00
|
|
|
GameConfigScene,
|
2020-11-06 19:49:44 -06:00
|
|
|
ExitScene,
|
2019-05-22 22:57:34 -05:00
|
|
|
}
|
|
|
|
|
2020-10-10 20:17:48 -05:00
|
|
|
local mainmenuidle = {
|
2020-11-06 19:49:44 -06:00
|
|
|
"Idle",
|
|
|
|
"On title screen",
|
|
|
|
"On main menu screen",
|
|
|
|
"Twiddling their thumbs",
|
|
|
|
"Admiring the main menu's BG",
|
|
|
|
"Waiting for spring to come",
|
|
|
|
"Actually not playing",
|
|
|
|
"Contemplating collecting stars",
|
|
|
|
"Preparing to put the block!!",
|
|
|
|
"Having a nap",
|
|
|
|
"In menus",
|
|
|
|
"Bottom text",
|
2020-10-10 20:17:48 -05:00
|
|
|
}
|
2020-10-09 17:43:22 -05:00
|
|
|
|
2019-05-22 22:57:34 -05:00
|
|
|
function TitleScene:new()
|
|
|
|
self.main_menu_state = 1
|
2020-10-10 20:17:48 -05:00
|
|
|
DiscordRPC:update({
|
2020-11-06 19:49:44 -06:00
|
|
|
details = "In menus",
|
2020-11-08 15:19:01 -06:00
|
|
|
state = mainmenuidle[math.random(#mainmenuidle)],
|
2020-11-06 19:49:44 -06:00
|
|
|
})
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
function TitleScene:update()
|
|
|
|
end
|
|
|
|
|
|
|
|
function TitleScene:render()
|
|
|
|
love.graphics.setFont(font_3x5_2)
|
|
|
|
|
|
|
|
love.graphics.draw(
|
|
|
|
backgrounds["title"],
|
|
|
|
0, 0, 0,
|
|
|
|
0.5, 0.5
|
|
|
|
)
|
|
|
|
|
|
|
|
love.graphics.setColor(1, 1, 1, 0.5)
|
|
|
|
love.graphics.rectangle("fill", 20, 278 + 20 * self.main_menu_state, 160, 22)
|
|
|
|
|
|
|
|
love.graphics.setColor(1, 1, 1, 1)
|
|
|
|
for i, screen in pairs(main_menu_screens) do
|
|
|
|
love.graphics.printf(screen.title, 40, 280 + 20 * i, 120, "left")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function TitleScene:changeOption(rel)
|
|
|
|
local len = table.getn(main_menu_screens)
|
|
|
|
self.main_menu_state = (self.main_menu_state + len + rel - 1) % len + 1
|
|
|
|
end
|
|
|
|
|
2020-11-08 14:55:06 -06:00
|
|
|
function TitleScene:onInputPress(e)
|
|
|
|
if e.input == "menu_decide" then
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("main_decide")
|
2019-05-22 22:57:34 -05:00
|
|
|
scene = main_menu_screens[self.main_menu_state]()
|
2020-11-08 14:55:06 -06:00
|
|
|
elseif e.input == "up" then
|
2019-05-22 22:57:34 -05:00
|
|
|
self:changeOption(-1)
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("cursor")
|
2020-11-08 14:55:06 -06:00
|
|
|
elseif e.input == "down" then
|
2019-05-22 22:57:34 -05:00
|
|
|
self:changeOption(1)
|
2020-10-09 16:50:05 -05:00
|
|
|
playSE("cursor")
|
2020-11-08 14:55:06 -06:00
|
|
|
elseif e.input == "menu_back" then
|
2020-11-06 19:49:44 -06:00
|
|
|
love.event.quit()
|
2019-05-22 22:57:34 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
return TitleScene
|