update:Boule
This commit is contained in:
@@ -39,10 +39,17 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
private int meilleurSansCompte = 0;
|
||||
private int mortsSansCompte = 0;
|
||||
private int tempsSansCompteSec = 0;
|
||||
private int niveauMaxAtteintSansCompte = 1;
|
||||
private long debutPartieMs = 0;
|
||||
private boolean immortel = false;
|
||||
private final boolean modeCampagne;
|
||||
|
||||
private void mettreAJourNiveauMaxSansCompte(int niveau) {
|
||||
if (idCompte <= 0) {
|
||||
niveauMaxAtteintSansCompte = Math.max(niveauMaxAtteintSansCompte, niveau);
|
||||
}
|
||||
}
|
||||
|
||||
private int meilleurActuel() {
|
||||
return idCompte > 0 ? db.getMeilleurScoreParCompte(idCompte) : meilleurSansCompte;
|
||||
}
|
||||
@@ -53,6 +60,7 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
}
|
||||
return "💀 Nombre de morts: " + mortsSansCompte
|
||||
+ "\n⏱️ Temps total: " + tempsSansCompteSec + "s"
|
||||
+ "\n📈 Niveau max atteint: " + niveauMaxAtteintSansCompte
|
||||
+ "\n🏆 Meilleur score: " + meilleurSansCompte;
|
||||
}
|
||||
|
||||
@@ -78,6 +86,7 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
this.idCompte = idCompte;
|
||||
this._niv = niveau;
|
||||
this.modeCampagne = modeCampagne;
|
||||
mettreAJourNiveauMaxSansCompte(_niv);
|
||||
labScore = new JLabel();
|
||||
labScore.setText("<html><h3>score : 0</h3></html>");
|
||||
|
||||
@@ -260,6 +269,7 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
meilleurSansCompte = 0;
|
||||
mortsSansCompte = 0;
|
||||
tempsSansCompteSec = 0;
|
||||
niveauMaxAtteintSansCompte = Math.max(1, _niv);
|
||||
} else {
|
||||
idCompte = db.getIdParPseudo(choix);
|
||||
}
|
||||
@@ -444,6 +454,7 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
}
|
||||
|
||||
_niv = nouveauNiveau;
|
||||
mettreAJourNiveauMaxSansCompte(_niv);
|
||||
resetLevel();
|
||||
return;
|
||||
}
|
||||
@@ -509,6 +520,7 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
int nouveauNiveau = choisirNouveauNiveau();
|
||||
if (nouveauNiveau > 0) {
|
||||
_niv = nouveauNiveau;
|
||||
mettreAJourNiveauMaxSansCompte(_niv);
|
||||
resetLevel();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user