mr-crocs-adventures/tilorswift/js/module.js

24 lines
659 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);
}
imageLoader.onLoad = () => {
Level.createFromFile(
'../levels/moonbase.json',
(level) => {
const tilorswift = new Tilorswift(level);
tilorswift.loadLevel();
tilorswift.init();
}
);
}
imageLoader.load();