xxxxxxxxxx
25
let gif;
let x = 0;
let directionX = 2;
function preload() {
gif = createImg("lunidin.gif", "lunidin.gif"); //??
}
function setup() {
createCanvas(700, 700);
background(220);
}
function draw() {
gif.position(x, 0);
x = x + directionX;
if (x > width) {
directionX = -2;
}
if (x < 0) {
directionX = 2;
}
}