Advertisement
Guest User

piti serpent

a guest
Jan 16th, 2015
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement