Skip to content

Commit

Permalink
fix(audio): use import.meta.url to import sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Apr 21, 2024
1 parent 29c24cc commit e898a2a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 19 additions & 4 deletions src/scenes/Boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,25 @@ export class Boot extends Phaser.Scene {
}

preload() {
this.load.audio(key.audio.click, '/audio/drop_004.ogg');
this.load.audio(key.audio.drop, '/audio/drop_002.ogg');
this.load.audio(key.audio.error, '/audio/back_001.ogg');
this.load.audio(key.audio.success, '/audio/confirmation_004.ogg');
this.load.audio(
key.audio.click,
new URL('../audio/drop_004.ogg', import.meta.url).href,
);

this.load.audio(
key.audio.drop,
new URL('../audio/drop_002.ogg', import.meta.url).href,
);

this.load.audio(
key.audio.error,
new URL('../audio/back_001.ogg', import.meta.url).href,
);

this.load.audio(
key.audio.success,
new URL('../audio/confirmation_004.ogg', import.meta.url).href,
);
}

create() {
Expand Down

0 comments on commit e898a2a

Please sign in to comment.