draw function and background
in
Programming Questions
•
1 year ago
Ok, I have a feeling the solution to my problem is going to be a lot easier than I think it is, but I am new to programming and was wondering if someone would be kind enough to help me through my confusion.
Here's a basic idea of my problem. I would like the lines in this program to behave the same way they do right now, while also being able to utilize the background function that's commented out.
- int newStroke = 1;
- int x = 100;
- void setup () {
- size (400, 400);
- background (255);
- frameRate (15);
- smooth ();
- }
- void draw () {
- //background (255);
- line (x, 100, x - 30, 300);
- x += 10;
- if (x > 300) {
- x = 100;
- strokeWeight (newStroke ++);
- }
- if (newStroke >= 13) {
- noLoop ();
- }
- }
1