xxxxxxxxxx
function preload()
{
img1 = loadImage('https://picsum.photos/100');
img2 = loadImage('https://picsum.photos/101');
img3 = loadImage('https://picsum.photos/102');
img4 = loadImage('https://picsum.photos/103');
img5 = loadImage('https://picsum.photos/104');
allimg = [img1, img2, img3, img4, img5];
}
let size;
function setup()
{
colorMode(HSB);
createCanvas(windowWidth, windowHeight);
background(255);
}
function draw()
{
mappedMouseX = map(mouseX, 0, windowWidth,0, 360);
mappedMouseY = map(mouseY, 0, windowHeight, 0, 100);
// the tint function eats memory for days, which creates a "natural" delay. I gotta say, I kinda like it.
tint(mappedMouseX, mappedMouseY, 100);
size = random(20, 200);
for (let y = 0; y < height; y += size)
{
for (let x = 0; x < width; x += size)
{
image(random(allimg), x, y, size, size);
}
}
}