I’m developing a game (a missile command clone) where I need to check if a surface (a building) collides with a point (a missile).

How can I check if a missile hits a building?
A Rect has the collidepoint method, but I want it to be pixel perfect.
=> using a Rect =>
=> but it should be pixel perfect => 
You can use a
Maskand use it’sget_atmethod.Creating a mask is quite simple by calling
pygame.mask.from_surfaceSo, given the following helper method for some vector math:
use the following code to check if a given point is inside a mask/surface: