pygame is
pygame.org is

Wiki
CalculateDistGet the distance between two (x,y) format locations using the Pythagorean theorem In a right triangle, (x1x2) being the horizontal distance between the two points (The change in x) and (y1y2) being the vertical distance between the two points (The change in y), (x1x2)*(x1x2) + (y1y2)*(y1y2) == distance*distance. So the distance is the square root of (x1x2)*(x1x2) + (y1y2)*(y1y2). dist = math.sqrt((x1x2)**2 + (y1y2)**2)) You can also used the math function hypot: dist = math.hypot(x1x2, y1y2) [edit] 
