Created
September 15, 2015 16:26
-
-
Save slambert/938ebeb1d61c25786d45 to your computer and use it in GitHub Desktop.
Done with one IF 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 v0.1 | |
September 15, 2015 | |
Done with one IF 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 || mouseX >= width/4 * 3) { // if we go to the left or right quarter | |
// then do this: | |
background(255,0,0); // paint the town red | |
println("X: " + mouseX); | |
} | |
//// THIS WORKS | |
//// Greater than or = to 600 turn red | |
//if (mouseX >= (width/4 * 3)) { // if we go to the right quarter | |
//// then do this: | |
// background(255,0,0); // paint the town red | |
// println("X: " + mouseX); | |
// } | |
} // end draw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment