Wednesday, April 04, 2012
Spawning Galaxy
// just type here
// and click "save" when your done
int frameCount = 0;
int ranDom = random(1.5,4.3);
int addRandom = random(1,300);
int randomRing5 = random(620,680);
int randomRing6 = random(845,871);
int randomRing7 = random(1000,1050);
int randomRing8 = random(1200,1300);
int randomRing9 = random(1400,1471);
int randomRing10 = random(1600,1700);
int randomRing11 = random(1750,1900);
int ringRange2 = random(2,4);
int ringRange3 = random(4.5,6);
int ringRange4 = random(6.5,8);
int ringRange5 = random(8.5,10);
int ringRange6 = random(10.5,12);
int ringRange7 = random(12.5,14);
int ringRange8 = random(14.5,16);
int ringRange9 = random(16.5,18);
int ringRange10 = random(18.5,20);
int ringRange11 = random(20.5,22);
void setup(){
background(0);
size(600,600);
fill(random(0,255),125,125);
noStroke();
int m = 0;
for(int i = 900; i > 0; i--)
{ m = map (i,1000,0,50,0);
fill(m,m,m);
m = map (i,1000,0,260,0);
ellipse(width/ranDom+addRandom,height/ranDom+addRandom,i,m);
}
}
void draw() {
frameCount++;
int x = sin(frameCount)* width/8;
int y = cos(frameCount)* height/40;
//galaxy rings added individual colour randomisers
//ring 1
translate(width/ranDom+addRandom,height/ranDom+addRandom);
fill(random(125,200),random(125,200),random(125,250));
ellipse(x,y,0.45,1);
//ring 2 - sets when it will spawn ( 100 frames after ring one)
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 100) {
ellipse(x*ringRange2,y*ringRange2,1,2);
}
//ring 3
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 250) {
ellipse(x*ringRange3,y*ringRange3,2,2);
}
//ring 4
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 450) {
ellipse(x*ringRange4,y*ringRange4,2,2);
}
//ring5
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing5) {
ellipse(x*ringRange5,y*ringRange5,2,3);
}
//ring6
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing6) {
ellipse(x*ringRange6,y*ringRange6,2,3);
}
//ring7
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing7) {
ellipse(x*ringRange7,y*ringRange7,2,3);
}
//ring8
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing8) {
ellipse(x*ringRange8,y*ringRange8,2,3);
}
//ring9
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing9) {
ellipse(x*ringRange9,y*ringRange9,2,3);
}
//ring10
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing10) {
ellipse(x*ringRange10,y*ringRange10,2,4);
}
//ring11
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing11) {
ellipse(x*ringRange11,y*ringRange11,2,4);
}
}
// and click "save" when your done
int frameCount = 0;
int ranDom = random(1.5,4.3);
int addRandom = random(1,300);
int randomRing5 = random(620,680);
int randomRing6 = random(845,871);
int randomRing7 = random(1000,1050);
int randomRing8 = random(1200,1300);
int randomRing9 = random(1400,1471);
int randomRing10 = random(1600,1700);
int randomRing11 = random(1750,1900);
int ringRange2 = random(2,4);
int ringRange3 = random(4.5,6);
int ringRange4 = random(6.5,8);
int ringRange5 = random(8.5,10);
int ringRange6 = random(10.5,12);
int ringRange7 = random(12.5,14);
int ringRange8 = random(14.5,16);
int ringRange9 = random(16.5,18);
int ringRange10 = random(18.5,20);
int ringRange11 = random(20.5,22);
void setup(){
background(0);
size(600,600);
fill(random(0,255),125,125);
noStroke();
int m = 0;
for(int i = 900; i > 0; i--)
{ m = map (i,1000,0,50,0);
fill(m,m,m);
m = map (i,1000,0,260,0);
ellipse(width/ranDom+addRandom,height/ranDom+addRandom,i,m);
}
}
void draw() {
frameCount++;
int x = sin(frameCount)* width/8;
int y = cos(frameCount)* height/40;
//galaxy rings added individual colour randomisers
//ring 1
translate(width/ranDom+addRandom,height/ranDom+addRandom);
fill(random(125,200),random(125,200),random(125,250));
ellipse(x,y,0.45,1);
//ring 2 - sets when it will spawn ( 100 frames after ring one)
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 100) {
ellipse(x*ringRange2,y*ringRange2,1,2);
}
//ring 3
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 250) {
ellipse(x*ringRange3,y*ringRange3,2,2);
}
//ring 4
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > 450) {
ellipse(x*ringRange4,y*ringRange4,2,2);
}
//ring5
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing5) {
ellipse(x*ringRange5,y*ringRange5,2,3);
}
//ring6
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing6) {
ellipse(x*ringRange6,y*ringRange6,2,3);
}
//ring7
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing7) {
ellipse(x*ringRange7,y*ringRange7,2,3);
}
//ring8
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing8) {
ellipse(x*ringRange8,y*ringRange8,2,3);
}
//ring9
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing9) {
ellipse(x*ringRange9,y*ringRange9,2,3);
}
//ring10
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing10) {
ellipse(x*ringRange10,y*ringRange10,2,4);
}
//ring11
fill(random(125,200),random(125,200),random(125,250));
if(frameCount > randomRing11) {
ellipse(x*ringRange11,y*ringRange11,2,4);
}
}
comments
loading...
Add a comment: