Advertisement
Guest User

Untitled

a guest
Jul 1st, 2018
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None
  1. void beginState2() {
  2. //movie = new Movie(this, "movie.mp4");
  3. // movie.play();
  4. }
  5. int speed = 0;
  6. int delayer = 0;
  7. void updateState2(){
  8. delayer++;
  9. // --------------------------------------------
  10. // Do something with input
  11. // --------------------------------------------
  12.  
  13. //println(delayer);
  14. //if (delayer > 75){
  15. if (keyPressed){
  16. if (key == '1') currentState = 1;
  17. if (key == '3') currentState = 3;
  18. }
  19. // }
  20.  
  21. // --------------------------------------------
  22. // Do something with output
  23. // --------------------------------------------
  24.  
  25. image(movie, 0, 0, width, height);
  26. textSize(32);
  27. text("State: " + currentState + " Attraction!", 10, 30);
  28. text("Press 1,3 to switch to other state", 10, 70);
  29.  
  30. background(0, 0, 255);
  31. //image(mimg, 0, 0);
  32.  
  33. speed-=4;
  34. for(int i = 0;i < camImageArray.length;i++){
  35. if(camImageArray[i] != null){
  36. image(camImageArray[i], speed + i * 250, 100,250,200);
  37. }
  38. }
  39.  
  40. }
  41.  
  42. void endState2() {
  43. movie.stop();
  44. delayer = 0;
  45. speed=0;
  46. }
  47.  
  48. // movieEvent needed for play back
  49. // we could place this also in the main code, but this is the only state with
  50. // video so I've decided to put it here.
  51. //void movieEvent(Movie m) {
  52. // m.read();
  53. //}
Advertisement
RAW Paste Data Copied
Advertisement