PYTHON & PYGAME How to move and rotate polygon towards the mouse position?
问题 ( EDIT: The rotation doesn't matter too much to me anymore - just the movement. I am still curious and would love to know how to do the rotation however.) def angle_between(p1, p2): ang1 = np.arctan2(*p1[::-1]) ang2 = np.arctan2(*p2[::-1]) return (ang1 - ang2) % (2 * np.pi) class Minion: # Shape: Triangle def __init__(self): self.rotation = 0 self.position = (200,200) self.radius = 50 self.vertices = ((1,1), (10,10), (1,10)) def determine_vertices(self): x = self.position[0] y = self.position