Hey guys, I’m new here to the forums and processing.
For school I’m trying to create a quiz that makes a shape based on your answers.
I want to have around 4 questions with just two answers.
Now what I can’t seem to figure out is how to have the questions change.
Here is what I have so far.
int q=1;
int l=0;
PFont font;
void setup() {
size (1600, 800);
font = loadFont ("Futura.vlw");
textFont(font);
rect(800, 0, 1600, 1600);
}
void draw() {
fill(255);
rect(0, 0, 800, 400); // question panel
rect(0, height/2, 400, 400);//left box
rect(400, height/2, 400, 400);//right box
rect(800, 800, 1600, 1600); //Drawscape
fill(0);
textSize(32);
//QUESTION1
if (q==1) text("Ik zie mijzelf als sociaal", 200, 200);
if (q==1) text("ja", 200, 600);
if (q==1) text("nee", 600, 600);
if (q==1) strokeWeight(5);
if (q==1) fill(255);
//QUESTION2
if (q==2) text("Ik wil graag op vakantie", 200, 200);
if (q==2) text("ja", 200, 600);
if (q==2) text("nee", 600, 600);
if (q==2) strokeWeight(5);
}
void mousePressed() {
if (mousePressed && mouseX > 0 && mouseX < (0 + 400) && mouseY > 400 && mouseY < (400 + 400))
line (1100, 200, 1200, 100);
if (mousePressed && mouseX > 0 && mouseX < (0 + 400) && mouseY > 400 && mouseY < (400 + 400))
q++;
if (mousePressed && mouseX > 400 && mouseX < (400 + 400) && mouseY > 400 && mouseY < (400 + 400))
line (1300, 200, 1200, 100);
if (mousePressed && mouseX > 400 && mouseX < (400 + 400) && mouseY > 400 && mouseY < (400 + 400))
q++;
}
Help would be appreciated guys!
Cheers,
juriaan