This commit is contained in:
parent
a42d1d0323
commit
a10ea3b7dd
@ -1,7 +1,7 @@
|
||||
import { type SpriteSpec, SPRITE_SPECS } from ".";
|
||||
import { SOUND_SPECS, SoundSpec } from "./sounds";
|
||||
|
||||
const BASE_URL = import.meta.env.BASE_URL ?? document.location;
|
||||
const BASE_URL = import.meta.env.BASE_URL;
|
||||
|
||||
export const FONT = new FontFace(
|
||||
"scientifica",
|
||||
@ -22,7 +22,7 @@ export const loadSpritesIntoImageElements = (
|
||||
for (const spriteSpec of spriteSpecs) {
|
||||
if (spriteSpec.sheet) {
|
||||
const img = new Image();
|
||||
img.src = BASE_URL + spriteSpec.sheet;
|
||||
img.src = document.location + spriteSpec.sheet;
|
||||
IMAGES.set(spriteSpec.sheet, img);
|
||||
|
||||
spritePromises.push(
|
||||
@ -49,7 +49,7 @@ export const loadSoundsIntoAudioElements = (
|
||||
|
||||
for (const soundSpec of soundSpecs) {
|
||||
if (soundSpec.url) {
|
||||
const promise = fetch(BASE_URL + soundSpec.url)
|
||||
const promise = fetch(document.location + soundSpec.url)
|
||||
.then((response) => response.blob())
|
||||
.then((blob) => {
|
||||
const audio = new Audio();
|
||||
|
Loading…
Reference in New Issue
Block a user