changed color of the chessboard and higlited

This commit is contained in:
Jérôme BEDIER 2025-05-22 22:31:51 +02:00
parent 3b41d77eea
commit 9ded1e1879
1 changed files with 4 additions and 4 deletions

View File

@ -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(