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

    Class GamemodeAbstract

    Base class for game modes.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    BaseSpawnDistance: number = 2

    Distance (in tiles) from the base center where players should spawn. A value of 2-3 ensures they don't spawn directly on the flag.

    game: Game

    The game instance.

    name: string = "defaultmode"

    Internal identifier for the game mode.

    Methods

    • Adapts bot speed based on team balance.

      Parameters

      • players: Player[]

        The list of players including the bots of whom to adapt the speed

      • team: Team | null

        The team to adjust for (usually the leading team gets harder bots?).

      • val: number = 0.1

        The adaptation intensity.

      Returns void

    • Updates player score.

      Parameters

      • player: Player

        The player.

      • val: number

        The score value.

      Returns void

    • Initializes bases for each team. Ensures one base per team, placed far from each other.

      Returns Base[]

    • Called every game step.

      Parameters

      • _dt: number

        The time elapsed since the last frame in milliseconds.

      Returns void