ajout du score et nombre de lignes supprimés dans la vue + vue gameover

This commit is contained in:
ROGER
2025-05-20 12:38:23 +02:00
parent e93b1cfb64
commit abd6ae07c8
4 changed files with 84 additions and 5 deletions

View File

@@ -26,13 +26,13 @@ public class VueBandeauControle extends JPanel implements Observer {
// setPreferredSize();
// SCORE
scoreLabel = new JLabel("SCORE : 0");
scoreLabel = new JLabel("SCORE : " + jeu.getGrille().getScore());
scoreLabel.setForeground(Color.white);
scoreLabel.setFont(new Font("Arial", Font.PLAIN, 16));
scoreLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
// NB LIGNE
nbLigneLabel = new JLabel("LIGNES : 0");
nbLigneLabel = new JLabel("LIGNES : "+ jeu.getGrille().getNbLignesSupprimees());
nbLigneLabel.setForeground(Color.white);
nbLigneLabel.setFont(new Font("Arial", Font.PLAIN, 16));
nbLigneLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
@@ -133,8 +133,9 @@ public class VueBandeauControle extends JPanel implements Observer {
public void update(Observable o, Object arg) {
if (o instanceof Jeu) {
afficherPieceSuivante(jeu.getPieceSuivante());
// TODO : setScore ??
setScore(jeu.getGrille().getScore());
nbLigneLabel.setText("LIGNES : " + jeu.getGrille().getNbLignesSupprimees());
scoreLabel.setText("SCORE : " + jeu.getGrille().getScore());
}
}
}