summaryrefslogtreecommitdiff
path: root/main.js
blob: d02e0fb80fcf9ef0927c287aad0bc52bfec16e68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Voronoi from './modules/3rdparty/rhill-voronoi-core.js';
import Terrain from './modules/Terrain.js';

const $ = id => document.getElementById(id)

window.onload = () => {
	let canvas = document.createElement('canvas');
	canvas.setAttribute('width', window.innerWidth);
	canvas.setAttribute('height', window.innerHeight);
	const ct = canvas.getContext('2d');

	const scale = Math.min(window.innerWidth, window.innerHeight);
	ct.scale(scale, scale);
	
	const terrain = new Terrain();
	terrain.renderGrid(ct);

	
	const root = $('root');
	root.appendChild(canvas);
}