Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. /* If/then, click and drag, variable, || etc v0.1
  2. Steve Lambert February 7, 2018
  3.  
  4. todo:
  5. gravity
  6. */
  7.  
  8. color darkBlue = color(34, 83, 120);
  9. color medBlue = color(22, 149, 163);
  10. color lightBlue = color(172, 240, 242);
  11. color offWhite = color(243, 255, 226);
  12. color orange = color(235, 127, 0);
  13.  
  14. int whichThird = 2;
  15.  
  16. void setup() {
  17. noStroke();
  18. size(1000, 1000);
  19. } // end setup
  20.  
  21. void draw() {
  22. if (mouseX < width/3) { // if in right third
  23. whichThird = 0;
  24. } else if (mouseX > width/3 && mouseX < width/3*2){
  25. // mouseX > 333 AND mouseX < 666
  26. whichThird = 1;
  27. } else {
  28. whichThird = 2;
  29. }
  30.  
  31. println("whichThird = " + whichThird);
  32.  
  33. if (whichThird == 0 || mouseY >= 900){
  34. background(lightBlue);
  35. fill(darkBlue);
  36. } else if (whichThird == 1){
  37. background(medBlue);
  38. fill(orange);
  39. } else {
  40. fill(offWhite);
  41. background(orange);
  42. }
  43.  
  44. ellipse(mouseX, mouseY, 50, 50);
  45. }// end draw
Add Comment
Please, Sign In to add comment