An interactive physics playground built with Matter.js. The application displays 100 bouncing balls that respond to device orientation on mobile devices. Users can continuously spawn new balls by holding down the mouse or touch, and adjust motion sensitivity with a slider control.
- 100 Initial Balls: Colorful balls with realistic physics
- Continuous Ball Spawning: Hold mouse button or touch screen to create streams of balls
- Motion Sensitivity Control: Adjust device tilt responsiveness from 0% to 10,000%
- Responsive Design: Works on both desktop and mobile browsers
- Accelerometer Support: Balls respond to device tilt on mobile devices
- Node.js (v14 or higher)
- npm
# Install dependencies
npm install# Start the server
npm startThe application will be available at http://localhost:3000
- Desktop: Click and hold to spawn balls continuously. Move the mouse while holding to create trails.
- Mobile: Tap and hold to spawn balls. Tilt your device to control gravity direction. You may need to grant accelerometer permissions on iOS devices.
- Sensitivity Slider: Adjust the slider at the top to control how strongly balls respond to device motion (0-10,000%).
- Backend: Express.js
- Physics Engine: Matter.js
- Sensors: DeviceOrientationEvent API
- Frontend: Vanilla JavaScript
MIT