Bouncing Balls
✓ Published0🌍 Public
Ten colorful circles bounce around a canvas, affected by gravity and repelling each other when they touch. Users can click and drag any ball to fling it, with a spring-like pull force applied toward the mouse cursor. The simulation runs on HTML5 Canvas with requestAnimationFrame, using physics calculations for velocity, dampening, and collision detection between boundaries and other circles.
AI-generated descriptionA modernization of this old bouncing balls example, which I originally developed in 2012.
You can pick up the balls and fling them.
MIT Licensed