Skip to content

Instantly share code, notes, and snippets.

@kdoodoo kdoodoo/final6
Last active Dec 1, 2015

Embed
What would you like to do?
var a = [];
var av;
var c = 0;
var d;
var e;
var f = 0;
function setup() {
// createCanvas(windowWidth,windowHeight);
// background(0,0,20);
}
function draw() {
createCanvas(windowWidth,windowHeight);
background(0,0,20);
//VALUE
b = 30;// mouseX-windowWidth/2;
append(a, b);
//ARRAY
if(f<windowWidth/2){
for(f = 0 ; f < a.length ; f++){
d = a[f];
c = c + d*f/2; // c + d
e = c / a.length*1.2;
noStroke();
fill(0,255,random(200,255));
ellipse(random(0,windowWidth),random(0,windowHeight),2.5,2.5);
}
//COUNTER CHANGE
}
else{
f = 0;
a=[];
//c=-1/2*c;
c=-c/500;
}
//noFill();
//noFill();
noStroke(30);
//strokeWeight(e);
//stroke(random(0,50));
///ellipse(windowWidth/2+f/3,windowHeight/2,e/1000,e/3000);
//fill(0,0,255);
//ellipse(windowWidth/2+f/3,windowHeight/2,e/1050,e/3050);
fill(255,random(80,255),0);
ellipse(windowWidth-3*f,windowHeight/2-f/30,e/5000,e/5000);
// fill(100,0,random(80,150));
fill(0,0,random(150,255));//random(0,255));
ellipse(windowWidth/2,windowHeight/2,e/5000,e/5000);
fill(255,0,random(50,255));
// fill(50,0,random(80,150));
ellipse(windowWidth/5+f*2,windowHeight/2-f/100,e/7000,e/7000);
fill(0,random(180,255),0);
// fill(50,0,random(80,150));
ellipse(windowWidth/5+f,windowHeight-f,e/9000,e/9000);
// fill(0,0,random(80,150));
fill(0,0,random(180,250));
// ellipse(windowWidth/3+f,windowHeight/4+f/3,e/9000,e/9000);
// fill(random(20,100),0,100);
ellipse(f*2,windowHeight/4+f/3,e/9000,e/9000);
// fill(50,0,random(80,150));
fill(random(180,255),0,0);
ellipse(windowWidth/9+f,windowHeight-f,e/6000,e/6000);
// fill(0,50,random(80,150));
fill(255,255,random(80,255));
ellipse(windowWidth/6+f/3,2*windowHeight/3+f/9,e/12000,e/12000);
//
fill(255,0,random(180,255));
// fill(50,50,random(80,150));
ellipse(windowWidth/2-f/2,windowHeight/5+1.5*f,e/6000,e/6000);
fill(100,0,random(180,255));
// fill(random(80,150),0,50);
ellipse(windowWidth-f*2,windowHeight/2-f/30,e/15000,e/15000);
//
// fill(50,50,random(80,150));
fill(0,255,random(80,255));
ellipse(windowWidth-5*f,windowHeight/4+f,e/6000,e/6000);
// fill(0,50,random(80,150));
fill(random(100,255),0,0);
ellipse(windowWidth/3+f*2,windowHeight/30+f/3,e/17000,e/17000);
//
// fill(50,0,random(80,150));
fill(0,0,random(80,255));
ellipse(4*windowWidth/5-f,4*windowHeight/5-f,e/6000,e/6000);
// fill(random(80,150),0,50);
fill(0,random(180,255),0);
ellipse(2*windowWidth/3-f/10,windowHeight-f*2,e/15000,e/15000);
fill(random(80,255));
// fill(50,0,random(80,150));
ellipse(windowWidth/8+f,windowHeight/3+f,e/10000,e/10000);
// fill(0,50,random(80,150));
fill(random(80,255));
ellipse(windowWidth+f/3,windowHeight+f*2,e/10000,e/10000);
//
// fill(50,0,random(80,150));
fill(random(80,255),0,0);
ellipse(f,windowHeight/4+f,e/4000,e/4000);
// fill(random(80,150),0,50);
fill(random(180,255));
ellipse(windowWidth/7+f,windowHeight+f/9,e/15000,e/15000);
// ellipse(windowWidth/3,windowHeight/2,e/20,e/20);
// ellipse(windowWidth/4,windowHeight/2,e/20,e/20);
// ellipse(windowWidth/5,windowHeight/2,e/20,e/20);
//line(windowWidth/2,windowHeight/2,e/10,e/10);
// strokeWeight(abs(e/120));
// stroke(random(0,255),0,0);
//translate(windowWidth/2,windowHeight/2);
//rotate(f);
//line(windowWidth/2,windowHeight/2,windowWidth/2+e/40,windowHeight/2);
//console.log(e);
// console.log(a);
// fill(255,0,0);
// strokeWeight(10);
// stroke(255,255,255);
// textSize(100);
// text("<<",mouseX-150,mouseY);
// text(">>",mouseX+200,mouseY);
// text(d,mouseX,mouseY);
// textSize(10);
// text(e,windowWidth/2,windowHeight/2+20);
// fill(0,0,255);
// stroke(255,255,255);
//text(c,windowWidth/2,windowHeight/2-20);
//text(f,windowWidth/2,windowHeight/2-40);
//strokeWeight(40);
//stroke(255,0,random(100,255));
//line(i+1,windowHeight/2,i+1,(d+b)/2);
//stroke(1);
//line(f,windowHeight/2,f,windowHeight/2+d);
console.log(c);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.