mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Tilorswift levels will be loaded asynchronously now
This commit is contained in:
@@ -4,12 +4,20 @@ import ImageLoader from "../../js/ImageLoader.js";
|
||||
import GraphicSet from "../../js/GraphicSet.js";
|
||||
import Setting from "../../js/Setting.js";
|
||||
|
||||
const level = Level.createFromFile('../levels/moonbase.json');
|
||||
const imageLoader = new ImageLoader();
|
||||
imageLoader.addImage('../' + Setting.TILESET_LOCATION + GraphicSet[level.terrain.tileset.setId].tileset);
|
||||
|
||||
for (const graphicSet of GraphicSet) {
|
||||
imageLoader.addImage('../' + Setting.TILESET_LOCATION + graphicSet.tileset);
|
||||
}
|
||||
|
||||
imageLoader.onLoad = () => {
|
||||
const tilorswift = new Tilorswift(level);
|
||||
tilorswift.init();
|
||||
tilorswift.loadLevel();
|
||||
Level.createFromFile(
|
||||
'../levels/moonbase.json',
|
||||
(level) => {
|
||||
const tilorswift = new Tilorswift(level);
|
||||
tilorswift.loadLevel();
|
||||
tilorswift.init();
|
||||
}
|
||||
);
|
||||
}
|
||||
imageLoader.load();
|
||||
|
||||
Reference in New Issue
Block a user