Last active
February 1, 2016 16:15
-
-
Save claytical/32129bbdef04dbd2329f to your computer and use it in GitHub Desktop.
Multiple If Statements
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
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