safe zone pour chaque niveau

This commit is contained in:
2026-03-04 14:21:44 +01:00
parent 263711cff3
commit 853dc5a940

View File

@@ -54,19 +54,24 @@ public class Ligne extends ObjetGraphique{// Hérite de la classe ObjetGraphique
Segment s = new Segment(x, y, dx, dy);
listSegments.add(s);
for (int i=1; i<nbSegments; i++) {
dx = (Math.random()*20)+80;
dy = (Math.random() * (2.0 * inclinaisonMax)) - inclinaisonMax;
for (int i = 1; i < nbSegments; i++) {
dx = (Math.random() * 20) + 80;
if (y + dy < 0 || y + dy > 600) {
dy = -dy;
if (i <= 5) {
dy = 0;
} else {
dy = (Math.random() * (2.0 * inclinaisonMax)) - inclinaisonMax;
if (y + dy < 0 || y + dy > 600) {
dy = -dy;
}
}
s = new Segment(x,y,dx,dy);
s.setCouleur(new Color(0.2f,0.2f,0.2f));
s = new Segment(x, y, dx, dy);
s.setCouleur(new Color(0.2f, 0.2f, 0.2f));
x+=dx;
y+=dy;
x += dx;
y += dy;
listSegments.add(s);
}
}