* make chain number shake only on new combo
This commit is contained in:
parent
d1694b69da
commit
2f9e66cbd5
|
@ -89,6 +89,7 @@ end
|
|||
|
||||
function update_combo(newCombo)
|
||||
chain = newCombo
|
||||
Chain.onNewCombo();
|
||||
if (chain > maxChain) then
|
||||
maxChain = chain;
|
||||
end
|
||||
|
|
|
@ -6,6 +6,7 @@ local desh = 1920;
|
|||
|
||||
local transitionShakeScale = 0;
|
||||
local transitionShakePosOffset = 0;
|
||||
local shakeTimer = 0;
|
||||
|
||||
function load_number_image(path)
|
||||
local images = {}
|
||||
|
@ -57,9 +58,19 @@ local tickTransitions = function (deltaTime)
|
|||
end
|
||||
end
|
||||
|
||||
local onNewCombo = function ()
|
||||
shakeTimer = 0.25;
|
||||
end
|
||||
|
||||
local render = function (deltaTime, comboState, combo, critLineCenterX, critLineCenterY)
|
||||
tickTransitions(deltaTime)
|
||||
|
||||
if shakeTimer > 0 then
|
||||
shakeTimer = shakeTimer - deltaTime;
|
||||
else
|
||||
transitionShakePosOffset = 0;
|
||||
end
|
||||
|
||||
if combo == 0 then return end
|
||||
|
||||
local posx = desw / 2 + transitionShakePosOffset;
|
||||
|
@ -86,5 +97,6 @@ local render = function (deltaTime, comboState, combo, critLineCenterX, critLine
|
|||
end
|
||||
|
||||
return {
|
||||
onNewCombo=onNewCombo,
|
||||
render=render
|
||||
}
|
Loading…
Reference in New Issue