So I'm trying to create an interactive film through state machines. A "choose your own path" type situation but I can't get the button to work to trigger the second video. Help?
import processing.video.*; Movie start; Movie askout; Movie askhow; Movie yes; Movie no; Movie slutty; Movie conservative; Movie friend; Movie ss;
int state = 1; void setup (){ size (600,600); if (state ==1){ start = new Movie(this, "1A.mp4"); start.play(); } if (state == 2){ askout= new Movie(this, "ask valerie out.mp4"); askout.play (); } if (state == 3){ askhow = new Movie(this, "ask valerie how shes doing.mp4"); } if (state == 4){ yes = new Movie(this,"yes choice.mp4"); } if (state == 5){ no = new Movie (this, "No choice.mp4"); } if (state == 6){ slutty = new Movie(this, "Slutty choice.mp4"); } if (state == 7){ conservative=new Movie(this,"Conservative choice.mp4"); } if (state == 8){ friend = new Movie (this, "Friend choice.mp4"); } if (state == 9){ ss = new Movie (this,"Student Service.mp4"); }
}
void draw (){ image(start,0,0,600,600); }
void movieEvent(Movie m) { m.read(); }
void mousePressed () { //ask valerie out if (state == 1 && mouseX > 350) { state = 2; //image(askout,0,0,600,600); } //ask how shes doing if (state == 1 && mouseX < 350) { state = 3; } //Say yes (2) if (state == 2 && mouseX <350) { state = 4; } //say no (2) if (state == 2 && mouseX >350) { state = 5; } //Say yes (3) if (state == 3 && mouseX <350) { state = 4; } //say no (3) if (state == 3 && mouseX >350) { state = 5; } //slutty (4) if (state == 4 && mouseX>350) { state = 6; } //conservative (4) if (state == 4 && mouseX<350){ state = 7; } //slutty (5) if (state == 5 && mouseX >350) { state=6; } //conservative(5) if (state == 5 && mouseX <350) { state=7; } //call friend (6) if (state == 6 && mouseX >350) { state = 8; } //call student services (6) if (state ==6 && mouseX <350) { state = 9; } //call friend (7) if (state ==7 && mouseX >350){ state=8; } //call student services (7) if (state == 7 && mouseX<350){ state=9; }
}