// OOP EXample: Robots is a visual robot Robot[] bots; int N = 10; Robot r; void setup() { size(600, 600); background(255); r = new Robot(50); // Createa robot object/instance println(r); // using the print method bots = new Robot[N]; for (int i = 0; i < N; i++) { bots[i] = new Robot(random(20, 40)); } } // setup()
void draw() { background(255); r.move(); r.display(); for (Robot r : bots) { r.move(); r.display(); } } // draw()