Options
All
  • Public
  • Public/Protected
  • All
Menu

Asset manager is responsible for loading and managing assets of the game.

Hierarchy

  • AssetManager

Index

Constructors

constructor

Properties

Private sounds

sounds: Map<string, HTMLAudioElement> = ...

Private textures

textures: Map<string, HTMLImageElement> = ...

Static Private _instance

_instance: AssetManager

Accessors

Static Instance

Methods

getSound

  • getSound(name: string): HTMLAudioElement
  • Get a sound with the given name.

    Parameters

    • name: string

      Name of the sound.

    Returns HTMLAudioElement

    Sound with the given name or undefined if not found.

getTexture

  • getTexture(name: string): HTMLImageElement
  • Get a texture with the given name.

    Parameters

    • name: string

      Name of the texture.

    Returns HTMLImageElement

    Texture with the given name or undefined if not found.

loadSound

  • loadSound(name: string, path: string): void
  • Load a sound with a given name.

    Parameters

    • name: string

      Name of the sound.

    • path: string

      Path to the sound file.

    Returns void

loadTexture

  • loadTexture(name: string, path: string): void
  • Load a texture with a given name.

    Parameters

    • name: string

      Name of the texture.

    • path: string

      Path to the texture file.

    Returns void

Generated using TypeDoc