mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Compare commits
4 Commits
v.1.2.v.2.
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c6857bca9 | ||
|
|
0e8d3ceacc | ||
|
|
b73c82c765 | ||
|
|
d7d9f77127 |
@@ -41,7 +41,7 @@ local virtual_quad=setmetatable((function()
|
||||
empty_quad=gc_newQuad(0,0,1,1,5*w,2*w)
|
||||
for i,name in next,{
|
||||
'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
|
||||
return t
|
||||
end)(),{
|
||||
@@ -108,7 +108,7 @@ function control_type.button:draw(forceAlpha)
|
||||
if self.shape=='circle' then
|
||||
love.graphics.setColor(0,0,0,alpha)
|
||||
love.graphics.circle('fill',self.x,self.y,self.r-4)
|
||||
|
||||
|
||||
love.graphics.setColor(1,1,1,self.pressed and .5 or 0)
|
||||
love.graphics.circle('fill',self.x,self.y,self.r-4)
|
||||
|
||||
@@ -117,7 +117,7 @@ function control_type.button:draw(forceAlpha)
|
||||
elseif self.shape=='square' then
|
||||
love.graphics.setColor(0,0,0,alpha)
|
||||
love.graphics.rectangle('fill',self.x-self.r-4,self.y-self.r-4,self.r*2+8,self.r*2+8)
|
||||
|
||||
|
||||
love.graphics.setColor(1,1,1,self.pressed and .5 or 0)
|
||||
love.graphics.rectangle('fill',self.x-self.r-4,self.y-self.r-4,self.r*2+8,self.r*2+8)
|
||||
|
||||
@@ -182,7 +182,7 @@ function VCTRL.clearAll()
|
||||
local toggle = global_toggle
|
||||
VCTRL.toggle(false)
|
||||
global_toggle = toggle
|
||||
|
||||
|
||||
for i=#VCTRL,1,-1 do VCTRL[i] = nil end
|
||||
collectgarbage()
|
||||
end
|
||||
|
||||
21
main.lua
21
main.lua
@@ -20,9 +20,6 @@ MOBILE = CURRENT_OS == "Android" or CURRENT_OS == "iOS"
|
||||
|
||||
LILY = require "libs.lily"
|
||||
|
||||
---@type table
|
||||
local sceneStack -- Only use for checking scene stack, not
|
||||
|
||||
function love.load()
|
||||
require 'funcs'
|
||||
math.randomseed(os.time())
|
||||
@@ -309,23 +306,12 @@ function love.run()
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
|
||||
if SCENE and SCENE.update and love.timer then
|
||||
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
|
||||
if time_accumulator < frame_duration then
|
||||
@@ -346,12 +332,6 @@ function love.run()
|
||||
time_accumulator = time_accumulator - frame_duration
|
||||
end
|
||||
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
|
||||
|
||||
@@ -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
|
||||
main_bg_cur_mino = 1
|
||||
end
|
||||
main_bg_placed = false
|
||||
main_bg_draw_frame = main_bg_draw_frame + 1
|
||||
end
|
||||
|
||||
@@ -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"
|
||||
@@ -154,8 +154,8 @@ function ReplaySelectScene:onInputPress(e)
|
||||
local selected_replay_text = self.replay_text[self.replay_select + ((self.page-1) * self.page_flip)]
|
||||
|
||||
if (
|
||||
e.type == "touch" or e.type == "mouse") and
|
||||
not BUTTON.press(buttonList, e.x, e.y, e.id and
|
||||
(e.type == "touch" or e.type == "mouse") and
|
||||
not BUTTON.press(buttonList, e.x, e.y, e.id) and
|
||||
#self.replays > 0
|
||||
) then
|
||||
local selection = math.floor((e.y - 15) / 30)
|
||||
|
||||
@@ -25,7 +25,7 @@ local main_menu_scenes = {
|
||||
DataManagementScene,
|
||||
function() love.system.openURL("https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile") end,
|
||||
AboutScene,
|
||||
|
||||
|
||||
TrainingScene,
|
||||
function() love.system.openURL("https://mycophobia.org/forums/viewtopic.php?t=29") end,
|
||||
SettingsScene,
|
||||
@@ -39,7 +39,7 @@ local main_menu_icons = {
|
||||
CHAR.icon.export,
|
||||
CHAR.icon.home,
|
||||
CHAR.icon.info,
|
||||
|
||||
|
||||
CHAR.icon.toDown,
|
||||
CHAR.icon.globe,
|
||||
CHAR.icon.settings,
|
||||
@@ -63,13 +63,13 @@ end
|
||||
|
||||
function Title2Scene:render()
|
||||
MainBackground()
|
||||
|
||||
|
||||
love.graphics.setColor(0, 0, 0, 0.7)
|
||||
love.graphics.rectangle("fill", 30, 60, 580, 85, 10, 10) -- Tromi
|
||||
love.graphics.rectangle("fill", 30, 165, 580, 225, 10, 10) -- Menu
|
||||
|
||||
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")
|
||||
|
||||
if PENTO_MODE then
|
||||
|
||||
Reference in New Issue
Block a user