I have corrected my sketch in this way:
Code:PImage mapImage;
Table locationTable;
Table destinationTable;
float size =.7;
float x;
float y;
float targetX;
float targetY;
float easing;
int rowCount;
int start;
PVector[] location = new PVector[110];
PVector[] destination = new PVector[110];
PVector[] velocity = new PVector [110];
void setup(){
background (0, 0, 0);
size(450,551);
ellipseMode(CENTER);
colorMode(RGB,255,255,255,255);
noStroke();
smooth();
noiseDetail(14);
mapImage = loadImage("pianta-italia-regione.png");
easing = 0.008;
frameRate (10);
start = millis();
locationTable = new Table("locations.tsv");
destinationTable = new Table("destinations.tsv");
rowCount = locationTable.getRowCount();
for (int row = 0; row < 110; row++) {
x = locationTable.getFloat(row, 1);
y = locationTable.getFloat(row, 2);
targetX = destinationTable.getFloat(row, 1);
targetY = destinationTable.getFloat(row, 2);
location[row] = new PVector (x, y);
}
}
void draw(){
tint(100,100,100, 6);
image(mapImage, 0, 0);
//fill(0,0,0,2);
//rect(-5,-5,width+5,height+5);
for (int row = 0; row < 110; row++) {
destination[row] = new PVector (targetX, targetY);
velocity[row] = new PVector ((destination[row].x - location[row].x)*easing , ((destination[row].x - location[row].y)+30)*easing );
location[row].add(velocity[row]);
for(int i=0; i<50; i++){
fill(255,255,250,122/(i+1));
ellipse(location[row].x,location[row].y,size/8*i,size/8*i);
}
}
if((millis()-start) >= 4000){
for (int row = 0; row < 110; row++) {
destination[row] = new PVector (targetX, targetY);
velocity[row] = new PVector ((destination[row].x - location[row].x)*easing , ((destination[row].x - location[row].y)+30)*easing );
location[row].add(velocity[row]);
for(int i=0; i<50; i++){
fill(255,255,250,122/(i+1));
ellipse(location[row].x,location[row].y,size/8*i,size/8*i);
}
}
}
}
but now I can't delay with millis() the second block of ellipse, why?