Adding increase difficulty
This commit is contained in:
@@ -147,7 +147,22 @@ public class Jeu implements KeyListener, ActionListener{
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ecran.traiterBoucleAnimation();
|
||||
if (ecran.aCollision()) {
|
||||
resetLevel();
|
||||
if (horloge != null) horloge.stop();
|
||||
int finalScore = (int) score;
|
||||
Object[] options = {"Relancer", "Quitter"};
|
||||
int choix = javax.swing.JOptionPane.showOptionDialog(null,
|
||||
"Perdu\nScore : " + finalScore,
|
||||
"Perdu",
|
||||
javax.swing.JOptionPane.DEFAULT_OPTION,
|
||||
javax.swing.JOptionPane.INFORMATION_MESSAGE,
|
||||
null,
|
||||
options,
|
||||
options[0]);
|
||||
if (choix == 0) { // Relancer
|
||||
resetLevel();
|
||||
} else {
|
||||
System.exit(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
score+=(0.05+(0.05*horloge.getDelay()/100.0));
|
||||
|
||||
Reference in New Issue
Block a user