How to make a sprite follow your mouse cursor || Pygame

preview_player
Показать описание
How to make an object or sprite follow your mouse cursor. In this video I use Pygame and show you the necessary math that you need to know to do that certain movement. Please watch the whole video.
Рекомендации по теме
Комментарии
Автор

For anyone wondering why he made *mvx = sin(angle)* instead of *cos*.
Thats because the angle itself is also inverted

It should atan2(dy, dx) instead of atan2(dx, dy), else you need to flip sin & cos 🎉

Ishaan_Garud
Автор

Bro u r a legend u taught me how to make a sprite follow ur mouse also u r working on a mobile which is so much harder to work on.

u have a new sub

proparamyt
Автор

nice video but why did you invert the x and y coordinate for mvx and mvy lol.
You put mvx for sin and mvy for cos when it should be the opposite (might get others confused a bit)

namlasyruhdwohc
Автор

Interesting content, just subbed 👍 any more pygame projects planned?I have my own pygame channel focused on game dev tools and puzzles ( when I have time).

nerdyturkey
Автор

Great video, I'm just wondering why does the blue circle on your video move much much slower than the one on my screen?

scorpions
Автор

Bang kenapa baris ke 19 masih error padahal udah sama🤓

jasminaabdullah-vjsc
Автор

Bang knapa msih error pdhl udah bner dah

alsecret
Автор

AttributeError: module’math’ has no attribute ‘atan2’
Why bro

acommon