Ciao 访客, welcome back to old school! :p
float xPos,yPos,d,r;void setup(){ size(500,500); smooth(); xPos=width/2 ; yPos=height/2; r=50;}void draw(){ background(255); fill(0); noStroke(); ellipse(xPos,yPos,r,r);}void mouseMoved(){ d=dist(xPos,yPos,mouseX,mouseY); if(d<=r){ xPos+=random(-80,80); yPos+=random(-80,80); }}
Kyle hiKyle;void setup() { size(600, 600); smooth(); hiKyle=new Kyle(color(#F25711));}void draw(){ background(255); hiKyle.display(); hiKyle.changecolor();}class Kyle{ color c; float d; float r; int x; int y;Kyle(color c){ c=color(#F25711); r=25; x=0; y=0;}void display() { //legs noStroke(); fill(#106B65); rect(170, 500, 260, 75); //shoes fill(#36333B); stroke(#36333B); strokeWeight(9); strokeJoin(ROUND); triangle(150, 580, 300, 570, 450, 580); //cloth shadow noFill(); stroke(#5F3C1C); strokeCap(SQUARE); beginShape(); curveVertex(172,524); curveVertex(172,524); curveVertex(245,541); curveVertex(355,541); curveVertex(428,524); curveVertex(428,524); endShape(); //body noStroke(); fill(c); arc(300, 500, 340, 400, PI, TWO_PI); arc(300, 500, 320, 90, 0, PI); //arms stroke(0); strokeWeight(2); beginShape(); curveVertex(180,435); curveVertex(180,435); curveVertex(176,445); curveVertex(170,465); curveVertex(170,460); endShape(); beginShape(); curveVertex(420,435); curveVertex(420,435); curveVertex(424,445); curveVertex(430,465); curveVertex(430,460); endShape(); //glove fill(#43B135); noStroke(); ellipse(140, 480, 60, 60); ellipse(460, 480, 60, 60); stroke(0); strokeWeight(1); ellipse(160, 470, 23, 23); ellipse(440, 470, 23, 23); //pokets strokeWeight(3); line(300, 350, 300, 547); noFill(); strokeWeight(2); rect(220, 430, 40, 55); rect(340, 430, 40, 55); triangle(220, 430, 260, 430, 240, 455); triangle(340, 430, 380, 430, 360, 455); //collar stroke(0); strokeWeight(1); fill(#02A441); pushMatrix(); translate(236, 388); rotate(radians(25)); ellipse(0, 0, 140, 40); popMatrix(); pushMatrix(); translate(364, 388); rotate(radians(155)); ellipse(0, 0, 140, 40); popMatrix(); //face noStroke(); fill(#FFEABD); ellipse(300, 230, 360, 360); //hat stroke(#43B135); strokeWeight(40); strokeJoin(ROUND); fill(#43B135); rect(140, 30, 320, 110); noStroke(); pushMatrix(); noStroke(); fill(#43B135); translate(109, 225); rotate(radians(110)); ellipse(0, 0, 180, 75); popMatrix(); pushMatrix(); noStroke(); fill(#43B135); translate(491, 225); rotate(radians(70)); ellipse(0, 0, 180, 75); popMatrix(); fill(#02A441); rect(140, 80, 320, 80); stroke(#02A441); strokeWeight(20); strokeCap(SQUARE); noFill(); beginShape(); curveVertex(141,170); curveVertex(141,170); curveVertex(300,150); curveVertex(459,170); curveVertex(459,170); endShape(); stroke(#208D2E); strokeWeight(3); line(140, 80, 460, 80); //eyebrow stroke(0); strokeWeight(8); strokeCap(SQUARE); line(190, 180, 240, 150); line(410, 180, 360, 150); //eye shadow pushMatrix(); noStroke(); fill(0, 30); translate(251, 223); rotate(radians(135)); ellipse(0, 0, 110, 90); popMatrix(); pushMatrix(); noStroke(); fill(0, 30); translate(349, 223); rotate(radians(45)); ellipse(0, 0, 110, 90); popMatrix(); //eye pushMatrix(); noStroke(); fill(255); translate(250, 225); rotate(radians(135)); ellipse(0, 0, 110, 90); popMatrix(); pushMatrix(); noStroke(); fill(255); translate(350, 225); rotate(radians(45)); ellipse(0, 0, 110, 90); popMatrix(); //eyeball fill(0); noStroke(); ellipse(270,230,10,10); ellipse(330,230,10,10); //mouth fill(0); stroke(0); strokeWeight(3); strokeJoin(ROUND); triangle(250, 330, 350, 330, 300, 370); //tooth fill(255); stroke(255); strokeWeight(2); strokeJoin(ROUND); beginShape(); vertex(261,331); vertex(267,341); vertex(277,341); vertex(280,331); endShape(); beginShape(); vertex(284,331); vertex(283,341); vertex(302,340); vertex(301,330); endShape(); beginShape(); vertex(306,331); vertex(307,341); vertex(320,341); vertex(323,330); endShape(); beginShape(); vertex(328,331); vertex(325,340); vertex(327,341); vertex(332,340); vertex(345,330); endShape(); //button noStroke(); fill(#27FFD5); ellipse(550,50,r,r); fill(#FF5895); rect(540,100,r,r);}void changecolor(){ d=dist(550,50,mouseX,mouseY); if(d<r){ c=color(#27FFD5); }else if (mouseX>=540&&mouseX<=590&&mouseY>=100&&mouseY<=150) { c=color(#FF5895); }else{ c=color(#F25711); }}}