I'm working on an interactive collage and I'm stuck on a problably simple problem.
I have 10 background, 10 images of men and 10 of woman and I'd like to just pick randomly one when you click in a zone.
To select randomly I write that :
void mouseClicked() {
background(255);
randImg = random(0,fondbg-1);
image(fond[(int)randImg], 0, 0);
randImg = random(0,femmedroite-1);
image(femme1[(int)randImg], 0, 0);
randImg = random(0,femmegauche-1);
image(femme[(int)randImg], 0, 0);
}
So it works but it changes each time all the three images, and I'd like to assign zone for changing them (click on top it changes background, left > first character, right > second character).
So I write put condition like that : if (mouseY>200 && mouseX>0 && mouseX<300)
But it surimpose images if I delete background(255); or it only display one part of the composition if I let it (background OR character1 OR character2)
I'm looking for an easy solution but I can't find it. Do you have an idea of how to proceed ?