int sphereDiameter = 10;
 boolean shoot = false;
 Â
 int randx()
 {
  return int(random(600));
 }
 Â
 int[] sphereXCoords = { randx(), randx(), randx(), randx(), randx() };
 int[] sphereYCoords = { 0, 0, 0, 0, 0 };
 Â
 void setup()
 {
  size(600,620);
 }
 Â
 void draw()
 {
  background(0);
  fill(color(0,255,0));
  stroke(color(0,255,0));
  triangle(mouseX-8, 580, mouseX+8, 580, mouseX, 565);
  fill(color(255,0,0));
  stroke(color(255,0,0));
 Â
  if(shoot==true)
  {
   sphereKiller(mouseX);
   shoot = false;
  }
 Â
  sphereDropper();
  gameEnder(); Â
 }
 Â
 void mousePressed()
 {
  shoot = true;
 }
 Â
 void sphereDropper()
 { Â
  stroke(255);
  fill(255);
  for (int i=0; i<5; i++)
  {
   ellipse(sphereXCoords[i], sphereYCoords[i]++,
       sphereDiameter, sphereDiameter);
  }
 }
 Â
 void sphereKiller(int shotX)
 {
  boolean hit = false;
  for (int i = 0; i < 5; i++)
  {
   if((shotX >= (sphereXCoords[i]-sphereDiameter/2)) &&Â
     (shotX <= (sphereXCoords[i]+sphereDiameter/2)))
   {
    hit = true;
    line(mouseX, 565, mouseX, sphereYCoords[i]);
    ellipse(sphereXCoords[i], sphereYCoords[i],
        sphereDiameter+25, sphereDiameter+25);
    sphereXCoords[i] = randx();
    sphereYCoords[i] = 0;
   }  Â
  }
 Â
  if(hit == false)
  {
   line(mouseX, 565, mouseX, 0);
  } Â
 Â
 }
 Â
 void gameEnder()
 {
  for (int i=0; i< 5; i++)
  {
   if(sphereYCoords[i]==600)
   {
    fill(color(255,0,0));
    noLoop();
   }
  }
 }
Â