From b01bad04604e653d4db7c7b70848343a3fc665cc Mon Sep 17 00:00:00 2001 From: Constant Date: Sat, 7 Feb 2026 13:29:27 +0100 Subject: [PATCH] init 9: Affichage ligne de jeu --- linea/linea/Ligne.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/linea/linea/Ligne.java b/linea/linea/Ligne.java index 7568a6a..9f6a429 100644 --- a/linea/linea/Ligne.java +++ b/linea/linea/Ligne.java @@ -70,8 +70,12 @@ public class Ligne extends ObjetGraphique{// Hérite de la classe ObjetGraphique if(SegCourant == null){ if( (xCercle >= s.x) && ( xCercle <= (s.x + s.xLong) ) ){ this.SegCourant = s; - }else{ - // Fin itération : rien ne se passe + } + }else{ + if( (this.SegCourant.x + this.SegCourant.xLong) < xCercle ){ + if( (s.x <= xCercle) && ((s.x + s.xLong) >= xCercle) ){ + this.SegCourant = s; + } } } }