From 9104a3a0dd2dade620a3049427307fa6eaf2c738 Mon Sep 17 00:00:00 2001 From: Paul V Craven Date: Thu, 8 Oct 2026 16:23:56 -0500 Subject: [PATCH] Say what units sprite velocity and change_angle are in Sprite speeds are per frame at 60 FPS, which the velocity, change_x, change_y and change_angle docstrings didn't say (#2397). Co-Authored-By: Claude Opus 5.5 --- arcade/sprite/sprite.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arcade/sprite/sprite.py b/arcade/sprite/sprite.py index 9314fe4e6..f2ed35e2b 100644 --- a/arcade/sprite/sprite.py +++ b/arcade/sprite/sprite.py @@ -97,7 +97,7 @@ def __init__( # Movement self._velocity = 0.0, 0.0 self.change_angle: float = 0.0 - """Change in angle per 1/60th of a second.""" + """Change in angle, in degrees per frame at 60 FPS.""" # Custom sprite properties self._properties: dict[str, Any] | None = None @@ -188,7 +188,8 @@ def radians(self, new_value: float) -> None: @property def velocity(self) -> Point2: """ - Get or set the velocity of the sprite. + Get or set the velocity of the sprite, in pixels per frame at 60 FPS. + For example, ``(5, 0)`` moves 300 pixels per second to the right. The x and y velocity can also be set separately using the ``sprite.change_x`` and ``sprite.change_y`` properties. @@ -205,7 +206,7 @@ def velocity(self, new_value: Point2) -> None: @property def change_x(self) -> float: - """Get or set the velocity in the x plane of the sprite.""" + """Get or set the x velocity, in pixels per frame at 60 FPS.""" return self.velocity[0] @change_x.setter @@ -214,7 +215,7 @@ def change_x(self, new_value: float) -> None: @property def change_y(self) -> float: - """Get or set the velocity in the y plane of the sprite.""" + """Get or set the y velocity, in pixels per frame at 60 FPS.""" return self.velocity[1] @change_y.setter