Problem with Scoreboard in game

Having some issues with my scoreboard I am trying to use missed++ whenever the ellipse hits the line before the scoreboard missed should plus one every time but it does not work. If someone could help me that would be great.
This is what I had put into the void mousePressed function.

void mousePressed() {
  if( dist(mouseX, mouseY, x, y) < 25 ){
    hits++;
    score++;
    y = 25;
    x = (int)random(25,475);
  }
  if(y > 575){
    y = 25;
    missed++;
  }
  
  if(hits == 0){
    hits = 0;
    missed++;
  }
  
}

This is what my draw function looks like.

void draw(){
  background(p);
  fill(#DFF218);
  ellipse(x,y,50,50);
  y+=5;
 if(y >= height){
    y = 25;
    x = (int)random(25,475);}
    if(y > 575){
     y = 25;
     x = (int)random(25,475);
    }
  fill(0);
  textSize(25);
  textAlign(CENTER);
  text("Score= " + score, 100,650);
  text("Missed= " + missed, 250,650);
  text("Hits= " + hits, 400,650);
}

I still don’t see any comments.

What does this do?

Also your indenting is weird for these if statements. Hit Ctrl + t to auto-format your code in the Processing IDE.

You probably don;t need both of these checks. The second one covers the first case just fine.