Accelerate debris when line clear is fast. 8176 tk

This commit is contained in:
Kistaro Windrider 2023-07-23 16:58:34 -07:00
parent 09ef3617f7
commit e5afd605c8
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -2002,6 +2002,7 @@ anim={
swooshes={},
new=function(t,a)
if (debris==3 and t=="crush") return
local listname = t.."es"
a.type,a.new,a.next=t,true,anim[listname].next
anim[listname].next=a
@ -2011,12 +2012,14 @@ anim={
draw=function()
--drawing in correct order
for t in all({"swoosh","crush"})do
local lnm = t.."es"
local prev=anim[lnm]
local afxn,prev=anim[t],anim[t.."es"]
local curr=prev.next
while curr do
if (not curr.wait and not anim[t](curr)) prev.next=curr.next
prev=curr
if not curr.wait and not afxn(curr) then
prev.next=curr.next
else
prev=curr
end
curr=curr.next
end
poke2(0x5f06,0x706)
@ -2039,8 +2042,7 @@ anim={
swoosh=function(a)
local baseframes = 10/clrspd --10 wide
local totalframes = baseframes+5 --5 swooshclrs
if a.age > totalframes then
if a.age > baseframes+5 then
dirty=true
return false
end
@ -2058,11 +2060,9 @@ anim={
end,
crush=function(a)
if (debris==3) return false
if (a.lag>0) return true
poke2(0x5f06,a.c)
local spr_base = 8*sprite.normal
local ret = false
local spr_base,ret = 8*sprite.normal,false
for p in all(a.list) do
ret = ret or p.y<128
sspr(spr_base+p.i%2*3,p.i\2*3,3,3,p.x,p.y)
@ -2081,12 +2081,14 @@ end
function upd_crush(a)
if a.list==nil then
local c2=clrspd/2
a.list = {
{i=0,x=a.x,y=a.y,dx=-rnd(0.5),dy=rnd(1)-1.5},
{i=1,x=a.x+3,y=a.y,dx=rnd(0.5),dy=rnd(1)-1.5},
{i=3,x=a.x+3,y=a.y+3,dx=rnd(0.5),dy=rnd(1)-0.5},
{i=2,x=a.x,y=a.y+3,dx=-rnd(0.5),dy=rnd(1)-0.5}
{i=0,x=a.x,y=a.y,dx=-rnd(c2),dy=(rnd(1)-1.5)},
{i=1,x=a.x+3,y=a.y,dx=rnd(c2),dy=(rnd(1)-1.5)},
{i=3,x=a.x+3,y=a.y+3,dx=rnd(c2),dy=(rnd(1)-0.5)},
{i=2,x=a.x,y=a.y+3,dx=-rnd(c2),dy=(rnd(1)-0.5)}
}
a.g=0.075*clrspd
if debris==2 then
deli(a.list,irnd1(4))
deli(a.list,irnd1(3))
@ -2099,7 +2101,7 @@ function upd_crush(a)
for p in all(a.list) do
p.x+=p.dx
p.y+=p.dy
p.dy+=0.075
p.dy+=a.g
end
end