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);
|
||||
listSegments.add(s);
|
||||
|
||||
for (int i=1; i<nbSegments; i++) {
|
||||
dx = (Math.random()*20)+80;
|
||||
for (int i = 1; i < nbSegments; i++) {
|
||||
dx = (Math.random() * 20) + 80;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user