xxxxxxxxxx
let img;
let i = 0;
let j = 0;
function preload(){
img = loadImage('illusion.png');
}
function setup() {
createCanvas(400, 800);
rectMode(CENTER);
textAlign(CENTER);
}
function draw() {
background(220);
fill(0);
rect(200, 120, 250, 100);
for(let y = 0; y < 800; y+=30){
for(let x = 0; x < 400; x +=30){
fill(0);
rect(x, y, 20);
}
}
while(i<800){
image(img, 0, i, 50, 50)
image(img, i, 0, 50, 50)
i+=50;
}
i = 0;
while(j<800){
image(img, j, 750, 50, 50);
image(img, 350, j, 50, 50);
j+=50;
}
j = 0;
}