https://editor.p5js.org/flash120603/sketches/9Z9D7-jn8
//Códigos do ator let xAtor = 100; let yAtor = 366;
function mostrarAtor(){ image(imagemDoAtor, xAtor, yAtor, 30, 30)
}
function movimentaAtor(){ if (keyIsDown(UP_ARROW)){ yAtor -= 5 } if (keyIsDown(DOWN_ARROW)){ yAtor += 5 } if (keyIsDown(LEFT_ARROW)){ xAtor -= 5
} if (keyIsDown(RIGHT_ARROW)){ xAtor += 5 } } function mostrarCarro(){ for (let i = 0; i < imagensCarros.length; i= i +1){ image(imagensCarros[i], xCarros[i], yCarros[i], comprimentoCarro, alturaCarro); } } function verificaColisao(){ //collideRectCircle(x1, y1, width1, height1, cx, cy, diameter) for (let i = 0; i < imagensCarros.length; i= i +1){ colisao = collideRectCircle(xCarros[i], yCarros[i], comprimentoCarro, alturaCarro, xAtor, yAtor, 15) } }