Já alterei como foi visto no vídeo e aderi diversas dicas, mas continua na mesma.
Já alterei como foi visto no vídeo e aderi diversas dicas, mas continua na mesma.
Olá, Mateus! Segue esta solução:
let bug = 0
function libCollBallRac(x, y) {
if (bug == 0) {
colli = collideRectCircle(x, y, widPlaRacket, heiPlaRacket, xBall, yBall, radBall);
if (colli) {
souRacket.play()
velXball *= -1
miss();
}
}
}
function ifBallBorder() {
if (xBall > width - radBall) {
velXball *= -1;
plaPoints += 1;
souPlaPoints.play();
bug += 1
}
if (xBall - radBall < 0) {
velXball *= -1;
comPoints += 1;
souComPoints.play();
bug += 1
}
function noBugs() {
if (xBall == 300) {
bug = 0
}
}
Espero ter ajudado/acrescentado de alguma forma. Valeu!