To be honest i am just confused about how to put this idea in the actual processing program. In this code i posted the text again but divided in different stages. When is clicked it pass from text 1 to text 4,5,6,7,8,9,12,13,14,15,16,17 and 18 with the star but still some choices are left out , and I cannot activate the choices as individuals.
Here is the zip of the file:
https://www.dropbox.com/s/bq5w2n85r07sv5v/Bea%20Koppers_actual_coding_of_final_project.zip?dl=0
The actual coding at the moment is this one:
General stage 0:
import processing.video.*;
import ddf.minim.*;
import ddf.minim.analysis.*;
import ddf.minim.effects.*;
import ddf.minim.signals.*;
import ddf.minim.spi.*;
import ddf.minim.ugens.*;
Minim minim;
AudioPlayer sound;
int state = 0;
int stage = 0;
String text1="Hello!";
String text2="...";
String text3="Hello~";
String text4="Did i catch you attention?";
String text5="Are you male or female?";
String text6="Male";
String text7="Female!";
String text8="None of the above";
String text9="Did you know that everyone shares something in common?";
String text10="All are humans";
String text11="Do you live or exist?";
String text12="Live";
String text13="Exist";
String text14="Live is being in the moment here and now";
String text15="Even if you exist will not have any meaning if you don't live";
String text16="So I propose you to do some challenge";
String text17="Light your own star of life";
String text18="This will consist in three challenges related to 3 colours that combined together will light your star";
String text19="Red";
String text20="Try to find someone who have something red and show it to the screen";
String text21="Blue";
String text22="Try to find someone who have something blue and show it to the screen";
String text23="Green";
String text24="Try to find someone who have something green and show it to the screen";
String text25= "Now all the colours put together creates a light";
String text26="And with the light the star will shine";
String[] questions;
boolean[] picked;
int picked_count = 0;
int value = 0;
float X;
float Y;
//PImage prism (not used at the moment)
void setup() {
size(1000, 1000);
state = 0;
draw_stage2();
minim = new Minim(this);
sound = minim.loadFile("canbebetter.mp3");
sound.setGain(-20);
sound.play(0);
}
void draw() {
background(250);
fill(0);
if (state == 0) {
text (text1, 500,400);
textSize (45);
textAlign(CENTER);
tint(value);
text(text1,0,0);;}
if (state == 1) {
text (text2,500,300);
textSize (45);
text(text3,500,400);
textSize (20);
textAlign(CENTER); }
if (state == 2) {
text (text4,500,300);
textSize (20);
textAlign(CENTER);
}
if (state == 3) {
text (text5,500,300);
textSize (20);
textAlign(CENTER);}
if (state == 4) {
text (text6,500,200);
text(text7,500,300);
text(text8,500,400);
textSize (20);
textAlign(CENTER);}
if (state == 5) {
text (text9,500,200);
textSize (20);
textAlign(CENTER);}
if (state == 6) {
text (text10,500,200);
textSize (20);
textAlign(CENTER);}
if (state == 7) {
text (text11,500,200);
textSize (20);
textAlign(CENTER);}
if (state == 8) {
text (text12,500,200);
text (text13,500,300);
textSize (20);
textAlign(CENTER);}
if (state == 9) {
text (text14,500,200);
textSize (20);
textAlign(CENTER);}
if (state == 10) {
text (text15,500,200);
textSize (20);
textAlign(CENTER);}
if (state == 11) {
text (text16,500,200);
text (text17,500,300);
textSize (20);
textAlign(CENTER);}
if (state == 12) {
text (text18,500,200);
textSize (15);
{
if (stage == 1) {
draw_stage1();
}else if (stage == 2) {
draw_stage2();
}else if (stage == 3) {
draw_stage3();
}else if (stage == 4) {
draw_stagend4();
}
}
}
}
void mouseClicked() {
state++;
for (int i = 5; i < 95; i += 5){
if (state == 0 ==true) {
state = 1;}
if (i < 500) {
//star
{ pushMatrix();
translate(mouseX,mouseY);
scale(1.5);
noStroke();
beginShape();
vertex(0, -50);
vertex(14, -20);
vertex(47, -15);
vertex(23, 7);
vertex(29, 40);
vertex(0, 25);
vertex(-29, 40);
vertex(-23, 7);
vertex(-47, -15);
vertex(-14, -20);
endShape(CLOSE);
popMatrix();
}
} else {
text(text4,500,400);
textSize (20);
textAlign(CENTER);(i)= 0;
}
}
if (state == 0) {
state = 1;}
if (state == 1) {
state = 2;}
for (int i = 5; i < 0; i += 5){
if (i< 500) {
}
//if (mouseX>500 && mouseX<400 && mouseY>500 && mouseY<400){state = 2;}
// }
if (state == 2) {
// if (mouseX>700 && mouseX<500 && mouseY>400 && mouseY<200){state = 2;}
state = 3;}
if (state == 3) {
state = 4;}
if (state == 4) {
state = 5;}
if (state == 5) {
state = 6;}
if (state == 6) {
state = 7;}
if (state == 7) {
state = 8;
}}
if (state == 8) {
state = 9;}
if (state == 9) {
state = 10;}
if (state == 10) {
state = 11;}
if (state == 11) {
state = 12;}
}
// void mousePressed() {
// mousePressed = true;
// if (stage == 1) {
// mousePressed_stage1();
// }else if (stage == 2) {
// mousePressed_stage2();
// }else if (stage == 3) {
// mousePressed_stage3();
// }else if (stage == 4) {
// mousePressed_stagend4();
// }
//}
//}
stage1:
void draw_stage1()
{
background(0, 0, 0);
if (state == 13) {
text (text19,500,200);
textSize (15);}
if (state == 14) {
text (text20,500,200);
textSize (15);}
}
stage 2:
void draw_stage2(){
background(0, 0, 0);
if (state == 16) {
text (text21,500,200);
textSize (15);}
if (state == 17) {
text (text22,500,200);
textSize (15);}
}
stage 3:
void draw_stage3(){
background(0, 0, 0);
if (state == 18) {
text (text23,500,200);
textSize (15);}
if (state == 19) {
text (text24,500,200);
textSize (15);}
}
stagend 4 :
void draw_stagend4()
{
background(0);
//loadImage(prism,50,50);
if (state == 20) {
text (text25,500,200);
textSize (15);}
if (state == 21) {
text (text26,500,200);
textSize (15);}
textAlign(CENTER);
textSize(50);
text("Here is your lighted star", width/2, height/2);
//star
pushMatrix();
translate(500,500);
scale(1.5);
noStroke();
fill (255, 238, 157);
beginShape();
vertex(0, -50);
vertex(14, -20);
vertex(47, -15);
vertex(23, 7);
vertex(29, 40);
vertex(0, 25);
vertex(-29, 40);
vertex(-23, 7);
vertex(-47, -15);
vertex(-14, -20);
endShape(CLOSE);
popMatrix();
}
void mousePressed_stagend4()
{
stage = 1;
}