for (var i = 0 ; i < balls.length ; i++) {
if (balls[i].x + RADIUS > 0 && balls[i].x - RADIUS < WINDOW_WIDTH) {
balls[cnt++] = balls[i];
}
}
balls.length = cnt;
//while( balls.length > cnt ){
// balls.pop();
//}
for (var i = 0 ; i < balls.length ; i++) {
if (balls[i].x + RADIUS > 0 && balls[i].x - RADIUS < WINDOW_WIDTH) {
balls[cnt++] = balls[i];
}
}
balls.length = cnt;
//while( balls.length > cnt ){
// balls.pop();
//}
2014-09-14
举报