2 Commits

Author SHA1 Message Date
15a280ad2c conflit 2025-10-08 17:24:12 +02:00
4b7d0c7753 nul 2025-10-08 17:14:42 +02:00
3 changed files with 12 additions and 21 deletions

View File

@@ -127,4 +127,4 @@ public class Words {
}
return out;
}
}
}

View File

@@ -10,9 +10,9 @@ import java.util.List;
/**
* Interface graphique du pendu avec niveaux :
* - facile : mots < 8 lettres
* - moyen : mots ≥ 8 lettres
* - difficile : deux mots (score + chrono cumulés)
* - 1 : mots < 8 lettres
* - 2 : mots ≥ 8 lettres
* - 3 : deux mots (score + chrono cumulés)
* Boutons : Essayer / Nouvelle partie / Menu / Quitter.
* (Toutes les méthodes ≤ 50 lignes)
*/
@@ -29,11 +29,11 @@ public class GameUI {
private String currentWord = "";
private Timer timer;
// Cumul de session (niveau difficile)
// Cumul de session (niveau 3)
private long sessionStartNano = -1L;
private int sessionScore = 0;
/** Reçoit la difficulté (facile, moyen, difficile). */
/** Reçoit la difficulté (1, 2, 3). */
public GameUI(int level) {
this.level = level;
}
@@ -88,17 +88,9 @@ public class GameUI {
scoreLabel = new JLabel("Score : 0");
timeLabel = new JLabel("Temps : 0s");
JLabel titleLabel = new JLabel("Sauver Michel!!", SwingConstants.CENTER);
titleLabel.setFont(new Font("Arial", Font.BOLD, 22));
titleLabel.setForeground(Color.RED);
JPanel top = new JPanel(new BorderLayout());
JPanel infoPanel = new JPanel(new GridLayout(2, 1));
infoPanel.add(buildTopLine(wordLabel, scoreLabel));
infoPanel.add(buildTopLine(triedLabel, timeLabel));
top.add(titleLabel, BorderLayout.NORTH);
top.add(infoPanel, BorderLayout.CENTER);
JPanel top = new JPanel(new GridLayout(2, 1));
top.add(buildTopLine(wordLabel, scoreLabel));
top.add(buildTopLine(triedLabel, timeLabel));
frame.add(top, BorderLayout.NORTH);
JPanel bottom = new JPanel(new BorderLayout(8, 8));
@@ -231,5 +223,4 @@ public class GameUI {
private void showMsg(String msg) {
JOptionPane.showMessageDialog(frame, msg);
}
}
}

View File

@@ -3,7 +3,7 @@ package front;
import javax.swing.*;
import java.awt.*;
/*
/**
* Menu de démarrage du jeu du pendu.
* Permet de choisir la difficulté (facile, moyen ou difficile).
*/
@@ -41,7 +41,7 @@ public class MenuUI {
frame.setVisible(true);
}
/* Lance le jeu avec le niveau choisi */
/** Lance le jeu avec le niveau choisi */
private void startGame(int level) {
frame.dispose(); // ferme le menu
GameUI ui = new GameUI(level);