Caden Spokas
Create Your First Project
Start adding your projects to your portfolio. Click on "Manage Projects" to get started
2D Physics Simulation
Project type
Simulation
Date
November 2024
Role
Developer + Presenter
Link
This is a simple simulation of 2D physics for a system of elastic collision between circles. This is intended for use in a GameDev Club workshop, essentially an hour long presentation teaching new to intermediate programmers how to create something like this.
Because it is intended to be taught at a GameDev workshop, the code was made very simple, with all objects being circles of equal radius, and all collisions assuming perfect elastic collision, with all objects having a mass of 1.
Recall that the formula for perfect elastic collisions is m1*v1i + m2*v2i = m1*v1f + m2*v2f, and since this simulation assumes a mass of 1 for all objects, this just becomes v1i + v2i = v1f + v2f, or in other words, objects in this simulation just swap velocities when they collide.