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