r/madeinpython • u/EventHorizon-dev • 7m ago
I built a lightning simulator in Python using Pygame!
Hey everyone!
I've been building a collection of physics and simulation projects lately, and I wanted to share my latest one: a real-time 2D Lightning Simulator built completely from scratch using Python and Pygame.
The main challenge was simulating realistic electrical discharge patterns and dynamic branching structures on a 2D canvas while keeping the rendering smooth.
What it does:
- Real-time procedural lightning generation with dynamic branching.
- Interactive controls to trigger electrical storms directly on the screen.
- Lightweight architecture built purely with Python and Pygame.
I'll drop the link to the GitHub repository in the comments if anyone wants to check out the source code or test it out. I'd love to get your feedback on the visual rendering or any ideas for new features!