Guest User

Untitled

a guest
Oct 16th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. int num = 10;
  2. int wPositions [] = new int [num];
  3. int hPositions [] = new int [num];
  4. color [] circleColor = new color [num];
  5. int r1 [] = new int [num];
  6. int r2 [] = new int [num];
  7.  
  8. int[] x = new int[width/2];
  9. int[] y = new int[height/2];
  10.  
  11.  
  12. void setup() {
  13. background(255);
  14. size(500, 300);
  15. for (int i=0; i<num; i++) {
  16. wPositions[i] = int(random(0, width));
  17. hPositions[i] = int(random(0, height));
  18. circleColor[i] = color (random(0, 255), random(0, 255), random(0, 255));
  19. }
  20. }
  21. void draw() {
  22. background(255);
  23. for (int i=0; i<num; i++) {
  24. noStroke();
  25.  
  26. circle(wPositions[0], hPositions[0]);
  27. circle1(wPositions[1], hPositions[1]);
  28. circle2(wPositions[2], hPositions[2]);
  29. circle3(wPositions[3], hPositions[3]);
  30. circle4(wPositions[4], hPositions[4]);
  31. }
  32. }
  33. void circle(int x, int y) {
  34. //fill(0, 0, 200, 40);
  35. for (int i = 0; i<num; i++) {
  36. fill(circleColor[i]);
  37. ellipse(x, y, 150, 150);
  38. }
  39. }
  40. void circle1(int x, int y) {
  41. for (int i = 0; i<num; i++) {
  42. fill(circleColor[i], 70);
  43. ellipse(x, y, 100, 70);
  44. }
  45. }
  46. void circle2(int x1, int y1) {
  47. for (int i = 0; i<num; i++) {
  48. fill(circleColor[i], 10);
  49. ellipse(x1, y1, 200, 200);
  50. }
  51. }
  52. void circle3(int x1, int y1) {
  53. noFill();
  54. stroke(220);
  55. strokeWeight(10);
  56. ellipse(x1, y1, 150, 150);
  57. }
  58. void circle4(int x1, int y1) {
  59. noFill();
  60. stroke(100);
  61. strokeWeight(4);
  62. ellipse(x1, y1, 100, 130);
  63. }
Add Comment
Please, Sign In to add comment