CSc 101: Car Drive

In this assignment, you will write a processing program that generates a very simple animation of a car driving. Below is an example of what the finished product should resemble:

There are several things to notice about this animation, all of which you should mimic:

You should use lines or custom shapes for the birds. The car must have at least a body, wheels, tires, and a window. If you want, you can make the car, birds, or tree much more detailed and intricate.

Your code should have a global variable to control the car's speed. This means that when you change such a variable, the car appears to move faster or slower. You should clearly state the variable name in the header and add an in-line comment in the variable declaration explaining how to use the variable.

Name your file car_drive.pde.

Programming strategy

You should start by getting the static (non-moving) parts of the drawing on the screen. These are the sky, earth, road, and car. Once you have the static parts finished, work on the tree movement. The tree is a little easier than the birds since you don’t need to repeat anything.

Lastly, do the birds. There must be 5 birds and they must be “repeated” using a for-loop.

Comments

Each program file should have a header comment at the top that has the following format:

/*
 * Author: Student Name.
 * Description:
 *    A short description of what this program does!
 * Variable name that controls the speed: Your variable name.
 */    

All of your programming should be well-formatted and easy for the graders to read and comprehend. To help with readability, separate the code that creates the main shapes in your program with a blank line and include a comment that describes the shape(s) being created. For example,


// the sky
rect(...);

Submission and grading

It is due on 10/4/2024 at 11:00pm.

Turn in both files described in the Assignment 4 spec (2 total) to Gradescope before the due date. (Note: You must select the files for both part 1 and part 2 and drag them into the Gradescope upload box.) Make sure to name the files exactly as the Part 1 and Part 2 documents specify. In general, make sure to follow these instructions precisely.