xxxxxxxxxx
circleArray = []
const step = 3
function setup() {
createCanvas(600, 600);
background('grey');
frameRate(20)
colours = [
"#fe4365",
"#fc9d9a",
"#f9cdad",
"#c8c8a9",
"#83af9b"
]
for (let i = 0; i < 1000; i++) {
let c = {
x: random(0, 600),
y: random(0, 600),
colour: random(colours)
}
circleArray.push(c)
}
}
function draw() {
drawMultipleWalkers()
moveMultipleWalker()
}
function drawMultipleWalkers() {
for (let c of circleArray) {
circle(c.x, c.y, 10);
fill(c.colour);
}
}
function moveMultipleWalker() {
for (let c of circleArray) {
c.x += random(-step, step)
c.y += random(-step, step)
}
}