CS 3 (Spring 2024) Project 02: Gravity (Demo)

In this project, you will create a demo with gravity that acts on multiple polygons!.

Code Correctness

Deliverable

This week’s demo is a “gravity” demo which should look something like the following:

Conceptually, this demo is a strict generalization of the “bounce” demo from last week. Instead of one star, we’ll have \(n\). Instead of one color, we’ll switch through many.

We expect your demo to contain (at least) the following:

Update 4/17/24: Note that our ref files implement gravity for you in polygon_move, so you don’t have to implement gravity yourselves. Also keep in mind that your polygons will probably move much faster than those shown in the video; don’t worry about that!

Additionally, this week you will be using the generic list_t interface in the provided list.h file, which is effectively replacing the vec_list_t interface that your team implemented last week. Make sure you are creating/modifying lists with list.h and not vec_list_t!

Grading

As the project gets bigger, the architecture of the individual pieces and how they fit together becomes more and more important. Since this is such an important focus of this week, we will grade you individually based on:

Here’s a bit more detail about architecture:

Project Architecture

We believe the current size of the project is a good size for you to experiment a little bit; so, this week, we will provide basically no guidance of how to actually break up your code. (However, we will discuss this in great detail with you at the code review.) Next week, we will require your architecture to fit with where we’re eventually going (generalized forces acting on bodies, testing for collisions, etc.). You are encouraged to discuss your design at office hours.