Assignment 6: OOP and Arrays
For this week’s project, Katie McCloskey and I created an interactive animation in which the user drives a car. The appearance of “driving” is created by iteration through arrays of objects in which the x position of each object (clouds, trees, mountains) is reset to 400 (offscreen to the right) once it becomes less than 0 (offscreen to left). When the user presses and holds the spacebar, the program uses a function to calculate acceleration, which is used to subtract from the x position of each on screen object except for the car, which creates the appearance of the car driving.
Check it out here.