mwg API
    Preparing search index...

    Class AudioListener

    Where sounds are heard from: a game moves one listener to its camera or its party leader each frame, and every SoundSource is mixed against it.

    import { AudioListener } from '@datamoc/mw_games/audio';

    const listener = new AudioListener({ x: 40, y: 12 });
    listener.moveTo(41, 12); // following the camera
    listener.face(Math.PI / 2); // now facing the world's south

    Implements

    Index
    facing: number

    heading in radians: 0 faces +x, increasing clockwise on a y-down screen

    x: number
    y: number