-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
80 lines (77 loc) · 2.46 KB
/
setup.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
export const GRID_SIZE = 20;
export const CELL_SIZE = 20;
export const DIRECTIONS = {
ArrowLeft: {
code: 37,
movement: -1,
rotation: 180
},
ArrowUp: {
code: 38,
movement: -GRID_SIZE,
rotation: 270
},
ArrowRight: {
code: 39,
movement: 1,
rotation: 0
},
ArrowDown: {
code: 40,
movement: GRID_SIZE,
rotation: 90
}
};
export const OBJECT_TYPE = {
BLANK: 'blank',
WALL: 'wall',
DOT: 'dot',
BLINKY: 'blinky',
PINKY: 'pinky',
INKY: 'inky',
CLYDE: 'clyde',
PILL: 'pill',
PACMAN: 'pacman',
GHOST: 'ghost',
SCARED: 'scared',
GHOSTLAIR: 'lair'
};
// Lookup array for classes
export const CLASS_LIST = [
OBJECT_TYPE.BLANK,
OBJECT_TYPE.WALL,
OBJECT_TYPE.DOT,
OBJECT_TYPE.BLINKY,
OBJECT_TYPE.PINKY,
OBJECT_TYPE.INKY,
OBJECT_TYPE.CLYDE,
OBJECT_TYPE.PILL,
OBJECT_TYPE.PACMAN,
OBJECT_TYPE.GHOSTLAIR
];
// prettier-ignore
export const LEVEL = [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1,
1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1,
1, 7, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 1, 1, 7, 1,
1, 2, 2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