float myValue; float myColour; void setup(){ size(300,200); background(0); framerate(20); // setting the speed with framerate. } void draw(){ myValue = random(30,225); myColour = random(30,200); noStroke(); rect(myValue,48,40,100); // myValue - back and forward on the x axis. fill(myColour,0,100); // random is a variety of R between the above. }