y how would I make a mouse-controlled cell object that will “eat” the pellets, pellets dissapear like in agario

How would we make it such that when the cell is within the appropriate proximity which is less than the sum of the radius of the pellet and the radius of the circle
The pellet disappears and the cell increases by a small factor

import java.io.*;
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;  
import javax.swing.event.*;
import java.awt.image.BufferedImage;

class Agario extends JFrame 
// Creates layered pane
JLayeredPane pane = new JLayeredPane();

// Stores default cell image
ImageIcon defaultCell = new ImageIcon("Default Cell.png");   

// Creates cell
Cell cell = new Cell(150,150,defaultCell,pane);

// Sets font 
Font font = new Font("Sans Serif Bold", Font.BOLD, 40);

constructor of class

public Agario()

// Creates frame

// Begins with lesson

public void game()
// Adds environment
Environment environment = new Environment(pane);

// Adds mouse-controlled cell

// Creates pellets
Pellets pellets = new Pellets(20,0,970,80,590,pane);  

public static void main(String[] args)
Agario agario = new Agario();

class Environment 
public Environment(JLayeredPane pane)
// Adds grid to layered pane
ImageIcon grid = new ImageIcon("Grid.png");
JLabel petri = new JLabel(grid);
pane.add(petri,new Integer(1),0);

mouse lsinter part

class Cell 
int x,y,radius;
boolean mouseMotionListenerActive;

public Cell(int width, int height, ImageIcon icon, JLayeredPane pane)
radius = width/2;

// Adds mouse motion listener

// Converts image icon to image object for compatibility purposes
Image original = icon.getImage();

// Resizes cell 
int size = Math.min(width,height);
BufferedImage resized = new BufferedImage(size, size, 
Graphics2D g = resized.createGraphics();

// Stores cell 
ImageIcon cell = new ImageIcon(resized);
JLabel life = new JLabel(cell);

// Enables movement of cell via mouse 
pane.addMouseMotionListener(new MouseAdapter() {
  public void mouseMoved(MouseEvent e) 
    // Obtains x-y coordinates of cursor
    int mouseX = e.getX();
    int mouseY = e.getY();

    // Stores mouse coordinates
    x = mouseX;
    y = mouseY;

      // Adds cell to layered pane at cursor position
      pane.add(life,new Integer(2),0);
  public void mouseDragged(MouseEvent e) 

public void enableMouseMotionListener()
// Activates mouse motion listener
mouseMotionListenerActive = true;

public void disableMouseMotionListener()
// Deactivates mouse motion listener
mouseMotionListenerActive = false;

pellets adder

class Pellets
int x,y;
Random r = new Random();

// Stores pellets 
ArrayList<JLabel> agar = new ArrayList<JLabel>(); 

// Stores positions of pellets
ArrayList<Point> pos = new ArrayList<Point>();

public Pellets(int pellets, int xmin, int xmax, int ymin, int ymax, 
JLayeredPane pane)
// Randomly generates pellets
for(int i=0; i<pellets; i++)
  // Randomizes colour
  ImageIcon pellet = new ImageIcon("Color " + (r.nextInt(7)+1) + ".png");
  JLabel food = new JLabel(pellet);

  // Randomizes pellet position
  x = r.nextInt(xmax-xmin+1)+xmin;
  y = r.nextInt(ymax-ymin+1)+ymin;

  // Stores point
  pos.add(new Point(x,y));

  // Adds pellet to pane
  pane.add(food,new Integer(2),0);

point class to keep track of where the cell is

class Point
int x,y;

// Sets properties of point object
public Point(int x, int y)
this.x = x;
this.y = y;