modif nb segments + y spwan + frequence spawn
This commit is contained in:
@@ -47,8 +47,8 @@ public class CampagneAutoroute {
|
||||
jeu.score = 0;
|
||||
jeu.labScore.setText("<html><h3 style='color:white;'>score : 0</h3></html>");
|
||||
|
||||
jeu.prochainBonusScore = 100 + jeu.random.nextInt(26);
|
||||
jeu.prochainMalusScore = 100 + jeu.random.nextInt(26);
|
||||
jeu.prochainBonusScore = 100 + jeu.random.nextInt(36);
|
||||
jeu.prochainMalusScore = 100 + jeu.random.nextInt(46);
|
||||
|
||||
jeu.layout.show(jeu.conteneurPrincipal, "JEU");
|
||||
jeu.ecran.setFocusable(true);
|
||||
|
||||
@@ -56,9 +56,9 @@ public class GestionnaireBDD {
|
||||
|
||||
// Insertion des valeurs de difficulté par défaut
|
||||
// On utilise INSERT OR REPLACE pour mettre à jour les valeurs si elles existent déjà
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (1, 6, 20, 50);");
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (2, 7, 45, 65);");
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (3, 8, 60, 80);");
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (1, 6, 20, 35);");
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (2, 7, 45, 50);");
|
||||
stmt.execute("INSERT OR REPLACE INTO difficultes (id_difficulte, vitesse, pente, segments) VALUES (3, 8, 60, 85);");
|
||||
|
||||
} catch (SQLException e) {
|
||||
System.out.println("Erreur lors de l'initialisation de la base de données : " + e.getMessage());
|
||||
|
||||
@@ -166,8 +166,8 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
score = 0;
|
||||
labScore.setText("<html><h3>score : 0</h3></html>");
|
||||
|
||||
this.prochainBonusScore = 100 + random.nextInt(26);
|
||||
this.prochainMalusScore = 100 + random.nextInt(26);
|
||||
this.prochainBonusScore = 100 + random.nextInt(36);
|
||||
this.prochainMalusScore = 100 + random.nextInt(46);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -181,13 +181,13 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
double yLigne = laligne.getHauteurLigneA(xSpawn);
|
||||
|
||||
if (yLigne != -1) {
|
||||
double yOffset = random.nextBoolean() ? -30 : 30;
|
||||
double yOffset = random.nextBoolean() ? -40 : 40;
|
||||
double yBonus = yLigne + yOffset;
|
||||
|
||||
Bonus bonus = new Bonus(xSpawn, yBonus, laligne.vitesseDefilement);
|
||||
ecran.ajouterObjet(bonus);
|
||||
|
||||
this.prochainBonusScore = score + 40 + random.nextInt(21);
|
||||
this.prochainBonusScore = score + 40 + random.nextInt(31);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,13 +196,13 @@ public class Jeu implements KeyListener, ActionListener {
|
||||
double yLigne = laligne.getHauteurLigneA(xSpawn);
|
||||
|
||||
if (yLigne != -1) {
|
||||
double yOffset = random.nextBoolean() ? -30 : 30;
|
||||
double yOffset = random.nextBoolean() ? -40 : 40;
|
||||
double yMalus = yLigne + yOffset;
|
||||
|
||||
Malus malus = new Malus(xSpawn, yMalus, laligne.vitesseDefilement);
|
||||
ecran.ajouterObjet(malus);
|
||||
|
||||
this.prochainMalusScore = score + 40 + random.nextInt(21);
|
||||
this.prochainMalusScore = score + 60 + random.nextInt(41);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user