safe zone pour chaque niveau
This commit is contained in:
@@ -54,19 +54,24 @@ public class Ligne extends ObjetGraphique{// Hérite de la classe ObjetGraphique
|
|||||||
Segment s = new Segment(x, y, dx, dy);
|
Segment s = new Segment(x, y, dx, dy);
|
||||||
listSegments.add(s);
|
listSegments.add(s);
|
||||||
|
|
||||||
for (int i=1; i<nbSegments; i++) {
|
for (int i = 1; i < nbSegments; i++) {
|
||||||
dx = (Math.random()*20)+80;
|
dx = (Math.random() * 20) + 80;
|
||||||
|
|
||||||
|
if (i <= 5) {
|
||||||
|
dy = 0;
|
||||||
|
} else {
|
||||||
dy = (Math.random() * (2.0 * inclinaisonMax)) - inclinaisonMax;
|
dy = (Math.random() * (2.0 * inclinaisonMax)) - inclinaisonMax;
|
||||||
|
|
||||||
if (y + dy < 0 || y + dy > 600) {
|
if (y + dy < 0 || y + dy > 600) {
|
||||||
dy = -dy;
|
dy = -dy;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
s = new Segment(x,y,dx,dy);
|
s = new Segment(x, y, dx, dy);
|
||||||
s.setCouleur(new Color(0.2f,0.2f,0.2f));
|
s.setCouleur(new Color(0.2f, 0.2f, 0.2f));
|
||||||
|
|
||||||
x+=dx;
|
x += dx;
|
||||||
y+=dy;
|
y += dy;
|
||||||
listSegments.add(s);
|
listSegments.add(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user