diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-11 16:35:51 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-11 16:35:51 -0600 |
commit | de4f3fd2fe45478ffabc84f055592e11b119d0a4 (patch) | |
tree | ad2ce3b3e646d2d6bfbccb4b9c8962196a0ea8fe /src/engine/config | |
parent | 32879581e53fae5e684c24b44433172d8375d69e (diff) | |
download | the-abstraction-engine-de4f3fd2fe45478ffabc84f055592e11b119d0a4.tar.gz the-abstraction-engine-de4f3fd2fe45478ffabc84f055592e11b119d0a4.zip |
prettier, fix assets and css
Diffstat (limited to 'src/engine/config')
-rw-r--r-- | src/engine/config/assets.ts | 16 | ||||
-rw-r--r-- | src/engine/config/constants.ts | 2 | ||||
-rw-r--r-- | src/engine/config/sprites.ts | 2 |
3 files changed, 10 insertions, 10 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())), diff --git a/src/engine/config/constants.ts b/src/engine/config/constants.ts index 527bfe1..89f7e92 100644 --- a/src/engine/config/constants.ts +++ b/src/engine/config/constants.ts @@ -31,7 +31,7 @@ export namespace KeyConstants { // value -> [key] from KeyActions export const ActionKeys: Map<Action, string[]> = Object.keys( - KeyActions + KeyActions, ).reduce((acc: Map<Action, string[]>, key) => { const action = KeyActions[key.toLowerCase()]; diff --git a/src/engine/config/sprites.ts b/src/engine/config/sprites.ts index 481dbb9..005e1b1 100644 --- a/src/engine/config/sprites.ts +++ b/src/engine/config/sprites.ts @@ -43,7 +43,7 @@ playerSpriteSpec.states.set(Direction.NONE, { playerSpriteSpec.states.set(direction, { sheet: `/assets/lambda/${direction.toLowerCase()}.png`, }); - } + }, ); SPRITE_SPECS.set(Sprites.PLAYER, playerSpriteSpec); |