Add start of procedural world generation

This commit is contained in:
asraelite 2018-03-06 22:16:54 +00:00
parent 62b8c74f57
commit ee5ab45cfb
7 changed files with 328 additions and 74 deletions

View file

@ -1,9 +1,6 @@
import * as sector from './sector.mjs';
import * as spawn from './spawn.mjs';
import * as graphics from '../graphics/index.mjs';
export {getSectorFromWorld, getContainedSectors} from './sector.mjs';
export const entities = new Set();
export const celestials = new Set();
export const ships = new Set();
@ -25,6 +22,7 @@ export function init() {
spawn.player();
let p = spawn.startPlanet();
spawn.testEntity(p);
spawn.tick();
}
export function tick() {
@ -33,4 +31,5 @@ export function tick() {
entities.forEach(e => e.tick());
ships.forEach(s => s.tick());
if (graphics.trace) tracers.forEach(t => t.tick());
spawn.tick();
}