Continuous Dynamic Wave / Track - HELP
in
Programming Questions
•
1 year ago
HEY!
I'm trying to make a continuous wave using line(). The line will serve as a dynamic track that the user will be able to create on the fly as a ball continuously rolls through it. The problem I'm having is getting the track to stick on the background rect() as it moves left. I tried using opacity but once a new line is created the old one doesn't stick. Would anyone be able to help me here?
int mouseXOld;
int mouseYOld;
int rectX = 600;
void setup() {
size(600, 400);
noStroke();
background(0);
//frameRate(30);
}
void draw() {
rectX--;
fill(0, 0, 0, 1000);
rect(rectX, 0, 600, 400);
stroke(255);
line(mouseXOld, mouseYOld, mouseX, mouseY);
mouseXOld = mouseX;
mouseYOld = mouseY;
}
I don't have much code here but I plan to make the lines X values static at 600 or so. I think I'm explaining it like a retard so if anyone has any questions...
I'm trying to make a continuous wave using line(). The line will serve as a dynamic track that the user will be able to create on the fly as a ball continuously rolls through it. The problem I'm having is getting the track to stick on the background rect() as it moves left. I tried using opacity but once a new line is created the old one doesn't stick. Would anyone be able to help me here?
int mouseXOld;
int mouseYOld;
int rectX = 600;
void setup() {
size(600, 400);
noStroke();
background(0);
//frameRate(30);
}
void draw() {
rectX--;
fill(0, 0, 0, 1000);
rect(rectX, 0, 600, 400);
stroke(255);
line(mouseXOld, mouseYOld, mouseX, mouseY);
mouseXOld = mouseX;
mouseYOld = mouseY;
}
I don't have much code here but I plan to make the lines X values static at 600 or so. I think I'm explaining it like a retard so if anyone has any questions...
1