Created
September 13, 2016 21:52
-
-
Save slambert/4b5152b85324f5fbb2125c5de2c1c855 to your computer and use it in GitHub Desktop.
conditionals, variables example September 13, 2016
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
// declare boolean variable | |
boolean switchstatus = false; | |
void setup(){ | |
size(500,500); | |
background(0); | |
} | |
void draw(){ | |
// Conditional colors | |
if(switchstatus == true){ | |
fill(255,0,0); // red | |
} else { | |
fill(255); // white | |
} | |
// Draw the circle | |
background(0); //make it black! | |
// make a circle that wont go away | |
noStroke(); | |
// fill(255); | |
ellipse(mouseX,mouseY,30,30); | |
println("Switch is: " + switchstatus); | |
} //draw | |
void mouseReleased(){ | |
switchstatus = !switchstatus; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment