refactor: move config into app
This commit is contained in:
parent
18a8865863
commit
1f51d6e035
|
@ -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],
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue
Block a user