Represents a mountainous landscape with various elements.

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

  • Constructor for generating a mountainous landscape with various elements.

    Parameters

    • xOffset: number

      The x-axis offset.

    • yOffset: number

      The y-axis offset.

    • Optional seed: number = DEFAULT_SEED

      The seed for noise functions.

    • Optional width: number

      The width of the mountain.

    • Optional height: number

      The height of the mountain.

    Returns MiddleMountainLayer

Properties

elements: Element[] = []

An array of Elements.

range: Range = ...

The tag for the layer.

x: number = 0

The x-coordinate.

y: number = 0

The y-coordinate.

Methods

  • Adds an object at the beginning of elements array. This way object will be rendered first, thus being a background.

    Parameters

    Returns void

  • Renders the layer asynchronously using a web worker.

    Parameters

    • frameNum: number

      The frame number.

    • layerNum: number

      The layer number.

    Returns Promise<string>

    A promise that resolves to the rendered layer as an SVG string.