Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. // Circular Waves
  2.  
  3. int x = 1;
  4.  
  5. void setup()
  6. {
  7. size(800, 800);
  8. background(255, 255, 255);
  9. strokeWeight(10);
  10. }
  11.  
  12. void draw()
  13. {
  14. if (mousePressed)
  15. {
  16. //Generates circles, with ascending diameters, where mouse click has happened
  17. background(255, 255, 255);
  18. //Each circle's diameter is 40 greater than the previous one
  19. ellipse(mouseX, mouseY, x, x);
  20. x = x + 40;
  21. } else {
  22. //Sets the initial diameter to 1, when mouse is released
  23. x =1;
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement