Please help my Processing code. due to tomorrow!

uniquenospace
Tue, 15 Jun 2021 15:18:59 +0000
Libraries

I want to make program that press the button on the first screen to play the first video, and when I press key ‘s’ or ‘l’ on the screen, I want to make them show different videos, but it’s too hard because I haven’t learned it yet.

import processing.video.*;
Movie myMovie;
Movie myMovie2;
Movie myMovie3;
int caseNum = 1;
Boolean btn1 = false;
Boolean btn2 = false;

void setup() {
  size(800, 600);
  myMovie = new Movie(this, "Movie01B.mp4");
  myMovie.play();
}

void draw() {
  image(myMovie, 0, 0);
  rect(90, 490, 35, 35, 7);
  fill(255);
  textSize(23);
  text("Start", 150, 515);
  if (mouseX>125 && mouseX<90 && mouseY>525 && mouseY<490) {
    btn1=true;
  } else {
    btn1=false;
  }

  switch(caseNum) {
  case 1:
   //fullScreen();
   image(myMovie, 0, 0);
   myMovie = new Movie(this, "Movie01B.mp4");
   myMovie.play();

  case 2:
   //fullScreen();
   image(myMovie2, 0, 0);
   myMovie2 = new Movie(this,"Movie02B.mp4");
   myMovie2.play();
   rect(90, 490, 35, 35, 7);
   fill(255);
   textSize(23);
   text("Play again", 150, 515);
   if (mouseX>125 && mouseX<90 && mouseY>525 && mouseY<490) {
     btn2=true;
   } else {
     btn2=false;
   }

  case 3:
    //fullScreen();
    image(myMovie3, 0, 0);
    myMovie3 = new Movie(this, "Movie03B.mp4");
    myMovie3.play();
  }
}

void keyPressed () {
  switch(caseNum) {
    case 1:
      if (key == 's') {
        caseNum = 2;
      }

    case 2:
      if (key == 'l') {
        caseNum = 3;
      }
       break;
  }
}

void mousePressed () {
  switch(caseNum) {
    case 1:
      if (btn1) {
        caseNum = 1;
      }
      break;

      case 2:
        if (btn2) {
          caseNum = 1;
        }
        break;
  }
}


void movieEvent(Movie m) {
  m.read();
}

please help! due to tomorrow…

7 posts - 4 participants