CS 18 (Spring 2026) Project 02: Forces and Impulses (Demo)

In this project, you will using an abstraction for forces and impulses to create a demo of gravitational force between n-bodies.

Code Correctness

Demos

This week, you will be implementing the following “n-bodies” demo. Here is the video example:

Your “n-bodies” must use the scene, body, and (new) force creator abstractions. Our implementation uses gravity in the n-bodies demo.

Since the demo is relatively straightforward, we have not included hints/clarifications. The exact colors/number of bodies/velocities don’t have to be exact, but other characteristics of the demo shown above should be present.

If one of your teammates implemented the physics engine, we highly encourage you to discuss with them to gain a better understanding of how scenes, bodies, and forces interact with each other.

Once all your group members have finished, work with them to complete the extension (more information in the main project page).