Shooting in pygame, rotating | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Resposta
+ 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
Ole113 - avatar