From 311dc3b64401950c79e54e68b70f0735c0278b99 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 24 Apr 2021 01:04:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=A7=A6=E5=B1=8F=E8=99=9A?= =?UTF-8?q?=E6=8B=9F=E6=8C=89=E9=94=AE=E6=9D=BE=E5=BC=80=E5=90=8E=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E8=BF=98=E4=BA=AE=E7=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/game.lua | 12 ++++++------ parts/scenes/net_game.lua | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index 0291275b..0e62f769 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -40,9 +40,10 @@ end function scene.touchUp(x,y) if noTouch then return end - local t=VK.on(x,y) - if t then - PLAYERS[1]:releaseKey(t) + local n=VK.on(x,y) + if n then + PLAYERS[1]:releaseKey(n) + VK.release(n) end end function scene.touchMove() @@ -63,6 +64,7 @@ function scene.touchMove() end end PLAYERS[1]:releaseKey(n) + VK.release(n) end ::CONTINUE_nextKey:: end @@ -73,9 +75,7 @@ function scene.keyDown(key) if k>0 then if noKey then return end PLAYERS[1]:pressKey(k) - local vk=VK.keys[k] - vk.isDown=true - vk.pressTime=10 + VK.press(k) else restart() end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 3e93e991..97cd54b9 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -44,9 +44,10 @@ end function scene.touchUp(x,y) if noTouch or not playing then return end - local t=VK.on(x,y) - if t then - PLAYERS[1]:releaseKey(t) + local n=VK.on(x,y) + if n then + PLAYERS[1]:releaseKey(n) + VK.release(n) end end function scene.touchMove() @@ -67,6 +68,7 @@ function scene.touchMove() end end PLAYERS[1]:releaseKey(n) + VK.release(n) end ::CONTINUE_nextKey:: end @@ -86,9 +88,7 @@ function scene.keyDown(key) local k=keyMap.keyboard[key] if k and k>0 then PLAYERS[1]:pressKey(k) - local vk=VK.keys[k] - vk.isDown=true - vk.pressTime=10 + VK.press(k) end elseif key=="space"then NET.signal_ready(not PLY_NET[1].ready)