function updateScore() {
  scoreElement.textContent = score;
}

function increaseScore() {
  if (foodCollected = true) {
    score++;
    updateScore();
    foodCollected = false;
  }
}

Der Score wird jede halbe Sekunde immer größer und nicht nur dann, wenn sie etwas gefressen hat!