changed color of the chessboard and higlited
This commit is contained in:
parent
3b41d77eea
commit
9ded1e1879
|
|
@ -80,7 +80,7 @@ public class JPanelChessBoard extends JPanel {
|
|||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
this.setBackground(Color.black);
|
||||
this.setBackground(Color.darkGray);
|
||||
if(pieceSelectorMode) {
|
||||
g.drawImage(
|
||||
spriteSheet,
|
||||
|
|
@ -97,16 +97,16 @@ public class JPanelChessBoard extends JPanel {
|
|||
float cellWidth = cellWidth();
|
||||
float cellHeight = cellHeight();
|
||||
|
||||
g.setColor(Color.white);
|
||||
g.setColor(Color.pink);
|
||||
for(int x=0; x<myGame.getWidth();x++) {
|
||||
for (int y=0; y<myGame.getHeight(); y++) {
|
||||
boolean isSelect = myGame.isSelected(x,y);
|
||||
boolean isHighlight = myGame.isHighlighted(x,y);
|
||||
if(isSelect) {
|
||||
g.setColor(Color.blue);
|
||||
g.setColor(Color.red);
|
||||
}
|
||||
if(isHighlight) {
|
||||
g.setColor(Color.yellow);
|
||||
g.setColor(Color.blue);
|
||||
}
|
||||
if((x+y)%2==1 || isSelect || isHighlight) {
|
||||
g.fillRect(
|
||||
|
|
|
|||
Loading…
Reference in New Issue