Huh, that's strange that keyboard and mouse didn't work...
The physics are actually not that hard to implement, I used verlet integration, there's a short series on youtube that covers it in javascript. I guess the difficult part is the polygon collisions, but I used a library to help me with that.
You can see how I implemented it here and here.
Thanks for playing :)