modif génération bonus malus pour qu'il soit plus fréquents
This commit is contained in:
@@ -47,6 +47,9 @@ public class CampagneAutoroute {
|
|||||||
jeu.score = 0;
|
jeu.score = 0;
|
||||||
jeu.labScore.setText("<html><h3 style='color:white;'>score : 0</h3></html>");
|
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.layout.show(jeu.conteneurPrincipal, "JEU");
|
jeu.layout.show(jeu.conteneurPrincipal, "JEU");
|
||||||
jeu.ecran.setFocusable(true);
|
jeu.ecran.setFocusable(true);
|
||||||
jeu.ecran.requestFocusInWindow();
|
jeu.ecran.requestFocusInWindow();
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ public class CampagneEspace {
|
|||||||
jeu.score = 0;
|
jeu.score = 0;
|
||||||
jeu.labScore.setText("<html><h3 style='color:white;'>LUNE - score : 0</h3></html>");
|
jeu.labScore.setText("<html><h3 style='color:white;'>LUNE - score : 0</h3></html>");
|
||||||
|
|
||||||
|
jeu.prochainBonusScore = 100 + jeu.random.nextInt(26);
|
||||||
|
jeu.prochainMalusScore = 100 + jeu.random.nextInt(26);
|
||||||
|
|
||||||
jeu.layout.show(jeu.conteneurPrincipal, "JEU");
|
jeu.layout.show(jeu.conteneurPrincipal, "JEU");
|
||||||
jeu.ecran.setFocusable(true);
|
jeu.ecran.setFocusable(true);
|
||||||
jeu.ecran.requestFocusInWindow();
|
jeu.ecran.requestFocusInWindow();
|
||||||
|
|||||||
@@ -45,6 +45,9 @@ public class CampagneOcean {
|
|||||||
jeuPrincipal.score = 0;
|
jeuPrincipal.score = 0;
|
||||||
jeuPrincipal.labScore.setText("<html><h3 style='color:white;'>Oxygène : 0</h3></html>");
|
jeuPrincipal.labScore.setText("<html><h3 style='color:white;'>Oxygène : 0</h3></html>");
|
||||||
|
|
||||||
|
jeuPrincipal.prochainBonusScore = 100 + jeuPrincipal.random.nextInt(26);
|
||||||
|
jeuPrincipal.prochainMalusScore = 100 + jeuPrincipal.random.nextInt(26);
|
||||||
|
|
||||||
jeuPrincipal.layout.show(jeuPrincipal.conteneurPrincipal, "JEU");
|
jeuPrincipal.layout.show(jeuPrincipal.conteneurPrincipal, "JEU");
|
||||||
jeuPrincipal.ecran.setFocusable(true);
|
jeuPrincipal.ecran.setFocusable(true);
|
||||||
jeuPrincipal.ecran.requestFocusInWindow();
|
jeuPrincipal.ecran.requestFocusInWindow();
|
||||||
|
|||||||
@@ -166,8 +166,8 @@ public class Jeu implements KeyListener, ActionListener {
|
|||||||
score = 0;
|
score = 0;
|
||||||
labScore.setText("<html><h3>score : 0</h3></html>");
|
labScore.setText("<html><h3>score : 0</h3></html>");
|
||||||
|
|
||||||
this.prochainBonusScore = 50 + random.nextInt(101);
|
this.prochainBonusScore = 100 + random.nextInt(26);
|
||||||
this.prochainMalusScore = 100 + random.nextInt(101);
|
this.prochainMalusScore = 100 + random.nextInt(26);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -187,7 +187,7 @@ public class Jeu implements KeyListener, ActionListener {
|
|||||||
Bonus bonus = new Bonus(xSpawn, yBonus, laligne.vitesseDefilement);
|
Bonus bonus = new Bonus(xSpawn, yBonus, laligne.vitesseDefilement);
|
||||||
ecran.ajouterObjet(bonus);
|
ecran.ajouterObjet(bonus);
|
||||||
|
|
||||||
this.prochainBonusScore = score + 50 + random.nextInt(101);
|
this.prochainBonusScore = score + 40 + random.nextInt(21);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,7 +202,7 @@ public class Jeu implements KeyListener, ActionListener {
|
|||||||
Malus malus = new Malus(xSpawn, yMalus, laligne.vitesseDefilement);
|
Malus malus = new Malus(xSpawn, yMalus, laligne.vitesseDefilement);
|
||||||
ecran.ajouterObjet(malus);
|
ecran.ajouterObjet(malus);
|
||||||
|
|
||||||
this.prochainMalusScore = score + 100 + random.nextInt(101);
|
this.prochainMalusScore = score + 40 + random.nextInt(21);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user