From e464307625b48260c135080c4af04822330b5e82 Mon Sep 17 00:00:00 2001 From: BoatsandJoes Date: Thu, 2 Dec 2021 15:49:27 -0600 Subject: [PATCH] Game over animation is longer, and reveals stack once it's over. --- tetris/modes/gamemode.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tetris/modes/gamemode.lua b/tetris/modes/gamemode.lua index 0e51cbc..e43267b 100644 --- a/tetris/modes/gamemode.lua +++ b/tetris/modes/gamemode.lua @@ -334,10 +334,14 @@ end function GameMode:onGameOver() switchBGM(nil) - local alpha = 1 - local animation_length = 90 + local alpha = 0 + local animation_length = 120 if self.game_over_frames < animation_length then + -- Show field for a bit, then fade out. alpha = math.pow(2048, self.game_over_frames/animation_length - 1) + elseif self.game_over_frames < 2 * animation_length then + -- Keep field hidden for a short time, then pop it back in (for screenshots). + alpha = 1 end love.graphics.setColor(0, 0, 0, alpha) love.graphics.rectangle(