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

    Represents a Flag in Capture the Flag mode.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    age: number = 0

    time (in milliseconds) for how long the object already exists in the game

    base: Base

    The base this flag belongs to.

    color: string

    The color of the flag.

    game: Game

    The game instance.

    inBase: boolean = true

    Whether the flag is currently at its home base.

    maxAge?: number

    optional duration in milliseconds for how long the object should still exist in the game

    picked: boolean = false

    Whether the flag is currently being carried by a tank.

    resetTimer: number = 0

    Timestamp until which the flag stays at its dropped position before resetting.

    size: number = 24

    The size of the flag for drawing and collision.

    team: Team

    The team this flag belongs to.

    tile?: Tile
    width: number = 0
    x: number = 0
    y: number = 0

    Methods

    • Draws the flag.

      Parameters

      • context: CanvasRenderingContext2D

        The context.

      Returns void

    • Drop the flag at a specific location.

      Parameters

      • x: number

        X coordinate.

      • y: number

        Y coordinate.

      Returns void

    • Let tank pick up the flag.

      Parameters

      • tank: Tank

        The tank picking up the flag.

      Returns void