Inspired by this video

I used C++ and glm for the simulation.

I started with one particle bouncing around in a circle.

Then I added displaying using OpenCV (saving frames to image files).

Next, I added more particles and another room with a tunnel so they can travel left and right.

Finally, some counters, and an ffmpeg command to render the video.

I ended up with a nice simulation, and a fascinating ending! Can you figure out why? I'd love to hear your thoughts!

Stick pony Maze Stick pony Maze