mini_arcade_core.spaces.d2.physics2d ==================================== .. py:module:: mini_arcade_core.spaces.d2.physics2d .. autoapi-nested-parse:: Simple 2D physics utilities. Classes ------- .. autoapisummary:: mini_arcade_core.spaces.d2.physics2d.Velocity2D Module Contents --------------- .. py:class:: Velocity2D Simple 2D velocity vector. :ivar vx (float): Velocity in the X direction. :ivar vy (float): Velocity in the Y direction. .. py:attribute:: vx :type: float :value: 0.0 .. py:attribute:: vy :type: float :value: 0.0 .. py:method:: to_tuple() -> tuple[float, float] Convert Velocity2D to a tuple. :return: Tuple of (vx, vy). :rtype: tuple[float, float] .. py:method:: advance(x: float, y: float, dt: float) -> tuple[float, float] Return new (x, y) after dt seconds. .. py:method:: stop() Stop movement in both axes. .. py:method:: stop_x() Stop horizontal movement. .. py:method:: stop_y() Stop vertical movement. .. py:method:: move_up(speed: float) Set vertical velocity upwards (negative Y). :param speed: Speed to set. :type speed: float .. py:method:: move_down(speed: float) Set vertical velocity downwards (positive Y). :param speed: Speed to set. :type speed: float .. py:method:: move_left(speed: float) Set horizontal velocity to the left (negative X)." :param speed: Speed to set. :type speed: float .. py:method:: move_right(speed: float) Set horizontal velocity to the right (positive X). :param speed: Speed to set. :type speed: float