Game adjusted to async file loading

This commit is contained in:
Mal 2023-09-19 11:53:43 +02:00
parent f02fb4d411
commit 014152b011

View File

@ -91,8 +91,9 @@ let game;
const urlGetter = new UrlParam();
const levelIndex = urlGetter.getInt('level');
loadLevel(
Level.createFromFile(
Setting.LEVELS_LOCATION + LEVEL[levelIndex < 0 || levelIndex >= LEVEL.length ? 0 : levelIndex]
)
Level.createFromFile(
Setting.LEVELS_LOCATION + LEVEL[levelIndex < 0 || levelIndex >= LEVEL.length ? 0 : levelIndex],
(level) => {
loadLevel(level);
}
);