Visualizing Atomic Structure with Pygame, Before I Knew Enough to Be Careful
Atomic structure is usually taught as notation first and intuition second. That always felt backwards. Electron configurations looked compact on paper, but they did not feel spatial. This project started as an attempt to make those patterns move.
The simulator was simple by design. One Pygame window. One atom at a time. Click through elements one by one and watch electrons populate shells in motion. It was an early project, and I was learning as much about rendering loops and trigonometry as I was about the chemistry.
Turning Data Into Motion
Most of the project lives in one file, which says a lot about its scope. The interesting part was not architecture. It was translating atomic data into something visual. I hardcoded data for the first 100 elements, then mapped electron counts into shells using a fixed capacity model.
The animation came from basic sine and cosine. Every electron position was computed from a radius, an angle, and a time variable that increments every frame. That was a small idea, but it clicked for me. Math stopped feeling abstract when it made something move at 60 frames per second.
Choosing Simplicity on Purpose
One decision mattered more than the rest. I did not try to model atoms accurately in a quantum sense. I used circular orbits because they were readable. That tradeoff made the project work.
- Fixed shell capacities made electron placement predictable and easy to render
- Uniform angular velocity kept the animation simple, even if it ignored real behavior
- Wrapping from element 100 back to 1 made exploration feel continuous instead of menu driven
None of those choices were physically rigorous. They were practical. For a learning project, that mattered more.
What Did Not Work
The biggest limitation is also the most obvious one. It is not a scientific model. It is a visualization built on shortcuts. The shell logic is simplified. The nucleus is static. Electrons behave more like a classroom diagram than quantum objects.
If I rebuilt it now, I would separate data from rendering, make shell logic less hardcoded, and add interactions beyond stepping through elements. Even basic comparisons between idealized orbits and actual electron clouds would make it more honest.
What It Represented
This was one of those projects where the technical detail was small, but the lesson was large. I learned that simulation does not need complexity to teach something useful. Sometimes a rough model that reveals structure is enough.
Two hundred lines. A hundred elements. Just enough to make abstractions move.