xxxxxxxxxx
//Bauhaus
// stores the size of the sqaures
let squaresize = 100;
let circlesize = 15;
function setup() {
createCanvas(1064, 768);
// Pick colors randomly
r = random(255);
g = random(255);
b = random(255);
}
function draw() {
background(0, 0, 0);
noStroke()
fill(71, 143, 74)
square(30, 70, squaresize);
fill(237, 210, 57)
square(135, 70, squaresize);
fill(74, 83, 240)
square(240, 70, squaresize);
fill(230, 50, 50)
square(135, 175, squaresize);
fill(230, 164, 50)
square(135, 280, squaresize);
fill(145, 23, 141)
square(344, 175, squaresize);
fill(222, 82, 110)
square(600, 350, squaresize);
fill(237, 210, 57)
square(705, 350, squaresize);
fill(71, 143, 74)
square(705, 245, squaresize);
fill(230, 50, 5)
square(705, 455, squaresize);
fill(255, 255, 255)
square(810, 350, squaresize);
fill(79, 93, 117)
square(915, 248, squaresize);
fill(127, 108, 130)
square(915, 142, squaresize);
fill(200, 235, 157)
square(240, 385, squaresize);
//I added some transparency to the shapes on the squares
fill(0, 0, 0, 200)
ellipse(150, 100, 10, 45);
ellipse(355, 240, 10, 45);
ellipse(945, 320, 10, 45);
ellipse(775, 500, 10, 45);
ellipse(300, 450, 10, 45);
//rectangle around text
fill('pink');
rect(75, 20, 150, 30);
//text
fill(0, 0, 0)
textSize(22);
text('By Audrey', 80, 45);
stroke(0, 0, 0);
//here is my for loop to create the line of squares
fill(r, g, b, 127);
for (let x = 0; x <= width; x = x + 50)
square(x, 700, 50);
// this is my modern-looking heart shape
beginShape();
vertex(20, 20);
vertex(33, 20);
vertex(43, 30);
vertex(55, 19);
vertex(67, 20);
vertex(40, 50);
endShape(CLOSE);
}
// When the mouse is clicked
function mousePressed() {
// Random color value for heart and line of squars
r = random(255);
g = random(255);
b = random(255);
}