Question: The program which need to be used is Processing 3 and mode : Python. def setup(): size(800, 800) def draw(): background (150) rectMode(CENTER) fill(255, 0,

The program which need to be used is Processing 3 and mode : Python.

def setup(): size(800, 800)

def draw(): background (150) rectMode(CENTER) fill(255, 0, 0) rect(mouseX, mouseY, 400, 120) #cab rect(mouseX, mouseY-110, 150, 100) stroke(130, 50, 40) fill('#DEF8FA') rect(mouseX, mouseY-110, 130, 85) #windshield fill('#DEF8FA') triangle(mouseX-75, mouseY-160, mouseX-75, mouseY- 60, mouseX-120, mouseY-60) #rear glass triangle(mouseX+75, mouseY-160, mouseX+75, mouseY-60, mouseX+120, mouseY-60) #tires fill(0) ellipse(mouseX - 100, mouseY + 50, 124, 124) ellipse(mouseX + 110, mouseY + 50, 124, 124)

#wheels fill(255) ellipse(mouseX - 100, mouseY + 50, 80, 80) ellipse(mouseX + 110, mouseY + 50, 80, 80)

This code will draw a car.

Now, here is what need to be done to the code above.

1. Slow the frame rate to 20 frames per second.

2. Translate the origin to the current mouse location.

3. Print the current mouse location to the console.

4. Use variables to replace the car bodys width and height and the cabs width and height.

5. Make the tires diameters randomly alternate by 15 pixels

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 Databases Questions!