Jiggle[] circles = new Jiggle [25];
Jiggle[] squid = new Jiggle [25];
img = loadImage("Box-Jellyfish-PNG-Image.png");
for(int i=0;i<circles.length;i++){
circles[i] = new Jiggle(int(random(width)),int(random(height)),int(random(minSize,maxSize)),int(random(minSpeed,maxSpeed)),(color(int(random(255)),int(random(255)),int (random(255)))));
squid[i] = new Jiggle(int(random(width)),int(random(height)),int(random(minSize,maxSize)),int(random(minSpeed,maxSpeed)),(color(int(random(255)),int(random(255)),int (random(255)))));
for(int i=0;i<circles.length;i++){
squid[i].hunt(circles[i].xPos,circles[i].yPos);
if ( squid[i].xPos == circles[i].xPos && squid[i].yPos == circles[i].yPos ){
circles[i].xPos = int(random(width));
circles[i].yPos = int(random(height));
int randomTarget = int(random(circles.length));
circles[randomTarget].xPos = mouseX;
circles[randomTarget].yPos = mouseY;
int xPos,yPos,Size,Speed;
Jiggle(int xPos,int yPos,int Size,int Speed,color Color){
image(img,this.xPos,this.yPos,this.Size,this.Size);
ellipse(this.xPos,this.yPos,this.Size,this.Size);
if ( x == 0 ) this.xPos -= (this.Speed);
if ( x == 1 ) this.xPos += (this.Speed);
if ( x == 2 ) this.yPos -= (this.Speed);
if ( x == 3 ) this.yPos += (this.Speed);
this.xPos -= (this.Speed);
this.yPos -= (this.Speed);
this.xPos += (this.Speed);
this.yPos -= (this.Speed);
this.xPos += (this.Speed);
this.yPos += (this.Speed);
this.xPos -= (this.Speed);
this.yPos += (this.Speed);
if (this.xPos > width) this.xPos = width;
if (this.xPos < 0) this.xPos = 0;
if (this.yPos > height) this.yPos = height;
if (this.yPos < 0) this.yPos = 0;
void hunt(int tX,int tY){
if ( this.xPos > tX ) this.xPos -= (this.Speed);
if ( this.xPos < tX ) this.xPos += (this.Speed);
if ( this.yPos > tY ) this.yPos -= (this.Speed);
if ( this.yPos < tY ) this.yPos += (this.Speed);
if ( this.xPos > tX && this.yPos > tY ){
this.xPos -= (this.Speed);
this.yPos -= (this.Speed);
if ( this.xPos < tX && this.yPos > tY ){
this.xPos += (this.Speed);
this.yPos -= (this.Speed);
if ( this.xPos < tX && this.yPos < tY ){
this.xPos += (this.Speed);
this.yPos += (this.Speed);
if ( this.xPos > tX && this.yPos < tY ){
this.xPos -= (this.Speed);
this.yPos += (this.Speed);