xxxxxxxxxx
26
function setup() {
createCanvas(400, 400);
}
function draw() {
background(175, 210, 245);
// Randomly sized rectangles appearing in random places on the screen
frameRate(4);
for (let i = 0; i < 150; i++) {
let noiseValue = noise(frameCount * 0.0001, i * 0.001);
let scaledNoise = (noiseValue - 0.5) * 100;
let x = random(width);
let y = random(height);
let rectWidth = random(100, 20);
let rectHeight = random(100, 20);
rect(x, y + scaledNoise, rectWidth, rectHeight);
// color of "trees"
let r = random(140, 170)
let g = random (120, 150)
let b = random (10, 40)
fill(r, g, b)
}
}