CTFTNKS Project Documentation - v1.3.0
    Preparing search index...

    Static class containing map generation algorithms.

    Index

    Constructors

    Properties

    algorithms: (
        (
            map: GameMap,
            x1?: number,
            y1?: number,
            x2?: number,
            y2?: number,
        ) => void
    )[]

    Methods

    • Generates a map using Recursive Division with more holes.

      Parameters

      • map: GameMap

        The map to modify.

      • x1: number = -1

        Start X.

      • y1: number = -1

        Start Y.

      • x2: number = -1

        End X.

      • y2: number = -1

        End Y.

      Returns void

    • Generates a maze using Prim's algorithm.

      Start with a grid full of walls. Pick a cell, mark it as part of the maze. Add the walls of the cell to the wall list. While there are walls in the list: Pick a random wall from the list. If the cell on the opposite side isn't in the maze yet: Make the wall a passage and mark the cell on the opposite side as part of the maze. Add the neighboring walls of the cell to the wall list. If the cell on the opposite side already was in the maze, remove the wall from the list.

      Parameters

      Returns void

    • Generates a map using Recursive Division.

      Parameters

      • map: GameMap

        The map to modify.

      • x1: number = -1

        Start X.

      • y1: number = -1

        Start Y.

      • x2: number = -1

        End X.

      • y2: number = -1

        End Y.

      Returns void