How To Use Joysticks & Controllers in PyGame

  Рет қаралды 19,864

NeuralNine

NeuralNine

Күн бұрын

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/

Пікірлер: 23
@edinetgrunhed6000
@edinetgrunhed6000 2 ай бұрын
Thank you for this video, direct to the point ,short and conside
@samperry8386
@samperry8386 Жыл бұрын
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 Жыл бұрын
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.
@Khan-qn5dc
@Khan-qn5dc 5 ай бұрын
Bro absuloutly what I needed today. Thank you homie
@salaarmansoor7435
@salaarmansoor7435 3 ай бұрын
NIce Implementation, Very Helpful
@vilasjacob4097
@vilasjacob4097 Жыл бұрын
Thank you for this tutorial. I would like to know how can we use Thrustmaster throttle and joystick in pygame.
@rahuljamba5846
@rahuljamba5846 Жыл бұрын
EXCELLENT BUDDY , you make my day , keep it up and make this type video.
@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)
@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
@astronomotivation
@astronomotivation 9 ай бұрын
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
@andme-tech102
@andme-tech102 2 жыл бұрын
Exactly what I needed thanks 👍
@jakep8484
@jakep8484 Жыл бұрын
I can not get two pygame controllers to work. Cant find a good example anywhere.
@stefan_balint_youtube
@stefan_balint_youtube 9 ай бұрын
thank you
@TheOfficialKingIdea
@TheOfficialKingIdea Жыл бұрын
THANK YOUUUUUUUUU
@cookingwithgouger9520
@cookingwithgouger9520 9 ай бұрын
Sorry this doesn’t work at all with color changing and the rectangle isn’t even drawn to the screen.
@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
@samperry8386
@samperry8386 Жыл бұрын
pygame.joystick.init() joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]
@idrisakande8551
@idrisakande8551 Жыл бұрын
it does not work on pycharm just a warning
@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
@ifracing
@ifracing Жыл бұрын
This was awesome, helped me finish off my xbox 360 controller gui project. Thank you
@guilherme5094
@guilherme5094 2 жыл бұрын
Nice👍
I run untested, viewer-submitted code on my 500-LED christmas tree.
45:17
Being Competent With Coding Is More Fun
11:13
TheVimeagen
Рет қаралды 79 М.
小丑妹妹插队被妈妈教训!#小丑#路飞#家庭#搞笑
00:12
家庭搞笑日记
Рет қаралды 37 МЛН
POV: Your kids ask to play the claw machine
00:20
Hungry FAM
Рет қаралды 22 МЛН
Which One Is The Best - From Small To Giant #katebrush #shorts
00:17
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 55 МЛН
This is Why Programming Is Hard For you
10:48
The Coding Sloth
Рет қаралды 882 М.
Hack your brain with Obsidian.md
11:53
No Boilerplate
Рет қаралды 1,9 МЛН
Exploring Word Chains
9:45
CodeParade
Рет қаралды 206 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 479 М.
How to STUDY so FAST that it feels ILLEGAL😳
7:21
jspark
Рет қаралды 1,2 МЛН
How to Use Pygame Masks for Pixel Perfect Collision
10:28
Coding With Russ
Рет қаралды 37 М.
How to use Bluetooth Controllers with Python on Raspberry Pi
16:36
Core Electronics
Рет қаралды 53 М.
Running "Hello World!" in 10 FORBIDDEN Programming Languages
18:07
DuckDB in Python - The Next Pandas Killer?
19:32
NeuralNine
Рет қаралды 30 М.
Pydantic Tutorial • Solving Python's Biggest Problem
11:07
pixegami
Рет қаралды 273 М.
小丑妹妹插队被妈妈教训!#小丑#路飞#家庭#搞笑
00:12
家庭搞笑日记
Рет қаралды 37 МЛН