mini_arcade_core.spaces.d2.kinematics2d

Kinematic helpers for mini_arcade_core (position + size + velocity).

Classes

KinematicData

Simple data structure to hold position, size, and velocity.

Module Contents

class mini_arcade_core.spaces.d2.kinematics2d.KinematicData[source]

Simple data structure to hold position, size, and velocity.

Variables:
  • (Position2D) (position) – Top-left position of the object.

  • (Size2D) (size) – Size of the object.

  • (Velocity2D) (velocity) – Velocity of the object.

  • (Optional[Color]) (color) – Optional color for rendering.

position: mini_arcade_core.spaces.geometry.bounds.Position2D
size: mini_arcade_core.spaces.geometry.bounds.Size2D
velocity: mini_arcade_core.spaces.d2.physics2d.Velocity2D
time_scale: float = 1.0
collider: mini_arcade_core.spaces.d2.collision2d.Collider2D | None = None
classmethod rect(x: float, y: float, width: int, height: int, vx: float = 0.0, vy: float = 0.0, time_scale: float = 1.0) KinematicData[source]

Convenience factory for rectangular kinematic data.

Parameters:
  • x (float) – Top-left X position.

  • y (float) – Top-left Y position.

  • width (int) – Width of the object.

  • height (int) – Height of the object.

  • vx (float) – Velocity in the X direction.

  • vy (float) – Velocity in the Y direction.

Returns:

KinematicData instance with the specified parameters.

Return type:

KinematicData