Skip to content

Commit

Permalink
Create Blob
Browse files Browse the repository at this point in the history
  • Loading branch information
broseidon91 committed Nov 22, 2013
1 parent c6dd35c commit 14ba8ea
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Blob
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class Blob extends Ball
{
float radius;
float radiusIntensity = 10;
float colorInt = 0;
Blob(AudioPlayer player, float X, float Y)
{
super(player, X, Y);

}


void draw()
{

stroke(255);
fill(colorInt, 255, 255);
float avg = 0;
int j = 0;
for (int i = 0; i< player.bufferSize() - 1 && i < width; i++)
{
j = i + 1;
avg += player.mix.get(i);
}
avg = abs(avg / j);
radius = (avg * 1000) + radiusIntensity;

ellipse(X, Y, radius, radius);
}
}

0 comments on commit 14ba8ea

Please sign in to comment.