Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int coul;
- void setup() {
- size(400, 400);
- frameRate(120);
- coul = 0;
- }
- void draw() {
- background(0);
- for (int i = 0; i <100; i++) {
- toto(i*5);
- }
- if(mousePressed) coul = 255;
- if(!mousePressed) coul = 0;
- }
- void toto(int pos) {
- fill(pos, coul, 0);
- rect(pos, mouseY+cos(radians(pos*2))*20, 30, 50);
- }
- void mousePressed() {
- save("toto.png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement