mirror of
https://gitea.com/SweetSea-ButImNotSweet/tromi_mobile.git
synced 2025-01-08 17:33:09 +08:00
Add `input.waiting2trigger` as buffer for too quick inputs
This commit is contained in:
@@ -33,6 +33,18 @@ function GameScene:new(player_name, replay_file, replay_grade)
|
|||||||
rotate_180=false,
|
rotate_180=false,
|
||||||
hold=false,
|
hold=false,
|
||||||
}
|
}
|
||||||
|
self.inputs_waiting2trigger={ -- Used for buffering the input, in case the input is too quick (1f)
|
||||||
|
left=false,
|
||||||
|
right=false,
|
||||||
|
up=false,
|
||||||
|
down=false,
|
||||||
|
rotate_left=false,
|
||||||
|
rotate_left2=false,
|
||||||
|
rotate_right=false,
|
||||||
|
rotate_right2=false,
|
||||||
|
rotate_180=false,
|
||||||
|
hold=false,
|
||||||
|
}
|
||||||
self.paused = false
|
self.paused = false
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -45,6 +57,8 @@ function GameScene:update(nosound, tas_update)
|
|||||||
end
|
end
|
||||||
for input, value in pairs(self.inputs) do
|
for input, value in pairs(self.inputs) do
|
||||||
inputs[input] = value
|
inputs[input] = value
|
||||||
|
if self.inputs_waiting2trigger[input] then inputs[input]=true end
|
||||||
|
self.inputs_waiting2trigger[input]=false
|
||||||
end
|
end
|
||||||
if tas and tas_update then
|
if tas and tas_update then
|
||||||
self.paused = false
|
self.paused = false
|
||||||
@@ -103,6 +117,7 @@ function GameScene:onInputPress(e)
|
|||||||
self.grace_frames = 90
|
self.grace_frames = 90
|
||||||
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
elseif e.input and string.sub(e.input, 1, 5) ~= "menu_" then
|
||||||
self.inputs[e.input] = true
|
self.inputs[e.input] = true
|
||||||
|
self.inputs_waiting2trigger[e.input] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user