Mouse Input - Pygame Tutorial

preview_player
Показать описание
Somehow I went all this time without making a video on how to get mouse input in Pygame, so here it is! Mouse input is very useful for a variety of games.

Code Written in Video:

Relevant Documentation:

Devlog Playlist:

Discord:

Twitter:

Watch ep. 1 & 2 if you don't understand the base code:

Outro Music is Pancakes by AdhesiveWombat

This video and the code produced in it are released under: CC0 1.0 Universal (CC0 1.0). This puts the video and code produced in it in the public domain, so use it for whatever you want.

#pygame #python #gamedevelopment
Рекомендации по теме
Комментарии
Автор

You are so awesome for making these! I enjoy watching your series! This channel is a pure gem <3

mixlaproduction
Автор

Just got here and I am already thanking you!

will_warrior
Автор

For me i usually always used something like this for mouse button input: mouseleft, mousemiddle, mouseright = pygame.mouse.get_pressed().
Anyways, nice vid, im glad there is someone else who also uses pygame and python for making games :)

adryncharn
Автор

Bruh this guy only has 8k subs he deserves at least 100k.
Nice vid bro.

xhamburger
Автор

Thanks, I was looking for this for weeks.I was not able to do left clicking on the image in the program.

manas
Автор

thanks man i thought it's impossible make good games with python but you make me believe thank so much

Pedr
Автор

Thanks for the tutorial! I'm wondering, how did you get so knowledgeable about Pygame? I've noticed through my own investigating that resources dedicated to Pygame are so scarce compared to engines like Godot or Unity. Did you learn mostly through trial and error?

roydonk
Автор

Love your videos, just subscribed.
U teach me a lot, keep going ;)

jonathanfin
Автор

Can someone help. I have got to 6:05 and when I try to run it, it says;
local variable 'clicking' referenced before assignment
Can someone help me with this please.

hangmanCode
Автор

Thanks for the video. do you recommend to use pymonk library for physics in 2D games?

simplepycodes
Автор

Hey, I used this method but found the mouse wheel scrolling is really bad at datection, any other method you suggest?

furykool
Автор

what if I would like to drop thatimage and be able to select another one in the screen and make this new one follow my mouse movements?

jessicacristinasantosdonas
Автор

Would be kind enough to help me on how to get collisions from touch screen input

echo_
Автор

Do you think that relatively large projects(2d) can be done with this library(py game)????

majnonshahrr
Автор

anyone know how to check if an image is clicked?

alexbaker
Автор

Hey thanks for tutorial but i have a question, how can i make it so the mouse cursor is in the middle and not the top left?

vybz
Автор

Hi bro, how can you make the image follow to the current mouse position instead of the immage following it around?

theleeyawnshow
Автор

What does this offset word mean in games?

riyamandal
Автор

can this work with bouncing balls?
i need help doing mouse interaction for bouncing balls

estebanqqquito
Автор

which editor/engine are you using, cant understand what is that

Morrwena
welcome to shbcf.ru