src/systems/AudioManager.tsimport { Howl, Howler, type HowlOptions } from 'howler';/*** Audio system built on Howler.js. Howler is the standard for web games:* Web Audio + HTML5 fallback, sprite slicing, fades, master volume, mute.** Howler auto-handles AudioContext unlocking on the first user gesture, so* you don't need to manually call resume() — just register sounds in* PreloadScene and play them by key.** Usage:* await game.audio.register(ASSETS.audio.pickup, 'assets/audio/pickup.wav');* game.audio.play(ASSETS.audio.pickup);*/export class AudioManager {private sounds = new Map<string, Howl>();private muted = false;/** Master volume, 0–1. */setVolume(value: number): void {
Showing the first 20 lines.
Get full code