jetlag2d
    Preparing search index...

    Class Path

    Path specifies a set of points that an actor will move among, in order, at a fixed speed.

    Index
    • Return a copy of the ith point in the path. We return a copy, so that the caller can use the point. i wraps around in both directions, so it's always safe to pass, e.g., -1 (the last point) or length (the first point again).

      Parameters

      • i: number

        The index of the point to return (0-based)

      Returns b2Vec2

    • Add a new point to a path by giving the coordinates for where the center of the actor goes next. This returns the path, so that calls to to can be chained.

      Parameters

      • x: number

        X value of the new coordinate

      • y: number

        Y value of the new coordinate

      Returns Path