Next Example of P5.js + Planck.js

Adding a bit more sophistication

Planck2 followed the hello world script on piqnt.com almost exactly—I just had to write my own rendering which involves turning the real-world coordinates of the physics engine into P5 screen coordinates. Now I will take a small further step and add a few twists such as creating additional objects from mouse clicks.

Click anywhere in the white canvas area to create a falling box

   
Canvas dimensions: pixels, meters