DEV Community

Cover image for Physics sandbox - easy JavaScript tutorial
Chuck Norris
Chuck Norris

Posted on

Physics sandbox - easy JavaScript tutorial

http://slicker.me/javascript/physics_sandbox.htm

This simple little physics sandbox was created with just several lines of code using the great Matter.js library. The code below should be simple enough for even inexperienced JavaScripters to understand. You can use the mouse to place different objects (cars, Newton's cradles, balls, bricks and trapezoids) on the screen. You can drag them with the mouse or use the keyboard to scale/rotate/delete them. Have fun!

Top comments (0)