timedeltafix
This commit is contained in:
@@ -7,8 +7,8 @@ local TEXTBOX_Y = math.floor((Config.screen.height - TEXTBOX_H) / 2 - 8)
|
||||
local TEXTBOX_MAX_CHARS = 30
|
||||
local DISCUSSION_LINE_HEIGHT = 8
|
||||
local PADDING = 4
|
||||
local AUTO_SCROLL_DELAY = 12
|
||||
local AUTO_SCROLL_STEP = 1
|
||||
local AUTO_SCROLL_DELAY = 8
|
||||
local AUTO_SCROLL_STEP = 2
|
||||
|
||||
--- Draws the discussion window.
|
||||
--- @within DiscussionWindow
|
||||
@@ -61,7 +61,7 @@ function DiscussionWindow.update()
|
||||
|
||||
if max_scroll > 0 then
|
||||
if Context.discussion.auto_scroll then
|
||||
Context.discussion.scroll_timer = Context.discussion.scroll_timer + 1
|
||||
Context.discussion.scroll_timer = Context.discussion.scroll_timer + Context.dt60
|
||||
if Context.discussion.scroll_timer >= AUTO_SCROLL_DELAY then
|
||||
Context.discussion.scroll_timer = 0
|
||||
Context.discussion.scroll_y = Context.discussion.scroll_y + AUTO_SCROLL_STEP
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- @section BriefIntroWindow
|
||||
BriefIntroWindow.y = Config.screen.height
|
||||
BriefIntroWindow.speed = 30 -- pixels per second
|
||||
BriefIntroWindow.speed = 45 -- pixels per second
|
||||
BriefIntroWindow.text = [[
|
||||
Norman Reds’ everyday life
|
||||
seems ordinary: work,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -103,8 +103,9 @@ function MinigameButtonMashWindow.update()
|
||||
local mg = Context.minigame_button_mash
|
||||
|
||||
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
|
||||
if mg.meter_on_complete then
|
||||
mg.meter_on_complete(mg.elapsed_sec or 0)
|
||||
else
|
||||
@@ -142,13 +143,13 @@ function MinigameButtonMashWindow.update()
|
||||
mg.win_timer = Config.timing.minigame_win_duration
|
||||
return
|
||||
end
|
||||
local degradation = mg.base_degradation + (mg.bar_fill * mg.degradation_multiplier)
|
||||
local degradation = (mg.base_degradation + (mg.bar_fill * mg.degradation_multiplier)) * Context.dt60
|
||||
mg.bar_fill = mg.bar_fill - degradation
|
||||
if mg.bar_fill < 0 then
|
||||
mg.bar_fill = 0
|
||||
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(mg.bar_fill / mg.target_points)
|
||||
|
||||
@@ -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