size(600,600); 視窗大小
background(128); 背景顏色
fill(255); 方框臉顏色
noStroke();//臉 (無邊框線線)
rect(100,100,400,400); 方塊,大小
stroke(128);
strokeWeight(5);//雙眼,線條粗細
ellipse(200,300,30,30); 橢圓,大小
ellipse(400,300,30,30);
noStroke(); 嘴巴
fill(#CC6600);
ellipse(300,400,200,100);
stroke(255); 嘴巴中間的白色長條
line(200,400,400,400);
改成函式寫法
void setup(){
size(600,600);
}
void draw(){
background(128);
fill(255);
noStroke();//臉
rect(100,100,400,400);
stroke(128);
strokeWeight(5);//雙眼
ellipse(mouseX,mouseY,30,30); 新增滑鼠依附
ellipse(400,300,30,30);
noStroke();
fill(#CC6600);//嘴巴
ellipse(300,400,200,100);
stroke(255);//嘴巴的直線
line(200,400,400,400);
}//重點1:畫圖函式,每秒60次 1小時=60分,1秒=60畫面frame
眼睛會依附在滑鼠上面
1


沒有留言:
張貼留言