整理代码

This commit is contained in:
MrZ626
2021-04-16 01:30:45 +08:00
parent 1baa59162e
commit e44a10de2c
5 changed files with 15 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ return{
for _=1,3 do P:getNext(7)end
while true do
YIELD()
if not P.nextQueue[1] then
if not P.nextQueue[1]then
local height=FREEROW.get(0)
local max=#P.field
if max>0 then

View File

@@ -19,7 +19,7 @@ return{
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1]and a[2]<b[2])end,
getRank=function(P)
if P.stat.row<40 then return end
local T=P.stat.time

View File

@@ -18,7 +18,7 @@ return{
end,
score=function(P)return{P.stat.time,P.stat.piece}end,
scoreDisp=function(D)return TIMESTR(D[1]).." "..D[2].." Pieces"end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1] and a[2]<b[2])end,
comp=function(a,b)return a[1]<b[1]or(a[1]==b[1]and a[2]<b[2])end,
getRank=function(P)
if P.stat.row<40 then return end
local T=P.stat.time

View File

@@ -459,7 +459,7 @@ function draw.drawNext_norm(P)
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
local k=#bk>2 and 2.2/#bk or 1
gc_scale(k)
for i=1,#bk do for j=1,#bk[1] do
for i=1,#bk do for j=1,#bk[1]do
if bk[i][j]then
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
end
@@ -497,7 +497,7 @@ function draw.drawNext_hidden(P)
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
local k=#bk>2 and 2.2/#bk or 1
gc_scale(k)
for i=1,#bk do for j=1,#bk[1] do
for i=1,#bk do for j=1,#bk[1]do
if bk[i][j]then
gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
end