Duality A1: Improved FadeIn and FadeOut functions

This commit is contained in:
Milla 2022-08-20 13:26:26 -07:00 committed by GitHub
parent ca0de46f6a
commit 5627caf589
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,13 +41,13 @@ function DualityA1Game:afterLineClear(cleared_row_count)
end end
local function fadeOut(game, block, x, y, age) local function fadeOut(game, block, x, y, age)
local opacity = game.are / (game:getARE() / 2) - 1 local opacity = 2 * game.are / game:getARE() - 1
return 0.5, 0.5, 0.5, opacity, opacity return 0.5, 0.5, 0.5, opacity, opacity
end end
local function fadeIn(game, block, x, y, age) local function fadeIn(game, block, x, y, age)
local opacity = game.are / (game:getARE() / 2) - 1 local opacity = 1 - (2 * game.are / game:getARE())
return 0.5, 0.5, 0.5, 1 - opacity, 1 - opacity return 0.5, 0.5, 0.5, opacity, opacity
end end
function DualityA1Game:drawGrid() function DualityA1Game:drawGrid()
@ -62,4 +62,4 @@ function DualityA1Game:drawGrid()
end end
end end
return DualityA1Game return DualityA1Game