2008年5月13日 星期二

期中"電風扇"

float angle = 0.0;
void setup()
{
size(400,400);
smooth();
noStroke();
}
void draw() {
fill(132,81,151);
rect(0,0,50,50);
if(mouseX<50 && mouseY<50)
if (mousePressed == true)
{
fill(255,0,128);
rect(190,250,20,120);
fill(0,0,255);
ellipse(200, 200, 15,15);
fill(40,50);
rect(0, 0, width, height);
fill(255,0,0);
angle = angle + 10.0;
translate(200,200);
rotate(angle);
rect(-50,-10,50,10);
}
}

沒有留言: