timedeltafix

This commit is contained in:
2026-05-07 21:46:46 +02:00
parent b353a96bfb
commit 6055b74ccf
13 changed files with 34 additions and 30 deletions

View File

@@ -135,7 +135,7 @@ end
--- @within Ascension
function Ascension.draw_flash()
if not _flash_active then return end
_flash_timer = _flash_timer + 1
_flash_timer = _flash_timer + Context.dt60
local sw = Config.screen.width
local sh = Config.screen.height
@@ -160,7 +160,7 @@ end
--- @within Ascension
function Ascension.update_fade()
if not _fade_active then return end
_fade_timer = _fade_timer + 1
_fade_timer = _fade_timer + Context.dt60
if _fade_timer >= FADE_DURATION then
_fade_active = false
end

View File

@@ -105,14 +105,14 @@ function Focus.update()
if driven then return end
if closing then
radius = radius - speed
radius = radius - speed * Context.dt60
if radius <= 0 then
local cb = on_complete
Focus.stop()
if cb then cb() end
end
else
radius = radius + speed
radius = radius + speed * Context.dt60
if radius >= max_radius(center_x, center_y) then
local cb = on_complete
Focus.stop()

View File

@@ -23,7 +23,7 @@ function Glitch.draw()
if not Context or not Context.glitch or not Context.glitch.enabled then return end
-- Update state timer
Context.glitch.timer = Context.glitch.timer - 1
Context.glitch.timer = Context.glitch.timer - Context.dt60
if Context.glitch.timer <= 0 then
if Context.glitch.state == "active" then
Context.glitch.state = "waiting"

View File

@@ -96,7 +96,7 @@ function Meter.update()
local in_minigame = string.find(Window.get_current_id(), "^minigame_") ~= nil
if not in_minigame then
if m.combo > 0 then
m.combo_timer = m.combo_timer + 1
m.combo_timer = m.combo_timer + Context.dt60
if m.combo_timer >= COMBO_TIMEOUT_FRAMES then
m.combo = 0
m.combo_timer = 0

View File

@@ -28,7 +28,7 @@ function Timer.update()
local in_minigame = string.find(Window.get_current_id(), "^minigame_") ~= nil
if not in_minigame then
t.progress = t.progress + (1 / timer_duration)
t.progress = t.progress + (Context.delta_time / (timer_duration / 60))
if t.progress >= 1 then
t.progress = t.progress - 1
end

View File

@@ -110,7 +110,7 @@ function Trigger.update()
for id, state in pairs(Context.triggers) do
local trigger = triggers[id]
if trigger then
state.elapsed = state.elapsed + 1
state.elapsed = state.elapsed + Context.dt60
if state.elapsed >= trigger.duration then
table.insert(fired, id)
end