Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float x = random(1280);
- float y= random(720);
- float planetsize= random(200);
- color creme = color(255,253,230);
- color green = color(232,242,218);
- color teal = color(207,230,224);
- color skyblu = color(195,211,217);
- color lilac = color(194,193,204);
- // custom function is drawPlanet
- void drawPlanet (float x, float y){
- color [] colorList = new color [5];
- colorList[0] = color (255,253,230);
- colorList[1] = color (232,242,218);
- colorList[2] = color (207,230,224);
- colorList[3] = color (195,211,217);
- colorList[4] = color (194,193,204);
- for ( int n = int(random(4));;){
- fill(colorList[n]);
- stroke(creme);
- circle(x,y,planetsize);
- noFill();
- ellipse(x,y,planetsize+150,planetsize-50);
- }
- }
- void setup(){
- size(1280, 720);
- background(40,40,100);
- float [] [] locations = new float [100][100];
- for (int x=0; x<100; x++){
- for (int y=0; y<100; y++){
- locations [x] [y] = random(10);
- }
- }
- for (int x=0; x<40; x++){
- for (int y=0; y<40; y++){
- circle(x*50,y*50,locations[x][y]);
- }
- }
- }
- void draw(){
- drawPlanet(x,y);
- drawPlanet(x+50,y+50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement