changement sur le mode de triche

This commit is contained in:
2026-03-16 16:57:51 +01:00
parent f8cf66f731
commit 4ed51ead51
2 changed files with 12 additions and 0 deletions

View File

@@ -245,6 +245,13 @@ public class Jeu implements KeyListener, ActionListener{
this.ecran.repaint(); // 3. Forcer l'affichage du texte
GestionBDD.ajouterScore((int)this.score);// enregistrement du score dans la base de donne
} else if (this.modeTriche && this.laLigne.getSegCourant() != null) {
// En mode triche, forcer le cercle à rester sur la ligne
double yPoint = this.laLigne.SegCourant.y + (this.laLigne.SegCourant.yLong / this.laLigne.SegCourant.xLong) * (this.demiCercleAvant.x - this.laLigne.SegCourant.x);
this.demiCercleAvant.y = yPoint;
this.demiCercleArriere.y = yPoint;
this.demiCercleAvant.resetVitesse();
this.demiCercleArriere.resetVitesse();
}
}