daily pastebin goal
62%
SHARE
TWEET

piti serpent

a guest Jan 16th, 2015 182 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int coul;
  2.  
  3. void setup() {
  4.   size(400, 400);
  5.   frameRate(120);
  6.  
  7.     coul = 0;
  8. }
  9.  
  10. void draw() {
  11.  
  12.   background(0);
  13.   for (int i = 0; i <100; i++) {
  14.     toto(i*5);
  15.   }
  16.  
  17.   if(mousePressed) coul = 255;
  18.   if(!mousePressed) coul = 0;
  19.  
  20. }
  21.  
  22. void toto(int pos) {
  23.  
  24.   fill(pos, coul, 0);
  25.   rect(pos, mouseY+cos(radians(pos*2))*20, 30, 50);
  26. }
  27.  
  28. void mousePressed() {
  29.  
  30.   save("toto.png");  
  31.  
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top