Practicing p5.js

JavaScript
function setup() {
  createCanvas(650, 400);
  frameRate(8); // slows down the animation to reduce eye strain
}


function draw() {
  background(0);
  for (let x = 0; x <= width; x+= 50) { 
    for (y = 0; y <= height; y+=50) {
      fill(random(255));
      ellipse(x, y, 25, 25);
    }
  }
}

Posted

in