整理代码,移除主菜单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
P.falling=P.falling-1
if P.falling>=0 then
goto stop
goto THROW_stop
else
local L=#P.clearingRow
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
--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
P.waiting=P.waiting-1
if P.waiting<0 then P:popNext()end
goto stop
goto THROW_stop
end
--Natural block falling
@@ -302,7 +302,7 @@ function update.alive(P,dt)
local D=P.dropDelay
if D>1 then
P.dropDelay=D-1
goto stop
goto THROW_stop
end
if D==1 then
@@ -335,14 +335,14 @@ function update.alive(P,dt)
end
else
P.lockDelay=P.lockDelay-1
if P.lockDelay>=0 then goto stop end
if P.lockDelay>=0 then goto THROW_stop end
P:drop()
if P.AI_mode=='CC'and P.AI_bot then
CC.updateField(P)
end
end
end
::stop::
::THROW_stop::
--B2B bar animation
if P.b2b1==P.b2b then

View File

@@ -161,14 +161,6 @@ function scene.draw()
--Player
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
drawSelfProfile()
end

View File

@@ -35,7 +35,7 @@ end
scene.mouseDown=NULL
function scene.mouseMove(x,y)netPLY.mouseMove(x,y)end
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)
if t then
@@ -44,7 +44,7 @@ function scene.touchDown(x,y)
end
end
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)
if n then
@@ -53,8 +53,8 @@ function scene.touchUp(x,y)
end
end
function scene.touchMove(x,y)
if not playing then netPLY.mouseMove(x,y)return end
if noTouch or touchMoveLastFrame then return end
if not playing then netPLY.mouseMove(x,y)end
if touchMoveLastFrame or noTouch then return end
touchMoveLastFrame=true
local L=tc.getTouches()
@@ -120,7 +120,6 @@ function scene.gamepadDown(key)
LOG.print(text.sureQuit,COLOR.O)
end
else
if noKey then return end
local k=keyMap.joystick[key]
if k and k>0 then
PLAYERS[1]:pressKey(k)
@@ -129,12 +128,10 @@ function scene.gamepadDown(key)
end
end
function scene.gamepadUp(key)
if noKey then return end
local k=keyMap.joystick[key]
if k and k>0 then
PLAYERS[1]:releaseKey(k)
VK.release(k)
return
end
end
@@ -288,7 +285,7 @@ scene.widgetList={
netPLY.getReady(1)or
NET.getlock('ready')
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()
return
playing or