CS2 Logo

Computer Science 2


Due Date: October 8, 2024

Moving Car on the Road

Original Program: (80 points)

Objective: Create a simple moving car animation on a road,
complete with additional elements like trees, clouds, and houses.
This code animates the car moving along
the road and allows it to stop at a traffic light.
Write a Python program using turtle.

Explanation:

Modifications:.

Your part (20 points)

Requirement: Modify the traffic light to use Yellow.
Modify the light to place the Red, Yellow, and Green parts in a better position.
Make the car more realistic
Have the Car travel thru the light to the end of the road.
After traveling to the end of the road, start at the beginning on the left side.
Stop at the light each time the light is red.
Go when the light is green


Example of screen shot of output.

Car Output

Click here to see a sample video of the output.

Code for the Program:


Program Part 1
Program Part 2
Program Part 3
Program Part 4
Program Part 5

Running the Program

To run the program, use the following command:

python3 PX_MovingCar_lastname.py


Files to Submit

Drop off your files into Google Classroom.