How to make score only go up by one when pressing spacebar?

I am trying to make a flappy bird clone and i was woundering how do i make it so that whenever you press the spacebar it increases the score by 1 and doesnt and more than 1 if you hold the space bar?

let y = 200 ;

let score = 1;

function setup() {
  createCanvas(400, 400);
}

function draw() {

  if (keyIsDown(32)) {
    y -= 10;
    score += 1;
  } else {
    y += 5;
  }

  clear();
  fill(255, 255, 0);
  background(50, 204, 255);
  ellipse(200, y, 50, 50);

  fill(0);
  textAlign(CENTER, CENTER);
  textSize(50);
  text(score, 350, 200);

  
  if (y >= 400) {
    clear();
    background(50, 204, 255)
    fill(0)
    textAlign(CENTER)
    textSize(50)
    text("Game Over", 200, 200)
  }
}

P.S sorry for the mess

Hello! If you want y to increase by pressing and holding and score to increase only when pressed, you can do that by moving score into the keyPressed function. keyPressed is called only once when a key is pressed and m keyPressed is called only once when a key is pressed.

var y = 0;
var score = 0;

function setup() {
  createCanvas(400, 400);
}

function draw() {

  if (keyIsDown(32)) {
    y -= 10;
  } else {
    y += 5;
  }

  clear();
  fill(255, 255, 0);
  background(50, 204, 255);
  ellipse(200, y, 50, 50);

  fill(0);
  textAlign(CENTER, CENTER);
  textSize(50);
  text(score, 350, 200);

  
  if (y >= 400) {
    clear();
    background(50, 204, 255)
    fill(0)
    textAlign(CENTER)
    textSize(50)
    text("Game Over", 200, 200)
  }
}

function keyPressed() {
  score += 1;
}