int centerX; int centerY; int bodyWidth = 20; int bodyHeight = 100; int headSize = 60; int eyeWidth = 16; int eyeHeight = 2 * eyeWidth; int eyeShift = headSize/3; int legYEnd; int legYStart; int shiftX = 10; int shiftY = 10; void setup() { size(800,800); // Set the size of the window background(255); // White background smooth(); ellipseMode(CENTER); rectMode(CENTER); for (int i = 0; i < width; i = i + headSize + 10) { //drawRooba((int) random(width), (int) random(height)); drawRooba(i, i); } } void drawRooba(int X, int Y) { centerX = X; centerY = Y; // Draw Rooba’s body stroke(0); fill(255, 0, 0); rect(centerX, centerY, bodyWidth, bodyHeight); // Draw Rooba’s head fill(255); rect(centerX, centerY - headSize/2, headSize, headSize); // Draw Rooba’s eyes fill(255, 0, 0); ellipse(centerX - eyeShift, centerY - headSize/2, eyeWidth, eyeHeight); ellipse(centerX + eyeShift, centerY - headSize/2, eyeWidth, eyeHeight); // Draw Rooba’s legs stroke(0); legYEnd = centerY + bodyHeight/2 + bodyWidth/2; legYStart = centerY + bodyHeight/2; line(centerX - bodyWidth/2, legYStart, centerX - bodyWidth, legYEnd); line(centerX, legYStart, centerX, legYEnd); line(centerX + bodyWidth/2, legYStart, centerX + bodyWidth, legYEnd); } void draw() { }