Since Box2D is one of the most used physics engine, I’ve started to implement it into the AGE game engine.
I’ve used the box2d version from haxelib, so don’t forget to add the following to your nmml file :
|
|
I’ve implemented it with the behaviors system. So now we have a Box2dEntity that has a special Behavior (Box2dMovementBehavior) which initialize and update all the Box2D stuff.
For example, to define an entity :
|
|
|
|
And that’s it !
The Box2D support works with Flash and C++ but needs some optimization for now.
Here is a quick example (click on the blocks to remove them) :
You can also apply a force or an impulse on your entity :
|
|
Another example (click on the oranges to apply a random impulse) :
For more information on Box2D, check out the flash documentation.