little ajustements

This commit is contained in:
leahb 2025-05-19 21:32:31 +02:00
parent 2aabc3b0f1
commit 21ff8c1b01
2 changed files with 6 additions and 9 deletions

View File

@ -14,13 +14,10 @@ public class Board {
ArrayList<int[]> highlightedSquares = new ArrayList<>(); ArrayList<int[]> highlightedSquares = new ArrayList<>();
private boolean pawnDoubleStep; private boolean pawnDoubleStep;
private int xCoordinatePawn; private int xCoordinatePawn;
private int yCoordinatePawn; private int yCoordinatePawn;
//<<<<<<< HEAD private boolean enPassant;
private boolean enPassant;
//=======
private boolean isGameOver = false;//flag for when a king is checkmate and no moves can be made anymore private boolean isGameOver = false;//flag for when a king is checkmate and no moves can be made anymore
//>>>>>>> branch 'master' of https://gitarero.ecam.fr/louise.berteloot/OOP_2A5_Project.git
private ArrayList<Board> previousStates; private ArrayList<Board> previousStates;
public Board(int colNum, int lineNum) { public Board(int colNum, int lineNum) {

View File

@ -85,18 +85,18 @@ public class JPanelChessBoard extends JPanel {
if (myGame == null) { if (myGame == null) {
// Display title before game starts // Display title before game starts
g.setColor(Color.WHITE); g.setColor(Color.WHITE);
g.setFont(g.getFont().deriveFont(48f)); // larger font size g.setFont(g.getFont().deriveFont(48f));
String title = "Chess Project"; String title = "Chess Project";
int stringWidth = g.getFontMetrics().stringWidth(title); int stringWidth = g.getFontMetrics().stringWidth(title);
int x = (getWidth() - stringWidth) / 2; int x = (getWidth() - stringWidth) / 2;
int y = getHeight() / 2; int y = getHeight() / 2;
g.drawString(title, x, y); g.drawString(title, x, y);
g.setFont(g.getFont().deriveFont(24f)); // Smaller font for subtitle g.setFont(g.getFont().deriveFont(24f));
String subtitle = "Groupe 2A5"; String subtitle = "Groupe 2A5";
int subtitleWidth = g.getFontMetrics().stringWidth(subtitle); int subtitleWidth = g.getFontMetrics().stringWidth(subtitle);
int x2 = (getWidth() - subtitleWidth) / 2; int x2 = (getWidth() - subtitleWidth) / 2;
int y2 = y + 40; // 40 pixels below the title, adjust spacing if needed int y2 = y + 40;
g.drawString(subtitle, x2, y2); g.drawString(subtitle, x2, y2);
return; return;