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

16 lines
581 B
JavaScript
Raw Normal View History

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 level = Level.createFromFile('../levels/moonbase.json');
const imageLoader = new ImageLoader();
imageLoader.addImage('../' + Setting.TILESET_LOCATION + GraphicSet[level.terrain.tileset.setId].tileset);
imageLoader.onLoad = () => {
const tilorswift = new Tilorswift(level);
tilorswift.init();
tilorswift.loadLevel();
}
imageLoader.load();