From 888312c578b2aeeb5e0ea51e5976c3c13f47b539 Mon Sep 17 00:00:00 2001 From: BoatsandJoes Date: Thu, 2 Dec 2021 13:40:52 -0600 Subject: [PATCH] Game over fadeout easing function now accelerates. --- tetris/modes/gamemode.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 5c20566..0e51cbc 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -334,7 +334,12 @@ end function GameMode:onGameOver() 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( "fill", 64, 80, 16 * self.grid.width, 16 * (self.grid.height - 4)