+ chain label to chain numbers & + variants of chain numbers depending on comboState

This commit is contained in:
FajsiEx 2021-09-05 15:22:33 +02:00
parent 97de42f51c
commit ef61a29703
1 changed files with 15 additions and 21 deletions

View File

@ -1,4 +1,5 @@
local chainLabel = gfx.CreateSkinImage("gameplay/chain/label.png", 0)
local desw = 1080;
local desh = 1920;
@ -14,7 +15,9 @@ function load_number_image(path)
return images
end
local chainNumbers = load_number_image('gameplay/chain/reg')
local chainNumbersReg = load_number_image('gameplay/chain/reg')
local chainNumbersUC = load_number_image('gameplay/chain/uc')
local chainNumbersPUC = load_number_image('gameplay/chain/puc')
function draw_number(x, y, alpha, num, digits, images, is_dim, scale, kern)
scale = scale or 1;
@ -54,35 +57,26 @@ local tickTransitions = function (deltaTime)
end
end
local render = function (deltaTime, combo, critLineCenterX, critLineCenterY)
local render = function (deltaTime, comboState, combo, critLineCenterX, critLineCenterY)
tickTransitions(deltaTime)
if combo == 0 then return end
-- comboTimer = comboTimer + deltaTime
local posx = desw / 2 + transitionShakePosOffset;
local posy = desh - 650 + transitionShakePosOffset;
local posy = desh - 640 + transitionShakePosOffset;
-- if portrait then posy = desh * critLinePos[2] - 150 end
-- if gameplay.comboState == 2 then
-- comboCurrent = comboPUC --puc
-- elseif gameplay.comboState == 1 then
-- comboCurrent = comboUC --uc
-- else
-- comboCurrent = comboREG --regular
-- end
-- local alpha = math.floor(comboTimer * 20) % 2
-- alpha = (alpha * 100 + 155) / 255
local alpha = 1
local chainNumbers = chainNumbersReg --regular
if comboState == 2 then
chainNumbers = chainNumbersPUC --puc
elseif comboState == 1 then
chainNumbers = chainNumbersUC --uc
end
-- \_ chain _/
local tw, th
-- tw, th = gfx.ImageSize(comboBottom)
-- gfx.BeginPath()
-- gfx.ImageRect(posx - tw / 2 + 10, posy - th / 4 - 210, tw * 0.85, th * 0.85, comboBottom, alpha, 0)
tw, th = gfx.ImageSize(chainLabel)
gfx.BeginPath()
gfx.ImageRect(posx - tw * 0.85 / 2, posy - 220, tw * 0.85, th * 0.85, chainLabel, 1, 0)
tw, th = gfx.ImageSize(chainNumbers[1])
posy = posy - th + 32