forked from menault/TD3_DEV51_Qualite_Algo
Compare commits
3 Commits
2dc9caee23
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b5b30ea7b | |||
| 960c8c7878 | |||
| 2fe044753a |
@@ -10,9 +10,9 @@ import java.util.List;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface graphique du pendu avec niveaux :
|
* Interface graphique du pendu avec niveaux :
|
||||||
* - 1 : mots < 8 lettres
|
* - facile : mots < 8 lettres
|
||||||
* - 2 : mots ≥ 8 lettres
|
* - moyen : mots ≥ 8 lettres
|
||||||
* - 3 : deux mots (score + chrono cumulés)
|
* - difficile : deux mots (score + chrono cumulés)
|
||||||
* Boutons : Essayer / Nouvelle partie / Menu / Quitter.
|
* Boutons : Essayer / Nouvelle partie / Menu / Quitter.
|
||||||
* (Toutes les méthodes ≤ 50 lignes)
|
* (Toutes les méthodes ≤ 50 lignes)
|
||||||
*/
|
*/
|
||||||
@@ -29,11 +29,11 @@ public class GameUI {
|
|||||||
private String currentWord = "";
|
private String currentWord = "";
|
||||||
private Timer timer;
|
private Timer timer;
|
||||||
|
|
||||||
// Cumul de session (niveau 3)
|
// Cumul de session (niveau difficile)
|
||||||
private long sessionStartNano = -1L;
|
private long sessionStartNano = -1L;
|
||||||
private int sessionScore = 0;
|
private int sessionScore = 0;
|
||||||
|
|
||||||
/** Reçoit la difficulté (1, 2, 3). */
|
/** Reçoit la difficulté (facile, moyen, difficile). */
|
||||||
public GameUI(int level) {
|
public GameUI(int level) {
|
||||||
this.level = level;
|
this.level = level;
|
||||||
}
|
}
|
||||||
@@ -88,9 +88,17 @@ public class GameUI {
|
|||||||
scoreLabel = new JLabel("Score : 0");
|
scoreLabel = new JLabel("Score : 0");
|
||||||
timeLabel = new JLabel("Temps : 0s");
|
timeLabel = new JLabel("Temps : 0s");
|
||||||
|
|
||||||
JPanel top = new JPanel(new GridLayout(2, 1));
|
JLabel titleLabel = new JLabel("Sauver Michel!!", SwingConstants.CENTER);
|
||||||
top.add(buildTopLine(wordLabel, scoreLabel));
|
titleLabel.setFont(new Font("Arial", Font.BOLD, 22));
|
||||||
top.add(buildTopLine(triedLabel, timeLabel));
|
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);
|
||||||
frame.add(top, BorderLayout.NORTH);
|
frame.add(top, BorderLayout.NORTH);
|
||||||
|
|
||||||
JPanel bottom = new JPanel(new BorderLayout(8, 8));
|
JPanel bottom = new JPanel(new BorderLayout(8, 8));
|
||||||
@@ -224,3 +232,4 @@ public class GameUI {
|
|||||||
JOptionPane.showMessageDialog(frame, msg);
|
JOptionPane.showMessageDialog(frame, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -9,9 +9,11 @@
|
|||||||
- Lecture de mots depuis un **fichier externe** (`bibliothèque/mots.txt`)
|
- Lecture de mots depuis un **fichier externe** (`bibliothèque/mots.txt`)
|
||||||
- Validation des entrées (une seule LETTRE à la fois)
|
- Validation des entrées (une seule LETTRE à la fois)
|
||||||
- Bouton **“Nouvelle partie”** pour rejouer sans relancer le programme
|
- Bouton **“Nouvelle partie”** pour rejouer sans relancer le programme
|
||||||
|
- Bouton **“Quitter”** pour quitter le programme
|
||||||
|
- Bouton **“Menu”** pour retourner à la page menu et pouvoir rechoisir le niveau de difficulté
|
||||||
- Messages de victoire / défaite
|
- Messages de victoire / défaite
|
||||||
- Score + Chronomètre en direct
|
- Score + Chronomètre en direct
|
||||||
- Sélection du niveau dans le menu avant de jouer
|
- Sélection du niveau dans le menu avant de jouer (Facile, Moyen, Difficile)
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user