mini_arcade_core.spaces.d2.physics2d¶
Simple 2D physics utilities.
Classes¶
Simple 2D velocity vector. |
Module Contents¶
- class mini_arcade_core.spaces.d2.physics2d.Velocity2D[source]¶
Simple 2D velocity vector.
- Variables:
(float) (vy) – Velocity in the X direction.
(float) – Velocity in the Y direction.
- vx: float = 0.0¶
- vy: float = 0.0¶
- to_tuple() tuple[float, float][source]¶
Convert Velocity2D to a tuple.
- Returns:
Tuple of (vx, vy).
- Return type:
tuple[float, float]
- advance(x: float, y: float, dt: float) tuple[float, float][source]¶
Return new (x, y) after dt seconds.
- move_up(speed: float)[source]¶
Set vertical velocity upwards (negative Y).
- Parameters:
speed (float) – Speed to set.
- move_down(speed: float)[source]¶
Set vertical velocity downwards (positive Y).
- Parameters:
speed (float) – Speed to set.