Created
September 15, 2015 16:41
-
-
Save slambert/2f07c0f434ebd0f7963c to your computer and use it in GitHub Desktop.
Done with an IF/ELSE statement
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Steve Lambert | |
Super Stunning Psychedelic Booleans | |
September 15, 2015 v0.2 | |
Done with an IF/ELSE statement | |
*/ | |
void setup(){ | |
size(800,600); // how big it is, you know this. | |
println("Welcome to Steve's Psychedelic Light Show"); | |
println("Width: " + width); // dumb question, dumb answer | |
} // end setup | |
void draw(){ | |
background(250); // dull | |
// THIS WORKS | |
if (mouseX <= width/4 ) { // if we go to the left quarter | |
// then do this: | |
background(255,0,0); // paint the town red | |
println("X: " + mouseX); | |
} | |
else /* otherwise... */ if (mouseX >= (width/4 * 3)) { | |
background(0,0,255); // paint the town blue | |
} | |
/* if none of the above is true, forget I mentioned it at all and go back to what you were doing */ | |
} // end draw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment