-
Notifications
You must be signed in to change notification settings - Fork 0
/
LineBlock.java
63 lines (59 loc) · 2.02 KB
/
LineBlock.java
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
public class LineBlock extends Block {
final static private int[][] bloks = {
{25, -25, -25, 25}, {75, 25, 25, 75}, {125, 75, 75, 125}, {175, 125, 125, 175}, //xbloks
{-25, -25, 25, 25}, {-25, -25, 25, 25}, {-25, -25, 25, 25}, {-25, -25, 25, 25} //ybloks
};
public LineBlock(int x, int y, int angle) {
super(x, y, angle, bloks);
this.rtEdge = x - 25;
this.ltEdge = x + 175;
this.btEdge = y + 25;
}
@Override
public void rotate() {
super.rotate();
System.out.println(angle);
// if(angle >= 360) angle -= 360;
// if(angle < 0) angle += 360;
// switch (angle){
//
//
// case 0:
// this.rtEdge = x - 25;
// this.ltEdge = x + 175;
// this.btEdge = y + 25;
// System.out.println("TEST CASE 0");
// System.out.println(rtEdge);
// System.out.println(ltEdge);
// System.out.println(btEdge);
//
//
// case 90:
// this.ltEdge = x - 25;
// this.rtEdge = x + 25;
// this.btEdge = y + 25;
// System.out.println("TEST CASE 90");
// System.out.println(rtEdge);
// System.out.println(ltEdge);
// System.out.println(btEdge);
//
// case 180:
// this.ltEdge = x - 175;
// this.rtEdge = x + 25;
// this.btEdge = y + 25;
// System.out.println("TEST CASE 180");
// System.out.println(rtEdge);
// System.out.println(ltEdge);
// System.out.println(btEdge);
//
// case 270:
// this.ltEdge = x - 25;
// this.rtEdge = x + 25;
// this.btEdge = y + 175;
// System.out.println("TEST CASE 270");
// System.out.println(rtEdge);
// System.out.println(ltEdge);
// System.out.println(btEdge);
// }
}
}