From afa0a529cdf735aafe0a825165af92feaf480c11 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 1 Jan 2021 04:28:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/init.lua | 12 ++++-------- parts/scenes/play.lua | 5 +++-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/parts/player/init.lua b/parts/player/init.lua index 54d30ada..2fa6aa68 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -50,10 +50,8 @@ local function releaseKey(P,keyID) end local function pressKey_Rec(P,keyID) if P.keyAvailable[keyID]then - if GAME.recording then - ins(GAME.rep,GAME.frame+1) - ins(GAME.rep,keyID) - end + ins(GAME.rep,GAME.frame+1) + ins(GAME.rep,keyID) P.keyPressing[keyID]=true P.actList[keyID](P) if P.control then @@ -66,10 +64,8 @@ local function pressKey_Rec(P,keyID) end end local function releaseKey_Rec(P,keyID) - if GAME.recording then - ins(GAME.rep,GAME.frame+1) - ins(GAME.rep,-keyID) - end + ins(GAME.rep,GAME.frame+1) + ins(GAME.rep,-keyID) P.keyPressing[keyID]=false end local function newEmptyPlayer(id,mini) diff --git a/parts/scenes/play.lua b/parts/scenes/play.lua index 40118407..728bc4cb 100644 --- a/parts/scenes/play.lua +++ b/parts/scenes/play.lua @@ -102,7 +102,9 @@ function scene.touchMove() end end function scene.keyDown(key) - if not noKey then + if key=="escape"then + pauseGame() + elseif not noKey then local m=keyMap for k=1,20 do if key==m[1][k]or key==m[2][k]then @@ -113,7 +115,6 @@ function scene.keyDown(key) end end end - if key=="escape"then pauseGame()end end function scene.keyUp(key) if noKey then return end