-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathblocks.js
More file actions
97 lines (90 loc) · 2.35 KB
/
blocks.js
File metadata and controls
97 lines (90 loc) · 2.35 KB
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
function Square() {
return {
id: 0,
cords: [
[1, 4], [1, 5],
[2, 4], [2, 5]
],
color: "",
phase: -1
}
}
function Line() {
return {
id: 1,
cords: [[1, 4], [2, 4], [3, 4], [4, 4]],
color: "",
phases: [[[1, 2], [0, 1], [-1, 0], [-2, -1]], [[-1, -2], [0, -1], [1, 0], [2, 1]]],
phase: 0
}
}
function T() {
return {
id: 2,
cords: [[1, 4], [2, 3], [2, 4], [2, 5]],
color: "",
phases: [[[1, 1], [-1, 1], [0, 0], [1, -1]], [[1, -1], [1, 1], [0, 0], [-1, -1]], [[-1, -1], [1, -1], [0, 0], [-1, 1]], [[-1, 1], [-1, -1], [0, 0], [1, 1]]],
phase: 0
}
}
function Z() {
return {
id: 3,
cords: [[1, 4], [1, 5], [2, 3], [2, 4]],
color: "",
phases: [[[1, 1], [2, 0], [-1, 1], [0, 0]], [[1, -1], [0, -2], [1, 1], [0, 0]], [[-1, -1], [-2, 0], [1, -1], [0, 0]], [[-1, 1], [0, 2], [-1, -1], [0, 0]]],
phase: 0
}
}
function NZ() {
return {
id: 4,
cords: [[1, 4], [1, 5], [2, 5], [2, 6]],
color: "",
phases: [[[0, 2], [1, 1], [0, 0], [1, -1]], [[2, 0], [1, -1], [0, 0], [-1, -1]], [[0, -2], [-1, -1], [0, 0], [-1, 1]], [[-2, 0], [-1, 1], [0, 0], [1, 1]]],
phase: 0
}
}
function L() {
return {
id: 5,
cords: [[1, 4], [2, 4], [2, 5], [2, 6]],
color: "",
phases: [[[0, 2], [-1, 1], [0, 0], [1, -1]], [[2, 0], [1, 1], [0, 0], [-1, -1]], [[0, -2], [1, -1], [0, 0], [-1, 1]], [[-2, 0], [-1, -1], [0, 0], [1, 1]]],
phase: 0
}
}
function NL() {
return {
id: 6,
cords: [[1, 5], [2, 5], [2, 4], [2, 3]],
color: "",
phases: [[[2, 0], [1, -1], [0, 0], [-1, 1]], [[0, -2], [-1, -1], [0, 0], [1, 1]], [[-2, 0], [-1, 1], [0, 0], [1, -1]], [[0, 2], [1, 1], [0, 0], [-1, -1]]],
phase: 0
}
}
export function getBlock(blockId) {
switch (blockId) {
case 0:
return Square();
break;
case 1:
return Line();
break;
case 2:
return T();
break;
case 3:
return Z();
break;
case 4:
return NZ();
break;
case 5:
return L();
break;
case 6:
return NL();
break
}
}