Moving Diagonal Lines
in
Programming Questions
•
8 months ago
Hello, i'm pretty new to processing and have been reading some material but I can't get my head around this. I hope this is the correct section to post in. I'm guessing this problem has a pretty simple solution that I am missing.
How can I draw diagonal lines in both directions instead of moving downwards as shown in the code below?
int endY;
void setup() {
size(200,200);
frameRate(5);
endY = 0;
}
void draw() {
background(255);
for (int y = 0; y < endY; y+=10) {
stroke(0);
line(0,y,width,y);
}
endY += 10;
if (endY > height) {
endY = 0;
}
}
1