xxxxxxxxxx
var bg;
var sf;
var x1 = 0;
var x2 = 0;
var y = 0;
function preload()
{
bg = loadImage("ex1.png");
sf = loadSound("ex1.mp3");
}
function setup() {
createCanvas(500, 500);
background(255);
//sf.play();
//sf.loop();
x2 = x1 - width;
}
function draw() {
image(bg, x1, y);
x1++;
if (x1 > width) {
x1 = -width;
}
image(bg, x2, y);
x2++;
if (x2 > width) {
x2 = x1 - width;
}
}