Changing Direction???
in
Programming Questions
•
1 year ago
Anyone able to make the lines go back when the reach the right edge and go forward when they reach the left again? Please and Thanks
int endX = 0;
void setup() {
size(200, 200);
frameRate (10);
endX = (0);
}
void draw() {
background (255);
stroke(0);
for (int x = 0; x < endX; x+=10) {
line(x, 0, x, height);
}
endX +=10;
if (endX > height) {
endX = 0;
}
}
int endX = 0;
void setup() {
size(200, 200);
frameRate (10);
endX = (0);
}
void draw() {
background (255);
stroke(0);
for (int x = 0; x < endX; x+=10) {
line(x, 0, x, height);
}
endX +=10;
if (endX > height) {
endX = 0;
}
}
1