for (var i = 0; i < 500; i++) {
shapes.push(new Shape());
for (var j = 0; j < 300; j++) {
vertexPoints.push(new VertexPoint());
colorMode(RGB, 255, 255, 255, 100);
colorMode(HSB, 360, 100, 100, 100);
for (var i = 0; i < shapes.length; i++) {
vertex(frame_w, frame_h);
for (var j = vertexPoints.length-1; j > 0; j--) {
vertex(vertexPoints[j].x, vertexPoints[j].y);
vertexPoints[j].update();
this.color_set = [0, 50, 180, 240];
this.x = random(-40, width + 40);
this.speed = random(0.5, 2);
this.c = this.color_set[floor(random(4))];
this.vertex_val = random(3, 6);
for (var i = 0; i < this.vertex_val; i++) {
if (this.x > width + 40) {
this.display = function() {
fill(this.c, 100, 100, 50);
for (var i = 0; i < this.vertex_val; i++) {
vertex(this.x + this.r[i] * cos(i * TWO_PI / this.vertex_val),
this.y + this.r[i] * sin(i * TWO_PI / this.vertex_val));
this.next_x = this.x + random(-20, 20);
this.next_y = this.y + random(-20, 20);
this.easing_x = random(0.01, 0.04);
this.easing_y = random(0.01, 0.04);
this.update = function() {
this.x += (this.next_x - this.x) * this.easing_x;
this.y += (this.next_y - this.y) * this.easing_y;
if (floor(this.next_x) == floor(this.x) || floor(this.next_y) == floor(this.y)) {
this.next_x = random(width);
this.next_y = random(height);