I built this. π΅
320 tiny spheres, falling, colliding and piling up exactly the way real beads would β running on a chip smaller than a coin.
Itβs an ESP32-S3 with a 2.06β AMOLED and a 6-axis IMU. The sensor reads the actual direction of gravity, so when I tilt the device the spheres donβt play a canned animation β they genuinely fall.
What I wrote:
β Verlet integration for the motion, so the spheres carry real momentum instead of just sliding.
β A spatial hash grid for the collisions. Checking every sphere against every other one would mean 50,000 tests per frame; splitting the screen into cells cuts it to a few hundred.
β No UI framework. Every sphere is a sprite I generate at boot β directional lighting, specular highlight, blue rim glow β and blit by hand into a framebuffer. Graphics libraries choke well before you hit 300 objects.
I used Claude as my pair programmer: I described what I wanted, we argued about the bottlenecks, and it caught the mistake that was quietly halving...
Not seeing views yet? Check back later!
Suggested Credits
Tags, Events, and Projects