diff --git a/src/gamelib.js b/src/gamelib.js index 7d1142a..5936494 100644 --- a/src/gamelib.js +++ b/src/gamelib.js @@ -132,8 +132,8 @@ export class Gamelib { ev.preventDefault(); } - loadSprite(name, width, height) { - return new Promise((resolve) => { + async loadSprite(name, width, height) { + return await new Promise((resolve) => { const sprite = new OffscreenCanvas(width, height); const image = new Image();