From 3d26db7a0114c090e6286fb08b229aff1f061df0 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 25 Nov 2021 02:42:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B6=88=E8=A1=8C=E5=BB=B6=E8=BF=9F=E5=92=8C?= =?UTF-8?q?=E5=87=BA=E5=9D=97=E5=BB=B6=E8=BF=9F=E5=9C=A8=E6=9E=81=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 6 +++--- parts/player/player.lua | 22 +++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 1e46f12d..6875f738 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -782,7 +782,7 @@ function draw.norm(P,repMode) _drawFXs(P) --Draw current block - if P.cur and P.waiting==0 then + if P.cur then local C=P.cur local curColor=C.color @@ -981,7 +981,6 @@ function draw.small(P) end function draw.demo(P) local ENV=P.gameEnv - local curColor=P.cur.color --Camera gc_push('transform') @@ -997,7 +996,8 @@ function draw.demo(P) gc_translate(0,600) _drawField(P) _drawFXs(P) - if P.cur and P.waiting==0 then + if P.cur then + local curColor=P.cur.color if ENV.ghost then drawGhost[ENV.ghostType](P.cur.bk,P.curX,P.ghoY,ENV.ghost,P.skinLib,curColor) end diff --git a/parts/player/player.lua b/parts/player/player.lua index a0126fa1..7fb94398 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -489,7 +489,9 @@ local playerActions={ if self.keyAvailable[keyID]and self.alive then if self.waiting>self.gameEnv.hurry then self.waiting=self.gameEnv.hurry - if self.waiting==0 then self:popNext()end + if self.waiting==0 and self.falling==0 then + self:popNext() + end end self.keyPressing[keyID]=true playerActions[keyID](self) @@ -1322,7 +1324,7 @@ function Player:hold_swap(ifpre) self.stat.hold=self.stat.hold+1 end function Player:hold(ifpre) - if self.holdTime>0 and(ifpre or self.waiting==0)then + if self.holdTime>0 and(ifpre or self.falling==0 and self.waiting==0)then if self.gameEnv.holdMode=='hold'then self:hold_norm(ifpre) elseif self.gameEnv.holdMode=='swap'then @@ -2019,7 +2021,12 @@ do self:_triggerEvent('hook_drop') end - if self.waiting==0 then self:popNext()end + --Remove controling block + self.cur=nil + + if self.waiting==0 and self.falling==0 then + self:popNext() + end end function Player:clearFilledLines(start,height) @@ -2419,8 +2426,11 @@ local function update_alive(P) P.downing=0 end + local stopAtFalling + --Falling animation if P.falling>0 then + stopAtFalling=true P:_updateFalling(P.falling-1) if P.falling>0 then goto THROW_stop @@ -2430,8 +2440,10 @@ local function update_alive(P) --Update block state if P.control then --Try spawn new block - if P.waiting>0 then - P.waiting=P.waiting-1 + if not P.cur then + if not stopAtFalling and P.waiting>0 then + P.waiting=P.waiting-1 + end if P.waiting<=0 then P:popNext() end