O meu código esta dessa maneira (fiz algumas mudancas)
//list let yCars = [40,316,210]; let xCars = [400,40,250];
//var car1 let xVel = 5; let xCar1 = 400; let yCar1 = 40;
//var car2 let xCar2 = 40; let yCar2 = 316;
//var car3 let xCar3 = 250; let yCar3 = 210;
//var cow let yCow = 366; let xCow = 200; let cowH = cowW = 30;
function showCars(){ image(cow,xCow,yCow,cowH,cowH); image(car1,xCar1,yCar1,50,40); image(car2,xCar2,yCar2,50,40); image(car3,xCar3,yCar3,50,40); }
function carMov(){ xCar1 -= 4; xCar2 -= 3.5; xCar3 -= 3; }
function carLimit(){ if(xCar1 < -50){ xCar1 = 600;} if(xCar2 < -50){ xCar2 = 600} if(xCar3 < -50){ xCar3 = 600} }
function movCow(){ if(keyIsDown(UP_ARROW)){ yCow -= 2} if(keyIsDown(DOWN_ARROW)){ yCow += 2;} if(keyIsDown(LEFT_ARROW)){ xCow -= 2;} if(keyIsDown(RIGHT_ARROW)){ xCow += 2;} } print(xCars[0]);
ai quando eu rodo dele oq acontece e que nao aparece nenhum valor no console e a imagem em anexo aparece