消除所有填满行的函数整理为玩家类的clearFilledLines方法

添加消7~20和20+的消除文本与消除音效
播放消n音效打包为函数移至gameFuncs文件
This commit is contained in:
MrZ626
2021-11-02 16:30:00 +08:00
parent aa01ab07f7
commit bd260b2c6f
14 changed files with 63 additions and 43 deletions

View File

@@ -2,16 +2,10 @@ return{
fillClear=false,
dropPiece=function(P)
if #P.field>P.gameEnv.fieldH then
local cc=P:checkClear(P.field,P.garbageBeneath+1,#P.field-P.garbageBeneath)
if cc>0 then
SFX.play('clear_'..math.min(cc,6))
P:showText(text.clear[cc]or cc.."-crash",0,0,60,'beat',.4)
P:removeClearedLines()
P.falling=P.gameEnv.fall
P.stat.row=P.stat.row+cc
end
if P.gameEnv.fieldH-cc-P.garbageBeneath>0 then
P:garbageRise(21,P.gameEnv.fieldH-cc-P.garbageBeneath,2e10-1)
local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath)
local h=P.gameEnv.fieldH-cc-P.garbageBeneath
if h>0 then
P:garbageRise(21,h,2e10-1)
if P.garbageBeneath>=P.gameEnv.fieldH then
P:lose()
end