int x=0; void setup( ) { size(800, 100); background(0); noLoop(); } void draw( ) { smoke( ); vehicle(color(0)); x = x+1; vehicle(color(255)); } void smoke( ) { noStroke( ); float d; fill(255, 200, 0); ellipse((x+40)-(x%10), 50, max(10, random(20)), max(15, random(25))); } void vehicle(color c) { stroke(0); fill(c); rect(40+x, 40, 100, 20); triangle(140+x, 40, 155+x, 50, 140+x, 60); triangle(35+x, 40, 35+x, 30, 60+x, 40); triangle(35+x, 60, 35+x, 70, 60+x, 60); } void mousePressed( ) { loop( ); } void mouseReleased( ) { noLoop( ); }