* 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)
|
function update_combo(newCombo)
|
||||||
chain = newCombo
|
chain = newCombo
|
||||||
|
Chain.onNewCombo();
|
||||||
if (chain > maxChain) then
|
if (chain > maxChain) then
|
||||||
maxChain = chain;
|
maxChain = chain;
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,6 +6,7 @@ local desh = 1920;
|
||||||
|
|
||||||
local transitionShakeScale = 0;
|
local transitionShakeScale = 0;
|
||||||
local transitionShakePosOffset = 0;
|
local transitionShakePosOffset = 0;
|
||||||
|
local shakeTimer = 0;
|
||||||
|
|
||||||
function load_number_image(path)
|
function load_number_image(path)
|
||||||
local images = {}
|
local images = {}
|
||||||
|
@ -57,9 +58,19 @@ local tickTransitions = function (deltaTime)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local onNewCombo = function ()
|
||||||
|
shakeTimer = 0.25;
|
||||||
|
end
|
||||||
|
|
||||||
local render = function (deltaTime, comboState, combo, critLineCenterX, critLineCenterY)
|
local render = function (deltaTime, comboState, combo, critLineCenterX, critLineCenterY)
|
||||||
tickTransitions(deltaTime)
|
tickTransitions(deltaTime)
|
||||||
|
|
||||||
|
if shakeTimer > 0 then
|
||||||
|
shakeTimer = shakeTimer - deltaTime;
|
||||||
|
else
|
||||||
|
transitionShakePosOffset = 0;
|
||||||
|
end
|
||||||
|
|
||||||
if combo == 0 then return end
|
if combo == 0 then return end
|
||||||
|
|
||||||
local posx = desw / 2 + transitionShakePosOffset;
|
local posx = desw / 2 + transitionShakePosOffset;
|
||||||
|
@ -86,5 +97,6 @@ local render = function (deltaTime, comboState, combo, critLineCenterX, critLine
|
||||||
end
|
end
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
onNewCombo=onNewCombo,
|
||||||
render=render
|
render=render
|
||||||
}
|
}
|
Loading…
Reference in New Issue