This is what I have so far. I want the rectangle to move back to the other side instead of the just stopping. Another variable needs to be used for this but I don't know how. Could someone help please?
int xp = 100;
void setup() {
size(300, 300); noStroke(); }
void draw() { background(0,0,0); rect(xp, 100, 10, 10); xp++; if (xp > width-10) { xp = width-10; }