Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* If/then, click and drag, variable, || etc v0.1
- Steve Lambert February 7, 2018
- todo:
- gravity
- */
- color darkBlue = color(34, 83, 120);
- color medBlue = color(22, 149, 163);
- color lightBlue = color(172, 240, 242);
- color offWhite = color(243, 255, 226);
- color orange = color(235, 127, 0);
- int whichThird = 2;
- void setup() {
- noStroke();
- size(1000, 1000);
- } // end setup
- void draw() {
- if (mouseX < width/3) { // if in right third
- whichThird = 0;
- } else if (mouseX > width/3 && mouseX < width/3*2){
- // mouseX > 333 AND mouseX < 666
- whichThird = 1;
- } else {
- whichThird = 2;
- }
- println("whichThird = " + whichThird);
- if (whichThird == 0 || mouseY >= 900){
- background(lightBlue);
- fill(darkBlue);
- } else if (whichThird == 1){
- background(medBlue);
- fill(orange);
- } else {
- fill(offWhite);
- background(orange);
- }
- ellipse(mouseX, mouseY, 50, 50);
- }// end draw
Add Comment
Please, Sign In to add comment