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

    Represents a bullet fired by a tank.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    age: number = 0

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

    angle: number = 0
    bounceSound: string = SOUNDS.bounce
    color: string = "#000"
    exploded: boolean = false
    extrahitbox: number = 0
    game: Game

    The game instance.

    image?: HTMLImageElement
    isBulletBulletCollisionEnabled: boolean = true
    lethal: boolean = true
    maxAge?: number

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

    player: Player
    radius: number = 4
    smokeColor: string | null = null
    speed: number
    tile?: Tile
    trace: boolean = false
    weapon: Weapon
    width: number = 0
    x: number = 0
    y: number = 0

    Methods

    • Checks for collision with other bullets.

      Returns void

    • Check for collision with walls, handle them.

      Parameters

      • oldPosition: Coord

        Previous position {x, y}.

      Returns void

    • Draws the bullet on the canvas.

      Parameters

      • context: CanvasRenderingContext2D

        The 2D context.

      Returns void