PImage [] arrChoices =new PImage[imgNum];
PImage[] arrImgGears = new PImage[0];
int startValue=0;
int [] arrCenterX = new int[0];
int [] arrCenterY = new int[0];
int randomNum;
void setup()
{
size(1000, 800);
Choices();
}
void draw()
{
background(255);
for (int i=0; i<arrCenterX.length; i++)
{
image(arrImgGears[i], arrCenterX[i], arrCenterY[i]);
}
}
void Choices()
{
for (int i=0; i<arrChoices.length; i++)
{
arrChoices[i]= loadImage("gear"+(i+1)+".png");
}
}
void mousePressed()
{
randomNum=int(random(0,3));
arrImgGears= (PImage[])append(arrImgGears, arrChoices[randomNum]);
arrCenterX = append(arrCenterX, mouseX);
arrCenterY = append(arrCenterY, mouseY);
}