création admin pour avoir Cheat Code
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user