3 Commits

Author SHA1 Message Date
SweetSea
1c6857bca9 Fix longlasting wrong icon key 2024-11-24 15:40:16 +07:00
SweetSea
0e8d3ceacc Merge https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile 2024-10-27 05:58:03 +07:00
SweetSea
b73c82c765 Fix scene stack and bump ver 2024-10-27 05:56:40 +07:00
4 changed files with 8 additions and 84 deletions

View File

@@ -41,7 +41,7 @@ local virtual_quad=setmetatable((function()
empty_quad=gc_newQuad(0,0,1,1,5*w,2*w) empty_quad=gc_newQuad(0,0,1,1,5*w,2*w)
for i,name in next,{ for i,name in next,{
'left','right','up','down','restart', 'left','right','up','down','restart',
'rotate_right','rotate_left','rotate_right2','rotate_left2' 'rotate_left','rotate_right','rotate_left2','rotate_right2'
} do if #name>0 then t[name]=gc_newQuad((i-1)%5*w,math.floor((i-1)/5)*w,w,w,5*w,2*w) end end } do if #name>0 then t[name]=gc_newQuad((i-1)%5*w,math.floor((i-1)/5)*w,w,w,5*w,2*w) end end
return t return t
end)(),{ end)(),{

View File

@@ -20,9 +20,6 @@ MOBILE = CURRENT_OS == "Android" or CURRENT_OS == "iOS"
LILY = require "libs.lily" LILY = require "libs.lily"
---@type table
local sceneStack -- Only use for checking scene stack, not
function love.load() function love.load()
require 'funcs' require 'funcs'
math.randomseed(os.time()) math.randomseed(os.time())
@@ -309,23 +306,12 @@ function love.run()
end end
end end
love.handlers[name](a,b,c,d,e,f) love.handlers[name](a,b,c,d,e,f)
-- Checking for new scene and add it to the end of scene stack
if SCENE ~= sceneStack[1] then
table.insert(sceneStack, SCENE)
SCENE = sceneStack[1]
end
end end
end end
if SCENE and SCENE.update and love.timer then if SCENE and SCENE.update and love.timer then
SCENE:update() SCENE:update()
-- Checking for new scene and add it to the end of scene stack
if SCENE ~= sceneStack[1] then
table.insert(sceneStack, SCENE)
SCENE = sceneStack[1]
end
local frame_duration = 1.0 / TARGET_FPS local frame_duration = 1.0 / TARGET_FPS
if time_accumulator < frame_duration then if time_accumulator < frame_duration then
@@ -346,12 +332,6 @@ function love.run()
time_accumulator = time_accumulator - frame_duration time_accumulator = time_accumulator - frame_duration
end end
last_time = love.timer.getTime() last_time = love.timer.getTime()
-- Finally, changing to the latest scene in scene stack
if #sceneStack > 1 then
SCENE = sceneStack[#sceneStack]
sceneStack = {SCENE}
end
end end
end end
@@ -590,6 +570,5 @@ function MainBackground()
while main_bg_cur_color == main_bg_last_color do main_bg_cur_color = minos[love.math.random(1,7)] end while main_bg_cur_color == main_bg_last_color do main_bg_cur_color = minos[love.math.random(1,7)] end
main_bg_cur_mino = 1 main_bg_cur_mino = 1
end end
main_bg_placed = false
main_bg_draw_frame = main_bg_draw_frame + 1 main_bg_draw_frame = main_bg_draw_frame + 1
end end

View File

@@ -1,55 +0,0 @@
local Object = require "libs.classic"
SCENE = Object:extend()
function SCENE:new() end
function SCENE:update() end
function SCENE:render() end
-- You can use the class SCENE_onInput to show suggestions for `e` table
---@class SCENE_onInput
---@field type "key"|"joystick"|"virtual"|"touch"|"mouse"|"wheel"
---
---@field input? string # Action triggered<br>Only visible via keyboard and gamepad
---@field key? love.KeyConstant Key pressed? Only visible via keyboard and gamepad
---@field scancode? love.Scancode Key pressed but on the US layout? Only visible via keyboard and gamepad
---
---@field x? number Only visible via touch and mouse
---@field y? number Only visible via touch and mouse
---@field dx? number # Delta X<br> Only visible via touch, mouse and wheel
---@field dy? number # Delta Y<br> Only visible via touch, mouse and wheel
---@field id? lightuserdata # Only visible via touch
---@field presses? number # Only visible via mouse
-- e in 4 below functions will contain different things based on it's type:
-- key - input, key, scancode
-- joystick - input, button, name
-- virtual - input
-- touch - x, y, dx, dy, id
-- mouse - x, y, dx, dy, presses
-- wheel - dx, dy
function SCENE:onInputMove(e) end
function SCENE:onInputPress(e) end
function SCENE:onInputRelease(e) end
GameScene = require "scene.game"
TrainingScene = require "scene.training"
NameEntryScene = require "scene.name_entry"
KeyConfigScene = require "scene.key_config"
StickConfigScene = require "scene.stick_config"
TouchConfigScene = require "scene.touch_config"
TouchConfigPreviewScene = require "scene.touch_config_preview"
InputConfigScene = require "scene.input_config"
ReplaySelectScene = require "scene.replay"
ReplayTestScene = require"scene.replay_test"
FullscreenScene = require "scene.fullscreen"
MusicToggleScene = require "scene.music_toggle"
LinesToggleScene = require "scene.lines_toggle"
ExitScene = require "scene.exit"
TitleScene = require "scene.title"

View File

@@ -69,7 +69,7 @@ function Title2Scene:render()
love.graphics.rectangle("fill", 30, 165, 580, 225, 10, 10) -- Menu love.graphics.rectangle("fill", 30, 165, 580, 225, 10, 10) -- Menu
drawBigText("Tromi", 40, 65, 100, "left") drawBigText("Tromi", 40, 65, 100, "left")
drawText("Mobile 1.1 - PC 2.3", 150, 78, 200, "left") drawText("Mobile 1.4 - PC 2.3", 150, 78, 200, "left")
drawText("https://mycophobia.org\nhttps://github.com/SweetSea-ButImNotSweet/", 40, 100, 300, "left") drawText("https://mycophobia.org\nhttps://github.com/SweetSea-ButImNotSweet/", 40, 100, 300, "left")
if PENTO_MODE then if PENTO_MODE then