Conversation
|
I literally don't have multiple controllers so I can't test this (unless there's a way to test with only 1 that I'm not aware of). That was the reason why I made it only for 1 so far. I won't merge this in yet until I buy another controller and can test things further. But I'll leave this open and use this as the first tests I run when I get an additional one. The idea is to use |
|
In a nutshell, yeah. If I have a game where a bunch of players have to press the local playerInputs = {}
for i = 1, 4 do
local input = Input()
input:setJoystickIndex(i)
input:bind("fdown", "join")
playerInputs[i] = input
end
function update()
for _, input in pairs(playerInputs) do
if input:pressed("join") then
-- do player instantiation and input setting code here
end
end
endThis is partially the reason why edit: Oh, found a bug that is only relevant when using multiple controllers. Gonna go ahead and push this to my forked branch. |
Adds really rudimentary multiple controller support.
You can use it as such:
This hasn't gone through intensive testing, and doesn't cause an error if it gets a controller that doesn't exist (since it's possible that it might later).