28 lines
815 B
JavaScript

import Tilorswift from "./Tilorswift.js";
import Level from "../../js/Level.js";
import ImageLoader from "../../js/ImageLoader.js";
import GraphicSet from "../../js/GraphicSet.js";
import Setting from "../../js/Setting.js";
const imageLoader = new ImageLoader();
for (const graphicSet of GraphicSet) {
imageLoader.addImage('../' + Setting.TILESET_LOCATION + graphicSet.tileset);
if (graphicSet.tilesetBackground !== null) {
imageLoader.addImage('../' + Setting.TILESET_LOCATION + graphicSet.tilesetBackground.path);
}
}
imageLoader.onLoad = () => {
Level.createFromFile(
'../levels/moonbase.json',
(level) => {
const tilorswift = new Tilorswift(level);
tilorswift.loadLevel();
tilorswift.init();
}
);
}
imageLoader.load();