This is a simulation of rigid disc-shaped particles including collision detection and resolution. The collisions are inelastic and so the particles' kinetic energy diminishes over time. A quadtree was used to spatially partition the space so that the simulation can be scaled up to thousands of particles and maintain real time frame rates. Source code here.