Instantly share code, notes, and snippets.

@vinskim /2week
Created Sep 20, 2017

Embed
What would you like to do?
2week
var circleX = 0;
var circleY = 0;
function setup() {
createCanvas(500, 500);
background(255, 254, 250);
noStroke()
// Compotion
fill(180);
rect(50, 60, 10, 420);
fill(180);
rect(120, 15, 10, 50);
fill(180);
rect(180, 320, 10, 160);
rect(320, 10, 10, 460);
rect(480, 15, 10, 470);
rect(400, 190, 10, 130);
rect(5, 60, 480, 10);
rect(5, 180, 45, 10);
rect(330, 180, 150, 10);
rect(5, 375, 500, 10);
rect(50, 430, 270, 10);
rect(50, 320, 480, 10);
rect(180, 460, 300, 10);
// Red Rectangle
fill(200);
rect(60, 70, 260, 250);
// Yellow Rectangle(right)
fill(220);
rect(330, 70, 150, 110);
fill(230);
rect(330, 10, 150, 50);
// Blue Rectangle
fill(190);
rect(330, 385, 150, 75);
// Yellow Rectangle(Left)
fill(240);
rect(5, 385, 45, 95);
// Red Rectangle(Right)
fill(210);
rect(490, 385, 45, 95);
// Black Rectangle(left)
fill(180);
rect(60, 330, 120, 100);
// Black Rectangle(Right)
fill(190);
rect(190, 440, 130, 20);
}
function mousePressed() {
background(250, 70);
let r = random(255);
let g = random(255);
let b = random(255);
// Compotion
noStroke()
rect(50, 60, 10, 420);
rect(120, 15, 10, 50);
rect(180, 320, 10, 160);
rect(320, 10, 10, 460);
rect(480, 15, 10, 470);
rect(400, 190, 10, 130);
rect(5, 60, 480, 10);
rect(5, 180, 45, 10);
rect(330, 180, 150, 10);
rect(5, 375, 500, 10);
rect(50, 430, 270, 10);
rect(50, 320, 480, 10);
rect(180, 460, 300, 10);
// Red Rectangle (Random Color)
fill(r, g, b, 130, 70);
rect(60, 70, 260, 250);
// Yellow Rectangle (Random Color)
fill(r, g, b, 150, 90);
rect(330, 70, 150, 110);
fill(r, g, b, 80, 50);
rect(330, 10, 150, 50);
// Blue Rectangle (Random Color)
fill(r, g, b, 150, 80);
rect(330, 385, 150, 75);
// Yellow Rectangle (Random Color)
fill(r, g, b, 80, 50);
rect(5, 385, 45, 95);
// Red Rectangle (Random Color)
fill(r, g, b, 80, 50);
rect(490, 385, 45, 95);
// Black Rectangle (Random Color)
fill(r, g, b, 255, 190);
rect(60, 330, 120, 100);
// Black Rectangle (Random Color)
fill(r, g, b, 80, 50);
rect(190, 440, 130, 20);
fill (0, 100, 255);
}
function draw() {
noStroke()
rect(mouseX, mouseY, 5, 5, 100);
fill(5);
let r = random(255);
let g = random(255);
let b = random(255);
background(500,5);
fill(r,g,b);
var x = random(0, width);
var y = random(0, height);
ellipse(x,y,5,5);
fill(r,g,b, 50, 50);
rect(-circleX, 60, 300, 10);
circleX = circleX + 5;
rect(circleX, 320, 150, 10);
circleX = circleX + 5;
rect(320, -circleY, 10, 380);
circleY = circleY + 5;
rect(50, -circleY, 10, 100);
circleY = circleY + 1;
rect(50, -circleY, 10, 100);
circleY = circleY + 1;
rect(50, circleY + 300, 10, 250);
circleY = circleY + 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment