A Pen by Ashwin Singh on CodePen.
Created
October 25, 2015 19:40
-
-
Save ashwinsingh2007/763df723514a57493347 to your computer and use it in GitHub Desktop.
RWMVmr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<script src="https://github.com/downloads/processing-js/processing-js/processing-1.4.1.min.js"></script> | |
<script src="processing.js"></script> | |
<canvas id="mycanvas" width="1000" height="1000"> | |
<script type="text/processing" data-processing-target="mycanvas"> | |
noStroke(); | |
var x=[random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500),random(-1200,1500)]; | |
//var y=[random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,50),random(0,50),random(0,50),random(0,50),random(0,50)]; | |
var y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; | |
var ch=[random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,1000),random(0,1000),random(0,1000),random(0,1000),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500),random(0,500)]; | |
var sze= [1,1,2,2,2,2,2,2,3,3,2,2,3,3,4,4,5,5,6,5,4,6,4,6,4,7,4,10,4]; | |
var spee=[2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,4,4,4,4,5,5,5,5,5,5,5,5,5,5]; | |
var j=0; | |
void setup() | |
{ | |
size(1200,500); | |
background(125); | |
fill(255); | |
PFont fontA = loadFont("courier"); | |
textFont(fontA, 14); | |
} | |
var draw(){ | |
background(0); | |
for(int k=0;k<=28;k++) | |
{ | |
for(var i=x[k];i<1500;i+=100) | |
{ | |
ellipse(i,y[k]-ch[j],sze[k],sze[k]); | |
j++; | |
} | |
j=0; | |
for(var i=x[k];i<1500;i+=50) | |
{ | |
ellipse(i,y[k]-ch[j]-100,sze[k],sze[k]); | |
j++; | |
} | |
j=0; | |
} | |
for(int k=0;k<=28;k++) | |
{ | |
if(y[k]>=1000) | |
{ | |
x[k]=random(-1200,1500); | |
y[k]=0; | |
} | |
x[k]+=1; | |
y[k]+=spee[k]; | |
} | |
} | |
</script> | |
</canvas> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment