-1

I have programming as a subject in school, and this is our last project of the semester. For our last task we are going to use replit.com, which use PygameZero. Which from my understanding, is a easier version of Pygame, which again is a version of python more focused on making games (correct me if im wrong).

I want to make a Street Fighter type game, and because of that i really want to use two controller for it (because i want a PvP game). I have searched, but the turorials i find are for Pygame, and i can't find any for Pygame Zero. Either that, or it is some semi-advanced stuff that i don't understand. If anyone knows how to connect controllers to Pygame Zero, it would help a ton!

And if controllers matter, i have Xbox One controllers, a switch pro controller and a gamecube controller (whith a gamecube to usb adapter). Allthough i mainly want to use the xbox controllers if thats possible.

thanks so much in advance!

PS: Im relativly new to programming, so i would really apreciate if you could dumb down your answers to the point that i can understand it!

TogiTogi
  • 3
  • 2
  • I used to pair old Playstation controllers using the sixaxis library. You can find a wrapper here. https://github.com/spydeee/sixAxis I have no idea if it works on other controllers, but it's a good starting point. –  Apr 29 '22 at 10:35
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Apr 30 '22 at 23:19

1 Answers1

0

Pygame Zero does support controllers and PS4 and Xbox One controllers both work.

This book is a great resource for beginners in Python who want to make games in Pygame Zero. It also has some more information on joysticks here and here.

Also regarding Sembei Norimaki's comment, you basically have to try and see if the code in sixAxis.py at that website works with your controller. See the bottom of the file and edit it to see if you can get it to work.

Anili
  • 88
  • 6
  • Hey! thanks so much for the answer. Do you know you can use two controllers by doing this as well, since i want this to be a sort of 1v1 game! So for example, ill have two characters, and one controller is for one character, and another controller is for another character. – TogiTogi Apr 29 '22 at 11:16
  • I am not sure about that, you will have to test it yourself. Also, how would you manage to achieve joystick input whilst running in repl.it? Isn't repl.it an online IDLE, so how would you even be able to pass live input into it? – Anili Apr 29 '22 at 15:57
  • Tbh, i have no idea, but i guess ill just have to test things out. Thanks again for the answer tho! – TogiTogi Apr 29 '22 at 16:20
  • No problem, good luck with your project! – Anili Apr 29 '22 at 16:41