This commit is contained in:
Simoes Lukas
2025-11-06 15:20:51 +01:00
parent 9b1257f3da
commit c730f07c1b
13 changed files with 874 additions and 8 deletions

View File

@@ -24,7 +24,7 @@ public class JGrilleDeJeu extends JComponent {
this.controleur = new ControleurClavier();
this.fenetre.addKeyListener(controleur);
this.directionActuelle = "Right";
this.intervalleTimer = 500;
this.intervalleTimer = 150;
Random r = new Random();
int coordXPomme = Math.abs(r.nextInt() % TAILLE_GRILLE);
@@ -145,13 +145,6 @@ public class JGrilleDeJeu extends JComponent {
}
this.coordSnake.addFirst(aAjouter);
this.coordSnake.addFirst(coordQueue);
if (this.intervalleTimer != 200) {
this.intervalleTimer -= 50;
this.timer.cancel();
this.timer = new Timer();
this.timer.scheduleAtFixedRate(new TacheTimer(this), 0, this.intervalleTimer);
}
}
try {