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)