var rPos = 450; var xPos = 400; var xSpeed = 6; var draw = function() { xPos -= xSpeed; rPos -= xSpeed; background(0, 255, 255); rect(0, 300, 400, 100); fill(); noStroke(); image(getImage("seasonal/xmas-tree-with-presents"), 100, 100, 170, 230); image(getImage("seasonal/santa-with-bag"), xPos, 240, 100, 100); image(getImage("seasonal/reindeer-with-hat"), rPos, 240, 100, 100); if(xPos < -100) { xPos = 400; } if(rPos < -50) { rPos = 450; } if(xPos < 200) { image(getImage("seasonal/xmas-presents"), 200, 240, 100, 100); } };