Build a 2d html physics playground with tons of sick physics phenomena for me to play…
- User
Build a 2d html physics playground with tons of sick physics phenomena for me to play with with my mouse
Assistant
Now let me create the full physics playground application. I'll structure it with a clean UI overlay on top of a Matter.js canvas.
Let me fix the TypeScript issues by using proper type handling:
Let me fix the remaining TypeScript warnings:
Now let me update the HTML title:
The project builds successfully! 🎉 The physics playground is ready. Let me verify the final file structure:
The ⚛️ Physics Playground is built and ready! Here's what it includes:
🎮 Features
15 Physics Phenomena to play with, selectable from the left sidebar:
Phenomenon Description Interaction 💦 Fountain Continuous spray of colorful particles Auto-running 💥 Explosion Radial blast of force + particles Click anywhere 🧸 Ragdoll Articulated stick figure with joints Click to spawn 🀄 Dominoes Chain of 20 falling dominoes Click to place ⏱️ Pendulum Swinging pendulum with physics Click to spawn 🧵 Cloth Soft body cloth with 140 nodes Click to simulate 🌉 Bridge Suspension bridge with 12 segments Click to build 📦 Stack 10-row pyramid of blocks Click to stack 🌧️ Rain Continuous falling shapes Auto-running 🌀 Gravity Well Objects orbit an attractor point Click to create 🪃 Slingshot Catapult that launches projectiles Click to fire 🌬️ Wind Floating objects with sinusoidal wind Auto-running ⚡ Chain Reaction Pendulum knocks over dominoes Click to start 🎯 Plinko Peg board with dropping ball Click to set up ⚾ Pinball Bumpers, flippers, and a ball Click to spawn Controls:
- Click on canvas → spawns/interacts with selected phenomenon
- Double-click → shockwave pushes nearby objects
- Drag → grab and throw objects with mouse constraint
- Gravity buttons (↑ ↓ ○ →) → toggle gravity direction
- Rate slider → adjust fountain/rain particle density
- Clear All → remove all objects from scene
The app uses Matter.js for physics and renders everything with custom Canvas 2D graphics including gradients, velocity vectors, and particle effects.
Files built:
src/App.tsx,index.html
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.