This is a 2D physics sandbox that runs in your browser, using a canvas to simulate glowing neon particles and one big Alpa mascot particle in real time. You can adjust gravity and bounce, switch between gravity modes, or grab Alpa and fling him across the screen to watch him bounce off the walls and knock particles aside. It works as a quick way to relax and also as a hands-on demo of gravitational acceleration, the coefficient of restitution and simple collision response, with nothing to install.
Gravity Force goes from 0 to 1.5 and Elasticity (Bounce) from 0.1 to 1.0. The higher the bounce, the more speed an object keeps after hitting a wall. The simulation also applies a little air drag, so even at 1.0 things eventually settle down. Spawn Particles (+20) drops 20 particles in at the top of the screen. Up to 400 particles are kept, and once you go past that the oldest ones are removed. Clear All removes them all at once. Press and drag Alpa with the mouse or a finger, then let go to throw him.
There are four gravity modes. Standard Downward works like gravity on Earth. Zero Gravity switches gravity off, and while you hold the mouse button down, particles within about 300 pixels of the pointer are pulled toward it. Alpa Black Hole pulls Alpa toward the center of the screen while every particle is drawn toward Alpa. The pull scales with the gravity slider, so at 0 there is no pull at all. Mobile Gyroscope makes gravity follow the direction you tilt your phone, and on iPhone you will be asked for permission first.
To run smoothly on phones, small particles only collide with Alpa and the edges of the screen, not with each other. The physics runs at a fixed 60 steps per second, so speed stays consistent on displays with different refresh rates, and the panel shows the live frame rate, particle count and Alpa's speed. When Alpa slams into a wall, his expression changes, a short sound plays and a few sparks fly out, while the glowing trails behind the particles are a visual effect drawn on the canvas. The whole simulation runs locally and collects no data.