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

@@ -339,8 +339,9 @@ function MinigameDDRWindow.update()
local mg = Context.minigame_ddr
if mg.win_timer > 0 then
mg.win_timer = mg.win_timer - 1
if mg.win_timer == 0 then
mg.win_timer = mg.win_timer - Context.dt60
if mg.win_timer <= 0 then
mg.win_timer = 0
Audio.music_stop()
Meter.apply_ddr_reward(mg.total_misses)
if not Context.game_in_progress then return end
@@ -359,7 +360,7 @@ function MinigameDDRWindow.update()
return
end
mg.frame_counter = mg.frame_counter + 1
mg.frame_counter = mg.frame_counter + Context.dt60
if mg.use_pattern and mg.current_song and mg.current_song.end_frame then
if mg.frame_counter > mg.current_song.end_frame and #mg.arrows == 0 then
@@ -381,7 +382,7 @@ function MinigameDDRWindow.update()
end
end
else
mg.arrow_spawn_timer = mg.arrow_spawn_timer + 1
mg.arrow_spawn_timer = mg.arrow_spawn_timer + Context.dt60
if mg.arrow_spawn_timer >= mg.arrow_spawn_interval then
spawn_arrow()
mg.arrow_spawn_timer = 0
@@ -391,7 +392,7 @@ function MinigameDDRWindow.update()
-- move arrow downwards
local arrows_to_remove = {}
for i, arrow in ipairs(mg.arrows) do
arrow.y = arrow.y + mg.arrow_fall_speed
arrow.y = arrow.y + mg.arrow_fall_speed * Context.dt60
if check_miss(arrow) then
table.insert(arrows_to_remove, i)
mg.bar_fill = math.max(0, mg.bar_fill - mg.miss_penalty)
@@ -406,13 +407,13 @@ function MinigameDDRWindow.update()
for dir, _ in pairs(mg.input_cooldowns) do
if mg.input_cooldowns[dir] > 0 then
mg.input_cooldowns[dir] = mg.input_cooldowns[dir] - 1
mg.input_cooldowns[dir] = mg.input_cooldowns[dir] - Context.dt60
end
end
for dir, _ in pairs(mg.button_pressed_timers) do
if mg.button_pressed_timers[dir] > 0 then
mg.button_pressed_timers[dir] = mg.button_pressed_timers[dir] - 1
mg.button_pressed_timers[dir] = mg.button_pressed_timers[dir] - Context.dt60
end
end