Hello everyone thanks for the add.I’m totally newbie to Processing & I tried to create my first code who works as a magic trick.
I have several conditions in my code in order to help me to guess a number within the several pictures I show to my spectator one by one. If he says he can see the number he’s thinking about, I click the mouse’s Right bouton, otherwise I click the left one and i’m able to guess the number he thought about at the end…
My problem, how can I have my conditions executed one after the other , how Can I pause between each condition and at the end of my code to reveal the number and Get my "voilà "?
Thanks a lot for your help
int nombre=0;
PImage img1;
PImage img2;
PImage img4;
PImage img8;
PImage img16;
PImage img32;
void setup() {
size(640, 360);
img1 = loadImage(“clé1.jpg”);
img2 = loadImage(“clé2.jpg”);
img4 = loadImage(“clé4.jpg”);
img8 = loadImage(“clé8.jpg”);
img16 = loadImage(“clé16.jpg”);
img32 = loadImage(“clé32.jpg”);;// Load the image into the program
}
void draw() {
// Displays the image at its actual size at point (0,0)
image(img32, 0,0);print(nombre);
if (mouseButton == RIGHT) {loop ();nombre = nombre +32;}
else if (mouseButton == LEFT) {loop ();nombre = nombre +0;}
if (mouseButton == RIGHT) {clear();image(img16, 0,0);nombre= nombre+8;}
else if (mouseButton == LEFT) {clear();image(img16, 0,0);}
if (mouseButton == RIGHT) {clear();image(img4, 0,0);nombre= nombre+16;}
else if (mouseButton == LEFT) {clear();image(img4, 0,0);}
if (mouseButton == RIGHT) {clear();image(img2, 0,0);nombre= nombre+4;}
else if (mouseButton == LEFT) {clear();image(img2, 0,0);}
if (mouseButton == RIGHT) {clear();image(img1, 0,0);nombre= nombre+2;}
else if (mouseButton == LEFT) {clear();image(img1, 0,0);}