how to rotate an image towards mouse in pygame code example
Example: how to rotate image through mouse in pygame
# if you want to find the angle the mouse position is from the center
#heres the formula
angle = 360 - math.atan2(pos[1] - 300, pos[0] - 400) * 180 / math.pi