i`m new to processing and i`m trying some test to create a moving box with a path beside the box.. the box will move according to the mouse position and a line will follow the path that the mouse took. the moving box is done, but the line i created is also refreshed with the box.. is there any help with this?
this is my code so far,
-
int pki = 200;
void setup(){size(1200, 600);background(126);}
void draw(){background(126); //refresh background//create box with respect to mouse movementstroke(0);fill(255);rect(mouseX, mouseY, 5, 5);//line detectorstroke(255, 0, 0);line((pmouseX-pki), pmouseY, (mouseX-pki), mouseY);}
thank you..
1