From b1b36dc0be9c056cfa1089de6cc5cdd9cf42edd0 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Sat, 18 Mar 2023 17:00:47 +0530 Subject: [PATCH 1/3] Add documentation for undocumented attributes --- arcade/pymunk_physics_engine.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/arcade/pymunk_physics_engine.py b/arcade/pymunk_physics_engine.py index 246474d06..05e306f2e 100644 --- a/arcade/pymunk_physics_engine.py +++ b/arcade/pymunk_physics_engine.py @@ -70,21 +70,21 @@ def add_sprite(self, ): """ Add a sprite to the physics engine. - :param sprite: The sprite to add - :param mass: The mass of the object. Defaults to 1 - :param friction: The friction the object has. Defaults to 0.2 + :param sprite: The sprite to add. + :param mass: The mass of the object. Defaults to 1. + :param friction: The friction the object has. Defaults to 0.2. :param elasticity: How bouncy this object is. 0 is no bounce. Values of 1.0 and higher may behave badly. :param moment_of_inertia: The moment of inertia, or force needed to change angular momentum. \ Providing infinite makes this object stuck in its rotation. :param body_type: The type of the body. Defaults to Dynamic, meaning, the body can move, rotate etc. \ Providing STATIC makes it fixed to the world. - :param damping: See class docs - :param gravity: See class docs + :param damping: See class docs. + :param gravity: See class docs. :param max_velocity: The maximum velocity of the object. - :param max_horizontal_velocity: maximum velocity on the x axis - :param max_vertical_velocity: maximum velocity on the y axis - :param radius: - :param collision_type: + :param max_horizontal_velocity: Maximum velocity on the x axis. + :param max_vertical_velocity: Maximum velocity on the y axis. + :param radius: Radius for the shape created for the sprite. + :param collision_type: Assign a name to the sprite, use this name when adding collision handler. """ if damping is not None: From fed3d1dece977cd4aaa544db4797a5ec62feb310 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Sat, 18 Mar 2023 17:15:22 +0530 Subject: [PATCH 2/3] Explicitly mention the unit i.e pixels Pushfoo's review --- arcade/pymunk_physics_engine.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arcade/pymunk_physics_engine.py b/arcade/pymunk_physics_engine.py index 05e306f2e..8e9ffa612 100644 --- a/arcade/pymunk_physics_engine.py +++ b/arcade/pymunk_physics_engine.py @@ -81,9 +81,9 @@ def add_sprite(self, :param damping: See class docs. :param gravity: See class docs. :param max_velocity: The maximum velocity of the object. - :param max_horizontal_velocity: Maximum velocity on the x axis. - :param max_vertical_velocity: Maximum velocity on the y axis. - :param radius: Radius for the shape created for the sprite. + :param max_horizontal_velocity: Maximum velocity on the x axis in pixels. + :param max_vertical_velocity: Maximum velocity on the y axis in pixels. + :param radius: Radius for the shape created for the sprite in pixels. :param collision_type: Assign a name to the sprite, use this name when adding collision handler. """ From 84f422b4c30f22661402f38442ef7ab0c478b4ee Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Sat, 18 Mar 2023 18:21:13 +0530 Subject: [PATCH 3/3] Fix typo for moment of intertia --- arcade/pymunk_physics_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arcade/pymunk_physics_engine.py b/arcade/pymunk_physics_engine.py index 8e9ffa612..b0fe03dac 100644 --- a/arcade/pymunk_physics_engine.py +++ b/arcade/pymunk_physics_engine.py @@ -205,7 +205,7 @@ def add_sprite_list(self, mass: float = 1, friction: float = 0.2, elasticity: Optional[float] = None, - moment_of_intertia: Optional[float] = None, + moment_of_inertia: Optional[float] = None, body_type: int = DYNAMIC, damping: Optional[float] = None, collision_type: Optional[str] = None @@ -217,7 +217,7 @@ def add_sprite_list(self, mass=mass, friction=friction, elasticity=elasticity, - moment_of_inertia=moment_of_intertia, + moment_of_inertia=moment_of_inertia, body_type=body_type, damping=damping, collision_type=collision_type)