-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathapp.js
47 lines (43 loc) · 1.15 KB
/
app.js
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
37
38
39
40
41
42
43
44
45
import menu from './script/menu/menu.js';
import input from './script/input.js';
import settings from './script/settings.js';
import gameHandler from './script/game/game-handler.js';
import * as randomizer from './script/game/modules/randomizers.js';
import {PIECE_SETS} from './script/consts.js';
import $, {hzToMs, framesToMs} from './script/shortcuts.js';
import locale from './script/lang.js';
import sound from './script/sound.js';
input.addMany([
'menuUp',
'menuDown',
'menuLeft',
'menuRight',
'menuOk',
'menuBack',
], [
() => {menu.up();},
() => {menu.down();},
() => {menu.left();},
() => {menu.right();},
() => {menu.ok();},
() => {},
]);
document.addEventListener('DOMContentLoaded', () => {
settings.load();
sound.loadMenu();
locale.loadLang(settings.settings.language)
.then((test) => {
locale.updateFonts();
menu.load('root');
menu.show();
window.onblur = () => {
try {
gameHandler.game.pause();
} catch (error) {
// game isn't running yet; no big deal
}
};
});
// TEMP BELOW
// gameHandler.newGame('marathon');
});