Shooting in pygame, rotating | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Shooting in pygame, rotating

I want to shoot where my ship is looking, with pygame. Give me examples please. I already did my ship look to the mouse position. I also want to shoot where the mouse is.

18th Aug 2019, 9:26 PM
Artur Spain 🇪🇸
1 ответ
+ 1
I havent used pygame but just find the cords of the mouse and when the command to fire happens(mouse click or space bar.... and so forth) you make a new sprite and animate it at x speed towards the mouse cords. Make sure the bullet sprite is rotated the same amount as the ship.
19th Aug 2019, 12:40 AM
Ole113 - avatar