[processing] array Study : array.length / append JavaScript

//클릭하는 곳에서 떨어지는 공



void draw() {
  background(255);
  for (int i =0; i< myCars.length; i ++) { 
    myCars[i].display();
    myCars[i].drive();
  }
}
void mouseClicked () {
myCars=(Car[])append(myCars, new Car(color (random(255),0,random(255), random(255)), mouseX, mouseY, random(1, 5)));
}

1 2 3 4 5 6 7 8 9 10 다음