13.10 end
This commit is contained in:
53
Muehle.java
53
Muehle.java
@@ -144,52 +144,61 @@ public class Muehle extends Application {
|
||||
}
|
||||
|
||||
public void drawMuehleButtons(Pane board, double topLeftX,double topLeftY,double topRightX,double topRightY) {
|
||||
ArrayList<Shape> shapes = new ArrayList<Shape>();
|
||||
Color button_color = Color.BLUE;
|
||||
ArrayList<MuehleButton> buttons = new ArrayList<MuehleButton>();
|
||||
|
||||
int id_count = 0;
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(0,0,i,topLeftX,topLeftY+ i*325,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,0,i,topLeftX,topLeftY+ i*325,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(i,1,i,topRightX -230,topLeftY+ i*100,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,1,i,topRightX -230,topLeftY+ i*100,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(0,2,i,topRightX + 140,topLeftY+ i*325,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,2,i,topRightX + 140,topLeftY+ i*325,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(1,0,i,topLeftX + 100,topLeftY+ i*220 +100,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,0,i,topLeftX + 100,topLeftY+ i*220 +100,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(1,2,i,topRightX +40,topLeftY+ i*220 +100,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,2,i,topRightX +40,topLeftY+ i*220 +100,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
for (int i = 2; i >=0; i--) {
|
||||
MuehleButton button = new MuehleButton(i,1,i,topRightX -230,topLeftY+ i*100 + 360,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(id_count,1,i,topRightX -230,topLeftY+ i*100 + 360,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
||||
MuehleButton button = new MuehleButton(2,0,i,topLeftX +200,topLeftY+ i*130 +200,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,0,i,topLeftX +200,topLeftY+ i*130 +200,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
MuehleButton button = new MuehleButton(0,2,i,topLeftX +540,topLeftY+ i*130 +200,button_color,game);
|
||||
shapes.add(button.getShape());
|
||||
MuehleButton button = new MuehleButton(id_count,2,i,topLeftX +540,topLeftY+ i*130 +200,game);
|
||||
id_count++;
|
||||
buttons.add(button);
|
||||
}
|
||||
|
||||
game.buttons.addAll(shapes);
|
||||
for (int i = 0; i < shapes.size() ;i++ ) {
|
||||
board.getChildren().add(shapes.get(i));
|
||||
game.buttons.addAll(buttons);
|
||||
for (int i = 0; i < buttons.size() ;i++ ) {
|
||||
board.getChildren().add(buttons.get(i).getShape());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user