Add ability to remove garbage by clearing [height+2] lines or more (#714)

* Resolve #684

* oh right almost forgor stack_u 💀
This commit is contained in:
NOT_A_ROBOT
2022-07-17 22:23:46 +07:00
committed by GitHub
parent e161e39b66
commit a4d6585e9c
2 changed files with 12 additions and 2 deletions

View File

@@ -11,7 +11,12 @@ return{
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
if cc>0 then
local h=20-cc-P.garbageBeneath
if h>0 then
if h<-1 and P.garbageBeneath>0 then
for i=1,math.min(P.garbageBeneath,-h-1) do
LINE.discard(table.remove(P.field,1))
LINE.discard(table.remove(P.visTime,1))
end
elseif h>0 then
P:garbageRise(21,h,2e10-1)
if P.garbageBeneath>=20 then
P:lose()

View File

@@ -11,7 +11,12 @@ return{
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
if cc>0 then
local h=20-cc-P.garbageBeneath-3
if h>0 then
if h<-1 and P.garbageBeneath>0 then
for i=1,math.min(P.garbageBeneath,-h-1) do
LINE.discard(table.remove(P.field,1))
LINE.discard(table.remove(P.visTime,1))
end
elseif h>0 then
P:garbageRise(21,h,2e10-1)
if P.garbageBeneath>=20 then
P:lose()