Game over fadeout easing function now accelerates.

pull/47/head
BoatsandJoes 2021-12-02 13:40:52 -06:00
parent 049806d9e2
commit 888312c578
1 changed files with 6 additions and 1 deletions

View File

@ -334,7 +334,12 @@ end
function GameMode:onGameOver() function GameMode:onGameOver()
switchBGM(nil) switchBGM(nil)
love.graphics.setColor(0, 0, 0, 1 - 2 ^ (-self.game_over_frames / 30)) local alpha = 1
local animation_length = 90
if self.game_over_frames < animation_length then
alpha = math.pow(2048, self.game_over_frames/animation_length - 1)
end
love.graphics.setColor(0, 0, 0, alpha)
love.graphics.rectangle( love.graphics.rectangle(
"fill", 64, 80, "fill", 64, 80,
16 * self.grid.width, 16 * (self.grid.height - 4) 16 * self.grid.width, 16 * (self.grid.height - 4)