触屏每帧只采样一次

This commit is contained in:
MrZ626
2021-01-01 16:43:21 +08:00
parent caf99c2605
commit fc15e2fe3d
2 changed files with 324 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ local function onVirtualkey(x,y)
end
local noTouch,noKey=false,false
local touchMoveLastFrame=0
local touchMoveLastFrame=false
local scene={}
@@ -80,9 +80,8 @@ function scene.touchUp(_,x,y)
end
end
function scene.touchMove()
if noTouch then return end
if touchMoveLastFrame>1 then return end
touchMoveLastFrame=touchMoveLastFrame+1
if noTouch or touchMoveLastFrame then return end
touchMoveLastFrame=true
local L=tc.getTouches()
for i=#L,1,-1 do
@@ -161,7 +160,7 @@ function scene.update(dt)
local GAME=GAME
GAME.frame=GAME.frame+1
touchMoveLastFrame=0
touchMoveLastFrame=false
--Update virtualkey animation
if SETTING.VKSwitch then