Polygon hexagon, octagon; void setup() { hexagon = new Polygon(color(0, 255, 0, 100), color(255), 6); hexagon.addVertex(30, 65); hexagon.addVertex(86, 200); hexagon.addVertex(90, 210); hexagon.addVertex(200, 180); hexagon.addVertex(70, 100); octagon = new Polygon(color(35, 100, 180, 80), color(255), 8); for (int i=0; i<8; i++) octagon.addVertex(); size(300, 300); smooth(); frameRate(20); } void draw() { // background(0); fill(0, 30); noStroke(); rect(0, 0, width, height); hexagon.drawPolygon(); if (frameCount%4 == 0) hexagon.replaceVertex(int(random(0, hexagon.i))); octagon.drawPolygon(); if (frameCount%9 == 0) octagon.replaceVertex(int(random(0, octagon.i))); }