Game adjusted to async file loading

This commit is contained in:
Mal 2023-09-19 11:53:43 +02:00
parent f02fb4d411
commit 014152b011
1 changed files with 5 additions and 4 deletions

View File

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