Dragon[] dragons; void setup() { size(400,400); dragons = new Dragon[3]; dragons[0] = new Dragon(200,200,1,1.0); dragons[1] = new Dragon(100,100,45,.5); dragons[2] = new Dragon(300,300,90,.25); } void draw() { background(255); // Rotate our dragons for (int i = 0; i < 3; i++) { dragons[i].drawDragon(); dragons[i].rotateDragon(); } } class Dragon { int locationX; int locationY; int rotation; float scalar; Dragon(int x, int y, int rot, float scl) { moveDragon(x,y); rotation = rot; scalar = scl; } void drawDragon() { pushMatrix(); strokeWeight(5); stroke(0); scale(scalar,scalar); translate(locationX,locationY); rotate(degsToRads(rotation)); bezier(-100,-100,-50,-125,50,150,100,100); ellipse(-110,-125,50,50); strokeWeight(2); stroke(255,0,0); ellipse(-120,-128,5,5); ellipse(-100,-128,5,5); popMatrix(); } float degsToRads(int degs) { return degs * PI / 180; } void rotateDragon() { // Handle rotation if (rotation <= 360) { rotation++; } else { rotation = 1; } } void moveDragon(int x, int y) { locationX = x; locationY = y; } }