From 57792bd23064fb8e422718eab2ead0c71f7157b6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Wed, 7 Jul 2021 07:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=8E=E5=9B=9E=E6=94=BE?= =?UTF-8?q?=E8=8F=9C=E5=8D=95=E8=BF=9B=E5=85=A5=E5=9B=9E=E6=94=BE=E6=97=B6?= =?UTF-8?q?=E8=BF=98=E6=98=BE=E7=A4=BA=E9=87=8D=E5=BC=80=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=B9=B6=E4=B8=94=E9=87=8D=E5=BC=80=E9=94=AE=E6=9C=89=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/game.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/parts/scenes/game.lua b/parts/scenes/game.lua index 8f38e648..86021bdf 100644 --- a/parts/scenes/game.lua +++ b/parts/scenes/game.lua @@ -1,6 +1,7 @@ local gc,tc=love.graphics,love.touch local sin=math.sin local SCR,VK=SCR,VK +local GAME=GAME local noTouch,noKey=false,false local touchMoveLastFrame=false @@ -74,7 +75,7 @@ function scene.keyDown(key,isRep) if noKey then return end PLAYERS[1]:pressKey(k) VK.press(k) - else + elseif not GAME.fromRepMenu then restart() end elseif key=="escape"then @@ -89,8 +90,6 @@ function scene.keyUp(key) PLAYERS[1]:releaseKey(k) VK.release(k) end - elseif key=="back"then - pauseGame() end end function scene.gamepadDown(key) @@ -115,14 +114,11 @@ function scene.gamepadUp(key) PLAYERS[1]:releaseKey(k) VK.release(k) end - elseif key=="back"then - pauseGame() end end function scene.update(dt) local _ - local GAME=GAME --Replay if GAME.replaying then @@ -216,7 +212,7 @@ function scene.draw() drawWarning() end scene.widgetList={ - WIDGET.newKey{name="restart",fText="R",x=380,y=35,w=60,font=40,code=restart}, + WIDGET.newKey{name="restart",fText="R",x=380,y=35,w=60,font=40,code=restart,hideF=function()return GAME.fromRepMenu end}, WIDGET.newKey{name="pause",fText="II",x=900,y=35,w=60,font=40,code=function()pauseGame()end}, }