From c6e9baa0009f7cce0f6ff156a3957ef04a8cb684 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Sat, 12 Aug 2023 13:49:16 -0600 Subject: the great engine refactor --- engine/config/assets.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engine/config/assets.ts') diff --git a/engine/config/assets.ts b/engine/config/assets.ts index 51a5303..173bab3 100644 --- a/engine/config/assets.ts +++ b/engine/config/assets.ts @@ -4,7 +4,7 @@ import { SPRITE_SPECS } from "./sprites"; export const IMAGES = new Map(); export const loadSpritesIntoImageElements = ( - spriteSpecs: Partial[] + spriteSpecs: Partial[], ): Promise[] => { const spritePromises: Promise[] = []; @@ -17,13 +17,13 @@ export const loadSpritesIntoImageElements = ( spritePromises.push( new Promise((resolve) => { img.onload = () => resolve(); - }) + }), ); } if (spriteSpec.states) { spritePromises.push( - ...loadSpritesIntoImageElements(Object.values(spriteSpec.states)) + ...loadSpritesIntoImageElements(Array.from(spriteSpec.states.values())), ); } } @@ -34,7 +34,9 @@ export const loadSpritesIntoImageElements = ( export const loadAssets = () => Promise.all([ ...loadSpritesIntoImageElements( - Array.from(SPRITE_SPECS.keys()).map((key) => SPRITE_SPECS.get(key)) + Array.from(SPRITE_SPECS.keys()).map( + (key) => SPRITE_SPECS.get(key) as SpriteSpec, + ), ), // TODO: Sound ]); -- cgit v1.2.3-70-g09d2