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'; import DebugUi from './ui/debug';
// Application. // Application.
const app = new App(); const app = new App();
const config = app.readConfig();
// DOM. // DOM.
const appNode = document.querySelector('.app'); const appNode = document.querySelector('.app');
// Graphics stage. // Graphics stage.
const visibleSize = [320, 180]; const stage = new Stage(config.visibleSize, config.visibleScale);
const visibleScale = [2, 2];
const stage = new Stage(Vector.mul(visibleSize, visibleScale));
stage.scale = visibleScale;
// Create room. // Create room.
const room = new Room(); const room = new Room();
room.world = new World(); room.world = new World();