diff --git a/funcs.lua b/funcs.lua index 9f98666..8c37d0e 100644 --- a/funcs.lua +++ b/funcs.lua @@ -99,7 +99,7 @@ end ---@return table t ---Merge 2 tables into one
(**WARNING**: t2 can **overwrite** some value of t1 if both tables have some same keys!) function table.merge(t1,t2) - local t + local t = {} for k, v in pairs(t1) do t[k] = v end for k, v in pairs(t2) do t[k] = v end return t diff --git a/game/gamemode.lua b/game/gamemode.lua index 971893d..13c5610 100644 --- a/game/gamemode.lua +++ b/game/gamemode.lua @@ -1084,14 +1084,14 @@ function GameMode:drawBackground() BACKGROUNDS[bg]:play() end if BACKGROUNDS[bg]:tell() >= limit then - BACKGROUNDS[bg]:rewind() + BACKGROUNDS[bg]:rewind() end if bg == 0 or bg == 8 or bg == 9 or bg == 3 then brightness = 0.7 end love.graphics.setColor(brightness, brightness, brightness, 1) love.graphics.draw( BACKGROUNDS[bg], 0, 0, 0, - 0.5, 0.5 + 1,1 ) end diff --git a/scene/touch_config.lua b/scene/touch_config.lua index ca75f86..c2ce955 100644 --- a/scene/touch_config.lua +++ b/scene/touch_config.lua @@ -2,6 +2,7 @@ local TouchConfigScene = SCENE:extend() TouchConfigScene.title = "Touchscreen config\n(you can tap anywhere on touch screen to select this)" local origin_touchPressed, origin_touchReleased, origin_touchMoved + local function onPressed(id, x, y) if not VCTRL.press(x, y, id) then -- TODO @@ -21,7 +22,21 @@ function TouchConfigScene:new() -- Temproraily hijacking game's touch-related functions origin_touchPressed, origin_touchReleased, origin_touchMoved = love.touchpressed, love.touchreleased, love.touchmoved - SETTINGS.input.keys = table.merge(SETTINGS.input.keys, SETTINGS.input.touch) + SETTINGS.input.keys = table.merge( + SETTINGS.input.keys, + { + enter = 'menu_decide', + acback = 'menu_back', + f13 = 'up', + f14 = 'down', + f15 = 'left', + f16 = 'right', + f17 = 'rotate_left', + f18 = 'rotate_left2', + f19 = 'rotate_right', + f20 = 'rotate_right2', + } + ) end function TouchConfigScene:update() -- TODO diff --git a/scene/training.lua b/scene/training.lua index 28405bf..183bdd0 100644 --- a/scene/training.lua +++ b/scene/training.lua @@ -25,7 +25,6 @@ function TrainingScene:new() rotate_left2=false, rotate_right=false, rotate_right2=false, - hold=false, } self.paused = false end diff --git a/settings.lua b/settings.lua index 45f5297..b44760c 100644 --- a/settings.lua +++ b/settings.lua @@ -11,22 +11,10 @@ local _defaultSettings = { ---@class input ---@field keys table ---@field joysticks table - ---@field mobile table + ---@field touch table input = { keys = {}, joysticks = {}, - mobile = { -- Should not be changed for any reason, used for mobile only - enter = 'menu_decide', - acback = 'menu_back', - f13 = 'up', - f14 = 'down', - f15 = 'left', - f16 = 'right', - f17 = 'rotate_left', - f18 = 'rotate_left2', - f19 = 'rotate_right', - f20 = 'rotate_right2', - } } }