création admin pour avoir Cheat Code

This commit is contained in:
2026-03-27 09:57:12 +01:00
parent 4551f8bf62
commit 0c1aa718b8
2 changed files with 17 additions and 2 deletions

View File

@@ -37,6 +37,8 @@ public class Jeu implements KeyListener, ActionListener {
protected String identifiantUtilisateurConnecte;
public int idCampagneActive = 0;
public int difficulteActive = 0;
public boolean modeInvincible = false;
public Jeu() {
score = 0;
@@ -97,6 +99,8 @@ public class Jeu implements KeyListener, ActionListener {
public void setUtilisateurConnecte(int id, String identifiant) {
this.utilisateurIdConnecte = id;
this.identifiantUtilisateurConnecte = identifiant;
this.modeInvincible = bdd.estAdmin(id);
}
public void afficherLeaderboard() {
@@ -253,7 +257,7 @@ public class Jeu implements KeyListener, ActionListener {
// calcule de la distance entre le centre du cercle et la ligne
double distance = Math.abs(hauteurLigne - demiCercleAvant.getY());
if (distance > demiCercleAvant.getRayon()) {
gameOver();
if (!modeInvincible) gameOver();
}
} else {
victoire();