diff options
Diffstat (limited to 'src/engine/config/assets.ts')
-rw-r--r-- | src/engine/config/assets.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/engine/config/assets.ts b/src/engine/config/assets.ts index 5c07c1d..c7d6a0e 100644 --- a/src/engine/config/assets.ts +++ b/src/engine/config/assets.ts @@ -6,7 +6,7 @@ BASE_URL = BASE_URL.endsWith("/") ? BASE_URL.slice(0, -1) : BASE_URL; export const FONT = new FontFace( "scientifica", - `url(${BASE_URL}/fonts/scientifica.ttf)` + `url(${BASE_URL}/fonts/scientifica.ttf)`, ); FONT.load().then((font) => { document.fonts.add(font); @@ -16,7 +16,7 @@ export const IMAGES = new Map<string, HTMLImageElement>(); export const SOUNDS = new Map<string, HTMLAudioElement>(); export const loadSpritesIntoImageElements = ( - spriteSpecs: Partial<SpriteSpec>[] + spriteSpecs: Partial<SpriteSpec>[], ): Promise<void>[] => { const spritePromises: Promise<void>[] = []; @@ -29,13 +29,13 @@ export const loadSpritesIntoImageElements = ( spritePromises.push( new Promise((resolve) => { img.onload = () => resolve(); - }) + }), ); } if (spriteSpec.states) { spritePromises.push( - ...loadSpritesIntoImageElements(Array.from(spriteSpec.states.values())) + ...loadSpritesIntoImageElements(Array.from(spriteSpec.states.values())), ); } } @@ -44,7 +44,7 @@ export const loadSpritesIntoImageElements = ( }; export const loadSoundsIntoAudioElements = ( - soundSpecs: SoundSpec[] + soundSpecs: SoundSpec[], ): Promise<void>[] => { const soundPromises: Promise<void>[] = []; @@ -74,7 +74,7 @@ export const loadSoundsIntoAudioElements = ( if (soundSpec.states) { soundPromises.push( - ...loadSoundsIntoAudioElements(Array.from(soundSpec.states.values())) + ...loadSoundsIntoAudioElements(Array.from(soundSpec.states.values())), ); } } @@ -86,8 +86,8 @@ export const loadAssets = () => Promise.all([ ...loadSpritesIntoImageElements( Array.from(SPRITE_SPECS.keys()).map( - (key) => SPRITE_SPECS.get(key) as SpriteSpec - ) + (key) => SPRITE_SPECS.get(key) as SpriteSpec, + ), ), FONT.load(), ...loadSoundsIntoAudioElements(Array.from(SOUND_SPECS.values())), |