Do some preparation for touch config screen

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-04-21 18:21:52 +07:00
parent 50fdcae8ac
commit 9425b047e2
5 changed files with 107 additions and 65 deletions

View File

@@ -7,10 +7,9 @@ else
end
require 'funcs'
DEBUG_showKey=false
DEBUG_showKey = false
PENTO_MODE = false
SAVE_DIR = 'saves/'
REPLAY_DIR = 'saves/replays/'
if not love.filesystem.getInfo(REPLAY_DIR) then
@@ -19,6 +18,33 @@ end
CONFIG_FILE = 'config.sav'
HIscoreFILE = 'hiscores.sav'
-- Text "LOADING..."
local loaded = {}
local last_loading
local loadedCounter = 0
--- Show the loading text while we are loading resources<br>
--- **WARNING**: should only be used while loading the game!
function ShowLoadingText(thing)
if last_loading then table.insert(loaded, last_loading) end
last_loading = thing
loadedCounter = loadedCounter + 1
love.graphics.replaceTransform(GLOBAL_TRANSFORM)
love.graphics.setFont(love.graphics.newFont(20))
love.graphics.clear()
drawText(
"Loading Tromi... ["..loadedCounter.." / 3]\nPlease wait, don't touch anywhere or press any key!\n\nLoading: "..thing,
10,0,1e99,"left"
)
for i, t in pairs(loaded) do
drawText("Loaded "..t,10,80+20*i,1e99,"left")
end
love.graphics.flushBatch()
love.graphics.present()
end
function love.load()
math.randomseed(os.time())
require "settings"
@@ -32,33 +58,6 @@ function love.load()
GLOBAL_TRANSFORM = love.math.newTransform()
love.resize(love.graphics.getWidth(), love.graphics.getHeight())
-- Text "LOADING..."
local loaded = {}
local prev_thing
local loadedCounter = 0
--- Show the loading text while we are loading resources<br>
--- **WARNING**: should only be used while loading the game!
function ShowLoadingText(thing)
if prev_thing then table.insert(loaded, prev_thing) end
prev_thing = thing
loadedCounter = loadedCounter + 1
love.graphics.replaceTransform(GLOBAL_TRANSFORM)
love.graphics.setFont(love.graphics.newFont(20))
love.graphics.clear()
drawText(
"Loading Tromi... ["..loadedCounter.." / 3]\nPlease wait, don't touch anywhere or press any key!\n\nLoading: "..thing,
10,0,1e99,"left"
)
for i, t in pairs(loaded) do
drawText("Loaded "..t,10,80+20*i,1e99,"left")
end
love.graphics.flushBatch()
love.graphics.present()
end
-- Now it's real time to load all stuffs!
highscores = {}
require "load" -- Most game's resources are loaded in here
@@ -66,24 +65,24 @@ function love.load()
require "game.vctrl" -- VCTRL
SCENE = SETTINGS.firstTime and InputConfigScene(true) or TitleScene()
VCTRL.toggle(love.system.getOS()=='Android')
VCTRL.toggle(love.system.getOS()=='Android' or true)
VCTRL.new{
-- {type='button',x= 100,y=320,key= 'up',icon= 'up',r=35,iconSize=60,alpha=1},
-- {type='button',x= 160,y=380,key='right',icon= 'right',r=35,iconSize=60,alpha=1},
-- {type='button',x= 100,y=440,key= 'down',icon= 'down',r=35,iconSize=60,alpha=1},
-- {type='button',x= 40,y=380,key= 'left',icon= 'left',r=35,iconSize=60,alpha=1},
-- {type='button',x=640-100,y=320,key= 'f16',icon='rotate_right2',r=35,iconSize=60,alpha=1},
-- {type='button',x=640-160,y=380,key= 'f14',icon= 'rotate_left2',r=35,iconSize=60,alpha=1},
-- {type='button',x=640-100,y=440,key= 'f15',icon= 'rotate_right',r=35,iconSize=60,alpha=1},
-- {type='button',x=640- 40,y=380,key= 'f13',icon= 'rotate_left',r=35,iconSize=60,alpha=1},
{type='button',x= 70,y=280,key= 'up',icon= 'up',r=45,iconSize=60,alpha=1},
{type='button',x= 145,y=355,key='right',icon= 'right',r=45,iconSize=60,alpha=1},
{type='button',x= 70,y=430,key= 'down',icon= 'down',r=45,iconSize=60,alpha=1},
{type='button',x= -5,y=355,key= 'left',icon= 'left',r=45,iconSize=60,alpha=1},
{type='button',x=640- 70,y=280,key= 'f16',icon='rotate_right2',r=45,iconSize=60,alpha=1},
{type='button',x=640-145,y=355,key= 'f14',icon= 'rotate_left2',r=45,iconSize=60,alpha=1},
{type='button',x=640- 70,y=430,key= 'f15',icon= 'rotate_right',r=45,iconSize=60,alpha=1},
{type='button',x=640- -5,y=355,key= 'f13',icon= 'rotate_left',r=45,iconSize=60,alpha=1},
-- {type='button',x= 100,y=320,key= 'up',icon= 'up',r=35,iconSize=60,alpha=0.75},
-- {type='button',x= 160,y=380,key='right',icon= 'right',r=35,iconSize=60,alpha=0.75},
-- {type='button',x= 100,y=440,key= 'down',icon= 'down',r=35,iconSize=60,alpha=0.75},
-- {type='button',x= 40,y=380,key= 'left',icon= 'left',r=35,iconSize=60,alpha=0.75},
-- {type='button',x=640-100,y=320,key= 'f16',icon='rotate_right2',r=35,iconSize=60,alpha=0.75},
-- {type='button',x=640-160,y=380,key= 'f14',icon= 'rotate_left2',r=35,iconSize=60,alpha=0.75},
-- {type='button',x=640-100,y=440,key= 'f15',icon= 'rotate_right',r=35,iconSize=60,alpha=0.75},
-- {type='button',x=640- 40,y=380,key= 'f13',icon= 'rotate_left',r=35,iconSize=60,alpha=0.75},
{type='button',x= 70,y=280,key= 'up',icon= 'up',r=45,iconSize=60,alpha=0.75},
{type='button',x= 145,y=355,key='right',icon= 'right',r=45,iconSize=60,alpha=0.75},
{type='button',x= 70,y=430,key= 'down',icon= 'down',r=45,iconSize=60,alpha=0.75},
{type='button',x= -5,y=355,key= 'left',icon= 'left',r=45,iconSize=60,alpha=0.75},
{type='button',x=640- 70,y=280,key= 'f16',icon='rotate_right2',r=45,iconSize=60,alpha=0.75},
{type='button',x=640-145,y=355,key= 'f14',icon= 'rotate_left2',r=45,iconSize=60,alpha=0.75},
{type='button',x=640- 70,y=430,key= 'f15',icon= 'rotate_right',r=45,iconSize=60,alpha=0.75},
{type='button',x=640- -5,y=355,key= 'f13',icon= 'rotate_left',r=45,iconSize=60,alpha=0.75},
}
end