-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.js
More file actions
36 lines (27 loc) · 863 Bytes
/
game.js
File metadata and controls
36 lines (27 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const config = {};
global.game = {};
game.config = {};
const _requires = require("./requires.json");
for (let _mod in _requires.PreInitGlobals) try{global[_mod] = require(_requires.PreInitGlobals[_mod])}catch(e){console.log(`Ignoring error while requiring ${_mod}: ${e}`)};
for (let _mod of _requires.PreInit) try{require(_mod)}catch(e){console.log(`Ignoring error while requiring ${_mod}: ${e}`)};
class _Game {
constructor() {
this.config = game.config;
this.world = {};
}
Initialize() {
console.log();
this.msg("GameInit");
console.log();
this.world = world.Create();
}
msg(_msg) {
if (locale.translation[_msg]) {
console.log(locale.translation[_msg])
} else {
console.log(_msg);
}
}
}
global.game = new _Game();
game.Initialize();