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';
|
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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user