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

    Class GameObjectAbstract

    Parent class for all objects in the game. Base class for Tanks, Bullets, PowerUps, etc.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    age: number = 0

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

    game: Game

    The game instance.

    maxAge?: number

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

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

    Methods

    • Default draw function.

      Parameters

      • context: CanvasRenderingContext2D

        The 2D rendering context.

      Returns void

    • Update method called every frame.

      Parameters

      • _dt: number

        The time elapsed since the last frame in milliseconds.

      Returns void