How To Use Joysticks & Controllers in PyGame

Поділитися
Вставка
  • Опубліковано 24 лис 2024

КОМЕНТАРІ • 23

  • @JaguarWisdom-9
    @JaguarWisdom-9 Рік тому +1

    Thank you for this tutorial. I used a slightly modified version of your code to get my sprite moving with a d-pad. Thanks again. AI was impressed with the efficiency of your code.

  • @edinetgrunhed6000
    @edinetgrunhed6000 4 місяці тому +1

    Thank you for this video, direct to the point ,short and conside

  • @Khan-qn5dc
    @Khan-qn5dc 7 місяців тому

    Bro absuloutly what I needed today. Thank you homie

  • @ifracing
    @ifracing Рік тому

    This was awesome, helped me finish off my xbox 360 controller gui project. Thank you

  • @salaarmansoor7435
    @salaarmansoor7435 5 місяців тому +1

    NIce Implementation, Very Helpful

  • @JLSXMK8
    @JLSXMK8 2 роки тому +5

    WARNING: PyGame will not work with Python 3.11!! As of 03 November 2022, there is no stable version of PyGame compatible with python 3.11, the latest stable version of Python. This tutorial WILL NOT WORK as intended; It is also recommended that you don't use the "--pre" flag when installing PyGame, as the develoipment versions downloaded could contain bugs, and are not recommended for use with stable versions of Python. @NeuralNine are there any alternative libraries that can be used instead? If so, can you try doing a tutorial on those? I would try using "uagame", but that does require that pygame needs to be installed.

  • @rahuljamba5846
    @rahuljamba5846 Рік тому

    EXCELLENT BUDDY , you make my day , keep it up and make this type video.

  • @vilasjacob4097
    @vilasjacob4097 Рік тому

    Thank you for this tutorial. I would like to know how can we use Thrustmaster throttle and joystick in pygame.

  • @JaguarWisdom-9
    @JaguarWisdom-9 Рік тому

    Here is my modified version without classes.
    hero_speed = 2 #(global variable)
    insert this in the while loop as an if statement:-
    if game_active:
    x_speed = round((pygame.joystick.Joystick(0).get_axis(0))*hero_speed)
    hero_rect.move_ip(x_speed, 0)

  • @andme-tech102
    @andme-tech102 2 роки тому

    Exactly what I needed thanks 👍

  • @tcgvsocg1458
    @tcgvsocg1458 2 роки тому

    i think you have to do (like tech with tim) a stream of 10 hour on make a game like street of rage but without any help...i think that raise your channel

  • @gli-squaletti
    @gli-squaletti 2 роки тому

    I need help, i Want to have the input forma my logitech steering wheel especially the throttle and the brake, cause pygame only see the buttons on the wheel not the throttle,brake, and clutch. Thanks

  • @astronomotivation
    @astronomotivation 11 місяців тому

    When I run this , and I hit L2 on my ps4 controller no button number pops up but an axis number. What does this mean .? It’s an axis

  • @jakep8484
    @jakep8484 Рік тому

    I can not get two pygame controllers to work. Cant find a good example anywhere.

  • @TheOfficialKingIdea
    @TheOfficialKingIdea Рік тому

    THANK YOUUUUUUUUU

  • @stefan_balint_youtube
    @stefan_balint_youtube 11 місяців тому

    thank you

  • @guilherme5094
    @guilherme5094 2 роки тому

    Nice👍

  • @cookingwithgouger9520
    @cookingwithgouger9520 11 місяців тому

    Sorry this doesn’t work at all with color changing and the rectangle isn’t even drawn to the screen.

  • @idrisakande8551
    @idrisakande8551 Рік тому

    it does not work on pycharm just a warning

  • @philtoa334
    @philtoa334 2 роки тому

    Thx_.

  • @codewithrohit2927
    @codewithrohit2927 2 роки тому

    First

  • @ludvigbentzen5640
    @ludvigbentzen5640 2 роки тому

    it a little weird, because i have written the exact same code as u but somehow my joystick is not being initialized even though i have used the pygame.joystick.init() line

    • @JaguarWisdom-9
      @JaguarWisdom-9 Рік тому

      pygame.joystick.init()
      joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]