From d6801d5be59f1e70050cd96b01df1f020b94ca39 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sat, 1 May 2021 14:21:45 +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/scenes/net_game.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 039b51c6..9baf1a5e 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -1,6 +1,7 @@ local gc,tc=love.graphics,love.touch local ins=table.insert local SCR,VK,NET=SCR,VK,NET +local PLAYERS,PLY_NET,GAME=PLAYERS,PLY_NET,GAME local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=550,hide=false} @@ -90,11 +91,13 @@ function scene.keyDown(key) PLAYERS[1]:pressKey(k) VK.press(k) end - elseif key=="space"then - NET.signal_ready(not PLY_NET[1].ready) - elseif key=="s"then - if not(PLY_NET[1].ready or NET.getlock('ready'))then - SCN.go('setting_game') + else + if key=="space"then + NET.signal_ready(not PLY_NET[1].ready) + elseif key=="s"then + if not(PLY_NET[1].ready or NET.getlock('ready'))then + SCN.go('setting_game') + end end end end @@ -202,7 +205,6 @@ function scene.update(dt) if not playing then return end local P1=PLAYERS[1] - local GAME=GAME touchMoveLastFrame=false VK.update()