玩家类添加一个目标线绘制函数
堆叠模式添加需要填满的高度线
This commit is contained in:
@@ -5,6 +5,7 @@ return{
|
||||
setFont(60)
|
||||
mStr(P.stat.row,63,280)
|
||||
mText(TEXTOBJ.line,63,350)
|
||||
PLY.draw.drawMarkLine(P,20,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||
end,
|
||||
dropPiece=function(P)
|
||||
if #P.field>20 then
|
||||
|
||||
@@ -5,6 +5,7 @@ return{
|
||||
setFont(60)
|
||||
mStr(P.stat.row,63,280)
|
||||
mText(TEXTOBJ.line,63,350)
|
||||
PLY.draw.drawMarkLine(P,18,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||
end,
|
||||
dropPiece=function(P)
|
||||
if #P.field>20 then
|
||||
|
||||
@@ -5,6 +5,7 @@ return{
|
||||
setFont(60)
|
||||
mStr(P.stat.row,63,280)
|
||||
mText(TEXTOBJ.line,63,350)
|
||||
PLY.draw.drawMarkLine(P,17,.3,1,1,TIME()%.42<.21 and .95 or .6)
|
||||
end,
|
||||
dropPiece=function(P)
|
||||
if #P.field>20 then
|
||||
|
||||
@@ -658,16 +658,26 @@ local draw={}
|
||||
draw.drawGhost=drawGhost
|
||||
draw.applyField=_applyField
|
||||
draw.cancelField=_cancelField
|
||||
function draw.drawTargetLine(P,r)
|
||||
if r<=20+(P.fieldBeneath+P.fieldUp+10)/30 and r>0 then
|
||||
function draw.drawTargetLine(P,h)
|
||||
if h<=20+(P.fieldBeneath+P.fieldUp+10)/30 and h>0 then
|
||||
gc_setLineWidth(3)
|
||||
gc_setColor(1,r>10 and 0 or .2+.8*rnd(),.5)
|
||||
gc_setColor(1,h>10 and 0 or .2+.8*rnd(),.5)
|
||||
_applyField(P)
|
||||
r=600-30*r
|
||||
h=600-30*h
|
||||
if P.falling~=-1 then
|
||||
r=r-#P.clearingRow*(P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^1.6*30 or 30)
|
||||
h=h-#P.clearingRow*(P.gameEnv.smooth and(P.falling/(P.gameEnv.fall+1))^1.6*30 or 30)
|
||||
end
|
||||
gc_line(0,r,300,r)
|
||||
gc_line(0,h,300,h)
|
||||
_cancelField()
|
||||
end
|
||||
end
|
||||
function draw.drawMarkLine(P,h,r,g,b,a)
|
||||
if h<=20+(P.fieldBeneath+P.fieldUp+10)/30 and h>0 then
|
||||
gc_setLineWidth(4)
|
||||
gc_setColor(r,g,b,a)
|
||||
_applyField(P)
|
||||
h=600-30*h
|
||||
gc_line(0,h,300,h)
|
||||
_cancelField()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user