Add delay to bubble burst, slightly change animation
parent
ad9a0ea35e
commit
75805b1093
13
main.lua
13
main.lua
|
|
@ -344,6 +344,7 @@ function love.update(dt)
|
||||||
for i = 1, #matches do
|
for i = 1, #matches do
|
||||||
local index = matches[i]
|
local index = matches[i]
|
||||||
game.bursting_bubbles[#game.bursting_bubbles+1] = {
|
game.bursting_bubbles[#game.bursting_bubbles+1] = {
|
||||||
|
delay = (i - 1) / 40,
|
||||||
x = game.bubble_slots[index].x,
|
x = game.bubble_slots[index].x,
|
||||||
y = game.bubble_slots[index].y,
|
y = game.bubble_slots[index].y,
|
||||||
bubble_type = game.bubble_slots[index].bubble_type,
|
bubble_type = game.bubble_slots[index].bubble_type,
|
||||||
|
|
@ -399,10 +400,14 @@ function love.update(dt)
|
||||||
if #game.bursting_bubbles > 0 then
|
if #game.bursting_bubbles > 0 then
|
||||||
for i = #game.bursting_bubbles, 1, -1 do
|
for i = #game.bursting_bubbles, 1, -1 do
|
||||||
local bubble = game.bursting_bubbles[i]
|
local bubble = game.bursting_bubbles[i]
|
||||||
bubble.scale = bubble.scale * 1.05
|
if bubble.delay <= 0 then
|
||||||
bubble.alpha = bubble.alpha - 0.1
|
bubble.scale = bubble.scale * 1.03
|
||||||
if bubble.scale >= 1.5 then
|
bubble.alpha = bubble.alpha - 0.02
|
||||||
table.remove(game.bursting_bubbles, i)
|
if bubble.scale >= 1.5 then
|
||||||
|
table.remove(game.bursting_bubbles, i)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
bubble.delay = bubble.delay - dt
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue