Это видео недоступно.
Сожалеем об этом.

How To Use Joysticks & Controllers in PyGame

Поделиться
HTML-код
  • Опубликовано: 7 сен 2022
  • Today we learn how to use joysticks and controllers in PyGame instead of keyboard and mouse.
    ◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
    📚 Programming Books & Merch 📚
    🐍 The Python Bible Book: www.neuralnine...
    💻 The Algorithm Bible Book: www.neuralnine...
    👕 Programming Merch: www.neuralnine...
    🌐 Social Media & Contact 🌐
    📱 Website: www.neuralnine...
    📷 Instagram: / neuralnine
    🐦 Twitter: / neuralnine
    🤵 LinkedIn: / neuralnine
    📁 GitHub: github.com/Neu...
    🎙 Discord: / discord
    🎵 Outro Music From: www.bensound.com/

Комментарии • 25

  • @edinetgrunhed6000
    @edinetgrunhed6000 28 дней назад +1

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

  • @samperry8386
    @samperry8386 Год назад +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.

  • @JLSXMK8
    @JLSXMK8 Год назад +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.

  • @salaarmansoor7435
    @salaarmansoor7435 2 месяца назад +1

    NIce Implementation, Very Helpful

  • @Khan-qn5dc
    @Khan-qn5dc 4 месяца назад

    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

  • @rahuljamba5846
    @rahuljamba5846 Год назад

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

  • @gli-squaletti
    @gli-squaletti Год назад

    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

  • @samperry8386
    @samperry8386 Год назад

    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)

  • @astronomotivation
    @astronomotivation 7 месяцев назад

    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

  • @vilasjacob4097
    @vilasjacob4097 Год назад

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

  • @tcgvsocg1458
    @tcgvsocg1458 Год назад

    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

  • @andme-tech102
    @andme-tech102 Год назад

    Exactly what I needed thanks 👍

  • @jakep8484
    @jakep8484 11 месяцев назад

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

  • @stefan_balint_youtube
    @stefan_balint_youtube 8 месяцев назад

    thank you

  • @heptex8989
    @heptex8989 Год назад +1

    A video explaining python classes and dataclasses would be nice

    • @JLSXMK8
      @JLSXMK8 Год назад

      Especially with the help of this video. Once you find the particular inputs on each controller, you can make a custom class to represent each type of controller used in game. You will likely also need another class for each button, with a similar labeling style to make things easier if you go with this option. This will make printing each button on the controller a lot easier for degugging.

  • @cookingwithgouger9520
    @cookingwithgouger9520 8 месяцев назад

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

  • @kingideaofficial
    @kingideaofficial Год назад

    THANK YOUUUUUUUUU

  • @idrisakande8551
    @idrisakande8551 Год назад

    it does not work on pycharm just a warning

  • @guilherme5094
    @guilherme5094 Год назад

    Nice👍

  • @philtoa334
    @philtoa334 Год назад

    Thx_.

  • @codewithrohit2927
    @codewithrohit2927 Год назад

    First

  • @ludvigbentzen5640
    @ludvigbentzen5640 Год назад

    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

    • @samperry8386
      @samperry8386 Год назад

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