Enhancement request:
A new method in the Sprite class to rotate it to face a given Point (or another Sprite). Perhaps give the option for it to instantly face a given Point or gradually turn towards it. Perhaps allow a Sprite as the parameter as well as a Point, so you can do something like player.look_at(enemy).
What should be added/changed?
A new method in the Sprite class. For example:
def look_at(self, point: Point) -> None: self.angle = math.degrees( math.atan2(point.x - self.center_y, point.y - self.center_x) )
What would it help with?
Simplify rotating one sprite to face another. This seems like something that is commonly done in 2D games that should not require manual calculations.
Enhancement request:
A new method in the Sprite class to rotate it to face a given Point (or another Sprite). Perhaps give the option for it to instantly face a given Point or gradually turn towards it. Perhaps allow a Sprite as the parameter as well as a Point, so you can do something like
player.look_at(enemy).What should be added/changed?
A new method in the Sprite class. For example:
def look_at(self, point: Point) -> None: self.angle = math.degrees( math.atan2(point.x - self.center_y, point.y - self.center_x) )What would it help with?
Simplify rotating one sprite to face another. This seems like something that is commonly done in 2D games that should not require manual calculations.