class Car { color colour; float x; float y; float v; float a; float angle; float maxspeed; Car(color colourTemp, float xPos, float yPos, float velocity, float acceleration, float angleTemp, float maxspeedTemp) { colour = colourTemp; x = xPos; y = yPos; v = velocity; a = acceleration; angle = angleTemp; maxspeed = maxspeedTemp; } void move(){ x=x+v; if (x>width){ x = 0; } } void display(){ fill(colour); rect(x,y,50,20); } } float randomCols = random(60); int cols = int(randomCols); Car [] carsArray; void setup(){ size(400,400); noStroke(); carsArray = new Car [cols]; for (int x=0; x