From e29c3af8bbd65b1b4c9ba5c1ddca1bf6f1b84468 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Thu, 8 Jul 2021 21:19:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E6=94=BE=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=9A=90=E5=BD=A2=E7=9A=84=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=92=8Cghost=20close=20#105?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 6aedf64c..70db51d3 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -115,6 +115,7 @@ local function drawField(P) local ENV=P.gameEnv local V,F=P.visTime,P.field local start=int((P.fieldBeneath+P.fieldUp)/30+1) + local showInvis=GAME.replaying if P.falling==-1 then--Blocks only if ENV.upEdge then @@ -128,7 +129,7 @@ local function drawField(P) end -- - for j=start,min(start+21,#F)do drawRow(j,V[j],F[j],GAME.replaying)end + for j=start,min(start+21,#F)do drawRow(j,V[j],F[j],showInvis)end -- else--With falling animation local stepY=ENV.smooth and(P.falling/(ENV.fall+1))^2.5*30 or 30 @@ -161,7 +162,7 @@ local function drawField(P) gc_setColor(1,1,1,alpha) gc_rectangle('fill',0,30-30*j,300,stepY) end - drawRow(j,V[j],F[j],GAME.replaying) + drawRow(j,V[j],F[j],showInvis) end -- gc_pop() @@ -285,6 +286,15 @@ local function drawBlockOutline(P,texture,trans) end end gc_setShader() end +local function drawBlockShade(P,alpha) + gc_setColor(1,1,1,alpha) + local CB=P.cur.bk + for i=1,#CB do for j=1,#CB[1]do + if CB[i][j]then + gc_rectangle('fill',30*(j+P.curX)-60,30-30*(i+P.curY),30,30) + end + end end +end local function drawBlock(P,clr) gc_setColor(1,1,1) gc_setShader(shader_blockSatur) @@ -684,6 +694,8 @@ function draw.norm(P) gc_setColor(1,1,1,ENV.center) gc_draw(spinCenterImg,centerX,-30*(P.ghoY+P.cur.sc[1])+15,nil,nil,nil,4,4) end + elseif GAME.replaying then + drawGhost.gray(P,nil,.15) end local dy=ENV.smooth and P.ghoY~=P.curY and(P.dropDelay/ENV.drop-1)*30 or 0 @@ -696,6 +708,8 @@ function draw.norm(P) gc_setColor(1,1,1,ENV.center) gc_draw(spinCenterImg,centerX,-30*(P.curY+P.cur.sc[1])+15,nil,nil,nil,4,4) end + elseif GAME.replaying then + drawBlockShade(P,trans*.3) end gc_translate(0,dy) end