game_qu.base.paths API documentation

# Module `game_qu.base.paths`

Expand source code

    from game_qu.math.linear_interpolation import LinearInterpolation
    from game_qu.paths.action_followable_path import ActionFollowablePath
    from game_qu.paths.velocity_followable_path import VelocityFollowablePath

    class Path(LinearInterpolation):
        """ Made up of multiple lines that are all connected. The previous point and the next point are connected by a line.
            For instance, a line looks like: LineSegment(points[0], points[1]). IMPORTANT: no LineSegments can share the same
            x_coordinate (besides the first x_coordinate between adjacent lines) otherwise the code won't work. Also understand
            that this the same as LinearInterpolation. I kept this class to have the API of the library stay the same across
            versions. It is not c"""

        pass

    class VelocityPath(VelocityFollowablePath):
        """A path that takes into account velocity. This is the same as VelocityFollowablePath. I kept this class here to have
            the programming API across versions (it is recommended to use the other 'VelocityFollowablePath' because it is
            technically more correct)."""

        pass

    class ActionPath(ActionFollowablePath):
        """ A path that performs an action at each of the points. This does not work the FollowablePath methods. This will have
            to change in the future. This is the same as ActionFollowablePath. I kept this class here to have
            the programming API across versions (it is recommended to use the other 'ActionFollowablePath' because it is
            technically more correct)."""

        pass

## Classes

`class ActionPath (start_point, object_on_path, velocity)`

  A path that performs an action at each of the points. This does not work the FollowablePath methods. This will have to change in the future. This is the same as ActionFollowablePath. I kept this class here to have the programming API across versions (it is recommended to use the other 'ActionFollowablePath' because it is technically more correct).

  Initializes the object

  Expand source code

      class ActionPath(ActionFollowablePath):
          """ A path that performs an action at each of the points. This does not work the FollowablePath methods. This will have
              to change in the future. This is the same as ActionFollowablePath. I kept this class here to have
              the programming API across versions (it is recommended to use the other 'ActionFollowablePath' because it is
              technically more correct)."""

          pass

  ### Ancestors

  - ActionFollowablePath
  - VelocityFollowablePath
  - FollowablePath
  - abc.ABC

  ### Inherited members

  - `ActionFollowablePath`:
    - `add_point`
    - `add_time_point`
    - `get_coordinates`
    - `get_coordinates_at_time`
    - `get_delta_value`
    - `get_index_of_line`
    - `get_value_at_time`
    - `has_finished`
    - `is_done`
    - `reset`
    - `restart`
    - `run`
    - `set_time`
    - `start`
    - `update_for_side_scrolling`
    - `update_time`
`class Path (start_point, other_points)`

  Made up of multiple lines that are all connected. The previous point and the next point are connected by a line. For instance, a line looks like: LineSegment(points[0], points[1]). IMPORTANT: no LineSegments can share the same x_coordinate (besides the first x_coordinate between adjacent lines) otherwise the code won't work. Also understand that this the same as LinearInterpolation. I kept this class to have the API of the library stay the same across versions. It is not c

  Initializes the object with the start_point and other_points. This method calls add_point() for each point in other_points

  Expand source code

      class Path(LinearInterpolation):
          """ Made up of multiple lines that are all connected. The previous point and the next point are connected by a line.
              For instance, a line looks like: LineSegment(points[0], points[1]). IMPORTANT: no LineSegments can share the same
              x_coordinate (besides the first x_coordinate between adjacent lines) otherwise the code won't work. Also understand
              that this the same as LinearInterpolation. I kept this class to have the API of the library stay the same across
              versions. It is not c"""

          pass

  ### Ancestors

  - LinearInterpolation
  - Function
  - abc.ABC

  ### Inherited members

  - `LinearInterpolation`:
    - `add_point`
    - `get_first_line`
    - `get_inverted_function`
    - `get_last_line`
    - `get_lines`
    - `get_new_function`
    - `get_x_coordinate`
    - `get_y_coordinate`
    - `is_moving_down`
`class VelocityPath (start_point, other_points, velocity, **kwargs)`

  A path that takes into account velocity. This is the same as VelocityFollowablePath. I kept this class here to have the programming API across versions (it is recommended to use the other 'VelocityFollowablePath' because it is technically more correct).

  Initializes the object. Here are the kwargs options:

  ## Args

  `game_object` :`GameObject`
    the game object that is following this path
  `attribute_modifying` :`str`
    the name of the attribute this path is modifying
  Expand source code

      class VelocityPath(VelocityFollowablePath):
          """A path that takes into account velocity. This is the same as VelocityFollowablePath. I kept this class here to have
              the programming API across versions (it is recommended to use the other 'VelocityFollowablePath' because it is
              technically more correct)."""

          pass

  ### Ancestors

  - VelocityFollowablePath
  - FollowablePath
  - abc.ABC

  ### Inherited members

  - `VelocityFollowablePath`:
    - `add_point`
    - `add_time_point`
    - `get_coordinates`
    - `get_coordinates_at_time`
    - `get_delta_value`
    - `get_index_of_line`
    - `get_value_at_time`
    - `has_finished`
    - `is_done`
    - `reset`
    - `restart`
    - `run`
    - `set_time`
    - `start`
    - `update_time`