A lot of FPS agnosticism, added def lerp

This commit is contained in:
Maruno17
2023-05-20 18:37:54 +01:00
parent 62e372f4d7
commit d112e2361a
38 changed files with 619 additions and 628 deletions

View File

@@ -360,9 +360,10 @@ class Battle::Scene
return if !ball
# Data box disappear animation
dataBoxAnim = Animation::DataBoxDisappear.new(@sprites, @viewport, idxBattler)
timer_start = System.uptime
loop do
dataBoxAnim.update
ball.opacity -= 12 * 20 / Graphics.frame_rate if ball.opacity > 0
ball.opacity = lerp(255, 0, 1.0, timer_start, System.uptime)
pbUpdate
break if dataBoxAnim.animDone? && ball.opacity <= 0
end