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