class MyShape { DMVector position = new DMVector(0, 0); void render() {} void setPosition(float x, float y) { position = new DMVector(x, y); } } class Man extends MyShape { DMPath facePath; DMPath bodyPath; DMPath llegPath; DMPath rlegPath; Float x,y,w,h; color currentColor = color(0, 0, 0); Man() { // edit the locations here, might be a good idea to grab a piece of graph paper facePath = new DMPath(); facePath.moveToPoint(-4, -4); facePath.curveToPoint(-4, -7.5, -2.5, -8, 0, -8); facePath.curveToPoint(2.5, -8, 4, -7.5, 4, -4); facePath.curveToPoint(4, -2.5, 2.5, 0, 0, 0); facePath.curveToPoint(-2.5, 0, -4, -2.5, -4, -4); bodyPath= new DMPath(); bodyPath.moveToPoint(0,0); bodyPath.curveToPoint(5,2, 5,7, 5,11); bodyPath.lineToPoint(5,20); bodyPath.lineToPoint(-5,20); bodyPath.lineToPoint(-5,11); bodyPath.curveToPoint(-5,7, -5,2, 0,0); llegPath= new DMPath(); llegPath.moveToPoint(-2.5,20); llegPath.lineToPoint(-2.5,20); llegPath.lineToPoint(-2.5,30); rlegPath= new DMPath(); rlegPath.moveToPoint(2.5,20); rlegPath.lineToPoint(2.5,20); rlegPath.lineToPoint(2.5,30); } void setColor(int r, int g, int b) { currentColor = color(r, g, b); } void render()//float x, float y) { pushMatrix(); translate(position.x, position.y); stroke(currentColor); //fill(150, 150); //rect(0,0,10,10); // Set the "man" object location to x,y DMPath randomFace = randomizePath(facePath); DMPath randomBody = randomizePath(bodyPath); DMPath randomLleg = randomizePath(llegPath); DMPath randomRleg = randomizePath(rlegPath); // randomize the face strokeWeight(1); randomFace.strokePath(); strokeWeight(1); randomBody.strokePath(); strokeWeight(1); randomRleg.strokePath(); strokeWeight(1); randomLleg.strokePath(); popMatrix(); } } class Man2 extends MyShape { DMPath facePath; DMPath bodyPath; DMPath llegPath; DMPath rlegPath; Float x,y,w,h; color currentColor = color(100, 100, 100); Man2() { // edit the locations here, might be a good idea to grab a piece of graph paper facePath = new DMPath(); facePath.moveToPoint(-25, -25); facePath.curveToPoint(-25, -37.5, -12.5, -50, 0, -50); facePath.curveToPoint(12.5, -50, 25, -37.5, 25, -25); facePath.curveToPoint(25, -12.5, 12.5, 0, 0, 0); facePath.curveToPoint(-12.5, 0, -25, -12.5, -25, -25); bodyPath= new DMPath(); bodyPath.moveToPoint(0,0); bodyPath.curveToPoint(35,10, 35,25, 35,60); bodyPath.lineToPoint(35,100); bodyPath.lineToPoint(-35,100); bodyPath.lineToPoint(-35,60); bodyPath.curveToPoint(-35,25, -35,5, 0,0); llegPath= new DMPath(); llegPath.moveToPoint(-15,100); llegPath.lineToPoint(-15,100); llegPath.lineToPoint(-15,140); rlegPath= new DMPath(); rlegPath.moveToPoint(15,100); rlegPath.lineToPoint(15,100); rlegPath.lineToPoint(15,140); } void setColor(int r, int g, int b) { currentColor = color(r, g, b); } void render()//float x, float y) { pushMatrix(); translate(position.x, position.y); //fill(150, 150); //rect(0,0,10,10); // Set the "man" object location to x,y stroke(100, 100, 100); DMPath randomFace = randomizePath(facePath); DMPath randomBody = randomizePath(bodyPath); DMPath randomLleg = randomizePath(llegPath); DMPath randomRleg = randomizePath(rlegPath); strokeWeight(2); stroke(currentColor); // randomize the face strokeWeight(1); randomFace.strokePath(); strokeWeight(1); randomBody.strokePath(); strokeWeight(1); randomRleg.strokePath(); strokeWeight(1); randomLleg.strokePath(); popMatrix(); } }