3-1
void setup(){
size(600,600);
//background(0,0,0);
}
void draw(){
fill(255,255,255);
rect(mouseX-150,mouseY-150,50,50);
fill(255,0,0);
ellipse(mouseX,mouseY,100,100);
}
3-2
void setup(){
size(600,600);
}
float x=100,y=100;
void draw()
{
background(0,0,0);
fill(255,255,0);
ellipse(mouseX,mouseY,x+30,y+30);
fill(255,0,0);
ellipse(x,y,x-30,y-30);
x=x*0.9 + mouseX*0.1;
y=y*0.9 + mouseY*0.1;
}
沒有留言:
張貼留言