forked from asalga/Tetrissing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLShape.pde
44 lines (42 loc) · 1.03 KB
/
LShape.pde
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
public class LShape extends Shape{
LShape(){
size = 3;
numStates = 4;
_color = PINK;
changeShape();
}
public void changeShape(){
if(state == 0){
spacesOnLeft = 0;
spacesOnRight = 0;
shape = new int[][] { {0, 0, 0},
{1, 1, 1},
{1, 0, 0}
};
}
else if(state == 1){
spacesOnRight = 1;
spacesOnLeft = 0;
shape = new int[][] { {1, 1, 0},
{0, 1, 0},
{0, 1, 0}
};
}
else if(state == 2){
spacesOnRight = 0;
spacesOnLeft = 0;
shape = new int[][] { {0, 0, 1},
{1, 1, 1},
{0, 0, 0}
};
}
else if(state == 3){
spacesOnRight = 0;
spacesOnLeft = 1;
shape = new int[][] { {0, 1, 0},
{0, 1, 0},
{0, 1, 1}
};
}
}
}