1.花朵自己會轉動
[程式碼]
void setup(){
size(600,600);
}
float rrr;
void draw(){
background(255);
fill(215,220,247,(200)); stroke(255,(200)); rect(30,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(80,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(130,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(180,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(230,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(280,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(330,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(380,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(430,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(480,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(530,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(580,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(580,0,20,600);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,30,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,80,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,130,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,180,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,230,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,280,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,330,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,380,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,430,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,480,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,530,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,580,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,580,600,20);
translate(300,300);
rotate(rrr); rrr+=0.01;
fill(255,174,201);
for(int i=0;i<18;i++)
{
rotate(PI/6);//random(PI*2)
ellipse(100,0,200,45);
}
fill(255,255,179,(125));
stroke(255,255,179);
ellipse(0,0,50,50);
}
1.花朵跟著滑鼠移動
[程式碼]
void setup(){
size(600,600);
}
float rrr;
void draw(){
background(255);
fill(215,220,247,(200)); stroke(255,(200)); rect(30,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(80,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(130,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(180,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(230,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(280,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(330,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(380,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(430,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(480,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(530,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(580,0,20,600);
fill(215,220,247,(200)); stroke(255,(200)); rect(580,0,20,600);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,30,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,80,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,130,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,180,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,230,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,280,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,330,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,380,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,430,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,480,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,530,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,580,600,20);
fill(185,230,240,(200)); stroke(255,(200)); rect(0,580,600,20);
translate(mouseX,mouseY);
rotate(rrr); rrr+=0.01;
fill(255,174,201);
for(int i=0;i<18;i++)
{
rotate(PI/6);//random(PI*2)
ellipse(100,0,200,45);
}
fill(255,255,179,(125));
stroke(255,255,179);
ellipse(0,0,50,50);
}
3.期中作業想做什麼
小狗雷克斯誤入了繪畫世界。
牠知道回家的路線,但路途遙遠。
幸運的是,牠將在路上找到各種美味的糖果骨頭來增強體力。
另外,牠還可以使用魔法道具:
可以隨意改變景觀的三種蠟筆,還有能夠擦除繪畫的橡皮擦。
快點來展示您的聰明才智,幫助雷克斯回家吧!
93
回覆刪除