orbiting particles



I liked the combination of gravity with bouncy walls - not a combination I've seen before! So I reworked the physics a little:
- Make orbital mechanics a bit more realistic (remove tangential component of acceleration)
- Initialize velocities to produce orbits that are closer to circular, on average
- Conserve energy on collision with walls
- Initialize starting positions uniformly across the screen
- Smaller timestep for less frenetic motion
Things that aren't present but might be fun to add:
- particle-particle interactions (maybe both gravity and collision?)
- hacks to make sure energy is conserved over longer runs
- something controllable!
It's possible there are mistakes but the behavior looks at least roughly right to me so I thought I'd post it anyway.
[Please log in to post a comment]