Interactive Video with Audience Options

Another useful concept for these kinds of projects is “state machine”

https://discourse.processing.org/search?q=state%20machine

So you have states like this:

int s0video = 0;
int s0choice = 1;
int s1video = 2;
int s1choice = 3;
int s2video = 4;
int s2choice = 5;
int s3video = 6; 
//....
int current = s0video;

and then you have rules like “if the state is s2choice and the mouse clicks on the right hand side of the screen, the state is now s5video”:

if(current==s2choice && mousePressed && mouseX>width/2) {
  current==s5video;
}

Draw to the screen displaying the video or buttons based on whatever the current state is.

For previous discussion of sketch state in a simple interactive experience, also see:

1 Like