So I’m currently working on a project and opened it on Firefox (Ubuntu) and it’s completely broken. (the game has normally a small countdown then spawns enemies, but it’s just stuck and I can’t move)
my sound handling code look like this
import { GameScene } from "../scenes/gameScene";
// Usage :
// this.scene.gameEvent.emit(signalName, Object with {sound: signalSOund});
export class SoundEffects {
private defaultUrl: string = '/src/games/cadre-de-guerre/assets/sounds/';
private soundList = [
'Alarm',
// other sounds omitted for brevity
];
private eventList = [
'playerRespawned',
// other events omitted for brevity
];
private sounds = []
scene: GameScene;
constructor(params) {
this.scene = params.scene;
}
preloadSound() {
this.soundList.forEach(element => {
this.scene.load.audio(element, this.defaultUrl + element + '.mp3', { instances: 1});
});
}
initSound() {
this.soundList.forEach(element => {
this.sounds[element] = this.scene.sound.add(element.toString());
this.sounds[element].volume = 0.3;
});
this.eventList.forEach(element => {
this.scene.gameEvent.on(element, this.playSound, this);
});
}
playSound(obj) {
if (obj) {
this.scene.sound.play(obj.sound);
} else {
console.log('no object sent');
}
}
}
usage in the GameScene is like this :
constructor() {
//...omitted code
this.soundEffectsManager = new SoundEffects({ scene: this });
}
preload(): void {
//...omitted code
this.soundEffectsManager.preloadSound();
}
create(): void {
// omitted code
this.soundEffectsManager.initSound();
// omitted code
}
it works on Chrome but for some reason I can’t make it work on Firefox.
The errors that I get on the console :
Audio cache entry missing: Alarm phaser.js:76313:21
TypeError: this.currentConfig is undefined
Source map error: TypeError: sockjs.js.map is not a valid URL.
Resource URL: webpack:///./node_modules/sockjs-client/dist/sockjs.js?
Source Map URL: sockjs.js.map
Maybe I’m missing something silly so…yeah
pls help ༼ つ ◕_◕ ༽つ