Created
February 1, 2016 16:24
-
-
Save claytical/bee037f843d53ba7e93f to your computer and use it in GitHub Desktop.
If with and
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
function setup() { | |
createCanvas(500,500); | |
} | |
function draw() { | |
background(255,255,255); | |
if (mouseY > height/2 && mouseX > width/2) { | |
fill(255,0,0); | |
ellipse(width/2, height/2, 50, 50); | |
} | |
if (mouseY > height/2 && mouseX < width/2) { | |
fill(255,255,0); | |
ellipse(width/2, height/2, 10, 10); | |
} | |
if (mouseY < height/2 && mouseX > width/2) { | |
fill(0,0,255); | |
rect(width/2, height/2, 50, 50); | |
} | |
if (mouseY < height/2 && mouseX < width/2) { | |
fill(0,255,0); | |
triangle(0, height, width/2, 0, width, height); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment