Uncaught TypeError: Cannot read property 'width' of undefined (carro: line 13)
> p5.js says: image() was expecting p5.Image|p5.Element for parameter #0 (zero-based index), received an empty variable instead. If not intentional, this is often a problem with scope: [https://p5js.org/examples/data-variable-scope.html] at about:srcdoc:114:3. [http://p5js.org/reference/#p5/image]
//código do carro
//carro 1
let xCarro = 600;
let yCarro = 40;
//carro 2
let xCarro2 = 600;
let yCarro2 = 96;
function mostraCarro(){
image(imagemCarro, xCarro, yCarro, 50, 40);
image(imagemCarro2, xCarro2, yCarro2, 50, 40);
}
function movimentaCarro(){
xCarro -= 2;
xCarro2 -=3;
}