Indicate when ceiling will drop
parent
b04fee6d61
commit
9c86ebb464
29
main.lua
29
main.lua
|
|
@ -513,6 +513,7 @@ function love.update(dt)
|
||||||
c = game.row_gap
|
c = game.row_gap
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
game.ceiling_should_drop = false
|
||||||
|
|
||||||
local matches = find_matches(movement_info.nearest_slot_index)
|
local matches = find_matches(movement_info.nearest_slot_index)
|
||||||
|
|
||||||
|
|
@ -694,11 +695,38 @@ function love.draw(alpha)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- draw ceiling drop indicator
|
||||||
|
love.graphics.setColor(0, 0, 0, 1)
|
||||||
|
for i = 1, game.ceiling_drops_after do
|
||||||
|
love.graphics.circle(
|
||||||
|
'line',
|
||||||
|
game.level_left + (i - 1) * 15 + 15,
|
||||||
|
game.level_bottom + 15,
|
||||||
|
6
|
||||||
|
)
|
||||||
|
end
|
||||||
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
local ceiling_progress = game.bubbles_launched % game.ceiling_drops_after
|
||||||
|
for i = 1, ceiling_progress do
|
||||||
|
love.graphics.circle(
|
||||||
|
'fill',
|
||||||
|
game.level_left + (i - 1) * 15 + 15,
|
||||||
|
game.level_bottom + 15,
|
||||||
|
5
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
if game.game_over then
|
if game.game_over then
|
||||||
love.graphics.setShader(game.shader)
|
love.graphics.setShader(game.shader)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- draw stationary bubbles
|
-- draw stationary bubbles
|
||||||
|
local ceiling_drops_in = game.ceiling_drops_after - ceiling_progress
|
||||||
|
if ceiling_drops_in == 1 or game.ceiling_should_drop then
|
||||||
|
local dx = love.math.random(-1, 1)
|
||||||
|
local dy = love.math.random(-1, 1)
|
||||||
|
love.graphics.translate(dx, dy)
|
||||||
|
end
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
for i = 1, #game.bubble_slots do
|
for i = 1, #game.bubble_slots do
|
||||||
local slot = game.bubble_slots[i]
|
local slot = game.bubble_slots[i]
|
||||||
|
|
@ -713,6 +741,7 @@ function love.draw(alpha)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
love.graphics.origin()
|
||||||
|
|
||||||
-- draw launcher
|
-- draw launcher
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue