From 9e63c89166b1926be802cf04aaaa60eadf1bff91 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 14 Feb 2021 15:51:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E6=B8=B8=E6=88=8F2048=E7=9B=B2?= =?UTF-8?q?=E6=89=93=E9=9A=BE=E5=BA=A6=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/scenes/mg_2048.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/parts/scenes/mg_2048.lua b/parts/scenes/mg_2048.lua index 63a3e2fa..d1df9fcc 100644 --- a/parts/scenes/mg_2048.lua +++ b/parts/scenes/mg_2048.lua @@ -230,8 +230,7 @@ function scene.sceneInit() blind=false tapControl=false - startTime,time=0,0 - state=0 + startTime=0 reset() end @@ -370,7 +369,7 @@ function scene.draw() "white" ) ]) - gc.rectangle("line",990,305+60*i,220,50) + rectangle("line",990,305+60*i,220,50) gc.print(repeater.seq[i],1000,313+60*i) end @@ -400,13 +399,18 @@ function scene.draw() local x,y=1+(i-1)%4,int((i+3)/4) local N=board[i] if i~=prevPos or prevSpawnTime==1 then - setColor(tileColor[N]or COLOR.black) - rectangle("fill",x*160+163,y*160-117,154,154,15) - if N>=0 and not blind or i==prevPos then - setColor(N<3 and COLOR.black or COLOR.W) - local fontSize=tileFont[N] - setFont(fontSize) - mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7) + if not blind or i==prevPos then + setColor(tileColor[N]or COLOR.black) + rectangle("fill",x*160+163,y*160-117,154,154,15) + if N>=0 then + setColor(N<3 and COLOR.black or COLOR.W) + local fontSize=tileFont[N] + setFont(fontSize) + mStr(tileName[N],320+(x-.5)*160,40+(y-.5)*160-fontSize*.7) + end + else + setColor(COLOR.grey) + rectangle("fill",x*160+163,y*160-117,154,154,15) end else local c=tileColor[N]