timedeltafix
This commit is contained in:
@@ -71,8 +71,9 @@ function MinigameRhythmWindow.update()
|
||||
local mg = Context.minigame_rhythm
|
||||
|
||||
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
|
||||
Meter.on_minigame_complete(false)
|
||||
if not Context.game_in_progress then return end
|
||||
if mg.focus_center_x then Focus.stop() end
|
||||
@@ -86,7 +87,7 @@ function MinigameRhythmWindow.update()
|
||||
return
|
||||
end
|
||||
|
||||
mg.line_position = mg.line_position + (mg.line_speed * mg.line_direction)
|
||||
mg.line_position = mg.line_position + (mg.line_speed * mg.line_direction * Context.dt60)
|
||||
if mg.line_position > 1 then
|
||||
mg.line_position = 1
|
||||
mg.line_direction = -1
|
||||
@@ -95,11 +96,11 @@ function MinigameRhythmWindow.update()
|
||||
mg.line_direction = 1
|
||||
end
|
||||
if mg.press_cooldown > 0 then
|
||||
mg.press_cooldown = mg.press_cooldown - 1
|
||||
mg.press_cooldown = mg.press_cooldown - Context.dt60
|
||||
end
|
||||
local mouse_on_button = Mouse.zone_circle({ x = mg.button_x, y = mg.button_y, r = mg.button_size })
|
||||
|
||||
if (Input.select() or mouse_on_button) and mg.press_cooldown == 0 then
|
||||
if (Input.select() or mouse_on_button) and mg.press_cooldown <= 0 then
|
||||
mg.button_pressed_timer = mg.button_press_duration
|
||||
mg.press_cooldown = mg.press_cooldown_duration
|
||||
local target_left = mg.target_center - (mg.target_width / 2)
|
||||
@@ -123,7 +124,7 @@ function MinigameRhythmWindow.update()
|
||||
return
|
||||
end
|
||||
if mg.button_pressed_timer > 0 then
|
||||
mg.button_pressed_timer = mg.button_pressed_timer - 1
|
||||
mg.button_pressed_timer = mg.button_pressed_timer - Context.dt60
|
||||
end
|
||||
if mg.focus_center_x then
|
||||
Focus.set_percentage(1 - mg.score / mg.max_score)
|
||||
|
||||
Reference in New Issue
Block a user