Question: This is the code I have so far on p 5 . js: function setup ( ) { createCanvas ( 5 0 0 , 2

This is the code I have so far on p5.js:
function setup(){
createCanvas(500,200);
background(220);
fill(255,0,0);
car(50,50,50);
fill(0,255,0);
car(90,150,30);
car(250,50,100);
}
function car(x, y, h){
push()
rect(x,y,2*h,h)
fill(0)
circle((2*h)*0.25,x*2,h/2)
circle((2*h)*0.75, x*2,h/2)
pop()
}
I've been messing around for so super long trying to get the 'wheels' right but everything I do will always work for 2 of the rectangles but not the third. What is the code for both circles??
This is the code I have so far on p 5 . js:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!