-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.mjs
41 lines (33 loc) · 1007 Bytes
/
constants.mjs
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
export const S = 48;
export const BOARD_W = 8;
export const BOARD_H = 16;
export const COLOR_NONE = 0;
export const COLOR_BLUE = 1;
export const COLOR_YELLOW = 2;
export const COLOR_RED = 3;
export const KIND_EMPTY = 0;
export const KIND_PILL = 1;
export const KIND_VIRUS = 2;
export const COLORS = [
undefined,
'blue',
'yellow',
'red',
];
export const KEY_LEFT = 'ArrowLeft';
export const KEY_RIGHT = 'ArrowRight';
export const KEY_DOWN = 'ArrowDown';
export const KEY_DROP = ' ';
export const KEY_ROT_CW = 'z';
export const KEY_ROT_CCW = 'x';
export const KEY_ROT_GP_REBIND = '1';
export const KEY_PAUSE = 'p';
// TODO keyboard rebind
export const GP_LEFT = 'left';
export const GP_RIGHT = 'right';
export const GP_DOWN = 'down';
export const GP_DROP = 'drop';
export const GP_ROT_CW = 'rcw';
export const GP_ROT_CCW = 'rccw';
export const GP_ACTIONS = [ GP_LEFT, GP_RIGHT, GP_DOWN, GP_DROP, GP_ROT_CW, GP_ROT_CCW ];
export const LEAVE_MS = 500;