Add the missing buffer logical code in training mode

This commit is contained in:
Squishy (C6H12O6+NaCl+H2O)
2024-04-12 21:01:43 +07:00
parent f56bde14b9
commit f8185d4f2d
2 changed files with 26 additions and 6 deletions

View File

@@ -1,5 +1,4 @@
local GameScene = Scene:extend()
local binser = require 'libs.binser'
GameScene.title = "Game"
local tas = false
@@ -33,7 +32,7 @@ function GameScene:new(player_name, replay_file, replay_grade)
rotate_180=false,
hold=false,
}
self.inputs_waiting2trigger={ -- Used for buffering the input, in case the input is too quick (1f)
self.inputs_waiting2trigger={ -- Used for buffering the input, in case the input is too fast (1f)
left=false,
right=false,
up=false,
@@ -56,9 +55,12 @@ function GameScene:update(nosound, tas_update)
end
end
for input, value in pairs(self.inputs) do
inputs[input] = value
if self.inputs_waiting2trigger[input] then inputs[input]=true end
self.inputs_waiting2trigger[input]=false
if self.inputs_waiting2trigger[input] then
inputs[input]=true
self.inputs_waiting2trigger[input]=false
else
inputs[input] = value
end
end
if tas and tas_update then
self.paused = false