>>278
そういうときは時間をカウントすれば良いよ。

int time_count;
...
void draw(){
...
if(time_count < 450) {Z[i] += 20;}
else {Z[i] -= 20;}
...
time_count ++;
if(time_count > 900) {time_count = 0;}
}