Hey guys! (:

I'm working on this game that kind of resembles Frogger. I'm having trouble to end the game when PacMan and the Ghosts intersect with each other. Can anyone help out?

Java Code:
Pacman pacman;
Grape newGrape;
PFont f;
int score = 0;
float frameCnt1, frameCnt2;

PFont font;

//String milTime = "010";
String secTime = "010";
String minTime = "010";

//int ml;
int s;//second specific variable
int m;//minute specific variable

//int milInterval = 1000;
int secInterval = 60;//second interval
int minInterval = 2;//minute interval

boolean lost = false;
PImage gameover;

void setup() 
{
  
  size(1100, 900);
  pacman = new Pacman();
  newGrape = new Grape();
  smooth();
  f = createFont("Arial",12,true); // A font to write text on the screen
  
  gameover = loadImage("game_over.png");
    
}
void draw() 
{
  background(255);
  
  if(lost == true)
  {
    stop();
    println("Re-run to start over!");
  }
  
  int a = 50;
  int b = 330;
  int x = 10;
  int y = 10;
  
  s = secInterval-int(millis()/1000);//the int() converts the primitive datatype or string to an integer
  secTime = nf(s, 2); // this formats the t integer into a string
  
  m = minInterval - int(millis()/60000);
  minTime = nf(m, 2);
  
  
  if(m >= 0 && s >= 0)
  {
    if(s == 0)
    {
      secInterval+=60;//seconds revert baca to 60
    }
  
    else if(s == 0 && m != 0)
    {
      secInterval+=60;//seconds revert baca to 60
    }
  
    else if(s == 0 && m == 0)
    {
      secTime = "00";
      minTime = "00";
    
    }
    text(minTime+": "+secTime, 50, 60);
  
    }
    else
    {
      textMode(CENTER);
      image(gameover, 550, 450); 
      lost = true;
      text("00: 00", 50, 60);
    }
    
  text("Score: "+ score, 100, 100);
  
  //
  newGrape.display();
  pacman.display();
  pacman.move();
  //
  if (rectangle_collision (pacman.xpos, pacman.ypos, pacman.sizeW, pacman.sizeH,
  newGrape.xpos, newGrape.ypos, newGrape.sizeW, newGrape.sizeH)) { 
    // println ("hit");
    newGrape = new Grape();
    score++;
  }
  
  //Ghosts speed
  frameCnt1 = frameCnt1 + 3; 
  frameCnt2 = frameCnt2 - 3;
  
  //Ghosts moving horizontally
  Ghost(frameCnt1, height/4); //ghost on top
  if(frameCnt1>width)
  {
    frameCnt1 = 0;
  }
  
  Ghost(frameCnt2, height/2); //ghost in middle
  if (frameCnt2 < 0)
  {
    frameCnt2 = width;
  }
  
  Ghost(frameCnt1, 3*height/4); //ghost on bottom
  if(frameCnt1>width)
  {
    frameCnt1 = 0;
  }
  
  
  //Ghosts moving vertically
  Ghost(width/4,frameCnt1); //ghost on left
  if (frameCnt1>height)
  {
    frameCnt1 = 0;
  }
  
  Ghost(width/2, frameCnt2); //ghost in middle
  if (frameCnt2 < 0)
  {
    frameCnt2 = height;
  }
  
  Ghost(3*width/4, frameCnt1); //ghost on right
  if(frameCnt1>height)
  {
    frameCnt1 = 0;
  }
  
/*  
  //Grid
  fill(0);
  //Vertical lines
  line(width/4, 0, width/4, height);
  line(width/2, 0, width/2, height);
  line(3*width/4, 0, 3*width/4, height);
  //Horizontal Lines
  line(0, height/4, width, height/4);
  line(0, height/2, width, height/2);
  line(0, 3*height/4, width, 3*height/4);
*/
}
//
boolean rectangle_collision(float x_1, float y_1, float width_1, float height_1,
float x_2, float y_2, float width_2, float height_2)
// from PhiLho
{
  return !(x_1 > x_2+width_2 || x_1+width_1 < x_2 || y_1 > y_2+height_2 || y_1+height_1 < y_2);
}
// =========================================================
void keyPressed() {
  int k = keyCode;
  if (k == ENTER | k == RETURN)
    pacman.speed = pacman.speed + 1;
  else if (k == ' ') 
    pacman.speed = pacman.speed - 1;
  else if (k == UP)     pacman.up    = true;
  else if (k == DOWN)   pacman.down  = true;
  else if (k == LEFT)   pacman.left  = true;
  else if (k == RIGHT)  pacman.right = true;
}
void keyReleased() {
  int k = keyCode;
  if      (k == UP)     pacman.up    = false;
  else if (k == DOWN)   pacman.down  = false;
  else if (k == LEFT)   pacman.left  = false;
  else if (k == RIGHT)  pacman.right = false;
}

void Ghost(float c, float v)
{
  stroke(0, 150, 255);
  fill(0, 150, 255);  
  arc(c, v, 40, 85, PI, 2*PI-PI/250, CHORD); //Ghost's body
  
  fill(0);
  ellipse(c - 7, v - 25, 6, 6); //Ghost's eyes
  ellipse(c + 7, v - 25, 6, 6); 
 
}
// =========================================================
class Pacman {
  color c;
  float xpos;
  float ypos;
  float speed=7;
  int sizeW = 50;
  int sizeH = 50;
  boolean up, down, left, right;
  float topBorderC;
  float bottomBorderC;mk
  float rightBorderC;
  float leftBorderC;
  Pacman() {
    c = color(255,255,0);
    xpos = width/2;
    ypos = width/2;
    setBordersC() ;
  }
  void intersect(float ghostXPos, float ghostYPos)
  {
    if(xpos == ghostXPos && ypos == ghostYPos){ //if pacman's x and y position = the ghosts'
       lost = true;                                   // GG
    } 
  }
  
  void setBordersC() {
    topBorderC = ypos - sizeW/2;
    bottomBorderC = ypos + sizeW/2;
    rightBorderC = xpos + sizeH/2;
    leftBorderC = xpos - sizeH/2;
  }
  void display() {
    rectMode(CENTER);
    stroke(0);
    fill(c);
    arc(xpos, ypos, sizeW, sizeH, PI/6, 2*PI-PI/3, PIE);
    fill(0);
    ellipse(xpos-4, ypos-6,5,5);
  }
  void move() 
  {
    if (up)
    {
      if(ypos > 30)
      {
        ypos -= speed;
      }
    }
    if (down)  
    {
      if(ypos < 870)
      {
        ypos += speed;
      }
    }
    if (left)  
    {
      if(xpos>30)
      {
        xpos -= speed;
      }
    }
    if (right) 
    {
      if(xpos<1070)
      {
        xpos += speed;
      }
    }
  }
}
// =========================================================
class Grape {
  color c;
  float xpos;
  float ypos;
  int sizeW = 10;
  int sizeH = 10;
  float topBorderG;
  float bottomBorderG;
  float rightBorderG;
  float leftBorderG;
  //  float speed;
  Grape() {
    c = color(random(180, 255), 44, 208);
    xpos = int(random(width));
    ypos = int(random(height));
    setBordersG();
  }
  void setBordersG() {
    topBorderG = ypos - sizeW/2;
    bottomBorderG = ypos + sizeW/2;
    rightBorderG = xpos + sizeH/2;
    leftBorderG = xpos - sizeH/2;
  }
  void display() {
    rectMode(CENTER);
    stroke(0);
    fill(c);
    setBordersG();
    rect(xpos, ypos, sizeW, sizeH);
  }
  void tele() {
    xpos = int(random (width));
    ypos = int(random(height));
  }
}
Line 214 is where the intersection code is.
I'm using Processing.

Thanks in advanced!