Box2d
Box2d is a 2d physics simulation library written for C++ and ported to many languages including Javascript.
From Box2d's Website
Box2D is a feature rich 2D rigid body physics engine, written in C++ by Erin Catto. It has been used in many games, including Crayon Physics Deluxe, winner of the 2008 Independant Game Festival Grand Prize.
Box2d can is used to develop 2d games in various languages. In this tutorial we shall use the Box2d library to write a simple Hello World program.
We shall use the Box2d Javascript port from http://code.google.com/p/box2dweb/. It used version Box2d ver. 2.1 (at the time of writing this article).
Demo
Lets first take a look at what we shall be making in this tutorial. Try clicking anywhere in the white area and a solid object would be created at the point and fall down. The fall would be realistic.
Code
Components of a Box2d Animation
Any Box2d animation or say environment has some components :
1. A World
2. Some Gravity - It can be in any direction , or even absent (like deep space).
3. Some real objects that have properties like density , friction , restitution etc
In the above demo if you click somewhere , objects would appear and start falling down. So...
Read full post here
Programming box2d in javascript – tutorial on basics
Box2d is a 2d physics simulation library written for C++ and ported to many languages including Javascript.
From Box2d's Website
Box2D is a feature rich 2D rigid body physics engine, written in C++ by Erin Catto. It has been used in many games, including Crayon Physics Deluxe, winner of the 2008 Independant Game Festival Grand Prize.
Box2d can is used to develop 2d games in various languages. In this tutorial we shall use the Box2d library to write a simple Hello World program.
We shall use the Box2d Javascript port from http://code.google.com/p/box2dweb/. It used version Box2d ver. 2.1 (at the time of writing this article).
Demo
Lets first take a look at what we shall be making in this tutorial. Try clicking anywhere in the white area and a solid object would be created at the point and fall down. The fall would be realistic.
Code
Components of a Box2d Animation
Any Box2d animation or say environment has some components :
1. A World
2. Some Gravity - It can be in any direction , or even absent (like deep space).
3. Some real objects that have properties like density , friction , restitution etc
In the above demo if you click somewhere , objects would appear and start falling down. So...
Read full post here
Programming box2d in javascript – tutorial on basics