Duality A1: Improved FadeIn and FadeOut functions

pull/7/merge
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
1 changed files with 4 additions and 4 deletions

View File

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