Procedural Drawing: moving eyeballs
float x=0 ; //location for the face float x2=0 ;//location for the eyes int dirX = 1; //direction for the face int dirX2 = -1; //direction for eyes float speedX = 0.5; //speed of face float speedX2 = 0.001; //speed of eyes void setup () { size(400, 400); background(0); } void draw () { background(0); noFill(); //condition for the direction of the face to change x += speedX * dirX; if (x <= -200) { // x = -25; dirX = - dirX; } if (x >=200) { dirX = -1; } for (int i = -200; i <= 600; i+=70) { for (int i2 = 25; i2 <=400; i2+=70) { stroke(i, random(200), random(255)); strokeWeight(2); noFill(); ellipse(i+x, i2+(random(-1.5, 1.5)), 50, 50); ...