hadean-old/src/index.ts

16 lines
618 B
TypeScript
Raw Normal View History

2021-06-14 22:03:55 -04:00
import { Game } from './Game.js';
2021-06-16 15:26:42 -04:00
import { render } from './ui/UI.js';
2021-06-18 02:02:50 -04:00
import { ensureDirSync } from 'fs-extra';
import { parse } from 'path';
2021-06-14 22:03:55 -04:00
2021-06-18 02:02:50 -04:00
const saveFile = process.argv[2] || 'data/world01.json';
2021-06-15 20:05:07 -04:00
2021-06-18 02:02:50 -04:00
ensureDirSync(parse(saveFile).dir);
2021-06-18 21:29:45 -04:00
// TODO move render logic into game, so that the ui doesnt exist until the game does...
// maybe, i mean, an argument could be made for not that, because the game
// isnt necessarily the entire thing, its just one instance of a save file.
// But probably the initial menu screens will be their own thing entirely.
2021-06-18 02:02:50 -04:00
const game = Game.create(saveFile);
2021-06-14 22:03:55 -04:00
render(game);