I am trying to check a collision between one static, and one moving image. The static image is a balloon and the moving image is a gun. I've tried to create a function that gets the rect of the gun (using get_rect), checks if one of the (7) balloons (stored in a list) has the same x coordinate (x coordinate is randomly generated), and prints out which balloon it collided with. But it doesn't always seem to work, and only works in a certain position. Also, it prints out something like collision with [<Surface(444x250x32 SW)>
when it should print the name (variable name) of which one of the balloons it hit.
Edit: Using Rabbid's suggestions, I've made a mask around both the balloon and the gun and tried checking those for the collision. They still don't work, but I feel like I am getting closer. I also made a repl, so you can run the code yourself. Here it is: Repl
(When the gun is in the same position as the balloon, it should print out which balloon it hit.)
How can I check the collisions between these images properly, and print out which balloon was hit?