-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.js
98 lines (94 loc) · 1.39 KB
/
variables.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
const COLS = 10;
const ROWS = 20;
const BLOCK_SIZE = 30;
const SCORE_PER_LEVEL = 300;
const linesSound = new Audio("design/linesSound.wav");
const KEY = {
LEFT: 37,
RIGHT: 39,
DOWN: 40,
SPACE: 32,
UP: 38
}
Object.freeze(KEY);
const POINTS = {
SINGLE: 50,
DOUBLE: 100,
TRIPLE: 150,
TETRIS: 200,
SOFT_DROP: 1,
HARD_DROP: 2
}
Object.freeze(POINTS);
const LEVEL = {
0: 800,
1: 720,
2: 630,
3: 550,
4: 470,
5: 380,
6: 300,
7: 220,
8: 130,
9: 100,
10: 80,
11: 80,
12: 80,
13: 70,
14: 70,
15: 70,
16: 50,
17: 50,
18: 50,
19: 30,
20: 30,
}
Object.freeze(LEVEL);
const COLORS = [
'null',
'cyan',
'blue',
'orange',
'yellow',
'green',
'purple',
'red'
];
const SHAPES = [
[],
[
[0, 0, 0, 0],
[1, 1, 1, 1],
[0, 0, 0, 0],
[0, 0, 0, 0]
],
[
[2, 0, 0],
[2, 2, 2],
[0, 0, 0]
],
[
[0, 0, 3],
[3, 3, 3],
[0, 0, 0]
],
[
[4, 4],
[4, 4]
],
[
[0, 5, 5],
[5, 5, 0],
[0, 0, 0]
],
[
[0, 6, 0],
[6, 6, 6],
[0, 0, 0]
],
[
[7, 7, 0],
[0, 7, 7],
[0, 0, 0]
]
];