mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-21 20:19:02 -06:00
Game over animation is longer, and reveals stack once it's over.
This commit is contained in:
parent
888312c578
commit
e464307625
@ -334,10 +334,14 @@ end
|
|||||||
|
|
||||||
function GameMode:onGameOver()
|
function GameMode:onGameOver()
|
||||||
switchBGM(nil)
|
switchBGM(nil)
|
||||||
local alpha = 1
|
local alpha = 0
|
||||||
local animation_length = 90
|
local animation_length = 120
|
||||||
if self.game_over_frames < animation_length then
|
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)
|
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
|
end
|
||||||
love.graphics.setColor(0, 0, 0, alpha)
|
love.graphics.setColor(0, 0, 0, alpha)
|
||||||
love.graphics.rectangle(
|
love.graphics.rectangle(
|
||||||
|
Loading…
Reference in New Issue
Block a user