Skip to content

Instantly share code, notes, and snippets.

@claytical
Last active February 1, 2016 16:15
Show Gist options
  • Save claytical/32129bbdef04dbd2329f to your computer and use it in GitHub Desktop.
Save claytical/32129bbdef04dbd2329f to your computer and use it in GitHub Desktop.
Multiple If Statements
var canDraw = false;
function setup() {
createCanvas(500,500);
background(255,255,0);
}
function draw() {
if (mouseY < 10) {
background(255,255,255);
canDraw = true;
}
if (mouseY > height - 10) {
background(255,0,0);
canDraw = false;
}
if (canDraw == true) {
ellipse(mouseX, mouseY, 10, 10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment