I have this piece of code where i am trying to move an object i.e three dots created by a for loop and i want to move the dots when mouse is pressed eg. Move the dots like dot++.If anyone can help me it would be great\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
int dotX=0;
int dotY=0;
int Radius=25;
And now to the code if i press the mouse and want to shift the circles to line up in the x axis///////If mousePresssed the circles should face the width and start moving towards the width in a straight line.
int dotX=0;
int dotY=0;
int Radius=25;
void setup() {
size(700, 700);
dotX=Radius/2;
dotY=height/2;
}
void draw() {
background(200);
// if (mousePressed) {
// dotX = (dotX+5) % (width-(Radius/2));
// }
for (int i=0; i<3; i++) {
circle(dotX, dotY+Radius*i, Radius);
}
}