整理代码,移除主菜单ai角框,修复触屏在房间内会不能操作

This commit is contained in:
MrZ626
2021-05-05 10:51:11 +08:00
parent 871e042044
commit 1d36d50fca
3 changed files with 11 additions and 22 deletions

View File

@@ -280,7 +280,7 @@ function update.alive(P,dt)
if P.falling>=0 then if P.falling>=0 then
P.falling=P.falling-1 P.falling=P.falling-1
if P.falling>=0 then if P.falling>=0 then
goto stop goto THROW_stop
else else
local L=#P.clearingRow local L=#P.clearingRow
if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end if P.sound and ENV.fall>0 and #P.field+L>P.clearingRow[L]then SFX.play('fall')end
@@ -289,11 +289,11 @@ function update.alive(P,dt)
end end
--Try spawn new block --Try spawn new block
if not P.control then goto stop end if not P.control then goto THROW_stop end
if P.waiting>=0 then if P.waiting>=0 then
P.waiting=P.waiting-1 P.waiting=P.waiting-1
if P.waiting<0 then P:popNext()end if P.waiting<0 then P:popNext()end
goto stop goto THROW_stop
end end
--Natural block falling --Natural block falling
@@ -302,7 +302,7 @@ function update.alive(P,dt)
local D=P.dropDelay local D=P.dropDelay
if D>1 then if D>1 then
P.dropDelay=D-1 P.dropDelay=D-1
goto stop goto THROW_stop
end end
if D==1 then if D==1 then
@@ -335,14 +335,14 @@ function update.alive(P,dt)
end end
else else
P.lockDelay=P.lockDelay-1 P.lockDelay=P.lockDelay-1
if P.lockDelay>=0 then goto stop end if P.lockDelay>=0 then goto THROW_stop end
P:drop() P:drop()
if P.AI_mode=='CC'and P.AI_bot then if P.AI_mode=='CC'and P.AI_bot then
CC.updateField(P) CC.updateField(P)
end end
end end
end end
::stop:: ::THROW_stop::
--B2B bar animation --B2B bar animation
if P.b2b1==P.b2b then if P.b2b1==P.b2b then

View File

@@ -161,14 +161,6 @@ function scene.draw()
--Player --Player
PLAYERS[1]:draw() PLAYERS[1]:draw()
--Special area
gc.setColor(1,1,1,.8)
gc.setLineWidth(10)
gc.line(515,215,515,135,595,135)
gc.line(765,215,765,135,685,135)
gc.line(515,545,515,625,595,625)
gc.line(765,545,765,625,685,625)
--Profile --Profile
drawSelfProfile() drawSelfProfile()
end end

View File

@@ -35,7 +35,7 @@ end
scene.mouseDown=NULL scene.mouseDown=NULL
function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end
function scene.touchDown(x,y) function scene.touchDown(x,y)
if noTouch or not playing then return end if not playing or noTouch then return end
local t=VK.on(x,y) local t=VK.on(x,y)
if t then if t then
@@ -44,7 +44,7 @@ function scene.touchDown(x,y)
end end
end end
function scene.touchUp(x,y) function scene.touchUp(x,y)
if noTouch or not playing then return end if not playing or noTouch then return end
local n=VK.on(x,y) local n=VK.on(x,y)
if n then if n then
@@ -53,8 +53,8 @@ function scene.touchUp(x,y)
end end
end end
function scene.touchMove(x,y) function scene.touchMove(x,y)
if not playing then netPLY.mouseMove(x,y)return end if not playing then netPLY.mouseMove(x,y)end
if noTouch or touchMoveLastFrame then return end if touchMoveLastFrame or noTouch then return end
touchMoveLastFrame=true touchMoveLastFrame=true
local L=tc.getTouches() local L=tc.getTouches()
@@ -120,7 +120,6 @@ function scene.gamepadDown(key)
LOG.print(text.sureQuit,COLOR.O) LOG.print(text.sureQuit,COLOR.O)
end end
else else
if noKey then return end
local k=keyMap.joystick[key] local k=keyMap.joystick[key]
if k and k>0 then if k and k>0 then
PLAYERS[1]:pressKey(k) PLAYERS[1]:pressKey(k)
@@ -129,12 +128,10 @@ function scene.gamepadDown(key)
end end
end end
function scene.gamepadUp(key) function scene.gamepadUp(key)
if noKey then return end
local k=keyMap.joystick[key] local k=keyMap.joystick[key]
if k and k>0 then if k and k>0 then
PLAYERS[1]:releaseKey(k) PLAYERS[1]:releaseKey(k)
VK.release(k) VK.release(k)
return
end end
end end
@@ -288,7 +285,7 @@ scene.widgetList={
netPLY.getReady(1)or netPLY.getReady(1)or
NET.getlock('ready') NET.getlock('ready')
end}, end},
WIDGET.newKey{name="cancel",x=900,y=560,w=400,h=100,color='H',font=40,code=pressKey"space", WIDGET.newKey{name="cancel",x=1060,y=630,w=300,h=80,color='H',font=40,code=pressKey"space",
hide=function() hide=function()
return return
playing or playing or