One of the things that I have been very interested in but never got around to learning has been animations. I find them fascinating, I think every person who grew up playing games does, and I have been eager to find the best entry point into that world. Then I saw @suffick's tearable cloth. After playing around with it for a crazy amount of time, I started checking out the code. 300 lines of well written javascript and no external libraries. A basic physics engine that simulates a cloth. I will now explain in detail how it all works. The Tearable Cloth
So it all starts with the <canvas id=“c”></canvas>
element in the html. Thats the only html you need and then you can let the javascript do the work. Oh and you dont need any CSS either; dont you love it when things are simple?
The <canvas>
tag is used to draw graphics in the browser with javascript.
When the program loads we need to do some simple configurations to the canvas el