产设编程基础第二课

float circleX;

float circleY;

void setup(){

 size(640,360);

background(50);

}

void draw(){

  //shu ye

 circleX =random(-10,640);//width宽度

  circleY =random(-20,300);

 fill(#1e3f39);

 ellipse(circleX,circleY,16,24);

 //shuye2

  circleX =random(-20,640);

  circleY =random(-20,300);

 fill(#2f4226);

 ellipse(circleX,circleY,16,24);

 //shuye3

   circleX =random(200,450);

  circleY =random(20,210);

 fill(#4a6b4e);

 ellipse(circleX,circleY,10,24);

 //光1

 circleX =random(190,340);

  circleY =random(150,300);

 fill(#959e58);

 ellipse(circleX,circleY,16,24);

 //光

 circleX =random(220,300);

  circleY =random(100,150);

 fill(#9ca761);

 ellipse(circleX,circleY,16,24);

 //光2

 circleX =random(320,540);

  circleY =random(200,320);

 fill(#9ca761);

 ellipse(circleX,circleY,16,24);

 //guang3

  circleX =random(320,500);

  circleY =random(100,200);

 fill(#385c41);

 ellipse(circleX,circleY,16,24);

 //guang4

  circleX =random(280,400);

  circleY =random(60,100);

 fill(#385c41);

 ellipse(circleX,circleY,16,24);

 //树干

   circleX =random(70,120);

  circleY =random(80,380);

 fill(#14251b);

 ellipse(circleX,circleY,10,24);

 //shugan2

 circleX =random(80,200);

  circleY =random(40,200);

 fill(#14251b);

 ellipse(circleX,circleY,10,24);

 //shugan3

  circleX =random(10,400);

  circleY =random(30,90);

 fill(#14251b);

 ellipse(circleX,circleY,10,24);

 //shugan

  circleX =random(120,190);

  circleY =random(20,250);

 fill(#3d5c4c);

 ellipse(circleX,circleY,16,24);

 //shugan

  circleX =random(120,190);

  circleY =random(20,250);

 fill(#3d5c4c);

 ellipse(circleX,circleY,16,24);

 //地板

 circleX =random(0,640);

  circleY =random(200,360);

 fill(#1c3843);

 ellipse(circleX,circleY,24,18);

 //地板2

  circleX =random(0,640);

  circleY =random(300,360);

 fill(#355379);

 ellipse(circleX,circleY,24,16);

 //you

 circleX =random(550,640);//width宽度

  circleY =random(-20,300);

 fill(#2b4756);

 ellipse(circleX,circleY,16,24);

 //youshang

  circleX =random(480,640);//width宽度

  circleY =random(10,50);

 fill(#636e79);

 ellipse(circleX,circleY,16,24);

 //youshuang

  circleX =random(590,640);//width宽度

  circleY =random(30,100);

 fill(#636e79);

 ellipse(circleX,circleY,16,24);

 //diban

    circleX =random(90,400);

  circleY =random(270,300);

 fill(#d6d7c2);

 ellipse(circleX,circleY,24,16);

 //diban2

  circleX =random(90,400);

  circleY =random(270,300);

 fill(#284867);

 ellipse(circleX,circleY,24,24);

 //逻辑

 circleX=circleX +random(-2,2);

}

原创文章,作者:速盾高防cdn,如若转载,请注明出处:https://www.sudun.com/ask/82857.html

Like (0)
速盾高防cdn的头像速盾高防cdn
Previous 2024年5月31日
Next 2024年5月31日

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注