Created
July 27, 2016 12:54
-
-
Save flempke/9fe1213a9e6e0fe5a0886e8be4904690 to your computer and use it in GitHub Desktop.
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(){ | |
// executed once | |
createCanvas(windowWidth, windowHeight); | |
background(80); | |
fill(70); | |
rect(width/2, 0, width/2, height); | |
} | |
function draw(){ | |
// executed all the time | |
for(var x = 0; x < width; x+=10) { | |
for(var y = 0; y < height; y+=10){ | |
if (x < width/2) { | |
if (mouseX < width/2){ | |
stroke(255, 80, 80); | |
} else { | |
stroke(0); | |
} | |
} else { | |
if (mouseX > width/2){ | |
stroke(80, 255, 80); | |
} else { | |
stroke(255); | |
} | |
} | |
strokeWeight(4); | |
point(x,y); | |
} | |
} | |
} | |
function windowResized(){ | |
resizeCanvas(windowWidth, windowHeight); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment