ajout score

ajout score
This commit is contained in:
2026-02-23 09:58:09 +01:00
parent 78ca42a0b4
commit 06a3809148

View File

@@ -47,12 +47,13 @@ public class Jeu implements KeyListener, ActionListener{
//-------------------------------------------------------------------------
public Jeu(){
// Gestion du score : a réactiver en fin de TP, inutile au début
/*
labScore = new JLabel();
labScore.setForeground(Color.WHITE);
labScore.setText("<html><h3>score : 0</h3></html>");
labScore.setBounds(20, 0, 200, 50);
ecran.add(labScore);
*/
ecran.traiterBoucleAnimation();
}
@@ -148,7 +149,8 @@ public class Jeu implements KeyListener, ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
ecran.traiterBoucleAnimation();
score = score + 0.4;
labScore.setText("<html><h3>score : " + (int)score + "</h3></html>");
if (demiCercleArriere.EnCollision(lili.SegCourant))
RecommencerPartie();
}