Porque a raquete não se move ao usar a tecla?
function setup() {
createCanvas(700, 500);
}
// bolinha setup
let xBolinha = 10;
let yBolinha = 10;
let diametro = 20;
let velocidadexBolinha = 6;
let velocidadeyBolinha = 6;
// raquete setup
let xRaquete = 5;
let yRaquete = 110;
let larguraRaquete = 10;
let alturaRaquete = 140;
let raquetexVelocidade = 5;
function draw() {
background(0);
circle( xBolinha, yBolinha, diametro)
raquete ();
xBolinha += velocidadexBolinha
yBolinha += velocidadeyBolinha
if (xBolinha > width || xBolinha < 0) {velocidadexBolinha *= -1;
}
if (yBolinha > height || yBolinha < 0) { velocidadeyBolinha *= -1;
moveRaquete (); }
}
function raquete (){
rect (xRaquete, yRaquete, larguraRaquete, alturaRaquete)
}
function moveRaquete() {
if (keyIsDown(UP_ARROW)) { yRaquete -= 5}
if (keyIsDown(DOWN_ARROW)) {yRaquete += 5}
}