Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

He swims like a fish, but runs like an elephant.

Answered: 1 week ago