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

14 lines
396 B
JavaScript
Raw Normal View History

2020-01-29 00:21:53 +01:00
import Terrain from "./Terrain.js";
import FileLoader from "../../js/FileLoader.js";
let image = new Image();
image.src = '../graphics/tileset-landscape01.jpg';
image.onload = function () {
console.log('Loaded');
let loader = new FileLoader('../levels/level.json');
let terrain = Terrain.createFromJson(loader.getContent());
document.body.appendChild(terrain.getElement());
};