xxxxxxxxxx
40
function setup() {
createCanvas(560, 800);
}
function draw() {
background(220);
noStroke();
fill(random(100, 200));
frameRate(24);
// Creating a hectic background through the nested loop
for (let x = 0; x <= width; x += random(50,560)) {
for (let y = 0; y <= height; y += random(50,800)) {
ellipse(x, y, random(50,300), random(50,300));
}
}
stroke(0);
strokeWeight(20);
strokeCap(SQUARE);
// Setting the speed of the arrows
let baseAngle = millis()/1500;
// Creating 4 columns and 6 rows of arrows
for (let lineX = 0; lineX < 4; lineX++) {
for (let lineY = 0; lineY < 6; lineY++) {
push();
translate(100 + lineX * 120, 100 + lineY * 120);
let offset = (lineX + lineY) * PI/6;
rotate(baseAngle + offset);
line(-50, 0, 50, 0);
pop();
}
}
}