Estou com problemas na hora de limitar o movimento do ator, para que ele não ultrapasse a tela. Ele continua desaparecendo quando aperto a tecla pra baixo mesmo depois de feita a função podeSeMover.
//variaveis ator
let xAtor = 85;
let yAtor = 366;
let larguraAtor = 30;
let alturaAtor = 30;
let colisao = false;
let meusPontos = 0;
function mostraAtor(){
  image(imagemDoAtor, xAtor, yAtor, larguraAtor, alturaAtor);
}
function movimentaAtor(){
  if (keyIsDown(UP_ARROW)) {
    yAtor -= 3
  }
  if (keyIsDown(DOWN_ARROW)){
    yAtor += 3
    if (podeSeMover()){
        yAtor += 3;
    }
  }
}
function verificaColisao(){
  for(let i = 0; i < imagemCarros.length; i++){
    colisao = collideRectCircle(xCarros[i], yCarros[i], comprimentoCarro, alturaCarro, xAtor, yAtor, 15);
  if (colisao){
    voltaAtorParaPosicaoInicial();
    if (pontosMaiorQueZero()){
      meusPontos -= 1
      }
    }
  }
}
function voltaAtorParaPosicaoInicial(){
  yAtor = 366;
}
function incluiPontos(){
  textAlign(CENTER);
  textSize (25);
  fill(color(255, 185, 0));
  text(meusPontos, width / 5, 27);
}
function marcaPontos(){
  if (yAtor < 15){
      meusPontos += 1
      voltaAtorParaPosicaoInicial();
    }
  }
function pontosMaiorQueZero (){
 return meusPontos > 0 
}
function podeSeMover() {
  return yAtor < 366
}