prototype fish drawer (fish not implemented)

This commit is contained in:
Kistaro Windrider 2024-02-29 20:26:51 -08:00
parent 0574fe4021
commit 09a09b646a
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -59,6 +59,12 @@ function event_list:pb(x)
self.tail = x self.tail = x
end end
function event_list:pf(x)
if (not self.next) self.tail = x
x.next = self.next
self.next = x
end
function event_list:u() function event_list:u()
local p, n = self, self.next local p, n = self, self.next
while n do while n do
@ -1595,9 +1601,35 @@ end)
function arcade_level:av() function arcade_level:av()
if (musicmode & 1 ==0) music(0,1000,7) if (musicmode & 1 ==0) music(0,1000,7)
for _=1,5 do
self:gen_fish(0, 150)
end
font_compact() font_compact()
end end
function arcade_level:gen_fish(xmin, xrg)
local fishdx = rnd(0.5) - 0.25, rnd(xrg) + xmin
local fish = spritem.new{
x = rnd(xrg) + xmin,
y = 80 + irnd(44),
s = {54, 55, 56, 55},
flipx = fishdx < 0,
i = irnd(4) + 1,
f = 20,
}
bg.pf(parallax.new{
level=self,
item=fish,
dx=fishdx,
z=0.5 + rnd(0.4),
id="fish",
})
end
function arcade_level:pdone(item)
if (item.id == "fish") self:gen_fish(129, 200)
end
function arcade_level:onmchg() function arcade_level:onmchg()
music((musicmode & 0x1 == 0) and 0 or -1, 500, 7) music((musicmode & 0x1 == 0) and 0 or -1, 500, 7)
end end
@ -1621,6 +1653,7 @@ function arcade_level:u()
end end
if (self.d:u()) seq:next() if (self.d:u()) seq:next()
end end
self.pdx = (self.phin.entered and not self.phin.exiting) and -1 or 0
self.v:u() self.v:u()
end end