Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement