Answers for "pygame how to rotate towards mouse"

3

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
Posted by: Guest on April-08-2021

Python Answers by Framework

Browse Popular Code Answers by Language