hi, i am trying to make my array of ellipses rotate continually when the mouse is clicked but am not sure how to do it, can someone please help!?
//aray multiple variables
int dotCount = 10;
float[] xn = new float [dotCount];
float[] yn = new float [dotCount];
//changes speed of ellipses
float[] s = new float [dotCount];
void setup(){
size(500,500);
smooth();
//loop that continusly puts random numbers into the 'boxes' in the arays. saves
//time then putting them in one at a time.
int i = 0;
while (i < dotCount){
xn[i] = random (500);
yn[i] = random (500);
s[i] = random (5);
i = i + 1; }
}
void draw(){
background (255);
int i = 0;
while (i < dotCount){
ellipse (xn[i], yn[i], 20,20);
// makes ellipses move
xn[i] = xn[i]+s[i];
//makes them keep going accross page.
if (xn[i] > 500){
xn[i] = 0;}
i = i + 1; }
}
1