0

I'm trying to develop a team based asteroids type game. Its going well except for the multiple user inputs to a single machine... Can anyone recommend a method for getting and updating 6 players using a single computer? is it even possible? at the moment I'm working with a couple of old XBox controllers and a keyboard and its almost working...

is it possible to add additional keyboards?

and would you arrange the code into one big get events function or is there a better way to check for user inputs at this scale?

Cheers,

1 Answer 1

1

I've never seen anyone try to connect multiple keyboards to an application, so I don't really think that it's possible, sadly. However, pygame does have a pretty rad Joystick module that you can use to initialize as many controllers as you like. I would recommend making a Player object for each one, then calling joystickObject.getAxis(axisIndex) every loop to get the data. You'll just have to figure out the axis/button indexes for the controller. I'm currently working on a project with multiple controllers, so let me know if you need any specific help!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.