refactor: prepare main feature gameplay object and use GLB sky model

This commit is contained in:
Tom Boullay
2026-04-30 10:02:00 +02:00
parent d7b77b2f44
commit 475a4c7c5e
26 changed files with 152 additions and 53 deletions
+6 -1
View File
@@ -1,5 +1,9 @@
import { logger } from "@/utils/logger";
interface PlaySoundOptions {
playbackRate?: number;
}
export class AudioManager {
private static _instance: AudioManager | null = null;
private readonly _audioPools = new Map<string, HTMLAudioElement[]>();
@@ -20,9 +24,10 @@ export class AudioManager {
private constructor() {}
playSound(path: string, volume = 1): void {
playSound(path: string, volume = 1, options: PlaySoundOptions = {}): void {
const audio = this._acquireAudio(path);
audio.volume = Math.max(0, Math.min(1, volume));
audio.playbackRate = options.playbackRate ?? 1;
audio.currentTime = 0;
void audio.play().catch((error: unknown) => {