Simple canvas 2d physics

We were out playing pool a couple of nights ago. Instead of betting money on the games we used code-hours. I'm not very good at pool so in the end i was lucky to only owe my friend one code-hour.
He wanted me to code a physics "demo" on a canvas element. Since i only had one hour to code we limited the "demo" to 2d and circles :) The implementation is quite ugly and the physics formulas are pretty much taken from an article at gamedev (which i can't find at the moment).

Demo

The result of my code-hour can be found at:
   http://static.slackers.se/pages/javascript/canvas-simple-2d-physics/

Comments

Anonymous said…
The collision detection/response is nice. The code could use a little cleaning, and there could be some sort of friction added, but it's nice for only an hour of code.
123 said…
http://remind.com.br/projetos/criar-blog-gratis/replicahandbags69/
http://remind.com.br/projetos/criar-blog-gratis/ureplicawatches/
http://remind.com.br/projetos/criar-blog-gratis/ureplicawatches1987/
http://replbags.livejournal.com/
http://replcawatche.livejournal.com/
http://repldbags.livejournal.com/
http://replica69bags.insanejournal.com/
http://replicabag242.livejournal.com/
http://replicacheap.21classes.com/weblogCategory/1951uut1lrg4t
http://replicacheap.ayubd.com/

Popular posts from this blog

Cubing for charity #4

jQuery floating table header plugin

Seascape - OpenVR adaptation of a 4k intro