Created
June 13, 2021 11:57
-
-
Save PatrickKalkman/bb0dcb54f7fd82d060b3a32ec646be29 to your computer and use it in GitHub Desktop.
Calculcate the rotation of the enemy space ship
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calculate_rotation(self, previous_point, current_point): | |
dx = current_point.xpos - previous_point.xpos | |
dy = current_point.ypos - previous_point.ypos | |
return math.degrees(math.atan2(dx, dy)) + 180 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment