扇扇扇扇扇
呼~
雖然基本程式不難寫
但是後來要把它改比較好看一點反而比較難一點...
一開始本來想爛爛的就算了
但是看到好多人得很好看
轉得很有feel
所以就給他稍微改一下
雖然還是很爛~"~(抱歉喔)
程式碼:
float angle = 0.0;void setup() {size(600, 600);smooth();noStroke(); background(0); frameRate(1000);}void draw() {rect(0,0,100,100);stroke(255,0,128);stroke(200,0,200,200);rect(0,0,0,150);if(mousePressed != true){ background(0);strokeWeight(10);translate(300, 300);stroke(200,0,200,200);rect(0,0,0,150);stroke(200,200,0,200);line(0, 0, 60, 0);line(0, 0, -60, 0);line(0, 0, 0, 60);line(0, 0,0,-60);}if(mousePressed == true)if(mouseX<100 && mouseY<100){stroke(200,0,200,200);rect(0,0,0,150);fill(0, 12);rect(0, 0, width, height);strokeWeight(10);fill(255);angle = angle + 0.2;translate(300, 300);stroke(200,0,200,200);rect(0,0,0,150);rotate(angle);stroke(200,200,0,200);line(0, 0, 60, 0);line(0, 0, -60, 0);line(0, 0, 0, 60);line(0, 0,0,-60);}}
沒有留言:
張貼留言