xxxxxxxxxx
20
let img;
function preload() {
img = loadImage("land.jpg");
}
function setup() {
createCanvas(400, 400);
image(img, 0, 0);
}
function draw() {
let x1 = random(width);
let y1 = random(height);
let x2 = round(x1 + random(-10, 10));
let y2 = round(y1 + random(-10, 10));
set(x2, y2, get(x1, y1, 30, 30)); // x,y,obj
updatePixels();
}