spark animation

This commit is contained in:
Kistaro Windrider 2024-02-11 12:57:15 -08:00
parent cdea234377
commit 304480553f
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -1297,7 +1297,7 @@ end
-- 1: black (for sprites) -- 1: black (for sprites)
-- 2: dolphin shading -- 2: dolphin shading
-- 3: azure water, maybe score display? (140) -- 3: azure water, maybe score display? (140)
-- 4, 5: unassigned, layer-specific -- 4, 5: keep default in sky layer (for emergency awakener)
-- 6: dolphin specular highlights -- 6: dolphin specular highlights
-- 7: dolphin white paint -- 7: dolphin white paint
-- 8, 9: unassigned, layer specific -- 8, 9: unassigned, layer specific
@ -1370,6 +1370,24 @@ function sea:draw()
rectfill(0, 125+(w>>3), 128, 128, 0x1001) rectfill(0, 125+(w>>3), 128, 128, 0x1001)
end end
spark = {
x=0,
y=0,
dx=0,
dy=0,
f=-1,
}
mknew(spark)
function spark:update()
self.f += 1
if (self.f >= 12) return true
self.x += self.dx
self.y += self.dy
end
function spark:draw()
spr(48+self.f\2, self.x, self.y)
end
arcade_level = { arcade_level = {
score=0, score=0,
max_score=999, max_score=999,
@ -1455,7 +1473,8 @@ end
function arcade_level:word_hit(word) function arcade_level:word_hit(word)
self.score += 1 self.score += 1
-- TODO: sfx -- TODO: sfx
-- TODO: sparkle self.bg:push_back(spark.new{x=word.x-1, y=word.y-1, dx=-2})
self.bg:push_back(spark.new{x=word.x+word.w, y=word.y-1, dx=1})
end end
function arcade_level:draw() function arcade_level:draw()