Added an option to disable diagonal input

This commit is contained in:
Ishaan Bhardwaj
2020-12-14 22:43:50 -05:00
parent 40a2e78280
commit f7c4908062
2 changed files with 12 additions and 1 deletions

View File

@@ -100,6 +100,16 @@ function GameMode:update(inputs, ruleset)
end
if self.completed then return end
if config.gamesettings.diagonal_input == 2 then
if inputs["left"] or inputs["right"] then
inputs["up"] = false
inputs["down"] = false
elseif inputs["up"] or inputs["down"] then
inputs["left"] = false
inputs["right"] = false
end
end
-- advance one frame
if self:advanceOneFrame(inputs, ruleset) == false then return end