mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
first commit
This commit is contained in:
106
scene/title.lua
Normal file
106
scene/title.lua
Normal file
@@ -0,0 +1,106 @@
|
||||
local TitleScene = Scene:extend()
|
||||
require 'load.save'
|
||||
require 'funcs'
|
||||
|
||||
TitleScene.title = "Title"
|
||||
TitleScene.restart_message = false
|
||||
|
||||
local main_menu_screens = {
|
||||
NameEntryScene,
|
||||
ReplaySelectScene,
|
||||
TrainingScene,
|
||||
InputConfigScene,
|
||||
FullscreenScene,
|
||||
MusicToggleScene,
|
||||
ExitScene,
|
||||
}
|
||||
|
||||
function TitleScene:new()
|
||||
if sounds['bgm_firsthalf']:isPlaying() or sounds['bgm_secondhalf']:isPlaying() or not config["music"] then
|
||||
love.audio.stop()
|
||||
end
|
||||
self.main_menu_state = 1
|
||||
PENTO_MODE = false
|
||||
self.code = {0,0,0,0,0,0,0,0}
|
||||
end
|
||||
|
||||
function TitleScene:update()
|
||||
end
|
||||
|
||||
function TitleScene:drawCredits(top, left)
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", top, left, 335, 345, 10, 10)
|
||||
drawText("Design & Programming mycophobia ", 6+top, 6+left, 1000, "left")
|
||||
drawText("Programming Cambridge contributors", 6+top, 21+left, 1000, "left")
|
||||
drawText("Music Jerry Martin", 6+top, 36+left, 1000, "left")
|
||||
drawText(" Juraj Stanik", 6+top, 51+left, 1000, "left")
|
||||
drawText("RNG Consultant colour_thief", 6+top, 66+left, 1000, "left")
|
||||
drawText("Mac Launcher nightmareci", 6+top, 81+left, 1000, "left")
|
||||
drawText("People Who Tested switchpalacecorner", 6+top, 106+left, 1000, "left")
|
||||
drawText("and/or Offered esquatre", 6+top, 121+left, 1000, "left")
|
||||
drawText("Cool Suggestions Kirby703", 6+top, 136+left, 1000, "left")
|
||||
drawText(" netdoll", 6+top, 151+left, 1000, "left")
|
||||
drawText(" lindtobias", 6+top, 166+left, 1000, "left")
|
||||
drawText(" zaphod77", 6+top, 181+left, 1000, "left")
|
||||
drawText(" Arch Nemesis", 6+top, 196+left, 1000, "left")
|
||||
drawText(" dtet_enjoyer", 6+top, 211+left, 1000, "left")
|
||||
drawText(" woozy", 6+top, 226+left, 1000, "left")
|
||||
drawText(" AgentBasey", 6+top, 241+left, 1000, "left")
|
||||
drawText(" Zircean", 6+top, 256+left, 1000, "left")
|
||||
drawText(" Eden GT", 6+top, 271+left, 1000, "left")
|
||||
drawText("Special Thanks theabsolute.plus", 6+top, 291+left, 1000, "left")
|
||||
drawText(" FYAD/Imp Zone Collective", 6+top, 306+left, 1000, "left")
|
||||
drawText(" All Version 1 Players", 6+top, 321+left, 1000, "left")
|
||||
end
|
||||
|
||||
function TitleScene:render()
|
||||
mainBackground()
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", 14, 174, 260, 200, 10, 10)
|
||||
love.graphics.setColor(0,0,0,0.7)
|
||||
love.graphics.rectangle("fill", 14, 400, 605, 75, 10, 10)
|
||||
love.graphics.setColor(0.4, 1, 1, 0.5)
|
||||
love.graphics.rectangle("fill", 20, 198 + 20 * self.main_menu_state, 240, 22)
|
||||
drawBigText('Tromi', 30, 180, 120, "left")
|
||||
drawText('version 2', 110, 193, 120, "left")
|
||||
self:drawCredits(300, 40)
|
||||
drawText("mycophobia.org", 20, 405, 1000)
|
||||
drawText("Based on Cambridge - t-sp.in/cambridge", 20, 420, 1000)
|
||||
drawText("Music for Tromi by Jerry Martin, all rights reserved - jerrymartinmusic.com", 20, 435, 1000)
|
||||
drawText("Game backgrounds by Pixabay users Joe_hackney, yokim, Favorisxp, Any_Ann, VisualSkyFX ", 20, 450, 1000)
|
||||
if config["music"] == true then
|
||||
drawText("On", 230, 320, 1000)
|
||||
else
|
||||
drawText("Off", 230, 320, 1000)
|
||||
end
|
||||
for i, screen in pairs(main_menu_screens) do
|
||||
drawText(screen.title, 40, 200 + 20 * i, 1200, "left")
|
||||
end
|
||||
if table.concat(self.code, ',') == '1,1,1,1,-1,-1,-1,-1' then PENTO_MODE = true end
|
||||
if PENTO_MODE then
|
||||
drawBigText('PENT MODE', 30, 100, 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
|
||||
|
||||
function TitleScene:onInputPress(e)
|
||||
if e.input == "menu_decide" or e.input == "rotate_left" or e.scancode == "return" then
|
||||
scene = main_menu_screens[self.main_menu_state]()
|
||||
elseif e.input == "up" or e.scancode == "up" then
|
||||
self:changeOption(-1)
|
||||
elseif e.input == "down" or e.scancode == "down" then
|
||||
self:changeOption(1)
|
||||
elseif e.input == "left" or e.scancode == "left" then
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, -1)
|
||||
elseif e.input == "right" or e.scancode == "right" then
|
||||
table.remove(self.code, 8)
|
||||
table.insert(self.code, 1, 1)
|
||||
end
|
||||
end
|
||||
|
||||
return TitleScene
|
||||
Reference in New Issue
Block a user