Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ProbeDroid droids;
- int num = 10;
- int [] x = new int[num];
- int [] y = new int[num];
- void setup(){
- size(512, 512);
- smooth();
- strokeWeight(1);
- }
- void draw() {
- background(25);
- for(int i = x.length - 1; i > 0; i--){
- x[i] = x[i-1];
- y[i] = y[i-1];
- }
- x[0] = mouseX;
- y[0] = mouseY;
- for (int i = 0; i < x.length; i++){
- droids = new ProbeDroid(-64 + x[i], -16 + y[i], .25);
- droids.display();
- }
- }
- class ProbeDroid {
- int xpos;
- int ypos;
- float scalar;
- float bodyWidth = 140;
- float bodyHeight = 420;
- ProbeDroid(int x, int y, float s){
- xpos = x;
- ypos = y;
- scalar = s;
- }
- void display(){
- pushMatrix();
- translate(xpos, ypos);
- scale(scalar);
- fill(#465042);
- //head and neck
- rect(230, 70, 52, 30);
- arc(256, 64, bodyWidth* 0.9, bodyHeight*.13, PI, TWO_PI);
- arc(256, 64, bodyWidth *0.9, bodyHeight *.07, TWO_PI, PI+TWO_PI);
- arc(256, 100, bodyWidth, bodyHeight*.07, PI, TWO_PI);
- //"arms"
- rect(256 - bodyWidth/3, 125, 94, 10);
- quad(248, 142, 270, 142, 280, 195, 266, 200);
- quad(262, 195, 280, 195, 220, 230, 210, 230);
- rect(215, 230, 55, 6);
- rect(270, 215, 6, 35);
- ellipse(260, 142, 25, 25);
- ellipse(272, 195, 18, 18);
- ellipse(215, 232, 15, 15);
- ellipse(273, 233, 12, 12);
- quad(210, 130, 220, 130, 218, 140, 208, 140);
- quad(210, 145, 220, 145, 240, 155, 230, 155);
- strokeWeight(2);
- line(238, 155, 238, 195);
- strokeWeight(1);
- line(234, 155, 234, 195);
- quad(235, 195, 240, 198, 220, 215, 210, 200);
- ellipse(213, 143, 12, 12);
- ellipse(235, 155, 12, 12);
- ellipse(235, 195, 12, 12);
- quad(290, 130, 300, 130, 300, 145, 290, 145);
- quad(290, 145, 300, 145, 325, 158, 320, 160);
- strokeWeight(2);
- line(322, 160, 315, 190);
- strokeWeight(1);
- quad(315, 190, 315, 195, 300, 200, 295, 190);
- ellipse(295, 145, 12, 12);
- ellipse(322, 160, 10, 10);
- ellipse(315, 190, 8, 8);
- //body mass
- quad(256 - bodyWidth/2, 100.0, 256 + bodyWidth/2, 100.0,
- 256 + (bodyWidth/2)*0.8, 130.0, 256 - (bodyWidth/2)*0.8, 130.0);
- quad(256 - bodyWidth/4.5, 35, 256 + bodyWidth/4.5, 35,
- 256 + bodyWidth/3.5, 42, 256 - bodyWidth/3.5, 42);
- quad(256, 102, 256 + bodyWidth/5, 102, 256+bodyWidth/5, 132, 256, 132);
- //head details 1
- arc(256 + bodyWidth*.05, 35, bodyWidth*.25, 10, PI, TWO_PI);
- rect(235, 15, 3, 20);
- rect(230, 20, 3, 15);
- //draw the eyes
- fill(0);
- arc(256 - bodyWidth *.36, 60, 28, 25, HALF_PI, PI+HALF_PI);
- ellipse(256 - bodyWidth/3, 58, 10, 10);
- ellipse(256 - bodyWidth/6, 64, 18, 18);
- ellipse(256 + bodyWidth/6, 60, 22, 22);
- arc(256 + bodyWidth/2.5, 62, 16, 16, PI+HALF_PI, TWO_PI+HALF_PI);
- popMatrix();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement