SHARE
TWEET

Untitled

a guest Feb 16th, 2020 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. float x = random(1280);
  2. float y= random(720);
  3. float planetsize= random(200);
  4.  
  5. color creme = color(255,253,230);
  6. color green = color(232,242,218);
  7. color teal = color(207,230,224);
  8. color skyblu = color(195,211,217);
  9. color lilac = color(194,193,204);
  10.  
  11.  
  12.  
  13. // custom function is drawPlanet
  14. void drawPlanet (float x, float y){
  15.  
  16.   color [] colorList = new color [5];
  17. colorList[0] = color (255,253,230);
  18. colorList[1] = color (232,242,218);
  19. colorList[2] = color (207,230,224);
  20. colorList[3] = color (195,211,217);
  21. colorList[4] = color (194,193,204);
  22.  
  23. for ( int n = int(random(4));;){
  24.   fill(colorList[n]);
  25.   stroke(creme);
  26. circle(x,y,planetsize);
  27. noFill();
  28. ellipse(x,y,planetsize+150,planetsize-50);
  29. }
  30. }
  31.  
  32. void setup(){
  33.   size(1280, 720);
  34.   background(40,40,100);
  35.  
  36.   float [] [] locations = new float [100][100];
  37. for (int x=0; x<100; x++){
  38. for (int y=0; y<100; y++){
  39. locations [x] [y] = random(10);
  40. }
  41. }
  42.  
  43. for (int x=0; x<40; x++){
  44. for (int y=0; y<40; y++){
  45.  
  46.   circle(x*50,y*50,locations[x][y]);
  47. }
  48. }
  49. }
  50.  
  51. void draw(){
  52.  
  53. drawPlanet(x,y);
  54. drawPlanet(x+50,y+50);
  55.  
  56. }
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