p5((sketch) => {
let system;
let height = 300;
let imageWidth = 210;
let imageHeight = 107;
let speed = 4;
let image;
sketch.setup = function () {
image = sketch.loadImage(
"https://upload.wikimedia.org/wikipedia/commons/9/9b/DVD_logo.svg"
);
sketch.createCanvas(width, height);
};
sketch.draw = function () {
sketch.background("white");
let x = lathe.fold((sketch.frameCount / width) * speed, 1);
let y = lathe.fold((sketch.frameCount / height) * speed, 1);
sketch.image(
image,
x * (width - imageWidth),
y * (height - imageHeight),
imageWidth,
imageHeight
);
};
})