|
@ -17,8 +17,9 @@ public class Logic { |
|
|
int currentPlayer; |
|
|
int currentPlayer; |
|
|
|
|
|
|
|
|
public int playChip(int[][] playfield, int column, int player) { |
|
|
public int playChip(int[][] playfield, int column, int player) { |
|
|
|
|
|
|
|
|
|
|
|
//add board update |
|
|
testForWin(playfield, player); |
|
|
testForWin(playfield, player); |
|
|
|
|
|
currentPlayer = 2; |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -45,6 +46,8 @@ public class Logic { |
|
|
for(int i = 0; i < gamefield.length; i++) { |
|
|
for(int i = 0; i < gamefield.length; i++) { |
|
|
gamefield[i] = new JLabel(); |
|
|
gamefield[i] = new JLabel(); |
|
|
gamefield[i].setBorder(BorderFactory.createLineBorder(Color.gray)); |
|
|
gamefield[i].setBorder(BorderFactory.createLineBorder(Color.gray)); |
|
|
|
|
|
gamefield[i].setOpaque(true); |
|
|
|
|
|
gamefield[i].setBackground(Color.white); |
|
|
playfieldPanel.add(gamefield[i]); |
|
|
playfieldPanel.add(gamefield[i]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|