float t;
float x,y;
void setup(){
size(360,202);
frameRate(50);
colorMode(HSB);
background(20);
stroke(255,0,0,100);
strokeWeight(0.3);
//
t = 0;
x = 0;
}
void draw(){
strokeWeight(random(1,5));
stroke(random(100,255),255,255);
translate(0,height/2);
if(random(0,1)<0.2){
line(x,height/4,x,-height/3 * random(0,1));
}
t += 1;
x = 5*t;
if (x > width){
x = 0;
t = 0;
}
}
void keyPressed() {
// 按键1~5:调节动画速率;
if(key == '1'){
frameRate(1);
println("FPS reset 1: to 1 ----> Current FPS: ", frameRate);
}
el