65



float x;
float y;
float speed = 1.0;
float speed2 = 1.2;
int radius = 22;
void setup(){
size(400,400);
noStroke();
}

void draw(){
x += speed;
y += speed2;
if(x > width-radius|| x <> height-radius){
speed2 *= -1;
}
fill(random(255),random(255),random(255));
rect(x,y,radius,radius);

}

コメント