refactor: move config into app

This commit is contained in:
cha0s 2019-04-19 20:01:06 -05:00
parent 18a8865863
commit 1f51d6e035
2 changed files with 13 additions and 5 deletions

View File

@ -14,4 +14,14 @@ const decorate = compose(
}),
);
export class App extends decorate(class {}) {}
export class App extends decorate(class {}) {
// Stub for now!
readConfig() {
return {
visibleScale: [2, 2],
visibleSize: [320, 180],
};
}
}

View File

@ -26,13 +26,11 @@ import Ui from './ui';
import DebugUi from './ui/debug';
// Application.
const app = new App();
const config = app.readConfig();
// DOM.
const appNode = document.querySelector('.app');
// Graphics stage.
const visibleSize = [320, 180];
const visibleScale = [2, 2];
const stage = new Stage(Vector.mul(visibleSize, visibleScale));
stage.scale = visibleScale;
const stage = new Stage(config.visibleSize, config.visibleScale);
// Create room.
const room = new Room();
room.world = new World();