さやえんどう
/** * pea * * @author aa_debdeb * @date 2016/10/02 */ void setup(){ size(640, 480); } void draw(){ background(0); stroke(0, 255, 0); strokeWeight(50); line(120, height / 2, 520, height / 2); stroke(0); strokeWeight(40); line(120, height / 2, 520, height / 2); noStroke(); fill(0, 255, 0); for(int i = 0; i <= 300; i++){ if(i % 20 == frameCount % 20){ float x = map(i, 0, 300, 120, 520); ellipse(x, height / 2, 20, 20); } } }