I'm a really beginner and there is yet something I don't understand.
Based on the car's example of
the tutorial on objects, I try to make appear "lots of" cars in the window, but without declaring each of them individually. I would like to do this with an array and only one car appear.
So, what's wrong?
Here is my code.
int nbreCar = 10;
Car[] myCar;
void setup(){
background(0);
size (200,200);
smooth();
// Variable value for each car (randomly assigned)
// Détermination des valeurs de variables de chaque voiture (random)
color c = color(random(125,255),random(125,255),random(125,255));
float x = random (width);
float y = (height/15)*random(height/15);
float v = random(4.0);
// Car declaring
// Déclaration de la voiture
myCar = new Car[nbreCar];
// Assign of each car object as an object of Car class
// Détermination de chaque voiture comme étant un objet de la classe Car